emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposed patch to expand-abbrev in abbrev.c


From: Karl Chen
Subject: proposed patch to expand-abbrev in abbrev.c
Date: Thu, 6 Feb 2003 00:53:03 -0800

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 / address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]