From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.bugs Subject: bug#29972: 25.3; dired-hide-details-mode does not persist in desktop session Date: Fri, 05 Jan 2018 15:02:21 +0000 Message-ID: References: <83d12pbmol.fsf@gnu.org> <83wp0w9ybt.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1148d5b2e6c915056208bc46" X-Trace: blaine.gmane.org 1515164480 27690 195.159.176.226 (5 Jan 2018 15:01:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2018 15:01:20 +0000 (UTC) Cc: 29972@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 05 16:01:16 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXTUf-0006lq-PR for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jan 2018 16:01:14 +0100 Original-Received: from localhost ([::1]:44392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXTWf-0001OB-6s for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jan 2018 10:03:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXTWV-0001Nc-GU for bug-gnu-emacs@gnu.org; Fri, 05 Jan 2018 10:03:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXTWQ-0002i7-UE for bug-gnu-emacs@gnu.org; Fri, 05 Jan 2018 10:03:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXTWQ-0002hY-RF for bug-gnu-emacs@gnu.org; Fri, 05 Jan 2018 10:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eXTWQ-0004Pq-Au for bug-gnu-emacs@gnu.org; Fri, 05 Jan 2018 10:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Yuen Ho Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jan 2018 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29972-submit@debbugs.gnu.org id=B29972.151516456116947 (code B ref 29972); Fri, 05 Jan 2018 15:03:02 +0000 Original-Received: (at 29972) by debbugs.gnu.org; 5 Jan 2018 15:02:41 +0000 Original-Received: from localhost ([127.0.0.1]:37139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXTW4-0004PG-9a for submit@debbugs.gnu.org; Fri, 05 Jan 2018 10:02:41 -0500 Original-Received: from mail-wm0-f46.google.com ([74.125.82.46]:45278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXTW2-0004P2-32 for 29972@debbugs.gnu.org; Fri, 05 Jan 2018 10:02:38 -0500 Original-Received: by mail-wm0-f46.google.com with SMTP id 9so2934772wme.4 for <29972@debbugs.gnu.org>; Fri, 05 Jan 2018 07:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4PtMitt70Cqa2Cd+Kh5vFpEXbfxxPn4cKA6V5De/KAc=; b=QRVfrCFciBtFB9AQqWtqSbWyxwvouCeQ8924p4eRuVCPrYROJuaEbJEnFM3znuqSgq RGVJgV0ovUExhaKlNX7slM6Dq0chuignG6ITy1h9JIX/osj80zyo48vPbHfGxbyNoecg 62RxtsJzUOmalK3UKijWOy8vjsooGd8Wy+VDc2XqWHICf9iqsjyvT/nF57jfTrIaW5xN 5wttYUu/zdfcgMavPgsmbsk4AVXbv8xmnl49Ow4Qx+Rz7j38UjWQUDpFXjqJBybFbFjs JoMtJX1zRkYtgNRM7gJdEoWCFGdJ2AuhXb9FDsdmmwasv+N74QLSjrYPqPG4SxC0Idqw wiZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4PtMitt70Cqa2Cd+Kh5vFpEXbfxxPn4cKA6V5De/KAc=; b=Lm2TrLWzmYypV/70KZmxCLZXhdyMAO9egECXfSX8sHUpUy6Ejo9WJ94DwYulr5buJd uXd/I/um/YAz4xM0p68xuj9ddbo9mMXY3GT/dMA+TJGgF6Egic4H3i2d/4aZmlP/LJeB GxvxySvcdCokBz4HSYGx8xAglaF8GSIl/clYQ3B9Z7VyqiZi/29EiMhgNMdwZ+DrDR7w c0mBHAEwLuKjF28Cxq4e7JfGZ4gWb5V0B4lQFBlFkq7Zfz4lrrf+vncIdof39lYZfLwc FJleW7X94OMuGc5Apc/5deRJt3L7y7I+V29w9ISOSga5+H2EjKfi5wTGe3ID++A0drAR vgiA== X-Gm-Message-State: AKGB3mLtdN1ErB1nwwy5DI7HwWdgLmZHXEAm0Rm9R8psS9B2QiUr20WN zNQyC7z6YNypoZak+j20cAqLpjIlTow3FP9rlSE= X-Google-Smtp-Source: ACJfBouIBpL+s0VAIKIg+LMz853PvGN1EaRh/Om4sbfaUFSsbN0ruEc7XnbKCWZ2NrGi+k5gN4A3uys/9E16At4cfS0= X-Received: by 10.28.194.138 with SMTP id s132mr2332500wmf.129.1515164552053; Fri, 05 Jan 2018 07:02:32 -0800 (PST) In-Reply-To: <83wp0w9ybt.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141802 Archived-At: --001a1148d5b2e6c915056208bc46 Content-Type: text/plain; charset="UTF-8" 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 wrote: > > From: Jimmy Yuen Ho Wong > > Date: Fri, 5 Jan 2018 13:08:35 +0000 > > Cc: 29972@debbugs.gnu.org > > > > 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. > --001a1148d5b2e6c915056208bc46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Actually I would question why we have minor modes not added to minor-mode-a= list at all just because both lighter and keymap are missing.

What d= o you think about changing define-minor-mode?
On Fri, 5 Jan 2018 at 2:26 pm, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
> Date: Fri, 5 Jan 2018 13:08:35 +0000
> Cc: 29972@d= ebbugs.gnu.org
>
> I don't believe so. I've looked at a number of approaches.
>
> 1. `desktop-minor-mode-handlers` on desktop-read
>=C2=A0 =C2=A0 =C2=A0Not going to be consulted unless `dired-hide-detail= s-mode` is saved as a buffer minor mode.
> 2. `desktop-minor-mode-table` on desktop-save
>=C2=A0 =C2=A0 =C2=A0If `dired-hide-details-mode` is not in `minor-mode-= alist`, `desktop-minor-mode-table` will not even be
> consulted.
> 3. `desktop-locals-to-save`
>=C2=A0 =C2=A0 =C2=A0This 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 varia= bles 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 ma= kes 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.=C2=A0 It doesn't sound right to me to make tr= icky
changes in a minor mode just so it could be restored by desktop.el.
--001a1148d5b2e6c915056208bc46--