lean4-mode icon indicating copy to clipboard operation
lean4-mode copied to clipboard

Rework Abbreviations for Input Method

Open mekeor opened this issue 1 year ago • 5 comments

Currently, our repository contains the abbreviations.json. I propose that it only contains an lean4-abbreviations.eld file that we build using an Elisp script.

mekeor avatar Dec 01 '24 10:12 mekeor

I guess this can be regarded as upstream: https://github.com/leanprover/vscode-lean/blob/master/src/abbreviation/abbreviations.json

mekeor avatar Dec 02 '24 13:12 mekeor

I guess this can be regarded as upstream: https://github.com/leanprover/vscode-lean/blob/master/src/abbreviation/abbreviations.json

The upstream URL has moved to a new location (see #97).

akirak avatar Feb 22 '25 03:02 akirak

Maybe we should not use quail.el for abbreviations but abbrev.el mechanism instead. Let's check how easy it is to customize abbrev-tables, i.e. add or remove abbreviations, per directory-local variables or per user init.el customization etc.

mekeor avatar Apr 21 '25 23:04 mekeor

If you define lean4-mode-abbrev-mode, it will be enabled by default when the user enables abbrev-mode. To make it opt-in, you can define a different variable and let the user set local-abbrev-table to its value as a local variable.

EDIT: The variable should be local-abbrev-table, and not abbrev-table.

akirak avatar Apr 24 '25 03:04 akirak

I'm convinced that Abbrev tables are the appropriate approach for what lean4-eri implements as an ugly hack with Quail. But it's quite some work and not as important as other issues (like general refactoring and the aim of decoupling Lean4-Mode from lsp-mode, for sake of Eglot compatibility). That's why I will postpone it until a later milestone.

mekeor avatar May 13 '25 15:05 mekeor