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

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

Re: A few simple questions


From: Oliver Scholz
Subject: Re: A few simple questions
Date: Mon, 12 May 2003 14:56:18 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

Oliver Scholz <address@hidden> writes:

> Wang Yin <address@hidden> writes:
>
>> good!
>> What about change the repeat mechanism of C-c f like C-x z z z z z ... ?
>
[Lisp code]

> Type `C-c f a' to move to the next "a". Type `f f f f ...' to move to
> the following "a"s.

Come to think about it, maybe it's nicer to hit the key for the char
you are looking for repeatedly: `C-c f a a a a ...'. I might even
consider using this myself.

(defun wy-go-to-char (n char)
  "Move forward to Nth occurence of CHAR.
Typing `wy-go-to-char-key' again will move forwad to the next Nth
occurence of CHAR."
  (interactive "p\ncGo to char: ")
  (search-forward (string char) nil nil n)
  (while (char-equal (read-char)
                     char)
    (search-forward (string char) nil nil n))
  (setq unread-command-events (list last-input-event)))

(define-key global-map (kbd "C-c a") 'wy-go-to-char)

    Oliver
-- 
23 Floréal an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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