[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[1]: non self-insert-command buffers

From: Eric M. Ludlam
Subject: Re[1]: non self-insert-command buffers
Date: Mon, 15 Jan 2001 21:40:21 -0500

>>> Sam Steingold <address@hidden> seems to think that:
>Some Emacs modes (dired, occur, arc, many others), usually in read-only
>buffers, do not bind single characters like "a", "b" &c to anything
>useful (they are bound to `self-insert-command' or to `undefined',
>depending on whether `make-keymap' or `make-sparse-keymap' was used).
>You get beeps for any key except for some selected ones.
>It would seem that some common bindings
>should be in place there:
>        q       quit-window
>        x       kill-this-buffer
>        g       revert (mode-specific re-create)
>        h       describe-mode
>maybe some others.
>Why not add a function
>(defun make-read-only-keymap (&optional name)
>  (let ((map (make-sparse-keymap name)))
>    (define-key "q" 'quit-window)
>    (define-key "x" 'kill-this-buffer)
>    (define-key "h" 'describe-mode)
>    map))
>and use it instead of
> `make-keymap' (like in dired.el for `dired-mode-map') and
> `make-sparse-keymap' (like in replace.el for `occur-mode-map')?
>[I raised this issue with RMS several years ago]

I like this idea in that it would make it easier to add consistency
between these types of modes.

Since keymaps can contain parents, perhaps it would be as simple as
providing a global keymap for non-text modes (modes marked 'special).
It would be up to the maintainer to inherit from it.

See `set-keymap-parent'.

In speedbar, I used a special function for compatibility between many
versions of Emacs, but I don't think that is necessary here.

Now you just need to figure out what all those modes could agree on.
(I suspect rebinding `x' is out of the question though.)


          Eric Ludlam:                 address@hidden, address@hidden
   Home: www.ultranet.com/~zappo            Siege: www.siege-engine.com
Emacs: www.ultranet.com/~zappo/fsf.shtml          GNU: www.gnu.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]