GNU bug report logs -
#15360
24.3; Bug in abbrev--check-chars function in abbrev.el ?
Previous Next
Reported by: glenn.coombs <at> gmail.com
Date: Thu, 12 Sep 2013 15:52:03 UTC
Severity: normal
Found in version 24.3
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 12 Sep 2013 15:37:26 -0400
with message-id <jwvppsdu91b.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#15360: 24.3; Bug in abbrev--check-chars function in abbrev.el ?
has caused the debbugs.gnu.org bug report #15360,
regarding 24.3; Bug in abbrev--check-chars function in abbrev.el ?
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
15360: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15360
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
The abbrev--check-chars function in abbrev.el is supposed to check either
the current syntax table or the global syntax table. According to the doc
string if the second argument is nil the local syntax table is checked,
otherwise the global syntax table will be checked. From looking at the
code it appears to do the opposite. This means that when asked to check
the local syntax table it actually checks the global syntax table.
I discovered this when I tried to define an abbrev for "#i" to expand to
"#include" but it failed even after I had run (modify-syntax-entry ?#
"w"). I have modified the abbrev--check-chars function as below and it now
works as I think it is supposed to:
(eval-after-load 'abbrev
'(defun abbrev--check-chars (abbrev global)
"GRC modified: Check if the characters in ABBREV have word syntax in
either the current (if global is nil) or standard syntax table."
(with-syntax-table
(cond ((null global) (syntax-table)) ; these 2 lines have been
changed
(t (standard-syntax-table))) ; to make this function
work as expected
(when (string-match "\\W" abbrev)
(let ((badchars ())
(pos 0))
(while (string-match "\\W" abbrev pos)
(cl-pushnew (aref abbrev (match-beginning 0)) badchars)
(setq pos (1+ pos)))
(error "Some abbrev characters (%s) are not word constituents %s"
(apply 'string (nreverse badchars))
(if global "in the standard syntax" "in this mode")))))))
I am not subscribed to this mailing list so please email me directly if you
require any further information.
--
Glenn
In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2013-07-08 on desk137
Windowing system distributor `The Cygwin/X Project', version 11.0.11200000
System Description: CentOS release 4.8 (Final)
Configured using:
`configure '--program-prefix=g'
'--prefix=/vl/edatools/intern/emacs/24.3.nicegui/linux/'
'--enable-locallisppath=/vl/edatools/intern/emacs/24.3.nicegui/site-lisp/'
'--without-pop' '--with-x-toolkit=lucid' '--without-xpm'
'--without-sound' '--without-jpeg' '--without-tiff' '--without-gif'
'--without-png' '--without-rsvg' '--without-imagemagick'
'--without-selinux''
Important settings:
value of $LC_ALL: C
value of $LANG: C
locale-coding-system: nil
default enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
which-function-mode: t
show-paren-mode: t
desktop-save-mode: t
tooltip-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
C-l <f7> <f7> <f7> <f7> <f7> <f7> <f7> <f7> <f7> <f7>
<f7> <f7> <f7> <f7> <f11> <backspace> <right> C-x C-s
C-a C-x b c o m m SPC h SPC <return> M-x t o g g SPC
r e SPC <return> # i SPC C-/ C-/ C-/ C-/ C-x k <return>
C-x b <return> C-x k <return> <up> <up> <up> <up> <up>
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-movement>
<drag-mouse-1> <kp-7> C-x b a b b SPC C-f C-g C-x C-f
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> C-g <down-mouse-1> <mouse-1>
M-x r e p o SPC r SPC <return>
Recent messages:
Loading /user/grc/.xemacs/ctypes...done
Saving file /user/grc/.emacs.d/init.el...
Wrote /user/grc/.emacs.d/init.el
Read-Only mode disabled
Undo! [3 times]
user-error: No further undo information
Mark set [2 times]
call-interactively: End of buffer
Quit [2 times]
Making completion list...
Load-path shadows:
/vl/edatools/intern/emacs/24.3.nicegui/site-lisp/verilog-mode hides
/vl/edatools/intern/emacs/24.3.nicegui/linux/share/emacs/24.3/lisp/progmodes/verilog-mode
/vl/edatools/intern/emacs/24.3.nicegui/site-lisp/vhdl-mode hides
/vl/edatools/intern/emacs/24.3.nicegui/linux/share/emacs/24.3/lisp/progmodes/vhdl-mode
Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-mode add-log ruby-mode perl-mode sh-script
smie executable jka-compr edmacro kmacro which-func ctypes cl-macs gv
saveplace paren desktop cus-start cus-load mouse-copy frame-restore
imenu cmake-mode p4 vc vc-dispatcher show-proto uniquify advice help-fns
advice-preload cc-langs cc-mode cc-fonts easymenu cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs alist cl cl-lib
grc-funcs time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dynamic-setting font-render-setting x-toolkit x multi-tty emacs)
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
> The abbrev--check-chars function in abbrev.el is supposed to check either
> the current syntax table or the global syntax table. According to the doc
> string if the second argument is nil the local syntax table is checked,
> otherwise the global syntax table will be checked. From looking at the
> code it appears to do the opposite. This means that when asked to check
> the local syntax table it actually checks the global syntax table.
Duh! Sorry for that swap, you're absolutely right.
I just installed a fix for it in the emacs-24 branch,
Stefan
This bug report was last modified 11 years and 250 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.