GNU bug report logs - #29972
25.3; dired-hide-details-mode does not persist in desktop session

Previous Next

Package: emacs;

Reported by: Yuen Ho Wong <wyuenho <at> gmail.com>

Date: Thu, 4 Jan 2018 01:14:01 UTC

Severity: minor

Found in version 25.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29972 <at> 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
[Message part 1 (text/plain, inline)]
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 <at> gnu.org> wrote:

> > From: Yuen Ho Wong <wyuenho <at> 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?
>
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.