all messages for Emacs-related lists mirrored at yhetil.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

* Re: proposed patch to expand-abbrev in abbrev.c
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2003-02-07  9:18 UTC (permalink / raw)
  Cc: emacs-devel

    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).

I think that additional change is important--could you add that part?

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

* Re: proposed patch to expand-abbrev in abbrev.c
  2003-02-07  9:18 ` Richard Stallman
@ 2003-02-07 17:33   ` Karl Chen
       [not found]     ` <E18hqkE-0003cl-00@fencepost.gnu.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2003-02-07 17:33 UTC (permalink / raw)
  Cc: quarl

>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:

    rms>     I think `expand-abbrev', should modify abbrevs-changed if it increments the
    rms>     usage counter of an abbrev. Maybe a better solution would be to set it to
    rms>     "'trivially" or use a secondary variable if this would be annoying to people
    rms>     that don't have (setq save-abbrevs 'quietly).

    rms> I think that additional change is important--could you add that part?

Which one?

-- 
Karl Chen / quarl@quarl.org

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

* Re: proposed patch to expand-abbrev in abbrev.c
       [not found]     ` <E18hqkE-0003cl-00@fencepost.gnu.org>
@ 2003-02-12  8:08       ` Karl Chen
  2003-02-13 10:07         ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Chen @ 2003-02-12  8:08 UTC (permalink / raw)
  Cc: Emacs Developement List

My previous suggestion was that save-abbrevs's options not change, and
abbrevs-changed would be set to 'trivially if abbrevs had changed trivially
only (only the use count). this would require a lot of options for saving
abbrevs however. I think you mean to have save-abbrevs have an extra option
of 'trivially but this is ambiguous as to whether it's silent or not.

How about a new variable save-abbrevs-trivially which would affect the
behavior of updating the abbrevs-changed value. 



>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:

    rms> I think `expand-abbrev', should modify abbrevs-changed if it increments the
    rms> usage counter of an abbrev. Maybe a better solution would be to set it to
    rms> "'trivially" or use a secondary variable if this would be annoying to people
    rms> that don't have (setq save-abbrevs 'quietly).


    rms> I think that additional change is important--could you add that part?

    rms>     Which one?

    rms> Using the value `trivally' for save-abbrevs to enable this.

-- 
Karl Chen / quarl@quarl.org

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

* Re: proposed patch to expand-abbrev in abbrev.c
  2003-02-12  8:08       ` Karl Chen
@ 2003-02-13 10:07         ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2003-02-13 10:07 UTC (permalink / raw)
  Cc: emacs-devel

    My previous suggestion was that save-abbrevs's options not change, and
    abbrevs-changed would be set to 'trivially if abbrevs had changed trivially
    only (only the use count).

I did misunderstand that.

			       this would require a lot of options for saving
    abbrevs however. I think you mean to have save-abbrevs have an extra option
    of 'trivially but this is ambiguous as to whether it's silent or not.

Yes, that's what I meant and what I thought you meant too.  But both
ideas make sense together.  A value of `trivially' for
`abbrevs-changed' could be used to implement support for this value of
`save-abbrevs'.

By the way, please keep in mind for the doc strings that we do not
use the convention of writing a ' in front of a symbol name
in English text.  Our convention is to put `...' around it.

^ 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 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.