From: Roland Winkler t28834 <winkler@tfkp07.physik.uni-erlangen.de>
Subject: pre-abbrev-expand-hook
Date: Sat, 3 Jul 2004 00:44:00 +0200 (CEST) [thread overview]
Message-ID: <20040702224400.128DD4E38@tfkp07.physik.uni-erlangen.de> (raw)
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.
Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.
In GNU Emacs 21.2.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2002-04-09 on tfkp12
configured using `configure --prefix=/nfs/common --libexecdir=/nfs/common/lib --bindir=/nfs/common/lib/emacs/21.2/bin/i686-Linux --mandir=/nfs/common/share/man --infodir=/nfs/common/share/info --with-gcc --with-pop --with-x --with-x-toolkit=athena i386-pc-linux'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: POSIX
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: en_US
locale-coding-system: iso-latin-1
default-enable-multibyte-characters: t
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
The following code is taken from the elisp manual, node Abbrev Expansion
(add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
;; This is the function invoked by `pre-abbrev-expand-hook'.
;; If the user terminated the abbrev with a space, the function does
;; nothing (that is, it returns so that the abbrev can expand). If the
;; user entered some other character, this function asks whether
;; expansion should continue.
;; If the user answers the prompt with `y', the function returns
;; `nil' (because of the `not' function), but that is
;; acceptable; the return value has no effect on expansion.
(defun query-if-not-space ()
(if (/= ?\ (preceding-char))
(if (not (y-or-n-p "Do you want to expand this abbrev? "))
(error "Not expanding this abbrev"))))
Somehow this example doesn't work for me. preceding-char in
query-if-not-space should return the word-separator character which
will cause the abbrev expansion. However, preceding-char returns the
last character of the abbreviation to be expanded.
I looked into this because I wanted to write a function that will
control abbrev expansion based on the word separator character that
invoked the abbrev axpansion. The above example from the elisp manual
suggests that this should be possible. But somehow it doesn't work.
Same problem with more recent versions of emacs.
Am I missing something here?
Roland
next reply other threads:[~2004-07-02 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-02 22:44 Roland Winkler t28834 [this message]
2004-07-05 14:22 ` pre-abbrev-expand-hook Richard Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040702224400.128DD4E38@tfkp07.physik.uni-erlangen.de \
--to=winkler@tfkp07.physik.uni-erlangen.de \
/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 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).