Closed yang-ling closed 1 year ago
FYI, I observe the same error when loading systemd mode.
Using add-hook
to modify company-backend
is an anti-pattern in Emacs Lisp. add-hook
is for modifying hooks variables. Making it local removes any previously set backends.
Furthermore, company-backends
should now use completion-at-point-functions
. It's a more appropriate way.^1
Do you want to create a PR, @notetiene?
On the other hand: Is this repo still maintained? I do not see any activity.
@stardiviner I could, but if it never gets merged, I would have wasted much time. I do use systemd, but occasionally. I would much prefer if this mode could be included in GNU Emacs. People can come and go, but big projects as such won't be impacted by lack of interest from the maintainer.
I'm not sure if the maintainer is still active in this project.
In my opinion, any situation is better than the current one.
Since it seems like modifying `company-backends' is something a major mode shouldn't be doing, I just nixed the line in 87426071. Keeping the company backend around since it's a TINY quality of life improvement.
Hi. I think it's a regression bug related to #4 . I open a new issue because #4 is closed.
Now I still get the same error messages while
systemd-mode
is active.My system info:
I checked source code, and found this line L410
Should it be changed to
(add-hook 'completion-at-point-functions #'systemd-complete-at-point nil 'local)
?I am not familiar with emacs lisp. It's just my guess, because L409 is
(add-hook 'company-backends #'systemd-company-backend nil 'local)
, I think L410 and L409 are very similar, then maybe L410 should also use'local
as the last parameter ofadd-hook
function.