Subject: bug#29972: 25.3; dired-hide-details-mode does not persist in desktop session

From: Jimmy Yuen Ho Wong <[email-masked]>
Date: Fri, 05 Jan 2018 15:02:21 +0000

Actually I would question why we have minor modes not added to
minor-mode-alist at all just because both lighter and keymap are missing.

What do you think about changing define-minor-mode?
On Fri, 5 Jan 2018 at 2:26 pm, Eli Zaretskii <[email-masked]> wrote:

> > From: Jimmy Yuen Ho Wong <[email-masked]>
> > Date: Fri, 5 Jan 2018 13:08:35 +0000
> > Cc: [email-masked]
> >
> > 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.
>
> Then maybe we need a new, more thorough customization facility for
> desktop.el, or a change in the facilities you tried to make them
> handle this case as well.  It doesn't sound right to me to make tricky
> changes in a minor mode just so it could be restored by desktop.el.
>