From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#14742: 24.3.50; enhancement request: be able to prepend stuff from buffer when search backward Date: Sat, 06 Jul 2013 02:17:35 +0300 Organization: JURTA Message-ID: <87ehbczje8.fsf@mail.jurta.org> References: <4b9029ca-1775-482f-ba9a-46a891be7405@default> <87sj01c3n2.fsf@mail.jurta.org> <7518b30b-63d2-40ea-956f-a504f40c4cfd@default> <87haggoc6r.fsf@mail.jurta.org> <8ada7269-baa9-483f-9595-d46619393aa7@default> <87y59ok18k.fsf@mail.jurta.org> <6ae1046e-e6ae-43ae-96ff-064fd01c9ec2@default> <87k3l8ik77.fsf@mail.jurta.org> <87k3l79seh.fsf@mail.jurta.org> <9fa6642c-dbcb-47aa-a8a3-29ee892bd933@default> <87y59lc32c.fsf@mail.jurta.org> <877gh43ara.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373067370 17346 80.91.229.3 (5 Jul 2013 23:36:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jul 2013 23:36:10 +0000 (UTC) Cc: 14742@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 06 01:36:10 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UvFXu-0007HI-9h for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jul 2013 01:36:10 +0200 Original-Received: from localhost ([::1]:56417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvFXt-0003bV-UP for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2013 19:36:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvFXo-0003ZY-Ms for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2013 19:36:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UvFXm-000121-Kv for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2013 19:36:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvFXm-00011o-Ha for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2013 19:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UvFXl-0004h4-VZ for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2013 19:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jul 2013 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14742 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14742-submit@debbugs.gnu.org id=B14742.137306734818003 (code B ref 14742); Fri, 05 Jul 2013 23:36:01 +0000 Original-Received: (at 14742) by debbugs.gnu.org; 5 Jul 2013 23:35:48 +0000 Original-Received: from localhost ([127.0.0.1]:33050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UvFXX-0004gH-8v for submit@debbugs.gnu.org; Fri, 05 Jul 2013 19:35:47 -0400 Original-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 ) id 1UvFXR-0004g6-Kk for 14742@debbugs.gnu.org; Fri, 05 Jul 2013 19:35:44 -0400 Original-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) In-Reply-To: (Stefan Monnier's message of "Fri, 05 Jul 2013 18:59:16 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75970 Archived-At: >> + ;; 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 )) 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'.