emacs-devel
[Top][All Lists]
Advanced

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

Re: did the abbrev mechanism ever expand «two words» to «two different w


From: Uwe Brauer
Subject: Re: did the abbrev mechanism ever expand «two words» to «two different words».
Date: Fri, 08 Jan 2021 09:20:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> An “abbrev” is a word that has been defined to “expand” into a specified
>> “expansion”.  When you insert a word-separator character following the
>> abbrev, that expands the abbrev—replacing the abbrev with its expansion.
>> For example, if ‘foo’ is defined as an abbrev expanding to ‘find outer
>> otter’, then typing ‘f o o .’ will insert ‘find outer otter.’.
>> 
>> This mean a word-separator character cannot be part of an abbrev.

> That's true for the default behavior.
> Since Emacs-24, abbrev tables do support abbrevs whose name includes
> non-word characters, but it requires extra work on the part of the user
> in order to characterize the possible names via the `:regexp` property
> (see `C-h o define-abbrev-table`).

Thanks, I read the documentation but I am unable to figure out, what
regexp has to be used for that regexp I should use in order to make a
two word expansion work. 

All regexp I tried returned error.

So this 

(define-abbrev-table 'fundamental-mode-abbrev-table
  '(
    ("a que" "a qué" :regexp 1 :count 0)))


Does not return error but does not work as well.

May I suggest to add an example in the documentation of 

`C-h o define-abbrev-table`

Thanks 

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


reply via email to

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