From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesc Rocher Newsgroups: gmane.emacs.devel Subject: Ignoring entries starting with space Date: Sun, 21 Jun 2009 23:20:04 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001485f7c36c34ae8c046ce252d0 X-Trace: ger.gmane.org 1245619220 4362 80.91.229.12 (21 Jun 2009 21:20:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2009 21:20:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 21 23:20:18 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIUSX-00014N-2u for ged-emacs-devel@m.gmane.org; Sun, 21 Jun 2009 23:20:17 +0200 Original-Received: from localhost ([127.0.0.1]:54469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIUSW-00080M-Df for ged-emacs-devel@m.gmane.org; Sun, 21 Jun 2009 17:20:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIUSS-0007zQ-H5 for emacs-devel@gnu.org; Sun, 21 Jun 2009 17:20:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIUSN-0007z7-Ki for emacs-devel@gnu.org; Sun, 21 Jun 2009 17:20:11 -0400 Original-Received: from [199.232.76.173] (port=56615 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIUSN-0007z4-Fg for emacs-devel@gnu.org; Sun, 21 Jun 2009 17:20:07 -0400 Original-Received: from mail-bw0-f228.google.com ([209.85.218.228]:41840) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIUSM-0007PP-VA for emacs-devel@gnu.org; Sun, 21 Jun 2009 17:20:07 -0400 Original-Received: by bwz28 with SMTP id 28so3074115bwz.26 for ; Sun, 21 Jun 2009 14:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ltlPjTeNtjPc32xY3/8F2lVLfQCkoSu3i69vboHlChA=; b=JXWnwRhWKd07b1WLjB7HmXSREIez3gOJcJVz04qUXvw8RrHXOHSLorTO1Qxg1ZptAE ieuHvKQOyGpwJc0Y0jYFs7xZl2x9FF8kmEfwzUGBt5/bh+m9WIM0AhxLGxB51K6dYApE /ODJAmyD1kMRyaxI/eegPBj+KbygHHEZiVNyw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=a4slJl0T1dOCUWNZhlYIm8IKRDC9x/ld9w35cXOoQzhv8TSyVY178wfXIXrnT+iSRI aMHyZrmHhMVMZbKhqlvMylvUmL3elCjAyiqMRdnt5Ds9sOz32Kfcby3fwgVIlVh72V/y YFKVmx1SzLoWsqWPQ918VlRp6ckONgcNgwsUM= Original-Received: by 10.239.133.65 with SMTP id 1mr419061hbu.150.1245619204435; Sun, 21 Jun 2009 14:20:04 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111618 Archived-At: --001485f7c36c34ae8c046ce252d0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello all, The same way it is possible to delete duplicates in minibuffer history, I think it is also very useful to have the possibility to ignore entries starting with space(s). The new variable `history-ignore-space' would take care of this, being `nil' its defaut value. Here you can see the changes needed. Index: lisp/cus-start.el =================================================================== RCS file: /sources/emacs/emacs/lisp/cus-start.el,v retrieving revision 1.136 diff -u -r1.136 cus-start.el --- lisp/cus-start.el 27 Mar 2009 16:50:25 -0000 1.136 +++ lisp/cus-start.el 21 Jun 2009 21:17:22 -0000 @@ -216,6 +216,7 @@ (choice (const :tag "Infinite" t) integer) "22.1") (history-delete-duplicates minibuffer boolean "22.1") + (history-ignore-space minibuffer boolean "23.2") (read-buffer-completion-ignore-case minibuffer boolean "23.1") (minibuffer-prompt-properties Index: src/minibuf.c =================================================================== RCS file: /sources/emacs/emacs/src/minibuf.c,v retrieving revision 1.362 diff -u -r1.362 minibuf.c --- src/minibuf.c 17 Mar 2009 04:37:41 -0000 1.362 +++ src/minibuf.c 21 Jun 2009 21:17:26 -0000 @@ -61,6 +61,10 @@ int history_delete_duplicates; +/* No entries starting with space. */ + +int history_ignore_space; + /* Non-nil means add new input to history. */ Lisp_Object Vhistory_add_new_input; @@ -776,6 +780,12 @@ else histstring = Qnil; + /* Make sure the string must be strored. */ + if (history_ignore_space + && !NILP (histstring) + && SREF (histstring,0) == ' ') + histstring = Qnil; + /* Add the value to the appropriate history list, if any. */ if (!NILP (Vhistory_add_new_input) && SYMBOLP (Vminibuffer_history_variable) @@ -2156,6 +2166,12 @@ elements are deleted from the history list. */); history_delete_duplicates = 0; + DEFVAR_BOOL ("history-ignore-space", &history_ignore_space, + doc: /* *Non-nil means to ignore entries starting with space. +If set to t, elements starting with space are not stored into the +history list. */); + history_ignore_space = 0; + DEFVAR_LISP ("history-add-new-input", &Vhistory_add_new_input, doc: /* *Non-nil means to add new elements in history. If set to nil, minibuffer reading functions don't add new elements to the If you like the idea I can install them in the trunk for release 23.2. -- Francesc Rocher --001485f7c36c34ae8c046ce252d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello all,

The same way it is possible to delete duplicates in m= inibuffer history, I
think it is also very useful to have the possibilit= y to ignore entries
starting with space(s). The new variable `history-ig= nore-space' would take
care of this, being `nil' its defaut value.

Here you can see the= changes needed.


Index: lisp/cus-start.el
=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/emacs/emacs/lisp/cu= s-start.el,v
retrieving revision 1.136
diff -u -r1.136 cus-start.el
--- lisp/cus-s= tart.el=A0=A0=A0 27 Mar 2009 16:50:25 -0000=A0=A0=A0 1.136
+++ lisp/cus-= start.el=A0=A0=A0 21 Jun 2009 21:17:22 -0000
@@ -216,6 +216,7 @@
=A0= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 (choice (const :tag "Infini= te" t) integer)
=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 "22.1")
=A0=A0= =A0=A0 =A0=A0=A0=A0 (history-delete-duplicates minibuffer boolean "22.= 1")
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (history-ignore-space min= ibuffer boolean "23.2")
=A0=A0=A0=A0 =A0=A0=A0=A0 (read-buffer= -completion-ignore-case minibuffer boolean "23.1")
=A0
=A0=A0=A0=A0 =A0=A0=A0=A0 (minibuffer-prompt-properties
Index: sr= c/minibuf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS f= ile: /sources/emacs/emacs/src/minibuf.c,v
retrieving revision 1.362
diff -u -r1.362 minibuf.c
--- src/minibuf.c=A0=A0=A0 17 Mar 2009 04:37:4= 1 -0000=A0=A0=A0 1.362
+++ src/minibuf.c=A0=A0=A0 21 Jun 2009 21:17:26 -= 0000
@@ -61,6 +61,10 @@
=A0
=A0int history_delete_duplicates;
= =A0
+/* No entries starting with space. */
+
+int history_ignore_space;
+
=A0/* Non-nil means add new input t= o history.=A0 */
=A0
=A0Lisp_Object Vhistory_add_new_input;
@@ -77= 6,6 +780,12 @@
=A0=A0 else
=A0=A0=A0=A0 histstring =3D Qnil;
=A0+=A0 /* Make sure the string must be strored.=A0 */
+=A0 if (history_ignore_space
+=A0=A0=A0=A0=A0 && !NILP (histstr= ing)
+=A0=A0=A0=A0=A0 && SREF (histstring,0) =3D=3D ' ')=
+=A0=A0=A0 histstring =3D Qnil;
+
=A0=A0 /* Add the value to the = appropriate history list, if any.=A0 */
=A0=A0 if (!NILP (Vhistory_add_new_input)
=A0=A0=A0=A0=A0=A0 && = SYMBOLP (Vminibuffer_history_variable)
@@ -2156,6 +2166,12 @@
=A0elem= ents are deleted from the history list.=A0 */);
=A0=A0 history_delete_du= plicates =3D 0;
=A0
+=A0 DEFVAR_BOOL ("history-ignore-space", &history_ignore_spa= ce,
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 doc: /* *Non-nil means t= o ignore entries starting with space.
+If set to t, elements starting wi= th space are not stored into the
+history list.=A0 */);
+=A0 history_ignore_space =3D 0;
+
=A0=A0 D= EFVAR_LISP ("history-add-new-input", &Vhistory_add_new_input,=
=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0 doc: /* *Non-nil means to add new eleme= nts in history.
=A0If set to nil, minibuffer reading functions don't= add new elements to the



If you like the idea I can install them in the trunk for releas= e 23.2.

-- Francesc Rocher

--001485f7c36c34ae8c046ce252d0--