bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16214: Consistency in dired-, occur-, and grep-mode


From: Howard Melman
Subject: bug#16214: Consistency in dired-, occur-, and grep-mode
Date: Thu, 17 Feb 2022 11:28:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)

I wish this got more traction so here's a small concrete proposal.

I think in all three RET already opens the file or line
under point (in dired changing the current window, in grep
and occur in another window, at least for me on the macport
of Emacs 27.2).  No changes here.

With this one change, o in any of them will open the thing
in another window and select that window:

    (define-key compilation-minor-mode-map (kbd "o") #'compile-goto-error)

C-o in all three already opens the thing in another window
but not select it, no changes here.

I propose no change to C-x C-q in any of the modes, some
want just to toggle read-only, dired already enters wdired.

This makes e enter a writable version of all three modes.
Reserve e in grep-mode (it's already unbound) for a writable
version like wdired or occur-edit via a comment or
documentation, no code change, no need to mention wgrep in
emacs proper.  The wgrep package or users can perhaps bind e
to wgrep-change-to-wgrep-mode.  Make one incompatible change
to dired:

    (define-key dired-mode-map (kbd "e") #'dired-toggle-read-only)

Dired users with existing muscle memory to enter wdired via
C-x C-q are unchanged.  Dired users that use f or RET to
edit a file are unchanged; those that use e to edit a file
will have to change or bind this themselves.  The emacs
manual already documents using f to find a file from dired
and describes RET and e, in that order, as duplicates of f.
With this, e will change to be a duplicate of C-x C-q.

In all three you use C-c C-c to apply the edits, no changes
here.

That's it.  1 comment, 1 new binding and 1 changed binding
that already has two other equally convenient (single key)
and intuitive bindings. This would make RET, o, C-o, and e
consistent in all three as well as saving changes via C-c
C-c.  I think this will be much easier for new and existing
users to remember.

-- 

Howard






reply via email to

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