auctex-devel
[Top][All Lists]
Advanced

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

AUCTeX and in-buffer completion


From: Arash Esbati
Subject: AUCTeX and in-buffer completion
Date: Fri, 14 Oct 2022 12:54:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi all,

AUCTeX is known to do minibuffer query and completion when adding new
macros or environments incl. arguments.  One thing missing is when one
wants to add/change keyval or other elements to existing constructs in
the buffer -- there is no in-buffer completion.

I was thinking about how to use the current information available in
`TeX-symbol-list' and `LaTeX-environment-list' in order to provide
in-buffer completion.  The result is attached and looks like this (with
company-mode which I use):

GIF image

The implementation solely relies on Emacs and should work with Corfu,
Company etc.  In order to use the library, put the file somewhere, load
your .tex file, do

  M-x load-library RET /pathto/latex-capf.el RET

and paste this in your .tex file and eval it:

  (add-hook 'completion-at-point-functions
            #'LaTeX-arguments-completion-at-point t t)

There is also a git branch feature/capf with the latest version.

Is it worth to integrate this into AUCTeX?  It will need some effort to
adjust latex.el and the styles we have in order to make them work with
the ideas here, so the question is, if this is a needed feature?

Any comments welcome.  

Best, Arash

Attachment: latex-capf.el
Description: application/emacs-lisp


reply via email to

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