unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15799@debbugs.gnu.org, 14914@debbugs.gnu.org,
	Jambunathan K <kjambunathan@gmail.com>
Subject: bug#14914: bug#15799: 24.3.50; dired-hide-details-mode:  Provide default key binding
Date: Mon, 4 Nov 2013 09:35:50 -0800 (PST)	[thread overview]
Message-ID: <8b3b095a-02b4-4e25-87b4-3db926df40e3@default> (raw)
In-Reply-To: <jwvob60kudw.fsf-monnier+emacsbugs@gnu.org>

> Thanks.  For #14914, there's no doubt for me that we should use
> a "[✓] Hide details" menu entry.

Sounds good to me (except it should be title case: `Hide Details').

> >> Also, wouldn't it make sense to try and bring hide-details
> >> "closer" to the dired-omit facilities?
> >
> > Definitely not.  No relation.  Completely different uses.
> 
> Of course, they're different, but I assume the @ was chosen because
> it's also used for things like outline-minor-mode, i.e. for other
> features that hide parts of the buffer.

`@' was proposed by Jambunathan, not I.  I have no special objection
to `@' instead of `(', however.

But I'm not convinced that it is good to confuse hiding stuff in
Dired with outline-minor-mode hiding.

> So, maybe @ should be a prefix key for "hiding stuff", in which we
> can place key bindings for "omit" and for "details".

I don't object to that.  As long as the two, hiding columns and
hiding rows, are kept clear and separate, no problem.

But there is really more to it than that.  There are at least these
hide/show commands in Dired:

$    (`dired-hide-subdir')
M-$  (`dired-hide-all')
(    (`dired-hide-details-mode')
M-o  (`dired-omit-mode')

It is good that each of these is quick, but yes, we could put them
all on a prefix key.  In that case, `M-o', `M-$', and `$' are also
good candidates for the prefix key.

We could have, for example:

M-o s  (`dired-hide-subdir')       - `s' for subdi
M-o S  (`dired-hide-all')          - `S' for subdirs
M-o c  (`dired-hide-details-mode') - `c' for columns
M-o r  (`dired-omit-mode')         - `r' for rows

No Shift key needed for them, except for the one that boosts `s'.

FWIW, Dired+ adds these commands, which could also be added to the
list, perhaps with these bindings:

M-o m  (`diredp-omit-marked')      - `m' for marked
M-o u  (`diredp-omit-unmarked')    - `u' for unmarked

Here are their (trivial) definitions:

(defun diredp-omit-marked ()
  "Omit lines of marked files.  Return the number of lines omitted."
  (interactive)
  (let ((old-modified-p  (buffer-modified-p))
        count)
    (when (interactive-p) (message "Omitting marked lines..."))
    (setq count  (dired-do-kill-lines nil "Omitted %d line%s."))
    (set-buffer-modified-p old-modified-p) ; So no `%*' appear in mode-line.
    count))

(defun diredp-omit-unmarked ()
  "Omit lines of unmarked files.  Return the number of lines omitted."
  (interactive)
  (let ((old-modified-p  (buffer-modified-p))
        count)
    (dired-toggle-marks)
    (message "Omitting unmarked lines...")
    (setq count  (diredp-omit-marked))
    (dired-toggle-marks)                ; Marks all except `.', `..'
    (set-buffer-modified-p old-modified-p) ; So no `%*' appear in mode-line.
    count))





  reply	other threads:[~2013-11-04 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04  8:09 bug#15799: 24.3.50; dired-hide-details-mode: Provide default key binding Jambunathan K
2013-11-04 14:06 ` Stefan Monnier
2013-11-04 14:32   ` Drew Adams
2013-11-04 16:35     ` Stefan Monnier
2013-11-04 17:35       ` Drew Adams [this message]
2013-11-06  7:31         ` bug#14914: " Jambunathan K
2020-10-28  8:41         ` Stefan Kangas
2013-11-15  5:15 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b3b095a-02b4-4e25-87b4-3db926df40e3@default \
    --to=drew.adams@oracle.com \
    --cc=14914@debbugs.gnu.org \
    --cc=15799@debbugs.gnu.org \
    --cc=kjambunathan@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).