Skip to content

Commit

Permalink
Expand path to prevent error when using ~
Browse files Browse the repository at this point in the history
Fix #7
  • Loading branch information
PillFall committed Jul 22, 2021
1 parent 04e16ae commit 535120e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions languagetool.el
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Its not recommended to run this function more than once."
(error "LanguageTool Server jar path is not set"))
(unless (or
languagetool-language-tool-class
(file-readable-p languagetool-server-language-tool-jar))
(file-readable-p (file-truename languagetool-server-language-tool-jar)))
(error "LanguageTool Server jar is not readable or could not be found"))

(let ((buffer (get-buffer-create languagetool-server-output-buffer-name)))
Expand Down Expand Up @@ -300,7 +300,7 @@ Its not recommended to run this function more than once."
;; Appends the LanguageTool Server jar path
(unless languagetool-language-tool-class
(setq arguments (append arguments (list "-cp"))))
(setq arguments (append arguments (list languagetool-server-language-tool-jar)))
(setq arguments (append arguments (list (file-truename languagetool-server-language-tool-jar))))
(unless languagetool-language-tool-class
(setq arguments (append arguments (list "org.languagetool.server.HTTPServer"))))

Expand Down Expand Up @@ -501,7 +501,7 @@ the call of LanguageTool when correcting the text."
;; Appends the LanguageTool jar path
(unless languagetool-language-tool-class
(setq arguments (append arguments (list "-jar"))))
(setq arguments (append arguments (list languagetool-language-tool-jar)))
(setq arguments (append arguments (list (file-truename languagetool-language-tool-jar))))

;; Appends the LanguageTool arguments
(dolist (arg languagetool-language-tool-arguments)
Expand Down Expand Up @@ -606,7 +606,7 @@ The region is delimited by BEGIN and END."
(error "LanguageTool jar path is not set"))
(unless (or
languagetool-language-tool-class
(file-readable-p languagetool-language-tool-jar))
(file-readable-p (file-truename languagetool-language-tool-jar)))
(error "LanguageTool jar is not readable or could not be found"))

(save-excursion
Expand Down

0 comments on commit 535120e

Please sign in to comment.