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

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

bug#6232: Suggestion for isearch: in backward search yank to front of se


From: Leo
Subject: bug#6232: Suggestion for isearch: in backward search yank to front of search string
Date: Fri, 21 May 2010 10:54:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2010-05-21 09:27 +0100, Andreas Schwab wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>> Yanking to the end of the search string in isearh (i.e. C-w etc.) is
>> very practical. However I miss yanking to the front of the search
>> string.
>>
>> My suggestion is to change the semantics a bit and yank to the front
>> of the search string when searching backwards. What do you think?
>
> Such a feature should definitely be on a separate key.
>
> Andreas.

C-y is almost useless to me so I have done something like this:

(define-key isearch-mode-map [remap isearch-yank-line] 'isearch-yank-sexp)

(defun isearch-yank-sexp ()
  "Pull the sexp at point into search string."
  (interactive)
  (if (and isearch-just-started (bounds-of-thing-at-point 'sexp))
      (progn (goto-char (car (bounds-of-thing-at-point 'sexp)))
             (isearch-yank-string (thing-at-point 'sexp)))
    (isearch-yank-internal
     (lambda () (ignore-errors (forward-sexp 1)) (point)))))

Leo





reply via email to

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