[slime-devel] [RfC] Changing behaviour of `C-w' in Isearch
billclem at gmail.com
Tue Jan 8 15:35:39 UTC 2008
> I often find it quite annoying that `C-w' during Isearch just inserts
> the word at point; the reason is that variable identifiers in Lisp
> contain non-word constituents very often.
> E.g. If point is at *special-variables*, you'd have to press `C-w' three
> times to eventually get it inserted as the search string.
> The following will make `C-w' respect symbol constituents as well as
> word constituents when isearching in Lisp buffers, such that one `C-w'
> will suffice for gripping special variables.
> (defun isearch-yank-symbolic-word-or-char ()
> (lambda ()
> (let ((distance (skip-syntax-forward "w_")))
> (when (zerop distance) (forward-char 1))
> (add-hook 'lisp-mode-hook
> (lambda ()
> (make-local-variable 'isearch-mode-map)
> (define-key isearch-mode-map
> "\C-w" 'isearch-yank-symbolic-word-or-char)))
> I consider this generally useful, and wanted to ask if I should commit
> something like that to Slime?
I don't know whether it should be put into Slime; however, it's easy
enough to set this in emacs by doing the following:
(modify-syntax-entry ?- "w") ; now '-' is not considered a word-delimiter
More information about the slime-devel