From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dani Moncayo Newsgroups: gmane.emacs.devel Subject: Re: Isearch: retrieve last successful search string from when you quit (`C-g') Date: Mon, 1 Oct 2012 20:31:16 +0200 Message-ID: References: <0860CD16FA6A43A7B3FB40FE34C6B934@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1349116300 7484 80.91.229.3 (1 Oct 2012 18:31:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 18:31:40 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 01 20:31:44 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TIkmB-0006Sf-DZ for ged-emacs-devel@m.gmane.org; Mon, 01 Oct 2012 20:31:31 +0200 Original-Received: from localhost ([::1]:59964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIkm5-00065e-Uv for ged-emacs-devel@m.gmane.org; Mon, 01 Oct 2012 14:31:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIkm3-00065O-8d for emacs-devel@gnu.org; Mon, 01 Oct 2012 14:31:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIklx-0007WD-Ft for emacs-devel@gnu.org; Mon, 01 Oct 2012 14:31:23 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:64844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIklx-0007W9-AS for emacs-devel@gnu.org; Mon, 01 Oct 2012 14:31:17 -0400 Original-Received: by obcva7 with SMTP id va7so6050170obc.0 for ; Mon, 01 Oct 2012 11:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uckOjiM39QwleRe/xwd8YVdA9lJZ7DbDQY4PMZDIAs8=; b=mRnOCRLF7PVg+bYpsFv++Mxs7yWKlZUFB4sldLGL6pB/zRFZPO1LAGwM56FX31JQtA LwRgoT1t1K7MZxga6ZZYnAm9wtonCZcOnzF8UWzbLl56C2oqmItSMnJLdMjUTcpmUZx8 1jW5R58olkT0p4vb6fUKetP/OqfVAd9PyIxNbw5Z+aM6scHPwMR0RwIlmz072BiFIhND 3Rll8HAOORnTOLiuTTn7hDS97mhhs/CaOaUoitwlHz5hjuosdfNttIIN0AtZPLj552c7 pg1+qUVNnahdYY2FqTiXsfZWW+bdbNiSQwRdGcFn1aZw7D413nRI8qqi6ZQdIOqwT6H9 k7Dw== Original-Received: by 10.182.40.34 with SMTP id u2mr12574309obk.7.1349116276717; Mon, 01 Oct 2012 11:31:16 -0700 (PDT) Original-Received: by 10.60.4.132 with HTTP; Mon, 1 Oct 2012 11:31:16 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153872 Archived-At: Hi Drew, I've tested your proposal (I don't need to test the other one, since the behavior is pretty obvious). I see two problems in your proposal: 1. It adds a bit of (unnecesary) user-level complexity: the users has to remember whether the search string was accepted (i.e. pushed to the search ring) or not, since the way of retrieving it is different in each case. 2. The user can't The search string is lost if is not accepted and is not the last one. The following approach overcomes these two problems: Define a new user-option whereby the user can choose between these 3 behaviors: a. Don't remember any cancelled search strings: i.e., the current behavior. b. Remember only the last cancelled search string: if the users cancels an i-search with `C-g', that search string will be retrieved by `C-s C-s' or `C-s M-p' as if it was stored at the top of the search ring; but this string will be forgot/removed after the next i-search session. b. Remember all cancelled search string: any cancelled search string will be pushed to the search ring, like the accepted ones. I think this approach is simple and flexible. I would adapt to the different usage patterns that people have expressed so far in this thread. -- Dani Moncayo