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: Robert Pluim
Subject: Re: did the abbrev mechanism ever expand «two words» to «two different words».
Date: Fri, 08 Jan 2021 11:55:28 +0100

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

> 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.
>

You've forgotten the 'hook' argument in the abbrev definition. Also,
:regexp is a property for the whole table, so you need something like
this:

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

(I agree the documentation could be clearer)

Robert



reply via email to

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