bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#2989: implement bash's ignoredups


From: Dan Nicolaescu
Subject: bug#2989: implement bash's ignoredups
Date: Mon, 13 Apr 2009 19:01:09 -0700 (PDT)

jidanni@jidanni.org writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > > *** New user option `history-delete-duplicates'.
  > Well, OK, but see, there they still are at the <escape> p's below.
  > $ cd /tmp
  > $ echo a:\;date>Makefile
  > $ emacs -Q -eval '(setq history-delete-duplicates t)' Makefile
  > <escape> x c o m p i l e <return> <return> <escape> x <up>
  > <return> <return> <escape> x <up> <return> <return>
  > C-x <escape> <escape> <escape> p <escape> p <escape> p
  > emacs-version "22.3.1" (Yes, I still use <escape>).

You probably want to open another bug saying that
history-delete-duplicates does not apply to command history.

You can try this (not even compile tested) patch:

--- callint.c.~1.172.~  Tue Mar 31 16:28:30 2009
+++ callint.c   Mon Apr 13 18:54:56 2009
@@ -370,8 +370,12 @@
             and turn them into things we can eval.  */
          values = quotify_args (Fcopy_sequence (specs));
          fix_command (input, values);
-         Vcommand_history
-           = Fcons (Fcons (function, values), Vcommand_history);
+         {
+           Lisp_Object this_cmd = Fcons (function, values);
+           if (history_delete_duplicates) 
+             Vcommand_history = Fdelete (this_cmd, Vcommand_history);
+           Vcommand_history = Fcons (this_cmd, Vcommand_history);
+         }
 
          /* Don't keep command history around forever.  */
          if (INTEGERP (Vhistory_length) && XINT (Vhistory_length) > 0)






reply via email to

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