From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: Re: pre-abbrev-expand-hook Date: Mon, 05 Jul 2004 10:22:45 -0400 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <20040702224400.128DD4E38@tfkp07.physik.uni-erlangen.de> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1089037413 24467 80.91.224.253 (5 Jul 2004 14:23:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Jul 2004 14:23:33 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 05 16:23:29 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BhUNU-0001Y0-00 for ; Mon, 05 Jul 2004 16:23:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhUPS-0004lo-K8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jul 2004 10:25:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BhUOz-0004aq-JU for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2004 10:25:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BhUOy-0004aJ-98 for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2004 10:25:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhUOy-0004a9-6a for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2004 10:25:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BhUMn-0003NL-L4 for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2004 10:22:45 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BhUMn-0003Gx-4r; Mon, 05 Jul 2004 10:22:45 -0400 Original-To: Roland Winkler t28834 In-reply-to: <20040702224400.128DD4E38@tfkp07.physik.uni-erlangen.de> (message from Roland Winkler t28834 on Sat, 3 Jul 2004 00:44:00 +0200 (CEST)) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8351 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8351 The example was no good; it should test last-command-char rather that (preceding-char). I discovered that pre-abbrev-expand-hook is useless with the current C code, since it is run whether or not the previous word is an abbrev. This change seems to make it usable. *** abbrev.c 17 Jun 2004 19:28:38 -0400 1.62 --- abbrev.c 05 Jul 2004 01:52:09 -0400 *************** *** 248,255 **** value = Qnil; - Frun_hooks (1, &Qpre_abbrev_expand_hook); - wordstart = 0; if (!(BUFFERP (Vabbrev_start_location_buffer) && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) --- 248,253 ---- *************** *** 325,330 **** --- 323,330 ---- wordend - wordstart, p - buffer); if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) return value; + + Frun_hooks (1, &Qpre_abbrev_expand_hook); if (INTERACTIVE && !EQ (minibuf_window, selected_window)) {