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: 14940@debbugs.gnu.org
Subject: bug#14940: 24.3.50; [PATCH] enhancement for `dired-hide-details-mode'
Date: Thu, 25 Jul 2013 17:57:28 -0700 (PDT)	[thread overview]
Message-ID: <375ded7a-1525-4e81-842c-748fa54d9812@default> (raw)
In-Reply-To: <jwvr4emo64f.fsf-monnier+emacs@gnu.org>

> > 1. Users can decide whether the initial hide/show state of new Dired
> >    buffers reflects the last chosen state for a Dired buffer.  This is
> >    decided by option `dired-hide-details-propagate'.  Non-nil means
> >    propagate the last chosen state as the initial state of a new Dired
> >    buffer.
> 
> > 2. If `dired-hide-details-propagate' is nil, or if the user has not
> >    yet explicitly changed any Dired hide/show state, then option
> >    `dired-hide-details-initially' defines the initial state of a new
> >    Dired buffer.  IOW, it specifies what the "last" state defaults to.
> 
> Hmm... couldn't we merge those two configuration variables?

I supppose you mean shouldn't, not couldn't.

> Here's the idea:
> - Rename dired-hide-details-initially to dired-hide-details-default-mode,
>   a new (global) minor mode which determines how new dired buffers show up.
> - Make it so that toggling dired-hide-details-default-mode also toggles the
>   dired-hide-details-mode in the current buffer.
> This way, instead of setting dired-hide-details-propagate to t, users
> can simply use dired-hide-details-default-mode instead of
> dired-hide-details-mode.

I see no advantage, only disadvantage.  User options are generally the place
for default user settings.  Why have two minor modes here?  I might be
missing something, but to my mind that only confuses users and offers no
advantage.

We should stick to a single command and its key binding, and not make users
jump through hoops (yes, including changing key bindings) to choose the default
behavior they want (wrt initial hide/show and wrt propagation).

And if the same key and command are used (not two different mode commands),
a user can easily toggle the option value at any time and have the behavior
change - no fiddling with different commands or rebinding keys.

But if the *same* behavior is offered by your proposal as by mine, and if
users are not additionally bothered by your proposal, then I guess I
don't see a problem with it.  (That's an if.)

IMO:

1. The out-of-the-box default behavior should be as I described.

2. Users should be able to set their own preferred default behavior
persistently.  To me, that means a user option.  In any case, it
means not having to toggle anything interactively just to get the
preferred behavior as the saved one.

3. If the rest of the behavior I described is also provided, no problem.

In sum, it's the behavior I'm interested in.  If the behavior is intact
then I don't care much how you decide to implement it.

The code I sent is in Dired+ at least, so it is anyway available to users
who choose it, should you decide it is not the behavior you want for
vanilla Emacs.  Obviously I would prefer that (a) everyone benefit from
this feature and (b) I can then remove it from Dired+.  If you implement
something different then I will see whether I like its behavior enough
to remove what I have now in Dired+.

If you think I am missing something, please fill me in.

> Your code often exceeds the 80 columns limit.

Often?  Four of the 113 lines are longer than 80 chars (83, 84, 84, 85).

The longest line in dired.el is 103 chars!, both before and after patch.
The longest line in the patch I sent is 85 chars.  But feel free to
shorten any lines you like.





  reply	other threads:[~2013-07-26  0:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 16:28 bug#14940: 24.3.50; [PATCH] enhancement for `dired-hide-details-mode' Drew Adams
2013-07-25 18:30 ` Stefan Monnier
2013-07-26  0:57   ` Drew Adams [this message]
2013-11-04 16:31     ` Stefan Monnier
2013-11-04 16:34       ` Jambunathan K
2013-11-04 17:35       ` Drew Adams
2013-11-04 15:33 ` Jambunathan K
2019-06-26 15:34   ` Lars Ingebrigtsen
2019-06-26 15:42     ` Drew Adams

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=375ded7a-1525-4e81-842c-748fa54d9812@default \
    --to=drew.adams@oracle.com \
    --cc=14940@debbugs.gnu.org \
    --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).