unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* M-g in dired
@ 2005-10-15 11:27 Juri Linkov
  2005-10-15 19:33 ` Kim F. Storm
                   ` (3 more replies)
  0 siblings, 4 replies; 44+ messages in thread
From: Juri Linkov @ 2005-10-15 11:27 UTC (permalink / raw)


`M-g M-n' is a nice key binding for `next-error' (easy to type and
mnemonic), but has one problem.  Just imagine a quite likely scenario:
the user switches to the dired buffer, invokes `compile' or `grep', and
types `M-g M-n' to go to the first error displayed in the output buffer
in another window.  Now instead of going to the first error, the message
"End of history; no default available" is displayed in the echo area.
That's because `M-g' is bound to `dired-goto-file' in the dired buffer,
which activates the minibuffer, and the second key `M-n' typed by the
user is bound in the minibuffer to `next-history-element' (which signals
an error for no default value).

It seems `M-g' in dired buffers should be rebound for `dired-goto-file'
to a key sequence with the `M-g' prefix.  I see at least two variants:

1. Rebind `dired-goto-file' to `M-g g' (and `M-g M-g').  The global
   binding for `M-g g' is `goto-line' which doesn't seem to be useful
   in dired buffers.  So dired buffers could have a local binding
   `M-g g' for `dired-goto-file'.

2. Rebind `dired-goto-file' to `M-g f' (and `M-g M-f').  This key
   sequence could serve as a global key binding.  Typing it in any
   buffer could create a dired buffer and move point to the file
   specified in the minibuffer (with the default value being the
   current buffer's file name).

It is not unreasonable to have both bindings.

BTW, there is a bug related to key suggestions: `M-x next-error RET'
typed in a dired buffer suggests the key binding `M-g n' even though
`M-g' is not a prefix key in dired buffers.  Sometimes it may suggest
`C-x `' when `where-is-internal' returns the first keybindings.  Since
it's not possible to control which keybinding `where-is-internal'
returns, to reproduce this bug `C-x `' should be unbound globally,
e.g. by (define-key ctl-x-map "`" nil).  After that

(key-description (where-is-internal 'next-error overriding-local-map t))

evaluates in a dired buffer to "M-g n", but currently it is not
possible to use this key in dired buffers.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2006-05-23  5:16 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <446C7B73.60907@earthlink.net>
2006-05-19  2:04 ` M-g in dired Richard Stallman
2006-05-19  3:04   ` Juri Linkov
2006-05-19  8:16     ` Kim F. Storm
2006-05-19  8:43       ` Miles Bader
2006-05-19 12:37         ` Kim F. Storm
2006-05-20 13:45         ` Juri Linkov
2006-05-20  5:03       ` Richard Stallman
     [not found]     ` <E1FhJd4-000822-Fe@fencepost.gnu.org>
2006-05-20 13:45       ` Juri Linkov
2006-05-20 15:46         ` Johan Bockgård
2006-05-20 20:03           ` Juri Linkov
2006-05-20 20:41             ` Romain Francoise
2006-05-21  0:56         ` Richard Stallman
2006-05-21  4:28           ` Juri Linkov
2006-05-22  2:38             ` Richard Stallman
2006-05-22 13:46               ` Juri Linkov
2006-05-22 20:37                 ` Richard Stallman
2006-05-23  5:16                   ` Juri Linkov
2006-05-19 18:53   ` David Hansen
2006-05-19 19:57     ` Reiner Steib
2006-05-19 20:07     ` Miles Bader
2005-10-15 11:27 Juri Linkov
2005-10-15 19:33 ` Kim F. Storm
2005-10-16 14:40 ` Richard M. Stallman
2005-10-16 14:40 ` Richard M. Stallman
2005-10-31  1:14 ` Richard Stallman
2005-10-31  7:47   ` Juri Linkov
2005-11-01  2:13     ` Richard M. Stallman
2005-11-01  9:16       ` Juri Linkov
2005-11-01 14:09         ` Andreas Schwab
2005-11-01 19:55           ` Juri Linkov
2005-11-02 10:28             ` Richard M. Stallman
2005-11-02 10:27         ` Richard M. Stallman
2005-11-03  7:48           ` Juri Linkov
2005-11-03 15:03             ` Stefan Monnier
2005-11-04 12:06               ` Juri Linkov
2005-11-05  1:37                 ` Richard M. Stallman
2005-11-05  7:55                   ` Juri Linkov
2005-11-05 23:43                     ` Richard M. Stallman
2005-11-07 14:27                       ` Juri Linkov
2005-11-07 16:03                         ` Stefan Monnier
2005-11-08 12:43                           ` Juri Linkov
2005-11-09  2:57                             ` Richard M. Stallman
2005-11-07 21:56                         ` Richard M. Stallman
2005-11-03 21:41             ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).