bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14742: 24.3.50; enhancement request: be able to prepend stuff from b


From: Stefan Monnier
Subject: bug#14742: 24.3.50; enhancement request: be able to prepend stuff from buffer when search backward
Date: Fri, 05 Jul 2013 06:37:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> @@ -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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]