emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Position of functions in `completion-at-point-functions'


From: Eshel Yaron
Subject: Re: Position of functions in `completion-at-point-functions'
Date: Mon, 19 Feb 2024 17:10:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hello Arash,

Arash Esbati <arash@gnu.org> writes:

> 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))
>
> With the latest AUCTeX, the new LaTeX-mode now derives from text-mode
> and the value of `completion-at-point-functions' becomes 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 a macro argument and one actually expects key=val
> completion for instance, so I want
> `LaTeX--arguments-completion-at-point' before
> `ispell-completion-at-point' in that list.  AUCTeX requires Emacs 27
> now, and I can fix this by changing this 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)
>
> Before making this change to 5 (which is an arbitrary choice): Is there
> any kind of range convention where major/minor modes should put their
> completion functions?  Any pointer is appreciated.

This isn't an authoritative answer, but I'm not aware of such a
convention.  IIRC I picked a DEPTH of 10 for that add-hook call mostly
because that's what text-mode, and prog-mode, were already using for
their context-menu-functions.  I think a value of 5 should be fine for
LaTeX--arguments-completion-at-point (and 9 too, for that matter).


Best,

Eshel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]