From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Menu suggestion
Date: 30 Apr 2004 19:30:46 +0200 [thread overview]
Message-ID: <m34qr1xtix.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <m13c6lsh0p.fsf-monnier+emacs@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > Today I mostly use the arrow keys.
>
> I started with arrow keys and nowadays I still mostly use arrow keys.
I use them too -- and I even have alternate bindings on C-f and C-b
to commands which do the same as vi's f and b commands *), and
CUA-mode remaps C-v and M-v.
But I do use C-n and C-p (quite often), but mostly to scroll through
minibuffer history...
It seems that a good part of the emacs developers don't actually use
the emacs bindings -- so how can we expect our users to learn them ?
*) Here is my find-char functions:
;;; find-char.el --- find character forward/backward
;; Copyright (C) 1998, 2004 Free Software Foundation, Inc.
;; Author: Kim F. Storm <storm@cua.dk>
;; Keywords: keyboard navigation
;; Revision: 1.2
;; This file is [not yet] part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; This is the find-char package which allow fast movement to a specific
;; character in the text, similar to the 'f' and 'b' commands in vi.
;;
;; Since the forward and backward char commands are bound to the right
;; and left arrow keys, the C-f and C-b keys are readily available for
;; binding these commands:
;;
;; (global-set-key "\C-b" 'find-char-backward)
;; (global-set-key "\C-f" 'find-char-forward)
;;
;; If the C-f or C-b is repeated immediately after the previous C-f or C-b
;; command, the command moves point to the next/prev occurrence of the same
;; character.
;;
;; For example, to move point to the third next 'x' in the text, simply
;; enter C-f x C-f C-f (or M-3 C-f x)
(provide 'find-char)
(defvar find-char-last-ok nil)
(defvar find-char-last-char ? )
;;;###autoload
(defun find-char-forward (count &optional backward)
"Find COUNT'th forward occurrence of character read from minibuffer.
If command is repeated immediately, move to next occurrence of same
character."
(interactive "p")
(let ((case-fold-search nil)
(char
(if (and (> count 0)
(or (and find-char-last-ok (eq last-command this-command))
(eq last-command (if backward 'find-char-forward 'find-char-backward))))
find-char-last-char
(message "Find character %sward (%c): " (if backward "back" "for") find-char-last-char)
(read-char))))
(if (/= char last-command-char) ; C-f C-f repeats last search.
(setq find-char-last-char char))
(setq count
(if (> 0 count) (- count)
(if (= 0 count) 1 count)))
(if (setq find-char-last-ok
(if backward
(progn
(backward-char)
(or (eq (char-after (point)) find-char-last-char)
(search-backward (char-to-string find-char-last-char) nil t count)
(forward-char)))
(forward-char)
(or (eq (char-after (point)) find-char-last-char)
(if (search-forward (char-to-string find-char-last-char) nil t count)
(progn (backward-char) t))
(backward-char))))
t
(ding)
(message "%c not found" find-char-last-char))
))
;;;###autoload
(defun find-char-backward (count)
"Find COUNT'th backward occurrence of character read from minibuffer.
If command is repeated immediately, move to previous occurrence of same
character."
(interactive "p")
(find-char-forward count t))
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2004-04-30 17:30 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-23 21:24 Menu suggestion David Kastrup
2004-04-24 13:29 ` Robert J. Chassell
2004-04-24 23:02 ` Kim F. Storm
2004-04-25 23:35 ` Richard Stallman
2004-04-26 8:23 ` Default Emacs keybindings (was: Re: Menu suggestion) Per Abrahamsen
2004-04-26 13:35 ` Luc Teirlinck
2004-04-26 14:22 ` Default Emacs keybindings Per Abrahamsen
2004-04-26 13:44 ` Default Emacs keybindings (was: Re: Menu suggestion) Alan Mackenzie
2004-04-26 15:16 ` David Kastrup
2004-04-26 22:33 ` Kim F. Storm
2004-04-26 21:36 ` David Kastrup
2004-04-26 23:06 ` Luc Teirlinck
2004-04-27 14:04 ` Stefan Monnier
2004-04-27 14:22 ` David Kastrup
2004-04-29 19:42 ` Stefan Monnier
2004-05-24 14:08 ` Richard Stallman
2004-05-26 16:18 ` Stefan Monnier
2004-05-26 17:01 ` David Kastrup
2004-05-27 23:53 ` Richard Stallman
2004-05-28 21:06 ` Stefan Monnier
2004-04-27 23:59 ` Default Emacs keybindings Stefan Daschek
2004-04-30 13:06 ` Per Abrahamsen
2004-04-30 21:41 ` Miles Bader
2004-05-01 17:50 ` Richard Stallman
2004-05-01 18:20 ` Andreas Schwab
2004-05-02 19:52 ` Richard Stallman
2004-05-02 21:15 ` Miles Bader
2004-05-03 6:11 ` Lars Brinkhoff
2004-05-03 5:53 ` Kim F. Storm
2004-05-03 8:34 ` Miles Bader
2004-05-03 7:32 ` Kim F. Storm
2004-05-03 9:55 ` Miles Bader
2004-05-03 9:36 ` Kai Grossjohann
2004-05-07 12:34 ` Jose E. Marchesi
2004-05-03 9:08 ` Jan Nieuwenhuizen
2004-05-03 7:25 ` Kim F. Storm
2004-05-03 9:51 ` Jan Nieuwenhuizen
2004-05-03 10:33 ` Per Abrahamsen
2004-05-03 11:28 ` Kenichi Handa
2004-05-03 11:54 ` Jan Nieuwenhuizen
2004-05-03 23:15 ` Masatake YAMATO
2004-05-04 0:11 ` Kenichi Handa
2004-05-03 22:21 ` Richard Stallman
2004-05-03 22:59 ` Luc Teirlinck
2004-05-04 6:01 ` Eli Zaretskii
2004-05-04 7:02 ` David Kastrup
2004-05-04 7:42 ` Alan Mackenzie
2004-05-04 13:54 ` Stefan Monnier
2004-05-04 15:37 ` Alan Mackenzie
2004-05-04 21:45 ` Luc Teirlinck
2004-05-04 21:35 ` Luc Teirlinck
2004-05-05 5:53 ` Eli Zaretskii
2004-05-05 14:29 ` Luc Teirlinck
2004-05-05 22:20 ` Thien-Thi Nguyen
2004-05-05 14:34 ` Luc Teirlinck
2004-05-04 20:07 ` Richard Stallman
2004-05-04 12:20 ` Robert J. Chassell
2004-05-05 20:20 ` Richard Stallman
2004-05-06 12:41 ` Robert J. Chassell
2004-05-06 14:22 ` Andreas Schwab
2004-05-06 14:54 ` Robert J. Chassell
2004-05-06 15:28 ` Andreas Schwab
2004-05-08 1:20 ` Richard Stallman
2004-05-08 23:20 ` Robert J. Chassell
2004-05-04 12:25 ` Robert J. Chassell
2004-05-03 22:21 ` Richard Stallman
2004-05-03 7:48 ` Jan Nieuwenhuizen
2004-04-26 9:56 ` Menu suggestion Kim F. Storm
2004-04-26 8:39 ` Miles Bader
2004-04-26 11:37 ` Kim F. Storm
2004-04-27 8:24 ` Richard Stallman
2004-04-27 11:05 ` Kim F. Storm
2004-04-27 10:38 ` Jan Nieuwenhuizen
2004-04-27 14:04 ` Kim F. Storm
2004-04-30 13:13 ` Per Abrahamsen
2004-04-30 14:03 ` Stefan Monnier
2004-04-30 17:30 ` Kim F. Storm [this message]
2004-04-30 19:35 ` Stefan Monnier
2004-04-30 19:55 ` Kim F. Storm
2004-05-03 7:18 ` Juanma Barranquero
2004-05-03 10:25 ` Kim F. Storm
2004-05-04 7:32 ` David Kastrup
2004-04-27 14:21 ` Stefan Monnier
2004-04-28 10:12 ` Richard Stallman
2004-04-28 5:09 ` Juri Linkov
2004-04-28 6:40 ` Eli Zaretskii
2004-04-28 5:55 ` Juri Linkov
2004-04-28 11:25 ` Eli Zaretskii
2004-04-28 12:57 ` Robert J. Chassell
2004-04-28 6:46 ` Miles Bader
2004-04-28 12:51 ` Robert J. Chassell
2004-04-29 10:44 ` Richard Stallman
2004-04-29 11:27 ` Juri Linkov
2004-04-26 10:35 ` Eli Zaretskii
2004-04-26 16:36 ` jargon translation up-front in doc (was: Menu suggestion) Drew Adams
2004-04-27 6:43 ` Eli Zaretskii
2004-04-29 1:48 ` Drew Adams
2004-04-29 15:44 ` Kevin Rodgers
2004-04-29 17:37 ` Drew Adams
2004-04-29 23:36 ` Kim F. Storm
2004-04-29 23:48 ` Drew Adams
2004-04-30 9:02 ` Richard Stallman
2004-04-25 18:08 ` Menu suggestion Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m34qr1xtix.fsf@kfs-l.imdomain.dk \
--to=storm@cua.dk \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.