unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* proposed patch to expand-abbrev in abbrev.c
@ 2003-02-06  8:53 Karl Chen
  2003-02-07  9:18 ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2003-02-06  8:53 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-13 10:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-06  8:53 proposed patch to expand-abbrev in abbrev.c Karl Chen
2003-02-07  9:18 ` Richard Stallman
2003-02-07 17:33   ` Karl Chen
     [not found]     ` <E18hqkE-0003cl-00@fencepost.gnu.org>
2003-02-12  8:08       ` Karl Chen
2003-02-13 10:07         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).