unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* avoid duplicates in history
@ 2004-06-01 17:00 Dan Nicolaescu
  2004-06-04  3:08 ` Juri Linkov
  0 siblings, 1 reply; 17+ messages in thread
From: Dan Nicolaescu @ 2004-06-01 17:00 UTC (permalink / raw)



One feature of tcsh that I miss in emacs is "histdup=erase". When
histdup is set that way when a command is entered in history all
previous occurrences of the same command will be erased. 
bash3 will also implement this feature, it will be called
"erasedups". 

Here is an implementation of this feature for Emacs. 

If this is acceptable, I will provide a complete patch with
documentation. 

Feedback would be appreciated. 
Is the history-erasedups name ok? 

Thanks.


*** minibuf.c	27 May 2004 23:22:35 -0700	1.266
--- minibuf.c	01 Jun 2004 09:47:22 -0700	
***************
*** 61,66 ****
--- 61,71 ----
  
  Lisp_Object Qhistory_length, Vhistory_length;
  
+ /* No duplicates in history.  */
+ 
+ int history_erasedups;
+ 
+ 
  /* Fread_minibuffer leaves the input here as a string. */
  
  Lisp_Object last_minibuf_string;
***************
*** 742,748 ****
  	{
  	  Lisp_Object length;
  
! 	  histval = Fcons (histstring, histval);
  	  Fset (Vminibuffer_history_variable, histval);
  
  	  /* Truncate if requested.  */
--- 747,754 ----
  	{
  	  Lisp_Object length;
  
! 	  if (history_erasedups) Fdelete (histstring, histval);
!           histval = Fcons (histstring, histval);
  	  Fset (Vminibuffer_history_variable, histval);
  
  	  /* Truncate if requested.  */
***************
*** 2631,2636 ****
--- 2637,2647 ----
  property of a history variable overrides this default.  */);
    XSETFASTINT (Vhistory_length, 30);
  
+   DEFVAR_BOOL ("history-erasedups", &history_erasedups,
+ 	       doc: /* *Non-nil means delete duplicates in history.
+   */);
+   history_erasedups = 0;
+   
    DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
  	       doc: /* *Non-nil means automatically provide help for invalid completion input.  */);
    Vcompletion_auto_help = Qt;

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

end of thread, other threads:[~2004-09-07  3:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01 17:00 avoid duplicates in history Dan Nicolaescu
2004-06-04  3:08 ` Juri Linkov
2004-06-04  3:20   ` Miles Bader
2004-06-04 16:29     ` Dan Nicolaescu
2004-06-04 19:32       ` Juri Linkov
2004-06-04 21:27         ` Dan Nicolaescu
2004-06-04 22:09           ` Juri Linkov
2004-06-05 22:50         ` Richard Stallman
2004-06-07  8:53           ` Stefan Monnier
2004-09-02  0:37             ` removing duplicate from history by default [was Re: avoid duplicates in history] Dan Nicolaescu
2004-09-02 19:02               ` Richard Stallman
2004-09-03 23:05                 ` removing duplicate from history by default Juri Linkov
2004-09-05 17:58                   ` Dan Nicolaescu
2004-09-07  3:43                     ` Richard Stallman
2004-06-05 13:48       ` avoid duplicates in history Richard Stallman
2004-06-26 20:45       ` Juri Linkov
2004-06-28  2:23         ` 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).