[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why on earth is abbrev baked into the C code?
From: |
Daniel Colascione |
Subject: |
Why on earth is abbrev baked into the C code? |
Date: |
Sat, 26 Feb 2011 19:06:58 -0800 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
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.
signature.asc
Description: OpenPGP digital signature
- Why on earth is abbrev baked into the C code?,
Daniel Colascione <=