[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Position of functions in `completion-at-point-functions'
From: |
Arash Esbati |
Subject: |
Position of functions in `completion-at-point-functions' |
Date: |
Sun, 28 Jan 2024 15:33:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi all,
Emacs 30.0.50 has this in text-mode.el (line 155; line break added for
better legibility):
(when (eq text-mode-ispell-word-completion 'completion-at-point)
(add-hook 'completion-at-point-functions
#'ispell-completion-at-point 10 t))
Since LaTeX-mode now derives from text-mode, the value of
`completion-at-point-functions' is this in a .tex file:
(TeX--completion-at-point t ispell-completion-at-point
LaTeX--arguments-completion-at-point)
The problem is that `ispell-completion-at-point' kicks in also when
point is inside an argument and one actually expects key=val completion
for instance. Since we require Emacs 27 now, we can cure this by
changing our addition in latex.el from:
(add-hook 'completion-at-point-functions
#'LaTeX--arguments-completion-at-point t t)
to something like:
(add-hook 'completion-at-point-functions
#'LaTeX--arguments-completion-at-point 5 t)
because docstring of `add-hook' says:
For backward compatibility reasons, a symbol other than nil is
interpreted as a DEPTH of 90.
Before making this change to 5 (which is an arbitrary choice): Is there
a kind of convention where major/minor modes should put their completion
functions? Any pointer is appreciated.
Best, Arash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Position of functions in `completion-at-point-functions',
Arash Esbati <=