all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Chen <quarl@hkn.eecs.berkeley.edu>
Subject: proposed patch to expand-abbrev in abbrev.c
Date: Thu, 6 Feb 2003 00:53:03 -0800	[thread overview]
Message-ID: <15938.8815.95606.22282@hkn.eecs.berkeley.edu> (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

             reply	other threads:[~2003-02-06  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-06  8:53 Karl Chen [this message]
2003-02-07  9:18 ` proposed patch to expand-abbrev in abbrev.c 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15938.8815.95606.22282@hkn.eecs.berkeley.edu \
    --to=quarl@hkn.eecs.berkeley.edu \
    --cc=quarl@quarl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.