1
submitted 1 year ago by zauberin@beehaw.org to c/emacs@lemmy.ml

I’m trying to set up completion-at-point-functions in pascal-mode, I found that adding a hook with use-package works and leaves the global setting:

:hook (pascal-mode . (remove-hook ‘completion-at-point-functions ‘pascal-completions-at-point t))

However that causes a File mode specification error: (error Lisp nesting exceeds ‘max-lisp-eval-depth’) when I open a pascal file. Any ideas on how I could do it better?

top 1 comments
sorted by: hot top controversial new old
[-] oantolin@discuss.online 3 points 1 year ago

I looked at the macro expansion of the form you wrote and it looks like gibberish, so I don't think the :hook keyword allows expressions to be used as hooks, you need to define a function and use the function name:

(use-package pascal ; presumably
  :init
  (defun remove-pascal-completions ()
    (remove-hook 'completion-at-point-functions
                 'pascal-completions-at-point t))
  :hook (pascal-mode . remove-pascal-completions))

Also, the weird single quote character you used probably doesn't work in Emacs (but maybe you have normal single quotes in your file and it's just lemmy's markdown messing things up).

this post was submitted on 05 Aug 2023
1 points (100.0% liked)

Emacs

1978 readers
1 users here now

Our infinitely powerful editor.

founded 4 years ago
MODERATORS