In my
I-search is really, truly useful (and along with having dabbrev-expand bound to Alt-Space is something I'd like to have working in all programs I use). The function above is a nice twist.
One thing I've wanted for a long time though is to be able to I-search (using Ctrl-w to expand the search string until I found the proper match) and then copy the string into the clipboard (or killing it in Emacs-speak).
I wouldn't be surprised if it's possible to actually do that already, but I haven't found anything after quite a bit of searching. So I hacked together this by adapting the occurence code:
(defun isearch-kill-string ()
"Make the current isearch-string the latest kill in the kill ring."
(interactive)
(let ((case-fold-search isearch-case-fold-search))
(kill-new (if isearch-regexp isearch-string (regexp-quote isearch-string)))))
(define-key isearch-mode-map (kbd "C-k") 'isearch-kill-string)
Feel free to code review the elisp, I'm sure it can be improved in one way or the other.
intent? (Score:1)
Re: (Score:1)
Thanks!