From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: proposed patch to expand-abbrev in abbrev.c Date: Thu, 6 Feb 2003 00:53:03 -0800 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <15938.8815.95606.22282@hkn.eecs.berkeley.edu> Reply-To: quarl@quarl.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1044521680 9964 80.91.224.249 (6 Feb 2003 08:54:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Feb 2003 08:54:40 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ghne-0002Zs-00 for ; Thu, 06 Feb 2003 09:54:26 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18ghwc-0004Zt-00 for ; Thu, 06 Feb 2003 10:03:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ghn4-0006D1-01 for emacs-devel@quimby.gnus.org; Thu, 06 Feb 2003 03:53:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ghmn-00068t-00 for emacs-devel@gnu.org; Thu, 06 Feb 2003 03:53:33 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ghmO-00061u-00 for emacs-devel@gnu.org; Thu, 06 Feb 2003 03:53:14 -0500 Original-Received: from hkn.eecs.berkeley.edu ([128.32.47.228]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ghmK-0005qE-00 for emacs-devel@gnu.org; Thu, 06 Feb 2003 03:53:05 -0500 Original-Received: from quarl by hkn.eecs.berkeley.edu with local id 18ghmJ-0002fc-00; Thu, 06 Feb 2003 00:53:03 -0800 Original-To: Emacs Developement List X-Mailer: VM 7.07.q1 under Emacs 21.2.1 X-Attribution: quarl X-Quack-Archive: 1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11410 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11410 Hi Emacsers, I think `expand-abbrev', should modify abbrevs-changed if it increments the usage counter of an abbrev. Maybe a better solution would be to set it to "'trivially" or use a secondary variable if this would be annoying to people that don't have (setq save-abbrevs 'quietly). Otherwise, the usage count is useless since often it doesn't get saved. The following patch would just set it to true when an abbrev is expanded. --- abbrev.c.~1.56.~ 2002-08-20 00:46:31.000000000 -0700 +++ abbrev.c 2003-02-06 00:51:30.000000000 -0800 @@ -344,10 +344,16 @@ /* Increment use count. */ if (INTEGERP (XSYMBOL (sym)->plist)) - XSETINT (XSYMBOL (sym)->plist, - XINT (XSYMBOL (sym)->plist) + 1); + { + XSETINT (XSYMBOL (sym)->plist, + XINT (XSYMBOL (sym)->plist) + 1); + abbrevs_changed = 1; + } else if (INTEGERP (tem = Fget (sym, Qcount))) - Fput (sym, Qcount, make_number (XINT (tem) + 1)); + { + Fput (sym, Qcount, make_number (XINT (tem) + 1)); + abbrevs_changed = 1; + } /* If this abbrev has an expansion, delete the abbrev and insert the expansion. */ -- Karl Chen / quarl@quarl.org