Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
abbrev and escapes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
harven  
View profile  
 More options Nov 23 2009, 5:24 am
Newsgroups: gnu.emacs.help
From: harven <har...@free.fr>
Date: Mon, 23 Nov 2009 11:24:07 +0100
Local: Mon, Nov 23 2009 5:24 am
Subject: abbrev and escapes
Here is a sample code that works with emacs22 in fundamental or tex mode.
It expands \med into \medskip.

(progn
   (clear-abbrev-table my-table)
   (define-abbrev-table 'my-table '(
      ("success" "success again")
      ("\\med"   "\\medskip")))
   (setq local-abbrev-table my-table)
   (setq abbrev-mode t)                      
   (setq words-include-escapes t))

Unfortunately, it does not work anymore with emacs23.
I tried tweaking the new :regexp property to no avail.

(abbrev-table-put my-table :regexp  "\\<?\\(\\\\?\\w+\\)\\W*")

I also tried
 "\\(\\(\\\\\\|\\<\\)\\w+\\)\\W*"
 "\\(\\(\\<\\|\w\\)\\w+\\)\\W*"
 "\\(\\<?\\\\?\\w+\\)\\W*"
 "\\(\\\\?\\w+\\)\\W*"

The closest I came is  "\\(\\\\\\w+\\)\\W*"
that expands \med but, of course, not success.

What am I doing wrong here ?

BTW, isn't there a typo in the manual ?
The default regexp given there (36.8 Abbrev Table Properties)
is "\\<\\(\\w+\\)\\W" and does not seem to work, but the one that comes with
the definition of define-abbrev-table is "\\<\\(\\w+\\)\\W*" (and it works)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Nov 23 2009, 10:25 pm
Newsgroups: gnu.emacs.help
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Mon, 23 Nov 2009 22:25:58 -0500
Local: Mon, Nov 23 2009 10:25 pm
Subject: Re: abbrev and escapes

> Unfortunately, it does not work anymore with emacs23.

Try M-x report-emacs-bug.

        Stefan


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google