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: Re: Ignoring entries starting with space Date: Thu, 25 Jun 2009 09:58:57 +0200 Message-ID: References: <873a9p5ls2.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001485f78ae189b6ff046d2798a2 X-Trace: ger.gmane.org 1245916765 22093 80.91.229.12 (25 Jun 2009 07:59:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2009 07:59:25 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 25 09:59: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 1MJjrQ-0002Gx-R5 for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2009 09:59:09 +0200 Original-Received: from localhost ([127.0.0.1]:35958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJjrQ-0005yg-C8 for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2009 03:59:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJjrL-0005xk-Pi for emacs-devel@gnu.org; Thu, 25 Jun 2009 03:59:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJjrH-0005un-R9 for emacs-devel@gnu.org; Thu, 25 Jun 2009 03:59:03 -0400 Original-Received: from [199.232.76.173] (port=59291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJjrH-0005uX-Le for emacs-devel@gnu.org; Thu, 25 Jun 2009 03:58:59 -0400 Original-Received: from mail-bw0-f217.google.com ([209.85.218.217]:51618) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJjrH-0006ho-3j for emacs-devel@gnu.org; Thu, 25 Jun 2009 03:58:59 -0400 Original-Received: by bwz17 with SMTP id 17so1486546bwz.42 for ; Thu, 25 Jun 2009 00:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=G9JGo4LA+EHlNh969e55sPe3H6mDcLzx57xZZAttzbs=; b=ICdYo/dii0P4WWhT+aJdOVPQUVL4DpIVs0LaHvSMe4NAMCr/dGs4e8V4wSCEpM1HWy OrGXjjDzq4JLbwXvYw5rIQbBRQaLN09WeBb/C/OcUtGz4gLLfWpFrCgX8U+dSwKYGxxj FJzXxqYCgKpimHkLQwvs1dH2MtY/ba0PyCBnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=K4ROhkRKGebKlwJad32BO6GDz3bggrVlgoaGeq7vj14qQwrIM4ilwrX10xEW8c85ej MeAw1qZwqvee9KwpawXXk9XF6A1f89M9URXBmA3daKeky9z5/u6DV1q4lXyOwHrdReKE +U6CoYuDoCa005yU//hxW/DLCJmAEZvcgAVqQ= Original-Received: by 10.239.134.140 with SMTP id 12mr175617hbz.155.1245916737156; Thu, 25 Jun 2009 00:58:57 -0700 (PDT) In-Reply-To: <873a9p5ls2.fsf@mail.jurta.org> 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:111713 Archived-At: --001485f78ae189b6ff046d2798a2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > >> 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. > > > > Could you explain some use cases? > > I have one use case where this will be useful. > > In http://thread.gmane.org/gmane.emacs.devel/91359/focus=92106 > I suggested a piece of code for .emacs that removes potentially > dangerous commands from the minibuffer history. > > With a new variable `history-ignore-space'=t this will be unnecessary > since it's possible to not put dangerous commands to the minibuffer history > with just prepending a command with a space like e.g. " rm -rf ." > Yes, that's the point. In general, any potentially dangerous command won't be stored into the history by simply pre-pending an space. Its the same as in Bash, the source of inspiration of this patch, especially when you are typing dangerous commands as root. It's better not to store them into the history. -- Francesc Rocher --001485f78ae189b6ff046d2798a2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>> 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-s= pace'
>> would take care of this, being `nil' its defaut value.
>
> Could you explain some use cases?

I have one use case where this will be useful.

In http://thread.gmane.org/gmane.emacs.devel/91359/focus= =3D92106
I suggested a piece of code for .emacs that removes potentially
dangerous commands from the minibuffer history.

With a new variable `history-ignore-space'=3Dt this will be unnecessary=
since it's possible to not put dangerous commands to the minibuffer his= tory
with just prepending a command with a space like e.g. " rm -rf ."=


Yes, that's the point. In general, any p= otentially dangerous command won't be stored
into the history by sim= ply pre-pending an space. Its the same as in Bash, the source
of inspiration of this patch, especially when you are typing dangerous comm= ands
as root. It's better not to store them into the history.
-- Francesc Rocher

--001485f78ae189b6ff046d2798a2--