[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: abbreviation ending with "."
From: |
Stefan Monnier |
Subject: |
Re: abbreviation ending with "." |
Date: |
Wed, 11 Nov 2009 23:30:47 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
> 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*")
See C-h v define-abbrev-table to see the default value used for
the :regexp (to which I just added \\.?).
Stefan