all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: harven <harven@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: abbreviation ending with "."
Date: Mon, 16 Nov 2009 11:34:21 +0100	[thread overview]
Message-ID: <87d43iiwr6.fsf@ergodik.univ-brest.fr> (raw)
In-Reply-To: jwv639gjrna.fsf-monnier+gnu.emacs.help@gnu.org

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.

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"


  parent reply	other threads:[~2009-11-16 10:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  0:30 abbreviation ending with "." finotti
2009-11-12  4:30 ` Stefan Monnier
2009-11-12 16:28   ` finotti
2009-11-14  8:11     ` Stefan Monnier
2009-11-16 10:34   ` harven [this message]
2009-11-16 11:08     ` Andreas Röhler
     [not found]     ` <mailman.10801.1258369753.2239.help-gnu-emacs@gnu.org>
2009-11-16 14:54       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d43iiwr6.fsf@ergodik.univ-brest.fr \
    --to=harven@free.fr \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.