minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
603 stars 22 forks source link

cape-tex seems unreliable, and `\Phi` missing? #71

Closed chriselrod closed 1 year ago

chriselrod commented 1 year ago

E.g., I type \Phi and then C-c p \, and get:

\Phi\

with cape-tex: No completions appearing in the mini-buffer. When the desired outcome was

Φ

It only seems to work when corfu already produced a drop down menu (which requires some valid completions to exist). It works sporadically, maybe 5% of the time I try it.

Binding to another key, e.g. C-c p x does work on occasion, but only for some unicode characters, e.g. \alpha or \phi but not \Phi.

\hi produces a menu showing \chi, \Chi, and \phi but no \Phi, so maybe \Phi is missing altogether? I looked briefly at cape.el but didn't see where this was defined.

minad commented 1 year ago

\Phi is indeed missing from the TeX input method, which is used internally by Cape. I improved the behavior when typing \Phi C-c p \ in 8841d1d21c64061d34fe35c46c05b661421cdab1.

chriselrod commented 1 year ago

Thanks for the quick fix!

As for \Phi, it sounds like I should follow the emoji-example, using company-math?

EDIT: Or maybe I'll just stick to \phi.

minad commented 1 year ago

As for \Phi, it sounds like I should follow the emoji-example, using company-math?

You could use company-math via cape-company-to-capf or port company-math directly to capf, if this doesn't exist already? cape-tex is intentionally more restricted. It doesn't come with its own tex entity registry but just reused the Emacs tex input. You could also open bug reports for Emacs itself, if you discover missing characters.

chriselrod commented 1 year ago

This is apparently what company-math uses: https://elpa.gnu.org/packages/math-symbol-lists.html https://github.com/vspinu/math-symbol-lists