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:41:05 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

Wang Yin <wang-y01@mails.tsinghua.edu.cn> writes:

> good!
> What about change the repeat mechanism of C-c f like C-x z z z z z ... ?

(defvar wy-go-to-char-key ?f)

(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)
  (let (ichar)
    (while (char-equal (setq ichar (read-char))
                       wy-go-to-char-key)
      (search-forward (string char) nil nil n))
    (setq unread-command-events (list last-input-event))))

(define-key global-map `[?\C-c ,wy-go-to-char-key] 'wy-go-to-char)

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

    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]