From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Why on earth is abbrev baked into the C code? Date: Sat, 26 Feb 2011 19:06:58 -0800 Message-ID: <4D69BFD2.7060606@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig03B37F39ED58F4234374044B" X-Trace: dough.gmane.org 1298776757 22191 80.91.229.12 (27 Feb 2011 03:19:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Feb 2011 03:19:17 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 27 04:19:11 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PtXA6-0004wu-Ck for ged-emacs-devel@m.gmane.org; Sun, 27 Feb 2011 04:19:10 +0100 Original-Received: from localhost ([127.0.0.1]:33822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PtWyV-0003Jz-AR for ged-emacs-devel@m.gmane.org; Sat, 26 Feb 2011 22:07:11 -0500 Original-Received: from [140.186.70.92] (port=45450 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PtWyP-0003IL-Jz for emacs-devel@gnu.org; Sat, 26 Feb 2011 22:07:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PtWyO-0003NZ-Gb for emacs-devel@gnu.org; Sat, 26 Feb 2011 22:07:05 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:56558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PtWyO-0003NV-Cx for emacs-devel@gnu.org; Sat, 26 Feb 2011 22:07:04 -0500 Original-Received: by iyf13 with SMTP id 13so2540823iyf.0 for ; Sat, 26 Feb 2011 19:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:x-enigmail-version:content-type; bh=FxOYe6baT40DDqqv7cmYzJL/J8WXatinWH6H8JynVu4=; b=DHooNUDY6sHyuZeQ88lktfFSyav2rslzI/dhDkKQU+oINhMHzKDjV4VAK3AbnnQv7k DZgAu09GWEE1zVof0WWPzuQYLF+9C6+IRrO0tr3yMGS3nYgRJUJYTlV457SkUna0zLvy ZTYW8jbwwPRXkPBZQ2/zyxfrFVqssfxH0n+Mo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type; b=czGpjFY0G2jDY0PjS+9vB2NsfC1Lps5n7dRc9fptIOPLHCgrUT16iSa6wVzPjm6Utl V5UZBiOiClsHQIaYgBI+QK7TTQnDpIAkpgXgdWTibOfEq2LcPKc9GBXWZOBacHi1P8EQ foTZUOl1CRWARm3s8bbHMHDTO1yvh2O8l72Jo= Original-Received: by 10.42.174.10 with SMTP id t10mr3022572icz.15.1298776023138; Sat, 26 Feb 2011 19:07:03 -0800 (PST) Original-Received: from edith.local (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id xa8sm1848776icb.10.2011.02.26.19.07.01 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Feb 2011 19:07:02 -0800 (PST) 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 X-Enigmail-Version: 1.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136568 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig03B37F39ED58F4234374044B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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.=20 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.) =3D=3D=3D 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 @@ =20 static int nonundocount; =20 -/* 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. --------------enig03B37F39ED58F4234374044B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk1pv9QACgkQ17c2LVA10Vsl9QCfVyAOlgl6jBTItKBRnKmFyi8l VI0AoOORPnGqo8fdZsxvPDcpGFwuLWmV =QoW2 -----END PGP SIGNATURE----- --------------enig03B37F39ED58F4234374044B--