Fred Krogh <fkr
...@mathalacarte.com> writes:
> I'm tired of typing: <alt cntrl s>\Wxy\W
You need to read the tutorial. Type C-h t.
ie. it's not <cntrl h> t, it's C-h t.
> to search for a variable with name xy, where xy is some input.
> I'd like a macro set up so I could type <cntrl c><cntrl s>xy<enter>
> to do this. Better still if after doing this <cntrl>s would do the
> same search. A similar macro starting with <cntrl c><cntrl
> r>xy<enter> to do the same search backward would also be nice, but
> instructions to do the first should enable me to do that.
> Thanks for any help.
This cannot be done with a macro. (Neither with a keyboard macro or an
elisp macro). You have to write a command instead.
Now that you know the correct term, you can read emacs manuals and
learn about it.
An Introduction to Programming in Emacs Lisp
http://www.gnu.org/software/emacs/emacs-lisp-intro/ or M-: (info "(eintr)Top") RET
(for non-programmers)
Emacs Lisp Manual
http://www.gnu.org/software/emacs/manual/elisp.html or M-: (info "(elisp)Top") RET
Emacs Manual
http://www.gnu.org/software/emacs/manual/ or M-: (info "(emacs)Top") RET
Something like:
(defun fred-search-variable (name)
(interactive "sVariable name:")
(search-forward-regexp (format "\\W%s\\W" name)))
(local-set-key (kbd "C-c C-s") ; notice how it's not "<cntrl c>"?
'fred-search-variable)
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.