emacs-devel
[Top][All Lists]
Advanced

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

[BUG? write-abbrev-file destroys this construction] (was: did the abbrev


From: Uwe Brauer
Subject: [BUG? write-abbrev-file destroys this construction] (was: did the abbrev mechanism ever expand «two words» to «two different words».)
Date: Sat, 09 Jan 2021 14:42:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Uwe Brauer <oub@mat.ucm.es> writes:

> Thatʼs not the way abbrev tables work: the regexp answers the question
> "which characters before point do I use to lookup abbrevs in this
> table?". That can't be both two words separated by a space and a
> single word at the same time, ie using

> "\\(\\w+ \\w+\\)\\|\\(w+\\)

> will fail, since that will match the 'two word' version if thereʼs a
> space on the line, so in order to get what you want you need two
> abbrev tables:

>     (define-abbrev-table 'fundamental-mode-abbrev-table
>       '(
>         ("asi" "así" nil :count 0)))

>     (define-abbrev-table 'my-abbrev-table
>       '(
>         ("a que" "a qué" nil :count 0))
>       "Uwe's table"
>       :regexp "\\(\\w+ \\w+\\)")


Your code works, if I put it in by .abbrev_defs file and re-read the
abbrev file. However when close emacs write-abbrev-file somehow destroys
the table with the regexp. Is this a bug?

This parts enters a minor mode
>     (setq local-abbrev-table (list my-abbrev-table 
> fundamental-mode-abbrev-table))

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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