[Conkeror] un-feature request

John J Foerch jjfoerch at earthlink.net
Fri Aug 22 09:02:49 PDT 2008


Silvio Levy <levy at msri.org> writes:
>
> The x4 action is not one of the emacs's best features.
>

Here is another idea related to prefix arguments.  I would like to find
out what people think of the following as a possible replacement for
emacs-style universal argument.

I posed the question to myself, "What does the C-u key really *mean* in
emacs?"  When C-u is not used for its mathematical effect of `x4', it
means in almost every case "make the following command do a special,
alternative action."  In both emacs and conkeror, these "alternate
commands" are essentially hard coded into the "basic commands".  There
is no explicit part of the emacs API that says "make this command be an
alternative to that one, when C-u is pressed".  This is the gist of my
idea for changing the meaning of C-u.  Press C-u once to run the "first
alternate" of the following command.  Press C-u twice to run the "second
alternate", and so on.  Alternates would be declared explicitly in the
`interactive' definition of each command, and utilities would be
provided so that people could change the alternates in their RC.
Commands would no longer have the "exceptional behavior" hard-coded into
them--there would be separate `interactive' definitions for each
alternative.

Although this approach is like the emacs style in spirit, formalizing
alternates in this way entails essentially two sacrifices: losing the
mathematical use of C-u (x4); and losing the ability to press C-u
followed by a sequence of unmodified number keys for numeric prefix.

Losing the mathematical significance of C-u can possibly be ameliorated
in some cases by providing "alternate commands" that, for example,
scroll 4 lines instead of 1.  A forgivable hack.

Losing the numeric overlay keymap may not be so bad.  As of yesterday,
it is now possible in conkeror to bind prefix commands in any keymap,
meaning that we can bind the keys C-[0-9] and M-[0-9] in top_keymap as
in emacs.

Advantages to this system would be in the readability of the source code
of commands, the configurability of the effect of C-u on any given
command, and the distinct separation of "numeric prefixes" from "object
prefixes".  Both kinds of prefixes could be unambiguously passed to
commands for a wider range of possible behaviors.

A couple of examples:

  The `go-back' command could take a numeric prefix to say how many
  history entries to go back, and its C-u "alternates" would be to open
  in a new buffer, or a new window.

  The `zoom-in' command can take a numeric prefix to specify how much to
  zoom, and the C-u "alternate" could be the `zoom-in-full' command
  (zoom pictures etc).  (This change would also free up the C-subtract
  key for use as `universal-negate'.)

Long message, I know.  If anybody wants to see some experimentation I
did along these lines a while back, check out the branch
jjf-alternate-commands.  (That branch now somewhat out of date because
of recent changes in master.)

Is this a good way to go with the conkeror UI, or does it stray too much
from the emacs style?

-- 
John Foerch



More information about the Conkeror mailing list