unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29972@debbugs.gnu.org
Subject: bug#29972: 25.3; dired-hide-details-mode does not persist in desktop session
Date: Fri, 5 Jan 2018 13:08:35 +0000	[thread overview]
Message-ID: <CAKDRQS4OWQL9-OJWFN_w-Z2_B9Hdh1HgN=iE-qnVkSHEfEg3pA@mail.gmail.com> (raw)
In-Reply-To: <83d12pbmol.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1870 bytes --]

I don't believe so. I've looked at a number of approaches.

1. `desktop-minor-mode-handlers` on desktop-read
    Not going to be consulted unless `dired-hide-details-mode` is saved as
a buffer minor mode.
2. `desktop-minor-mode-table` on desktop-save
    If `dired-hide-details-mode` is not in `minor-mode-alist`,
`desktop-minor-mode-table` will not even be consulted.
3. `desktop-locals-to-save`
    This does save the minor mode local variable to the desktop file, but
desktop won't be able to restore the minor mode because minor modes are
activated before buffer local variables are restored, not after.

So the only choices left to me are:
- :lighter ""
- (add-minor-mode 'dired-hide-details-mode "")

Either way adds an empty string as a lighter, and the second option makes
you ask why you are declaring *and* adding a minor mode, so I picked the
first option. It's more concise.

Jimmy Wong

On Thu, Jan 4, 2018 at 4:42 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Yuen Ho Wong <wyuenho@gmail.com>
> > Date: Thu, 04 Jan 2018 01:11:13 +0000
> >
> > How to reproduce:
> > 1. Turn on `desktop-save-mode`
> > 2. dired some directory
> > 3. Press `(` to turn on `dired-hide-details-mode`
> > 4. C-x C-c, when asked to save desktop, choose yes
> > 5. Launch emacs again, desktop restored the dired buffer but not
> > `dired-hide-details-mode`
> >
> > What went wrong:
> > `dired-hide-details-mode`'s definition does not declare a lighter or a
> > keymap, thus it is not added to `minor-mode-alist` by
> > `define-minor-mode`. So when `desktop` tries to get the buffer's info to
> > save to `.emacs.desktop` via `desktop-buffer-info`,
> > `dired-hide-details-mode` does not exist, and thus not saved to the
> > session file.
> >
> > Fix:
> > Just declare an empty lighter. I've attached a patch for this.
>
> Can't you instead customize desktop-locals-to-save?
>

[-- Attachment #2: Type: text/html, Size: 2561 bytes --]

  reply	other threads:[~2018-01-05 13:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  1:11 bug#29972: 25.3; dired-hide-details-mode does not persist in desktop session Yuen Ho Wong
2018-01-04 16:42 ` Eli Zaretskii
2018-01-05 13:08   ` Jimmy Yuen Ho Wong [this message]
2018-01-05 14:25     ` Eli Zaretskii
2018-01-05 15:02       ` Jimmy Yuen Ho Wong
2018-01-05 15:16         ` Eli Zaretskii
2018-01-05 17:42           ` Jimmy Yuen Ho Wong
2018-01-05 18:20             ` Eli Zaretskii
2018-01-05 18:29               ` Noam Postavsky
2018-01-05 18:37                 ` Drew Adams
2018-01-05 19:41                 ` Eli Zaretskii
2018-01-05 19:54                   ` Noam Postavsky
2018-01-05 19:56                     ` Eli Zaretskii
2018-01-05 19:59                       ` Noam Postavsky
2018-01-08 12:43                         ` Jimmy Yuen Ho Wong
2018-01-08 18:54                           ` Eli Zaretskii
     [not found]                           ` <<83r2r06v1y.fsf@gnu.org>
2018-01-08 19:08                             ` Drew Adams
2022-04-17 18:22 ` Lars Ingebrigtsen
     [not found] <<m28tdezavi.fsf@mobilecat.lan>

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='CAKDRQS4OWQL9-OJWFN_w-Z2_B9Hdh1HgN=iE-qnVkSHEfEg3pA@mail.gmail.com' \
    --to=wyuenho@gmail.com \
    --cc=29972@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).