unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5031: 23.1; abbrev and escapes
@ 2009-11-24  9:15 ` harven
  2009-11-25  5:10   ` bug#5031: marked as done (23.1; abbrev and escapes) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: harven @ 2009-11-24  9:15 UTC (permalink / raw)
  To: bug-gnu-emacs

It was possible under emacs 22 to expand abbrevs that start with an escape
character e.g. \ by setting words-include-escapes to true.
This does not work anymore under emacs 23. Here is a short example.

(progn
   (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))

Under emacs22,  success expands to  success again 
                \med    expands to  \medskip

Under emacs23,  only success expands.

I tried to modify the :regexp property of the table without success.

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  display-time-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: 1
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
M-t g n u s <return> M-t C-g C-x b * s c a r DEL DEL 
r a t c h * <return> M-t r e p o r t - b u g <return>

Recent messages:
nnimap: Mailbox INBOX modified
nnimap: Mailbox INBOX.Trash modified
nnimap: Checking mailboxes...done
Reading active file from sauvegarde via nnfolder...
Opening nnfolder server on sauvegarde...done
nnfolder: Reading incoming mail from file...
nnfolder: Reading incoming mail (no new mail)...done
Reading active file from sauvegarde via nnfolder...done
Checking new news...done
Quit






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#5031: marked as done (23.1; abbrev and escapes)
  2009-11-24  9:15 ` bug#5031: 23.1; abbrev and escapes harven
@ 2009-11-25  5:10   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-11-25  5:10 UTC (permalink / raw)
  To: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

Your message dated Wed, 25 Nov 2009 00:00:09 -0500
with message-id <jwvr5rnp5mo.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#5031: 23.1; abbrev and escapes
has caused the Emacs bug report #5031,
regarding 23.1; abbrev and escapes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
5031: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=5031
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4827 bytes --]

From: harven <harven@free.fr>
To: bug-gnu-emacs@gnu.org
Cc: 
Subject: 23.1; abbrev and escapes
Date: Tue, 24 Nov 2009 10:15:24 +0100
Message-ID: <87pr78qo5v.fsf@ergodik.univ-brest.fr>

It was possible under emacs 22 to expand abbrevs that start with an escape
character e.g. \ by setting words-include-escapes to true.
This does not work anymore under emacs 23. Here is a short example.

(progn
   (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))

Under emacs22,  success expands to  success again 
                \med    expands to  \medskip

Under emacs23,  only success expands.

I tried to modify the :regexp property of the table without success.

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  display-time-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: 1
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
M-t g n u s <return> M-t C-g C-x b * s c a r DEL DEL 
r a t c h * <return> M-t r e p o r t - b u g <return>

Recent messages:
nnimap: Mailbox INBOX modified
nnimap: Mailbox INBOX.Trash modified
nnimap: Checking mailboxes...done
Reading active file from sauvegarde via nnfolder...
Opening nnfolder server on sauvegarde...done
nnfolder: Reading incoming mail from file...
nnfolder: Reading incoming mail (no new mail)...done
Reading active file from sauvegarde via nnfolder...done
Checking new news...done
Quit



[-- Attachment #3: Type: message/rfc822, Size: 3715 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: harven <harven@free.fr>
Subject: Re: bug#5031: 23.1; abbrev and escapes
Date: Wed, 25 Nov 2009 00:00:09 -0500
Message-ID: <jwvr5rnp5mo.fsf-monnier+emacsbugreports@gnu.org>

> It was possible under emacs 22 to expand abbrevs that start with an escape
> character e.g. \ by setting words-include-escapes to true.
> This does not work anymore under emacs 23. Here is a short example.

> (progn
>    (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))

I've installed the patch below which should better match the
Emacs-22 behavior.  Thanks for the report,


        Stefan


=== modified file 'lisp/abbrev.el'
--- lisp/abbrev.el	2009-11-19 17:24:04 +0000
+++ lisp/abbrev.el	2009-11-25 04:45:07 +0000
@@ -680,11 +680,19 @@
           (setq tables (append (abbrev-table-get table :parents) tables))
           (setq res
                 (and (or (not enable-fun) (funcall enable-fun))
-                     (looking-back (or (abbrev-table-get table :regexp)
-                                       "\\<\\(\\w+\\)\\W*")
-                                   (line-beginning-position))
+                     (let ((re (abbrev-table-get table :regexp)))
+                       (if (null re)
+                           ;; We used to default `re' to "\\<\\(\\w+\\)\\W*"
+                           ;; but when words-include-escapes is set, that
+                           ;; is not right and fixing it is boring.
+                           (let ((lim (point)))
+                             (backward-word 1)
+                             (setq start (point))
+                             (forward-word 1)
+                             (setq end (min (point) lim)))
+                         (when (looking-back re (line-beginning-position))
                      (setq start (match-beginning 1))
-                     (setq end   (match-end 1))
+                           (setq end   (match-end 1)))))
                      (setq name  (buffer-substring start end))
                      (let ((abbrev (abbrev-symbol name table)))
                        (when abbrev


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-25  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <jwvr5rnp5mo.fsf-monnier+emacsbugreports@gnu.org>
2009-11-24  9:15 ` bug#5031: 23.1; abbrev and escapes harven
2009-11-25  5:10   ` bug#5031: marked as done (23.1; abbrev and escapes) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).