[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there a reason why abbrev-table properties are not saved in file
From: |
Anders Johansson |
Subject: |
Is there a reason why abbrev-table properties are not saved in file |
Date: |
Tue, 26 Jun 2018 15:51:32 +0200 |
User-agent: |
mu4e 1.1.0; emacs 26.1 |
Hi,
I recently wrote up some code for using different abbrev-tables
for different languages.
It boils down to two custom abbrev-tables in my abbrev file and
using some functions to determine if a language is active
(essentially checking ispell-local-dictionary) as enable-functions
for these tables.
However, this means I have to put properties on the tables every
time I load the abbrev file:
(with-eval-after-load abbrev-file-name
(abbrev-table-put aj/english-abbrevs :enable-function
#'aj/writing-english-p)
(abbrev-table-put aj/swedish-abbrevs :enable-function
#'aj/writing-swedish-p)
(abbrev-table-put text-mode-abbrev-table
:parents (list aj/english-abbrevs
aj/swedish-abbrevs)))
I initially did try to store these properties in the abbrev file,
but that was overwritten whenever abbrevs were edited and saved.
Apparently write-abbrev-file doesn’t include properties for
neither abbrev-tables nor individual abbrevs.
With my quick check through abbrev.el it appears that this could
be easily added at the end of insert-abbrev-table-description and
for individual symbols.
Since both define-abbrev and define-abbrev-table supports adding
properties as &rest arguments this shouldn’t be so complicated.
I guess this would involve filtering out the relevant properties
to store from what is returned by symbol-plist.
But perhaps there is a good reason for the present state that I
missed?
By the way, the last form in my code above would have to remain,
as the :parent property has to be a list of abbrev-tables (which
are themselves loaded from the file) and not only their names.
--
Anders Johansson
- Is there a reason why abbrev-table properties are not saved in file,
Anders Johansson <=