GNU bug report logs - #14742
24.3.50; enhancement request: be able to prepend stuff from buffer when search backward

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Fri, 28 Jun 2013 18:19:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 21 Sep 2020 19:14:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 21 15:14:36 2020
Received: from localhost ([127.0.0.1]:56259 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKRGm-0007ut-3B
	for submit <at> debbugs.gnu.org; Mon, 21 Sep 2020 15:14:36 -0400
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34431)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kKRGk-0007u8-9T
 for 14742 <at> debbugs.gnu.org; Mon, 21 Sep 2020 15:14:34 -0400
X-Originating-IP: 91.129.108.13
Received: from mail.gandi.net (m91-129-108-13.cust.tele2.ee [91.129.108.13])
 (Authenticated sender: juri@HIDDEN)
 by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 035031BF204;
 Mon, 21 Sep 2020 19:14:25 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50; enhancement request: be able to prepend
 stuff from buffer when search backward
Organization: LINKOV.NET
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN> <87lfh7f991.fsf@HIDDEN>
 <d0937b31-c9c2-467e-8feb-b69d43ff5424@default>
Date: Mon, 21 Sep 2020 22:07:03 +0300
In-Reply-To: <d0937b31-c9c2-467e-8feb-b69d43ff5424@default> (Drew Adams's
 message of "Fri, 18 Sep 2020 16:11:19 +0000 (UTC)")
Message-ID: <87blhzds00.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 14742
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 14742 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

>> Stefan had some further comments about the amount of code left in
>> isearch-other-meta-char, but since the code alters several variables
>> local to that function, the proposed solution for that looked (to me) a
>> lot less understandable than Juri's patch.
>>
>> But it seemed like everybody agreed that the feature was good, so
>> perhaps it should be applied now?  It probably needs some documentation,
>> though.
>
> From my point of view, separate, smaller changes are
> better, as that will make it easier to adapt my code
> in isearch+.el.  IOW, if this were done in stages,
> especially any heavy refactoring, that would be helpful.

I agree that smaller changes are better.  So first we need
to decide whether every proposed feature is useful for many users,
then implement it in the most compact and elegant way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 18 Sep 2020 16:13:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 18 12:13:36 2020
Received: from localhost ([127.0.0.1]:44272 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kJJ0x-0008KP-QX
	for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 12:13:35 -0400
Received: from userp2130.oracle.com ([156.151.31.86]:47960)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1kJJ0v-0008KB-J4
 for 14742 <at> debbugs.gnu.org; Fri, 18 Sep 2020 12:13:33 -0400
Received: from pps.filterd (userp2130.oracle.com [127.0.0.1])
 by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IG9iGf060504;
 Fri, 18 Sep 2020 16:13:27 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29;
 bh=coxk3th5+yQzYJ88w2QFBZzKVQ7gN+c9UWysXz26wUQ=;
 b=s4HhyMKkGEphvIoHYaLLYTfc7WsfSV14lmoUVfrsmbxxANn83yJPFZXcFMBMYKCu23kB
 4Q2vsG+FLSnwIIP1a7z9GeT0JDgpeoSJVuSyOicY4rtQfi4y5A6uXujumGLYuyOwhxOr
 OGGuHCgxUpczAPAKb7BMnHEdgOv5/vgPgPR9/bBNgVh1ezRssR7Hho7zhN8f22WMkh+N
 Mumg6yCxa7TDa84Nbn+GLWucK+OuoatsKnncmn8TphvnOj6pwzK19FcKABiD0//JsxSZ
 Pr7Pq4gmchhtlGwKlU/vnrF7XpUTOhFxxBp0ObrYdmSvf21HnrX6kEWBKfl/6U7z+bGq aA== 
Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79])
 by userp2130.oracle.com with ESMTP id 33gnrrg5kn-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
 Fri, 18 Sep 2020 16:13:27 +0000
Received: from pps.filterd (userp3020.oracle.com [127.0.0.1])
 by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IGA5tX076842;
 Fri, 18 Sep 2020 16:11:27 GMT
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userp3020.oracle.com with ESMTP id 33hm373231-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 18 Sep 2020 16:11:27 +0000
Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08IGBKMf011117;
 Fri, 18 Sep 2020 16:11:26 GMT
MIME-Version: 1.0
Message-ID: <d0937b31-c9c2-467e-8feb-b69d43ff5424@default>
Date: Fri, 18 Sep 2020 16:11:19 +0000 (UTC)
From: Drew Adams <drew.adams@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>, Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN> <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN> <87lfh7f991.fsf@HIDDEN>
In-Reply-To: <87lfh7f991.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.5044.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9748
 signatures=668679
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 bulkscore=0 mlxlogscore=999
 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000
 definitions=main-2009180131
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9748
 signatures=668679
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 spamscore=0
 lowpriorityscore=0 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0
 clxscore=1011 mlxlogscore=999 adultscore=0 priorityscore=1501
 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2006250000 definitions=main-2009180131
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Stefan had some further comments about the amount of code left in
> isearch-other-meta-char, but since the code alters several variables
> local to that function, the proposed solution for that looked (to me) a
> lot less understandable than Juri's patch.
>=20
> But it seemed like everybody agreed that the feature was good, so
> perhaps it should be applied now?  It probably needs some documentation,
> though.

Thanks for working on this.

From my point of view, separate, smaller changes are
better, as that will make it easier to adapt my code
in isearch+.el.  IOW, if this were done in stages,
especially any heavy refactoring, that would be helpful.

But any way it's done will be good.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 18 Sep 2020 14:30:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 18 10:30:17 2020
Received: from localhost ([127.0.0.1]:43929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kJHOy-0003XF-JE
	for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 10:30:16 -0400
Received: from quimby.gnus.org ([95.216.78.240]:55108)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kJHOw-0003Pj-Rq
 for 14742 <at> debbugs.gnu.org; Fri, 18 Sep 2020 10:30:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ul0UrvmScFkV3pAQe6cFC9dVFOZfZy/cbbB136BFFb0=; b=EmjZwPDROci9hggBeg4kCgTxxv
 lxR5x1+V89ISV8ZbvNKatc6Qnx3kGQ3O55t7BMB9PKIAdel6bQZrE596BTEfjcAk3jyvr2g4NBzUv
 +Uy3oFfMg+py4Up2ceQNc95QUgQJ5u/QmuhKs4CKUPf9hWMATaxvEZUfbouHftoGLNxA=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kJHOm-0006oL-2w; Fri, 18 Sep 2020 16:30:07 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14742: 24.3.50; enhancement request: be able to prepend
 stuff from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN>
X-Now-Playing: Saito Koji's _433-1_: "433_074"
Date: Fri, 18 Sep 2020 16:30:02 +0200
In-Reply-To: <877gh43ara.fsf@HIDDEN> (Juri Linkov's message of "Sat,
 06 Jul 2013 01:28:15 +0300")
Message-ID: <87lfh7f991.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Juri Linkov <juri@HIDDEN> writes: >> Could you move this
 new code to a separate function? > > In the following patch I moved new code
 to a separate function > `isearch-yank-or-del' that works like a combination
 of the existing > funct [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>> Could you move this new code to a separate function?
>
> In the following patch I moved new code to a separate function
> `isearch-yank-or-del' that works like a combination of the existing
> functions `isearch-yank-string' and `isearch-del-char'.
> `isearch-yank-or-del' is general enough that it can be used
> separately from the movement-yanking feature.

Stefan had some further comments about the amount of code left in
isearch-other-meta-char, but since the code alters several variables
local to that function, the proposed solution for that looked (to me) a
lot less understandable than Juri's patch.

But it seemed like everybody agreed that the feature was good, so
perhaps it should be applied now?  It probably needs some documentation,
though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 6 Jul 2013 00:40:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 20:40:37 2013
Received: from localhost ([127.0.0.1]:33154 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UvGYH-00072C-4N
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2013 20:40:37 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:56399)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1UvGYD-000722-LF
 for 14742 <at> debbugs.gnu.org; Fri, 05 Jul 2013 20:40:34 -0400
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r660eVOj019084;
 Fri, 5 Jul 2013 20:40:32 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id C6126AE0C1; Fri,  5 Jul 2013 20:40:30 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Message-ID: <jwvppuwpm02.fsf-monnier+emacs@HIDDEN>
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN>
 <jwvobagr4zi.fsf-monnier+emacs@HIDDEN>
 <87ehbczje8.fsf@HIDDEN>
Date: Fri, 05 Jul 2013 20:40:30 -0400
In-Reply-To: <87ehbczje8.fsf@HIDDEN> (Juri Linkov's message of "Sat,
 06 Jul 2013 02:17:35 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV4630=0
X-NAI-Spam-Version: 2.3.0.9362 : core <4630> : streams <994767> : uri <1468226>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.6 (-)

> then code for `isearch-allow-scroll' should be moved to a separate
> function like `isearch-handle-scroll-function' too.

That would be nice, as well, yes.

> But still I don't understand how this would be possible to handle
> outside of `isearch-other-meta-char', because this code changes the
> local variables `key', `keylist', `main-event', `move-command'
> locally bound in `isearch-other-meta-char'.

AFAICT, `move-command' is not used by the rest of the code, so `setq'ing
it is not needed.  For the other three, I guess you could do something
like

   +       ((let ((hmf (isearch-handle-motion-function <blabla>)))
   +          (when hmf (setq key (nth 0 hmf))
   +                    (setq keylist (nth 1 hmf))
   +                    (setq main-event (nth 2 hmf))
   +                    (nth 3 hmf))))

It's not super elegant, but the reason is the messed up data-flow, so at
least this formulation makes the mes more clear and self-evident.
Hopefully someone will find a way to clean it up at some point.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 5 Jul 2013 23:35:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 19:35:48 2013
Received: from localhost ([127.0.0.1]:33050 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UvFXX-0004gH-8v
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2013 19:35:47 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:44942
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UvFXR-0004g6-Kk
 for 14742 <at> debbugs.gnu.org; Fri, 05 Jul 2013 19:35:44 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 9306E258B9E91C;
 Fri,  5 Jul 2013 16:35:39 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN>
 <jwvobagr4zi.fsf-monnier+emacs@HIDDEN>
Date: Sat, 06 Jul 2013 02:17:35 +0300
In-Reply-To: <jwvobagr4zi.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 05 Jul 2013 18:59:16 -0400")
Message-ID: <87ehbczje8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

>> +	  ;; Handle a motion function.
>> +	  ((and isearch-allow-move
>> +		(progn (setq key (isearch-reread-key-sequence-naturally keylist))
>> +		       (setq keylist (listify-key-sequence key))
>> +		       (setq main-event (aref key 0))
>> +		       (setq move-command (or
>> +					   (isearch-lookup-move-key key)
>> +					   (isearch-lookup-move-key
>> +					    ;; Use the last key in the sequence.
>> +					    (vector (aref key (1- (length key)))))))))
>> +	   (setq prefix-arg arg)
>> +	   (let ((new-point (save-excursion
>> +			      (condition-case ()
>> +				  (command-execute move-command)
>> +				(error nil))
>> +			      (point))))
>> +	     ;; An alternative to move without yanking is (goto-char new-point)
>> +	     (isearch-yank-or-del (point) new-point))
>> +	   (unless (eq (car-safe isearch-allow-move) 'only)
>> +	     (setq isearch-allow-move (cons 'only isearch-allow-move))))
>
> Hmm... that still adds a crap load of code in this already too-long function.
> Can't we bring it down to something like
>
>   +       ((isearch-handle-motion-function <blabla>))

This code is mostly a copy of code that implements the `isearch-allow-scroll'
feature.  If it's necessary to refactor the whole `isearch-other-meta-char'
then code for `isearch-allow-scroll' should be moved to a separate
function like `isearch-handle-scroll-function' too.

But still I don't understand how this would be possible to handle
outside of `isearch-other-meta-char', because this code changes the
local variables `key', `keylist', `main-event', `move-command'
locally bound in `isearch-other-meta-char'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 5 Jul 2013 22:59:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 18:59:24 2013
Received: from localhost ([127.0.0.1]:33008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UvEyJ-0003KF-GZ
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2013 18:59:24 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:46105)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1UvEyG-0003K4-MS
 for 14742 <at> debbugs.gnu.org; Fri, 05 Jul 2013 18:59:21 -0400
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r65MxGBg010555;
 Fri, 5 Jul 2013 18:59:17 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id 9356AAE0C1; Fri,  5 Jul 2013 18:59:16 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Message-ID: <jwvobagr4zi.fsf-monnier+emacs@HIDDEN>
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
 <877gh43ara.fsf@HIDDEN>
Date: Fri, 05 Jul 2013 18:59:16 -0400
In-Reply-To: <877gh43ara.fsf@HIDDEN> (Juri Linkov's message of "Sat,
 06 Jul 2013 01:28:15 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV4630=0
X-NAI-Spam-Version: 2.3.0.9362 : core <4630> : streams <994717> : uri <1468154>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.6 (-)

> +	  ;; Handle a motion function.
> +	  ((and isearch-allow-move
> +		(progn (setq key (isearch-reread-key-sequence-naturally keylist))
> +		       (setq keylist (listify-key-sequence key))
> +		       (setq main-event (aref key 0))
> +		       (setq move-command (or
> +					   (isearch-lookup-move-key key)
> +					   (isearch-lookup-move-key
> +					    ;; Use the last key in the sequence.
> +					    (vector (aref key (1- (length key)))))))))
> +	   (setq prefix-arg arg)
> +	   (let ((new-point (save-excursion
> +			      (condition-case ()
> +				  (command-execute move-command)
> +				(error nil))
> +			      (point))))
> +	     ;; An alternative to move without yanking is (goto-char new-point)
> +	     (isearch-yank-or-del (point) new-point))
> +	   (unless (eq (car-safe isearch-allow-move) 'only)
> +	     (setq isearch-allow-move (cons 'only isearch-allow-move))))

Hmm... that still adds a crap load of code in this already too-long function.
Can't we bring it down to something like

  +       ((isearch-handle-motion-function <blabla>))


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 5 Jul 2013 22:37:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 18:37:38 2013
Received: from localhost ([127.0.0.1]:32982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UvEdF-0002Xy-RY
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2013 18:37:38 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:44543
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UvEdC-0002XT-8e
 for 14742 <at> debbugs.gnu.org; Fri, 05 Jul 2013 18:37:35 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id AC029258B9E920;
 Fri,  5 Jul 2013 15:37:32 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
 <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
Date: Sat, 06 Jul 2013 01:28:15 +0300
In-Reply-To: <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 05 Jul 2013 06:37:39 -0400")
Message-ID: <877gh43ara.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> Could you move this new code to a separate function?

In the following patch I moved new code to a separate function
`isearch-yank-or-del' that works like a combination of the existing
functions `isearch-yank-string' and `isearch-del-char'.
`isearch-yank-or-del' is general enough that it can be used
separately from the movement-yanking feature.

The remaining code in `isearch-other-meta-char' is also general enough
that it can be used to implement other features as well.  For example,
I tried to replace the call `(isearch-yank-or-del (point) new-point)'
with `(goto-char new-point)' and got another useful fully working feature
mentioned by Drew in this thread where cursor movement doesn't yank text.

This raises the question how users would be able to select
between these alternatives.  Maybe `isearch-allow-move'
should provide two options:

- `jump' that doesn't yank text during cursor movement;

- `yank' to yank text during cursor movement.

These options could be implemented in the next patch,
whereas this patch just moves yanking/deleting to a new function
`isearch-yank-or-del'.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-06-13 22:08:45 +0000
+++ lisp/isearch.el	2013-07-05 22:27:08 +0000
@@ -987,6 +1046,8 @@ (defun isearch-update ()
   ;; We must prevent the point moving to the end of composition when a
   ;; part of the composition has just been searched.
   (setq disable-point-adjustment t)
+  (when (eq (car-safe isearch-allow-move) 'only)
+    (setq isearch-allow-move (cdr isearch-allow-move)))
   (run-hooks 'isearch-update-post-hook))
 
 (defun isearch-done (&optional nopush edit)
@@ -1969,6 +2142,56 @@ (defun isearch-yank-line (&optional arg)
    (lambda () (let ((inhibit-field-text-motion t))
 		(line-end-position (if (eolp) (1+ arg) arg))))))
 
+(defun isearch-yank-or-del (old-point new-point)
+  "Add or delete text in search string, depending on two given positions.
+Given an old position of point in OLD-POINT and a new position NEW-POINT,
+either pull text from the buffer between these positions into the search
+string, or delete text from the search string to the length of the text
+between these positions.
+In forward search, when NEW-POINT is greater than OLD-POINT,
+yank text from the buffer between NEW-POINT and OLD-POINT;
+when NEW-POINT is less than OLD-POINT, delete text from
+the search string between NEW-POINT and OLD-POINT.
+In reverse search, when NEW-POINT is greater than OLD-POINT,
+delete text from the search string between NEW-POINT and OLD-POINT;
+when NEW-POINT is less than OLD-POINT, yank text from the buffer
+between NEW-POINT and OLD-POINT.
+When NEW-POINT is less than the beginning of the currently matched string
+in forward search, then change search direction to reverse search.
+When NEW-POINT is greater than the end of the currently matched string
+in reverse search, then change search direction to forward search."
+  ;; Change search direction between forward and backward.
+  (when (if isearch-other-end
+	    (and (not isearch-error)	; for regexp incomplete input
+		 (if isearch-forward
+		     (< new-point isearch-other-end)
+		   (> new-point isearch-other-end)))
+	  (if isearch-forward
+	      (< new-point old-point)
+	    (> new-point old-point)))
+    (setq isearch-forward (not isearch-forward))
+    (setq isearch-string "" isearch-message "")
+    (if isearch-other-end (setq old-point isearch-other-end)))
+  (if (< old-point new-point)
+      (if isearch-forward
+	  ;; Add text to the search string.
+	  (isearch-yank-string
+	   (buffer-substring-no-properties old-point new-point))
+	;; In reverse search, lax whitespace doesn't work,
+	;; so go to the new point explicitly.
+	(goto-char new-point)
+	;; In reverse search, delete text from beginning of search string.
+	(isearch-del-char (- new-point old-point) t))
+    (if isearch-forward
+	;; Delete text from the search string.
+	(isearch-del-char (- old-point new-point))
+      ;; In reverse search, lax whitespace doesn't work,
+      ;; so go to the new point explicitly.
+      (goto-char new-point)
+      ;; In reverse search, add text to beginning of search string.
+      (isearch-yank-string
+       (buffer-substring-no-properties old-point new-point) t))))
+
 (defun isearch-char-by-name (&optional count)
   "Read a character by its Unicode name and add it to the search string.
 Completion is available like in `read-char-by-name' used by `insert-char'.
@@ -2267,6 +2483,77 @@ (defun isearch-lookup-scroll-key (key-se
 	     (eq (get binding 'scroll-command) t))
          binding)))
 
+(defcustom isearch-allow-move nil
+  "Whether cursor movement is allowed to yank text in Isearch mode.
+If nil, point motion commands will exit Isearch mode immediately.
+If non-nil, point motion commands extend Isearch by yanking the text
+the cursor moves over in the buffer.  E.g., `C-f' yanks the next char,
+`C-M-f' yanks the next expression, etc. to the end of the search string
+in forward search.  In reverse search, `C-b' yanks the previous char,
+`C-M-b' yanks the previous expression, etc. to the beginning of the
+search string.  And conversely, backward cursor movements, e.g., `C-b'
+deletes text from the end of the search string when searching forward.
+When searching backward, forward cursor movements, e.g., `C-f' deletes
+text from the beginning of the search string.
+
+Lisp programs may give this variable a special value of
+\(only . OLDVAL) to enable motion yanking temporarily.
+After any subsequent Isearch command that is not point motion,
+the value of `isearch-allow-move' is set to OLDVAL."
+  :type 'boolean
+  :version "24.4"
+  :group 'isearch)
+
 (defalias 'isearch-other-control-char 'isearch-other-meta-char)
 
 (defun isearch-other-meta-char (&optional arg)
@@ -2292,7 +2579,7 @@ (defun isearch-other-meta-char (&optiona
                 (this-command-keys)))
 	 (main-event (aref key 0))
 	 (keylist (listify-key-sequence key))
-         scroll-command isearch-point)
+         scroll-command move-command isearch-point)
     (cond ((and (= (length key) 1)
 		(let ((lookup (lookup-key local-function-key-map key)))
 		  (not (or (null lookup) (integerp lookup)
@@ -2379,7 +2666,35 @@ (defun isearch-other-meta-char (&optiona
              (if ab-bel
                  (isearch-back-into-window (eq ab-bel 'above) isearch-point)
                (goto-char isearch-point)))
           (isearch-update))
+	  ;; Handle a motion function.
+	  ((and isearch-allow-move
+		(progn (setq key (isearch-reread-key-sequence-naturally keylist))
+		       (setq keylist (listify-key-sequence key))
+		       (setq main-event (aref key 0))
+		       (setq move-command (or
+					   (isearch-lookup-move-key key)
+					   (isearch-lookup-move-key
+					    ;; Use the last key in the sequence.
+					    (vector (aref key (1- (length key)))))))))
+	   (setq prefix-arg arg)
+	   (let ((new-point (save-excursion
+			      (condition-case ()
+				  (command-execute move-command)
+				(error nil))
+			      (point))))
+	     ;; An alternative to move without yanking is (goto-char new-point)
+	     (isearch-yank-or-del (point) new-point))
+	   (unless (eq (car-safe isearch-allow-move) 'only)
+	     (setq isearch-allow-move (cons 'only isearch-allow-move))))
 	  ;; A mouse click on the isearch message starts editing the search string
 	  ((and (eq (car-safe main-event) 'down-mouse-1)
 		(window-minibuffer-p (posn-window (event-start main-event))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 5 Jul 2013 10:37:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 06:37:49 2013
Received: from localhost ([127.0.0.1]:59287 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uv3Oe-000871-Q4
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2013 06:37:49 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:48591)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1Uv3Oa-00086W-Uc
 for 14742 <at> debbugs.gnu.org; Fri, 05 Jul 2013 06:37:45 -0400
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r65AbecE020878;
 Fri, 5 Jul 2013 06:37:41 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id D5BBBAE0D4; Fri,  5 Jul 2013 06:37:39 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Message-ID: <jwvr4fdthrm.fsf-monnier+emacs@HIDDEN>
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
 <87y59lc32c.fsf@HIDDEN>
Date: Fri, 05 Jul 2013 06:37:39 -0400
In-Reply-To: <87y59lc32c.fsf@HIDDEN> (Juri Linkov's message of "Fri,
 05 Jul 2013 02:34:18 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV4629=0
X-NAI-Spam-Version: 2.3.0.9362 : core <4629> : streams <994468> : uri <1467610>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.6 (-)

> @@ -2379,7 +2616,67 @@ (defun isearch-other-meta-char (&optiona
>               (if ab-bel
>                   (isearch-back-into-window (eq ab-bel 'above) isearch-point)
>                 (goto-char isearch-point)))
>            (isearch-update))
> +	  ;; Handle a motion function.
> +	  ((and isearch-allow-move
> +		(progn (setq key (isearch-reread-key-sequence-naturally keylist))
> +		       (setq keylist (listify-key-sequence key))
> +		       (setq main-event (aref key 0))
> +		       (setq move-command (or
> +					   (isearch-lookup-move-key key)
> +					   (isearch-lookup-move-key
> +					    ;; Use the last key in the sequence.
> +					    (vector (aref key (1- (length key)))))))))
> +	   (setq prefix-arg arg)
> +	   (let* ((old-point (point))
> +		  (new-point (save-excursion
> +			       (condition-case ()
> +				   (command-execute move-command)
> +				 (error nil))
> +			       (point))))
> +	     ;; Change search direction between forward and backward.
> +	     (when (if isearch-forward
> +			 (< new-point old-point)
> +		       (> new-point old-point))
> +	       (setq isearch-forward (not isearch-forward))
> +	       (setq isearch-string "" isearch-message "")
> +	       (if isearch-other-end (setq old-point isearch-other-end)))
> +	     (if (< old-point new-point)
> +		 (if isearch-forward
> +		     (isearch-yank-string
> +		      (buffer-substring-no-properties old-point new-point))
> +		   (isearch-del-char (- new-point old-point) t))
> +	       (if isearch-forward
> +		   (isearch-del-char (- old-point new-point))
> +		 (isearch-yank-string
> +		  (buffer-substring-no-properties old-point new-point) t))))
> +	   (setq isearch-allow-move (cons 'only isearch-allow-move)))
>  	  ;; A mouse click on the isearch message starts editing the search string
>  	  ((and (eq (car-safe main-event) 'down-mouse-1)
>  		(window-minibuffer-p (posn-window (event-start main-event))))

Could you move this new code to a separate function?


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 4 Jul 2013 23:44:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 04 19:44:43 2013
Received: from localhost ([127.0.0.1]:58314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UutCc-0004pv-JA
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2013 19:44:43 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:37549
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UutCY-0004pg-WA
 for 14742 <at> debbugs.gnu.org; Thu, 04 Jul 2013 19:44:40 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 00E95258B9E915;
 Thu,  4 Jul 2013 16:44:36 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
 <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
Date: Fri, 05 Jul 2013 02:34:18 +0300
In-Reply-To: <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default> (Drew Adams's
 message of "Wed, 3 Jul 2013 17:17:38 -0700 (PDT)")
Message-ID: <87y59lc32c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

>> > Do you have this working already?  Have you described what you have in
>> > mind somewhere?  Did you bring this up in emacs-devel?  If not, please
>> > consider it - that is the best place to toss such an idea around.
>>
>> Yes, it is working and I described it on emacs-devel a month ago.
>> Now I'll prepare a minimal patch that implements low-level support, then
>> send separate high-level code to activate it, so everyone could try it.
>
> Sounds good; looking forward to it.

The following minimal patch implements low-level support
for the motion yanking feature that could be later enabled
by separate higher-level commands.

It adds a new option `isearch-allow-move' with the nil default value.
Like the user option `transient-mark-mode' having the certain special
value of (only . OLDVAL) that enables Transient Mark mode temporarily,
until any subsequent point motion command that is not shift-translated
sets the value of `transient-mark-mode' back to OLDVAL, the new option
`isearch-allow-move' does the same.

This patch relies on the previously sent patch that adds a new argument
`BEGINNING' to `isearch-yank-string' and `isearch-del-char'.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-06-13 22:08:45 +0000
+++ lisp/isearch.el	2013-07-04 23:28:33 +0000
@@ -987,6 +1046,8 @@ (defun isearch-update ()
   ;; We must prevent the point moving to the end of composition when a
   ;; part of the composition has just been searched.
   (setq disable-point-adjustment t)
+  (when (eq (car-safe isearch-allow-move) 'only)
+    (setq isearch-allow-move (cdr isearch-allow-move)))
   (run-hooks 'isearch-update-post-hook))
 
 (defun isearch-done (&optional nopush edit)
@@ -2267,6 +2433,77 @@ (defun isearch-lookup-scroll-key (key-se
 	     (eq (get binding 'scroll-command) t))
          binding)))
 
+(defcustom isearch-allow-move nil
+  "Whether cursor movement is allowed to yank text in Isearch mode.
+If nil, point motion commands will exit Isearch mode immediately.
+If non-nil, point motion commands extend Isearch by yanking the text
+the cursor moves over in the buffer.  E.g., C-f yanks the next char,
+C-M-f yanks the next expression, etc. to the end of the search string
+in forward search.  In reverse search, C-b yanks the previous char,
+C-M-b yanks the previous expression, etc. to the beginning of the
+search string.  And conversely, backward cursor movements, e.g., C-b
+removes text from the end of the search string when searching forward.
+When searching backward, forward cursor movements, e.g., C-f removes
+text from the beginning of the search string.
+
+Lisp programs may give this variable a special value of
+\(only . OLDVAL) to enable motion yanking temporarily.
+After any subsequent Isearch command that is not point motion,
+the value of `isearch-allow-move' is set to OLDVAL."
+  :type 'boolean
+  :version "24.4"
+  :group 'isearch)
+
+(defun isearch-lookup-move-key (key-seq)
+  "If KEY-SEQ is bound to a motion command, return it as a symbol.
+Otherwise return nil."
+  (let* ((overriding-terminal-local-map nil)
+         (binding (key-binding key-seq)))
+    (and binding (symbolp binding) (commandp binding)
+         (eq (get binding 'isearch-move) t)
+         binding)))
+
 (defalias 'isearch-other-control-char 'isearch-other-meta-char)
 
 (defun isearch-other-meta-char (&optional arg)
@@ -2379,7 +2616,67 @@ (defun isearch-other-meta-char (&optiona
              (if ab-bel
                  (isearch-back-into-window (eq ab-bel 'above) isearch-point)
                (goto-char isearch-point)))
           (isearch-update))
+	  ;; Handle a motion function.
+	  ((and isearch-allow-move
+		(progn (setq key (isearch-reread-key-sequence-naturally keylist))
+		       (setq keylist (listify-key-sequence key))
+		       (setq main-event (aref key 0))
+		       (setq move-command (or
+					   (isearch-lookup-move-key key)
+					   (isearch-lookup-move-key
+					    ;; Use the last key in the sequence.
+					    (vector (aref key (1- (length key)))))))))
+	   (setq prefix-arg arg)
+	   (let* ((old-point (point))
+		  (new-point (save-excursion
+			       (condition-case ()
+				   (command-execute move-command)
+				 (error nil))
+			       (point))))
+	     ;; Change search direction between forward and backward.
+	     (when (if isearch-forward
+			 (< new-point old-point)
+		       (> new-point old-point))
+	       (setq isearch-forward (not isearch-forward))
+	       (setq isearch-string "" isearch-message "")
+	       (if isearch-other-end (setq old-point isearch-other-end)))
+	     (if (< old-point new-point)
+		 (if isearch-forward
+		     (isearch-yank-string
+		      (buffer-substring-no-properties old-point new-point))
+		   (isearch-del-char (- new-point old-point) t))
+	       (if isearch-forward
+		   (isearch-del-char (- old-point new-point))
+		 (isearch-yank-string
+		  (buffer-substring-no-properties old-point new-point) t))))
+	   (setq isearch-allow-move (cons 'only isearch-allow-move)))
 	  ;; A mouse click on the isearch message starts editing the search string
 	  ((and (eq (car-safe main-event) 'down-mouse-1)
 		(window-minibuffer-p (posn-window (event-start main-event))))



> What is the emacs-devel thread?  Somehow I must have missed it.

The emacs-devel thread is here:
http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00211.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 4 Jul 2013 00:17:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 03 20:17:50 2013
Received: from localhost ([127.0.0.1]:55768 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuXF8-0007VP-Jq
	for submit <at> debbugs.gnu.org; Wed, 03 Jul 2013 20:17:50 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:42533)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1UuXF5-0007Uy-PZ
 for 14742 <at> debbugs.gnu.org; Wed, 03 Jul 2013 20:17:48 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r640BKlY008019
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Thu, 4 Jul 2013 00:11:21 GMT
Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r640HdXM006565
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Thu, 4 Jul 2013 00:17:40 GMT
Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62])
 by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r640HdNd011609;
 Thu, 4 Jul 2013 00:17:39 GMT
MIME-Version: 1.0
Message-ID: <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default>
Date: Wed, 3 Jul 2013 17:17:38 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
 <87k3l79seh.fsf@HIDDEN>
In-Reply-To: <87k3l79seh.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> > Do you have this working already?  Have you described what you have in
> > mind somewhere?  Did you bring this up in emacs-devel?  If not, please
> > consider it - that is the best place to toss such an idea around.
>=20
> Yes, it is working and I described it on emacs-devel a month ago.
> Now I'll prepare a minimal patch that implements low-level support, then
> send separate high-level code to activate it, so everyone could try it.

Sounds good; looking forward to it.

What is the emacs-devel thread?  Somehow I must have missed it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 3 Jul 2013 22:59:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 03 18:59:52 2013
Received: from localhost ([127.0.0.1]:55626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuW1f-0003RC-Fi
	for submit <at> debbugs.gnu.org; Wed, 03 Jul 2013 18:59:51 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:42798
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UuW1c-0003R0-Sy
 for 14742 <at> debbugs.gnu.org; Wed, 03 Jul 2013 18:59:49 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id D667C258B9E915;
 Wed,  3 Jul 2013 15:59:46 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
 <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
Date: Thu, 04 Jul 2013 01:57:02 +0300
In-Reply-To: <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default> (Drew Adams's
 message of "Tue, 2 Jul 2013 22:40:27 -0700 (PDT)")
Message-ID: <87k3l79seh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> Is this the idea: cursor movements would extend isearch by yanking the
> text the cursor would move over in the buffer, starting from `point'
> (where isearch starts)?
>
> E.g., for forward search C-f, M-f, C-M-f, C-e, etc. would yank the next
> char, word, symbol, line etc. to the end of the search string.  And for
> reverse search C-b, M-b, C-M-b, C-a, etc. would yank the previous (next
> going backward) char, word, symbol, line etc. to the beginning of the
> search string.
>
> And presumably backward cursor movements when searching forward (e.g.,
> C-b, M-b, C-M-b, C-a) would undo, in the sense of removing yanked text
> (but only yanked text, presumably) from the end.  And forward cursor
> movements when searching backward would remove yanked text from the
> beginning.
>
> Is that the idea?

Exactly.

> Do you have this working already?  Have you described what you have in
> mind somewhere?  Did you bring this up in emacs-devel?  If not, please
> consider it - that is the best place to toss such an idea around.

Yes, it is working and I described it on emacs-devel a month ago.
Now I'll prepare a minimal patch that implements low-level support, then
send separate high-level code to activate it, so everyone could try it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 3 Jul 2013 05:40:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 03 01:40:40 2013
Received: from localhost ([127.0.0.1]:53440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuFo0-0002cl-5A
	for submit <at> debbugs.gnu.org; Wed, 03 Jul 2013 01:40:40 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:46924)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1UuFnx-0002cX-JF
 for 14742 <at> debbugs.gnu.org; Wed, 03 Jul 2013 01:40:38 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r635YAMH009817
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Wed, 3 Jul 2013 05:34:11 GMT
Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r635eTCV020353
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Wed, 3 Jul 2013 05:40:29 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
 by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r635eTFu020350;
 Wed, 3 Jul 2013 05:40:29 GMT
MIME-Version: 1.0
Message-ID: <cf8e54e1-6ff2-460e-bfa0-d8d5465d5b99@default>
Date: Tue, 2 Jul 2013 22:40:27 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
 <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
In-Reply-To: <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
X-Priority: 2
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Oops.  It just occurred to me what you might be up to, which I did not
understand.  I haven't seen your description of what you have in mind.
But if it is what I imagine now, then I think it sounds truly elegant.

Is this the idea: cursor movements would extend isearch by yanking the
text the cursor would move over in the buffer, starting from `point'
(where isearch starts)?

E.g., for forward search C-f, M-f, C-M-f, C-e, etc. would yank the next
char, word, symbol, line etc. to the end of the search string.  And for
reverse search C-b, M-b, C-M-b, C-a, etc. would yank the previous (next
going backward) char, word, symbol, line etc. to the beginning of the
search string.

And presumably backward cursor movements when searching forward (e.g.,
C-b, M-b, C-M-b, C-a) would undo, in the sense of removing yanked text
(but only yanked text, presumably) from the end.  And forward cursor
movements when searching backward would remove yanked text from the
beginning.

Is that the idea?  If so, bravo; I'm a supporter, a priori.  And yes,
IMO that would be quite natural.

I imagine it should be optional, though (even if it could perhaps
be/become the default), since some people might object to things like
C-M-f not ending isearch.  My guess is that most people would want this
behavior immediately - cursor movement does not currently do anything
except exit isearch (and there are plenty of other ways to do that).

TBD would be what to do with the equivalent of the combination yanks that
exist today, e.g., C-w for word-or-char.  Did you have another idea in
that area also, or did you intend to just leave them as is?  Perhaps you
were thinking of having things like C-f/right/C-b/left doing what C-w does?
If so, I'm guessing it would be better to just have them yank a char at a
time (easy enough to hold them pressed, or change to M-f/M-b etc.), in
order to keep the parallel with cursor movements.

Do you have this working already?  Have you described what you have in
mind somewhere?  Did you bring this up in emacs-devel?  If not, please
consider it - that is the best place to toss such an idea around.

Another possibility (an extension) just occurred to me: There is only one
starting position: `point' where isearch is started.  But it might be
useful to be able to toggle off the yanking, perform some more cursor
movements without yanking to, in effect, move the yanking position in the
buffer, then toggle yanking back on and resume yanking from the new
position.

Even if we made no provision (at least at first) for showing the yank
position in the buffer, I think it would be clear enough, just from the
result of yanking a char, say, (and then unyanking it if it was yanked
just to check where the yank position is).  And being able to move the
yank position using cursor movements would also be helpful when
combined with other yanking operations (e.g., combo's like C-w).

Dunno whether I am clear in these last two paragraphs, or whether you
have already considered something like this.  Anyway, bravo - great
idea to play with, and likely a real improvement to isearch.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 3 Jul 2013 01:07:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 02 21:07:41 2013
Received: from localhost ([127.0.0.1]:53222 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuBXo-0004HT-QO
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2013 21:07:41 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:44974)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1UuBXm-0004HD-2u
 for 14742 <at> debbugs.gnu.org; Tue, 02 Jul 2013 21:07:38 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r63119j0032613
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Wed, 3 Jul 2013 01:01:10 GMT
Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6317S7m018202
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Wed, 3 Jul 2013 01:07:29 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
 by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6317SkQ001753;
 Wed, 3 Jul 2013 01:07:28 GMT
MIME-Version: 1.0
Message-ID: <a2624d13-5fa3-4620-bced-f4170dbd2da8@default>
Date: Tue, 2 Jul 2013 18:07:26 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
 <87k3l8ik77.fsf@HIDDEN>
In-Reply-To: <87k3l8ik77.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> >> > 3. To me, yanking stuff to the beginning is more important than
> >> > deleting stuff from the beginning.  I was thinking either have a
> >> > separate key (or set of keys) that is (are) analogous to the
> >> > yank-at-end key(s) or else just reuse the same keys when searching
> >> > backward.
> >>
> >> I have no idea about new keys, but I need this change to implement
> >> yanking/deletion by motion keys (disabled by default).
> >
> > Dunno what that means.  Motion keys will yank or delete?
> > Doesn't sound too good, a priori.
> > Guess I missed the functional spec for that. ;-)
>=20
> No one tried this feature, but surprisingly it's very convenient.
> So I could implement only low-level support for this feature in isearch.e=
l,
> then more high-level commands could be implemented somewhere else.

Is it described somewhere, in user language?  If not, can you please
describe it?

> > Why not just reuse the keys we already use to yank, but have them yank
> > at the beginning when you search in reverse?  E.g.:
> >
> > C-w     - `isearch-yank-word-or-char', but at the beginning.
> > C-y     - `isearch-yank-kill', but at the beginning.
> > C-M-y   - `isearch-yank-char', but at the beginning.
> > M-y     - `isearch-yank-pop', but at the beginning.
> > M-x C-e - `isearch-yank-line', but at the beginning.
> >
> > Doesn't that seem natural?
>=20
> No, unfortunately there keys are not natural.

Are you saying they are unnatural when going backward but natural when
going forward?

> > In Isearch+ I have even more than that for yanking.  I would much
> > rather have a user be able to reuse the same keys in the opposite
> > direction.
>=20
> Do you mean a new boolean user option to define whether `C-M-y'
> should yank but at the beginning/end in a reverse search?

An option would be fine.  But why not just do it (by default)?
I don't understand why you think C-y yanking to the end when searching
forward is more natural than it yanking to the beginning when searching
backward.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 3 Jul 2013 00:09:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 02 20:09:08 2013
Received: from localhost ([127.0.0.1]:53160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuAd8-0002qj-Pp
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2013 20:09:07 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:32811
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UuAd5-0002qZ-US
 for 14742 <at> debbugs.gnu.org; Tue, 02 Jul 2013 20:09:04 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 17AD0258B9E915;
 Tue,  2 Jul 2013 17:09:01 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
 <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
Date: Wed, 03 Jul 2013 02:53:00 +0300
In-Reply-To: <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default> (Drew Adams's
 message of "Tue, 2 Jul 2013 16:42:49 -0700 (PDT)")
Message-ID: <87k3l8ik77.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

>> > 3. To me, yanking stuff to the beginning is more important than
>> > deleting stuff from the beginning.  I was thinking either have a
>> > separate key (or set of keys) that is (are) analogous to the
>> > yank-at-end key(s) or else just reuse the same keys when searching
>> > backward.
>>
>> I have no idea about new keys, but I need this change to implement
>> yanking/deletion by motion keys (disabled by default).
>
> Dunno what that means.  Motion keys will yank or delete?
> Doesn't sound too good, a priori.
> Guess I missed the functional spec for that. ;-)

No one tried this feature, but surprisingly it's very convenient.
So I could implement only low-level support for this feature in isearch.el,
then more high-level commands could be implemented somewhere else.

> Why not just reuse the keys we already use to yank, but have them yank
> at the beginning when you search in reverse?  E.g.:
>
> C-w     - `isearch-yank-word-or-char', but at the beginning.
> C-y     - `isearch-yank-kill', but at the beginning.
> C-M-y   - `isearch-yank-char', but at the beginning.
> M-y     - `isearch-yank-pop', but at the beginning.
> M-x C-e - `isearch-yank-line', but at the beginning.
>
> Doesn't that seem natural?

No, unfortunately there keys are not natural.

> In Isearch+ I have even more than that for yanking.  I would much
> rather have a user be able to reuse the same keys in the opposite
> direction.

Do you mean a new boolean user option to define whether `C-M-y'
should yank but at the beginning/end in a reverse search?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 2 Jul 2013 23:43:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 02 19:43:01 2013
Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UuADt-0002DP-1X
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2013 19:43:01 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:22928)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1UuADr-0002DA-8F
 for 14742 <at> debbugs.gnu.org; Tue, 02 Jul 2013 19:42:59 -0400
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r62NaV7r002233
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Tue, 2 Jul 2013 23:36:32 GMT
Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230])
 by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r62NgpEp012608
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 2 Jul 2013 23:42:51 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
 by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r62NgpO3012605;
 Tue, 2 Jul 2013 23:42:51 GMT
MIME-Version: 1.0
Message-ID: <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default>
Date: Tue, 2 Jul 2013 16:42:49 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
 <87y59ok18k.fsf@HIDDEN>
In-Reply-To: <87y59ok18k.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> > 2. Just use a name for the position, not the action:
> >    e.g. START or BEGINNING.=20
> Then let's use BEGINNING:

Good.  But I don't see where you documented parameter BEGINNING.

> > 3. To me, yanking stuff to the beginning is more important than
> > deleting stuff from the beginning.  I was thinking either have a
> > separate key (or set of keys) that is (are) analogous to the
> > yank-at-end key(s) or else just reuse the same keys when searching
> > backward.
>=20
> I have no idea about new keys, but I need this change to implement
> yanking/deletion by motion keys (disabled by default).

Dunno what that means.  Motion keys will yank or delete?
Doesn't sound too good, a priori.
Guess I missed the functional spec for that. ;-)

Why not just reuse the keys we already use to yank, but have them yank
at the beginning when you search in reverse?  E.g.:

C-w     - `isearch-yank-word-or-char', but at the beginning.
C-y     - `isearch-yank-kill', but at the beginning.
C-M-y   - `isearch-yank-char', but at the beginning.
M-y     - `isearch-yank-pop', but at the beginning.
M-x C-e - `isearch-yank-line', but at the beginning.

Doesn't that seem natural?

In Isearch+ I have even more than that for yanking.  I would much
rather have a user be able to reuse the same keys in the opposite
direction.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 2 Jul 2013 23:15:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 02 19:15:24 2013
Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uu9nA-0001XW-6z
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2013 19:15:24 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:41475
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1Uu9n6-0001XG-2F
 for 14742 <at> debbugs.gnu.org; Tue, 02 Jul 2013 19:15:21 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 488C2258B9E915;
 Tue,  2 Jul 2013 16:15:18 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
 <8ada7269-baa9-483f-9595-d46619393aa7@default>
Date: Wed, 03 Jul 2013 01:39:47 +0300
In-Reply-To: <8ada7269-baa9-483f-9595-d46619393aa7@default> (Drew Adams's
 message of "Sat, 29 Jun 2013 16:02:58 -0700 (PDT)")
Message-ID: <87y59ok18k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> 2. Just use a name for the position, not the action: e.g. START or
> BEGINNING.  (I would stay away from FRONT & BACK too, as references
> to the search-string ends.  BACK is particularly problematic.)

Then let's use BEGINNING:

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-06-13 22:08:45 +0000
+++ lisp/isearch.el	2013-07-02 22:35:17 +0000
@@ -1839,7 +1839,7 @@ (defun isearch-delete-char ()
     (isearch-pop-state))
   (isearch-update))
 
-(defun isearch-del-char (&optional arg)
+(defun isearch-del-char (&optional arg beginning)
   "Delete character from end of search string and search again.
 Unlike `isearch-delete-char', it only deletes the last character,
 but doesn't cancel the effect of other isearch command.
@@ -1847,9 +1847,13 @@ (defun isearch-del-char (&optional arg)
   (interactive "p")
   (if (= 0 (length isearch-string))
       (ding)
-    (setq isearch-string (substring isearch-string 0
-				    (- (min (or arg 1)
-					    (length isearch-string))))
+    (setq isearch-string (if beginning
+			     (substring isearch-string
+					(min (or arg 1)
+					     (length isearch-string)))
+			   (substring isearch-string 0
+				      (- (min (or arg 1)
+					      (length isearch-string)))))
           isearch-message (mapconcat 'isearch-text-char-description
                                      isearch-string "")))
   ;; Use the isearch-other-end as new starting point to be able
@@ -1858,17 +1862,23 @@ (defun isearch-del-char (&optional arg)
    (isearch-push-state)
    (isearch-update)))
 
-(defun isearch-yank-string (string)
+(defun isearch-yank-string (string &optional beginning)
   "Pull STRING into search string."
   ;; Downcase the string if not supposed to case-fold yanked strings.
   (if (and isearch-case-fold-search
 	   (eq 'not-yanks search-upper-case))
       (setq string (downcase string)))
   (if isearch-regexp (setq string (regexp-quote string)))
-  (setq isearch-string (concat isearch-string string)
+  (setq isearch-string (if beginning
+			   (concat string isearch-string)
+			 (concat isearch-string string))
 	isearch-message
 	(concat isearch-message
 		(mapconcat 'isearch-text-char-description


> 3. To me, yanking stuff to the beginning is more important than
> deleting stuff from the beginning.  I was thinking either have a
> separate key (or set of keys) that is (are) analogous to the
> yank-at-end key(s) or else just reuse the same keys when searching
> backward.

I have no idea about new keys, but I need this change to implement
yanking/deletion by motion keys (disabled by default).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 29 Jun 2013 23:03:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 29 19:03:09 2013
Received: from localhost ([127.0.0.1]:48612 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ut4Af-0008P5-Fv
	for submit <at> debbugs.gnu.org; Sat, 29 Jun 2013 19:03:09 -0400
Received: from aserp1040.oracle.com ([141.146.126.69]:24388)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1Ut4Ac-0008OY-V9
 for 14742 <at> debbugs.gnu.org; Sat, 29 Jun 2013 19:03:07 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r5TN30lC031744
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Sat, 29 Jun 2013 23:03:00 GMT
Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5TN2xX6008762
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Sat, 29 Jun 2013 23:02:59 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
 by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5TN2wNi014861;
 Sat, 29 Jun 2013 23:02:58 GMT
MIME-Version: 1.0
Message-ID: <8ada7269-baa9-483f-9595-d46619393aa7@default>
Date: Sat, 29 Jun 2013 16:02:58 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
 <87haggoc6r.fsf@HIDDEN>
In-Reply-To: <87haggoc6r.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

> It's easy to find a name for the new arg of `isearch-yank-string'.
> By default, it appends a string to the end of the search string,
> so a new arg for opposite meaning could have the name `prepend'
> to prepend a string to the beginning of the search string.
>=20
> But what could be a name for the new arg of `isearch-del-char'?
> By default, it deletes a substring from the end of the search string.
> And with a non-nil new arg it will delete a substring from the
> beginning of the search string.  What about the name `behead'

1. I would stay away from something like "behead" - that's
stretching things.  We don't commonly think of the "head" of a
search string.

I'd suggest not looking for a verb at all - the verb is already
in the command name.

2. Just use a name for the position, not the action: e.g. START or
BEGINNING.  (I would stay away from FRONT & BACK too, as references
to the search-string ends.  BACK is particularly problematic.)

PREPEND is not too bad if you do prefer a verb, but if you use
a position name then you can use the same name for multiple actions.
For this reason, for instance, BEGINNING is better than
FROM-BEGINNING & TO-BEGINNING.

3. To me, yanking stuff to the beginning is more important than
deleting stuff from the beginning.  I was thinking either have a
separate key (or set of keys) that is (are) analogous to the
yank-at-end key(s) or else just reuse the same keys when searching
backward.

I would probably go with the latter (same keys).  How useful is
it to incrementally yank more stuff in a forward-buffer direction
when searching backward?

I guess the same could be done for deletion as for yanking: reuse
the same keys.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 29 Jun 2013 22:06:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 29 18:06:47 2013
Received: from localhost ([127.0.0.1]:48572 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ut3I7-0006hG-AJ
	for submit <at> debbugs.gnu.org; Sat, 29 Jun 2013 18:06:47 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:40582
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1Ut3I4-0006gt-55
 for 14742 <at> debbugs.gnu.org; Sat, 29 Jun 2013 18:06:45 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 7B8B1258B9E915;
 Sat, 29 Jun 2013 15:06:42 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
 <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
Date: Sun, 30 Jun 2013 00:50:36 +0300
In-Reply-To: <7518b30b-63d2-40ea-956f-a504f40c4cfd@default> (Drew Adams's
 message of "Fri, 28 Jun 2013 15:00:47 -0700 (PDT)")
Message-ID: <87haggoc6r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

>> and since then I have not had problems with it.  So what could
>> be done is to move this code from `isearch-other-meta-char'
>> to `isearch-yank-string' and `isearch-del-char' for more
>> general functionality by adding a new argument `BACK' to them
>> (or could you propose a better name for the argument).
>
> I take your word for it wrt the implementation.  After I see it,
> I might have a suggestion wrt the name (maybe BACKWARD, as that
> seems to be the term used in our search names).

It's easy to find a name for the new arg of `isearch-yank-string'.
By default, it appends a string to the end of the search string,
so a new arg for opposite meaning could have the name `prepend'
to prepend a string to the beginning of the search string.

But what could be a name for the new arg of `isearch-del-char'?
By default, it deletes a substring from the end of the search string.
And with a non-nil new arg it will delete a substring from the
beginning of the search string.  What about the name `behead'
suggested in
http://english.stackexchange.com/questions/111382/what-are-the-antonyms-of-append-and-prepend

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-06-13 22:08:45 +0000
+++ lisp/isearch.el	2013-06-29 21:50:03 +0000
@@ -1839,7 +1839,7 @@ (defun isearch-delete-char ()
     (isearch-pop-state))
   (isearch-update))
 
-(defun isearch-del-char (&optional arg)
+(defun isearch-del-char (&optional arg behead)
   "Delete character from end of search string and search again.
 Unlike `isearch-delete-char', it only deletes the last character,
 but doesn't cancel the effect of other isearch command.
@@ -1847,9 +1847,13 @@ (defun isearch-del-char (&optional arg)
   (interactive "p")
   (if (= 0 (length isearch-string))
       (ding)
-    (setq isearch-string (substring isearch-string 0
-				    (- (min (or arg 1)
-					    (length isearch-string))))
+    (setq isearch-string (if behead
+			     (substring isearch-string
+					(min (or arg 1)
+					     (length isearch-string)))
+			   (substring isearch-string 0
+				      (- (min (or arg 1)
+					      (length isearch-string)))))
           isearch-message (mapconcat 'isearch-text-char-description
                                      isearch-string "")))
   ;; Use the isearch-other-end as new starting point to be able
@@ -1858,17 +1862,23 @@ (defun isearch-del-char (&optional arg)
    (isearch-push-state)
    (isearch-update)))
 
-(defun isearch-yank-string (string)
+(defun isearch-yank-string (string &optional prepend)
   "Pull STRING into search string."
   ;; Downcase the string if not supposed to case-fold yanked strings.
   (if (and isearch-case-fold-search
 	   (eq 'not-yanks search-upper-case))
       (setq string (downcase string)))
   (if isearch-regexp (setq string (regexp-quote string)))
-  (setq isearch-string (concat isearch-string string)
+  (setq isearch-string (if prepend
+			   (concat string isearch-string)
+			 (concat isearch-string string))
 	isearch-message
 	(concat isearch-message
 		(mapconcat 'isearch-text-char-description




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 28 Jun 2013 22:00:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 28 18:00:57 2013
Received: from localhost ([127.0.0.1]:47369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Usgiv-0007Oa-39
	for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 18:00:57 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:23319)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1Usgiu-0007OL-5S
 for 14742 <at> debbugs.gnu.org; Fri, 28 Jun 2013 18:00:56 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r5SLsU9P026523
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Fri, 28 Jun 2013 21:54:31 GMT
Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5SM0mJB010588
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Fri, 28 Jun 2013 22:00:49 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
 by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5SM0mWY004465;
 Fri, 28 Jun 2013 22:00:48 GMT
MIME-Version: 1.0
Message-ID: <7518b30b-63d2-40ea-956f-a504f40c4cfd@default>
Date: Fri, 28 Jun 2013 15:00:47 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#14742: 24.3.50; enhancement request: be able to prepend stuff
 from buffer when search backward
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
 <87sj01c3n2.fsf@HIDDEN>
In-Reply-To: <87sj01c3n2.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

> > In principle, yanked stuff could be prepended
> > as well as appended, IIUC.
>=20
> As you may remember, I implemented this two weeks ago
> in the patch I sent to emacs-devel,

No, I didn't know that.  Great!

> and since then I have not had problems with it.  So what could
> be done is to move this code from `isearch-other-meta-char'
> to `isearch-yank-string' and `isearch-del-char' for more
> general functionality by adding a new argument `BACK' to them
> (or could you propose a better name for the argument).

I take your word for it wrt the implementation.  After I see it,
I might have a suggestion wrt the name (maybe BACKWARD, as that
seems to be the term used in our search names).

It all sounds good so far.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at 14742 <at> debbugs.gnu.org:


Received: (at 14742) by debbugs.gnu.org; 28 Jun 2013 21:44:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 28 17:44:51 2013
Received: from localhost ([127.0.0.1]:47354 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UsgTL-0006tj-0E
	for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 17:44:51 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:36104
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1UsgTJ-0006tX-AJ
 for 14742 <at> debbugs.gnu.org; Fri, 28 Jun 2013 17:44:50 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id 7D59B258B9E915;
 Fri, 28 Jun 2013 14:44:47 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#14742: 24.3.50;
 enhancement request: be able to prepend stuff from buffer when search
 backward
Organization: JURTA
References: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
Date: Sat, 29 Jun 2013 00:43:45 +0300
In-Reply-To: <4b9029ca-1775-482f-ba9a-46a891be7405@default> (Drew Adams's
 message of "Fri, 28 Jun 2013 11:17:44 -0700 (PDT)")
Message-ID: <87sj01c3n2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14742
Cc: 14742 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> In principle, yanked stuff could be prepended
> as well as appended, IIUC.

As you may remember, I implemented this two weeks ago
in the patch I sent to emacs-devel, and since then
I have not had problems with it.  So what could be done
is to move this code from `isearch-other-meta-char'
to `isearch-yank-string' and `isearch-del-char' for more
general functionality by adding a new argument `BACK' to them
(or could you propose a better name for the argument).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jun 2013 18:18:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 28 14:18:04 2013
Received: from localhost ([127.0.0.1]:47213 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UsdFD-0000WZ-7N
	for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 14:18:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55549)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdFA-0000Vv-OW
 for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 14:18:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdF2-00057U-Mv
 for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 14:17:55 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-100.5 required=5.0 tests=BAYES_05, USER_IN_WHITELIST
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:52716)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdF2-00057P-JN
 for submit <at> debbugs.gnu.org; Fri, 28 Jun 2013 14:17:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57174)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdF0-0000nQ-3b
 for bug-gnu-emacs@HIDDEN; Fri, 28 Jun 2013 14:17:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdEy-00055Q-RR
 for bug-gnu-emacs@HIDDEN; Fri, 28 Jun 2013 14:17:50 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:49621)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1UsdEy-00055C-Kq
 for bug-gnu-emacs@HIDDEN; Fri, 28 Jun 2013 14:17:48 -0400
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
 by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id
 r5SIBRhU009387
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Fri, 28 Jun 2013 18:11:28 GMT
Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86])
 by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5SIHjYM012814
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
 for <bug-gnu-emacs@HIDDEN>; Fri, 28 Jun 2013 18:17:46 GMT
Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58])
 by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5SIHjN6026617
 for <bug-gnu-emacs@HIDDEN>; Fri, 28 Jun 2013 18:17:45 GMT
MIME-Version: 1.0
Message-ID: <4b9029ca-1775-482f-ba9a-46a891be7405@default>
Date: Fri, 28 Jun 2013 11:17:44 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50; enhancement request: be able to prepend stuff from buffer
 when search backward
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7  (607090) [OL
 12.0.6668.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Dunno how simple this would be to implement - just a thought/wish.

You can yank stuff from point onto the end of the search string.

When searching backward, it could be handy to be able to yank stuff
BEFORE point progressively onto the BEGINNING of the search string.
IOW, mirror the forward-search behavior.

I realize that in general you add to the end of the search string, even
when searching backward.  But that is presumably partly because there is
no easy way to prepend to it - to do that you need to use `M-e'.

But yanking from the buffer is not like typing text to add to the
search string.  In principle, yanked stuff could be prepended as well as
appended, IIUC.

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-06-27 on ODIEONE
Bzr revision: 113205 dgutov@HIDDEN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=3D/c/Devel/emacs/binary --enable-checking=3Dyes,glyphs
 CFLAGS=3D-O0 -g3 LDFLAGS=3D-Lc:/Devel/emacs/lib
 CPPFLAGS=3D-Ic:/Devel/emacs/include'




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#14742; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 21 Sep 2020 19:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.