From: Daniel Colascione <dan.colascione@gmail.com>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Why on earth is abbrev baked into the C code?
Date: Sat, 26 Feb 2011 19:06:58 -0800 [thread overview]
Message-ID: <4D69BFD2.7060606@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]
I was looking into abbrev.el to figure out how to code up a change I
wanted to make (having undo undo the abbrev expansion without undoing
the self-insert-command that triggered the expansion), when I realized
to my surprise that abbrev is actually baked into the Emacs C core.
This defies common sense: why can't abbrev.el be a standalone module
that uses post-self-insert-hook or post-command-hook? I realize we're
not supposed to use hooks to communicate between components that are
part of GNU Emacs, but the alternative in this case seems unnecessarily
invasive.
(By the way: the comment in front of self-insert-command is no longer
valid; ISTR that dubious optimization was removed a while ago.)
=== modified file 'src/cmds.c'
--- src/cmds.c 2011-01-26 08:36:39 +0000
+++ src/cmds.c 2011-02-27 03:02:04 +0000
@@ -263,8 +263,6 @@
static int nonundocount;
-/* Note that there's code in command_loop_1 which typically avoids
- calling this. */
DEFUN ("self-insert-command", Fself_insert_command,
Sself_insert_command, 1, 1, "p",
doc: /* Insert the character you type.
Whichever character you type to run this command is inserted.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next reply other threads:[~2011-02-27 3:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-27 3:06 Daniel Colascione [this message]
2011-02-28 3:18 ` Why on earth is abbrev baked into the C code? Stefan Monnier
[not found] ` <4D6BF0D7.3080005@gmail.com>
2011-03-01 21:08 ` Daniel Colascione
2011-03-02 17:21 ` Richard Stallman
2011-03-02 17:55 ` 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
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=4D69BFD2.7060606@gmail.com \
--to=dan.colascione@gmail.com \
--cc=emacs-devel@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 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).