Starting with Emacs 23,
‘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 following are additional ways to make a command or key act differently when it is repeated.
‘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 misc-cmds.el. The keys are bound in setup-keys.el.
‘C-e’repeatedly to zip up and down the beginnings and ends of visual lines. And use
‘end’to move repeatedly across full, logical lines. See commands `
beginning-of-visual-line+’ and `
end-of-visual-line+’ in misc-cmds.el. The keys are bound in setup-keys.el.