PlanDuSite ModificationsRécentes Nouvelles SectionElisp CommentFaire

RepeatKeyDifferentBehaviors

Dernière modification

Résumé : repeated beginning/end of line for visual-line-mode

Modifié(e) :

< * `##beginning-of-line+##' and `##end-of-line+##' in <tt>[[misc-cmds.el]]</tt>. Use `C-a' and `C-e' repeatedly to zip up and down the beginnings or ends of lines. First time: bol/eol, subsequently: next/previous line's bol/eol.

à

> * Use `C-a' and `C-e' repeatedly to zip up and down the beginnings and ends of lines. First time: bol/eol, subsequently: next/previous line's bol/eol. See commands `##beginning-of-line+##' and `##end-of-line+##' in <tt>[[misc-cmds.el]]</tt>. The keys are bound in <tt>[[setup-keys.el]]</tt>.
> * Same thing in `visual-line-mode', use
`C-a' and `C-e' repeatedly to zip up and down the beginnings and ends of visual lines. And use `home' and `end' to move repeatedly across full, logical lines. See commands `##beginning-of-visual-line+##' and `##end-of-visual-line+##' in <tt>[[misc-cmds.el]]</tt>. The keys are bound in <tt>[[setup-keys.el]]</tt>.


This page is about repeatedly using the same key or command and getting a different behavior each time. Such a key or command is no longer idempotent.

Starting with Emacs 23, ‘C-l’ (‘recenter-top-bottom’) is an example of this: When you hit ‘C-l’ it moves the current line (with point) to the middle, the top, or the bottom of the screen, in sequence: middle, top, bottom, middle,…

The code for this is in standard library GIT:window.el. It is based on ‘recenter-top-bottom’ from misc-cmds.el. See the source code for the technique used.

The following are additional ways to make a command or key act differently when it is repeated.


CategoryCommands CategoryKeys