help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: abbreviation ending with "."


From: Andreas Röhler
Subject: Re: abbreviation ending with "."
Date: Mon, 16 Nov 2009 12:08:15 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

harven wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
>>> I want to have an abbreviation that turns "p." into "para"
>>> (Portuguese).  But all my abbreviations that end with "." are not
>>> expanded.  I googled around and could not find anything on this.
>> Abbreviations by default only work if they're exclusively made up of
>> "word chars" (a.k.a chars of syntax class "word").
>>
>> So you can either change the char "." to be a word constituent (which
>> may lead to surprises), or you can change the setting on the
>> abbrev-table in which you placed that "p." abbreviation.
>>
>> E.g. if it's added to the abbrev table named `foo-abbrev-table', you
>> could do
>>
>>    (abbrev-table-put foo-abbrev-table
>>                      :regexp "\\<\\(\\w+\\.?\\)\\W*")
> 
> This does not seem to work. I tried the following with emacs -Q 
> 
> (progn
>    (setq abbrev-mode t)
>    (define-abbrev-table 'my-abbrev-table '(
>       ("success"         "success again")
>       ("try."            "try again")))
>    (abbrev-table-put my-abbrev-table
>                         :regexp "\\<\\(\\w+\\.?\\)\\W*")
>    (setq local-abbrev-table my-abbrev-table))
> 
> success expands as success again.
> try. does not expand.
> 

Here an explizit 'M-x expand-abbrev' does it, but <space> not.
Seems a bug somewhere.


Andreas

--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/





> Strange enough, If I try to make a new expansion for "try." with C-x a i l, 
> it says that I am trying to overwrite the "try. -> try again" expansion, but 
> there is still no expansion. What am I doing wrong ?
> 
> I am running "GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 
> 2009-09-14 on raven, modified by Debian"
> 





reply via email to

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