unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 14742@debbugs.gnu.org
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	[thread overview]
Message-ID: <87ehbczje8.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvobagr4zi.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 05 Jul 2013 18:59:16 -0400")

>> +	  ;; 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'.





  reply	other threads:[~2013-07-05 23:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 18:17 bug#14742: 24.3.50; enhancement request: be able to prepend stuff from buffer when search backward Drew Adams
2013-06-28 21:43 ` Juri Linkov
2013-06-28 22:00   ` Drew Adams
2013-06-29 21:50     ` Juri Linkov
2013-06-29 23:02       ` Drew Adams
2013-07-02 22:39         ` Juri Linkov
2013-07-02 23:42           ` Drew Adams
2013-07-02 23:53             ` Juri Linkov
2013-07-03  1:07               ` Drew Adams
2013-07-03  5:40                 ` Drew Adams
2013-07-03 22:57                   ` Juri Linkov
2013-07-04  0:17                     ` Drew Adams
2013-07-04 23:34                       ` Juri Linkov
2013-07-05 10:37                         ` Stefan Monnier
2013-07-05 22:28                           ` Juri Linkov
2013-07-05 22:59                             ` Stefan Monnier
2013-07-05 23:17                               ` Juri Linkov [this message]
2013-07-06  0:40                                 ` Stefan Monnier
2020-09-18 14:30                             ` Lars Ingebrigtsen
2020-09-18 16:11                               ` Drew Adams
2020-09-21 19:07                                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehbczje8.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=14742@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).