Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

languagetool-server-url ignored #23

Open
laotse opened this issue Jan 16, 2024 · 5 comments
Open

languagetool-server-url ignored #23

laotse opened this issue Jan 16, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@laotse
Copy link

laotse commented Jan 16, 2024

What version of Emacs are you running?

28.2

What version of LanguageTool are you running?

6.3

What version of this package are you running?

1.3.0

What is the current behaviour?

Although I specify "languagetool-server-url" for my own server, in tcpdump I see emacs connecting to localhost:8081 as IPv6

What is you expect to happen?

emacs should connect to the server specified in languagetool-server-url

What do you do to get this bug?

The config in ~/.emacs:

;; languagetool
(use-package languagetool
  :ensure t
  :defer t
  :commands (languagetool-check
             languagetool-clear-suggestions
             languagetool-correct-at-point
             languagetool-correct-buffer
             languagetool-set-language
             languagetool-server-mode)
  :config
  (setq languagetool-java-arguments '("-Dfile.encoding=UTF-8")
	languagetool-server-url "http://languagetool.example.com"
	languagetool-server-port 8081)
  :bind (("<f7>" . languagetool-server-mode)
	 ("<f8>" . languagetool-correct-buffer)))

Then load any document and press <f7>.
@laotse laotse added the bug Something isn't working label Jan 16, 2024
@laotse
Copy link
Author

laotse commented Jan 16, 2024

If I change the default value in languagetool-server.el i.e., line 67: (defcustom languagetool-server-url "http://languagetool.example.com", then it works as expected. It's just the setting in .emacs, which is apparently ignored.

@laotse
Copy link
Author

laotse commented Jan 17, 2024

When I start-up emacs none of the languagetool- variables are known. After pressing <f7>, languagetool-server-url exists, but has its default value. Manually setting it after the system has been initialized by <f7>: M-: (setq languagetool-server-url "http://languagetool.example.com") pressing <f7> again it works as expected.

I have no clue about emacs lisp, but could it be that languagetool-server-url is not declared at the point where .emacs attempts to set it?

@PillFall
Copy link
Owner

Hello @laotse,

Is the first time I encounter a bug like this.

This part of the code is intended for the use of Emacs customize

(defcustom languagetool-server-url "http://localhost"
"LanguageTool Server host URL."
:group 'languagetool-server
:type 'string)

I believe the the bug you are encountering have to deal with the usage of use-package, but as you set the defer flag to non-nil, it must load all the customize options after all the package is load. So we end up as the beginning.

It is weird that only the languagetool-server-url variable have this problem. Tell me if I'm wrong.

I will study the bug. And try to fix it asap.

@PillFall PillFall self-assigned this Jan 19, 2024
@PillFall
Copy link
Owner

Maybe this could be related to #19?

@laotse
Copy link
Author

laotse commented Jul 29, 2024

Hello @PillFall,

the issue may affect other variables as well. It's just that I have only languagetool-server-url set to a non default value. All the rest are default.
Concerning issue #19 it seems that the entire command is not set, which is not the case on my side. The commands are working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants