* Enable/disable theme while using desktop-save-mode
@ 2019-11-05 16:37 Pankaj Jangid
2019-11-05 21:20 ` Stefan Monnier
0 siblings, 1 reply; 7+ messages in thread
From: Pankaj Jangid @ 2019-11-05 16:37 UTC (permalink / raw)
To: Emacs mailing list
Hi,
I have (desktop-save-mode 1) and then enabled one dark mode theme. After
a few days, now I want to disable the theme. Even after I comment out
the theme related code from init.el, some of the theme settings don't go
away. This is because of the way themes are thought out in Emacs.
In Emacs, a theme is not just one setting. It is a collection of
settings that we configure. This allows us to set multiple themes in
sequence. Later settings will prevail finally.
Now, even when I disable all themes, the settings are still saved in
desktop session. Restarting Emacs, loads those settings from saved
desktop. This is where I am stuck.
Is there a way to remove all those settings which were configured by the
theme previously set?
Regards,
--
Pankaj Jangid
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Enable/disable theme while using desktop-save-mode
2019-11-05 16:37 Enable/disable theme while using desktop-save-mode Pankaj Jangid
@ 2019-11-05 21:20 ` Stefan Monnier
2019-11-06 5:08 ` Pankaj Jangid
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2019-11-05 21:20 UTC (permalink / raw)
To: help-gnu-emacs
> Is there a way to remove all those settings which were configured by the
> theme previously set?
I'd recommend you give more details. Such as *how* you "disable" your
themes and what settings you have noticed are still affected by the
(now disabled) themes.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Enable/disable theme while using desktop-save-mode
2019-11-05 21:20 ` Stefan Monnier
@ 2019-11-06 5:08 ` Pankaj Jangid
2019-11-06 8:03 ` YUE Daian
2019-11-06 16:09 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Pankaj Jangid @ 2019-11-06 5:08 UTC (permalink / raw)
To: help-gnu-emacs
> I'd recommend you give more details. Such as *how* you "disable" your
> themes and what settings you have noticed are still affected by the
> (now disabled) themes.
Okay. Here is my configuration,
#+BEGIN_SRC emacs-lisp
(setq-default custom-enabled-themes '(sanityinc-tomorrow-bright))
;; Ensure that themes will be applied even if they have not been customized
(defun reapply-themes ()
"Forcibly load the themes listed in `custom-enabled-themes'."
(dolist (theme custom-enabled-themes)
(unless (custom-theme-p theme)
(load-theme theme))))
(add-hook 'after-init-hook 'reapply-themes)
#+END_SRC
Now, to disable the theme I just commented these lines and restarted
Emacs. This should start Emacs with default theme with white
background. But the application starts with dark background although
some of the settings are gone. The font colours etc are different.
I am suspecting that this is because I have desktop-save-mode
enabled. If I start with '-Q' option then everything is ok. Because then
it doesn't read the desktop file.
I want to understand how to completely wipe out theme settings even from
saved-desktop. (If that is the reason).
Regards,
--
Pankaj Jangid
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Enable/disable theme while using desktop-save-mode
2019-11-06 5:08 ` Pankaj Jangid
@ 2019-11-06 8:03 ` YUE Daian
2019-11-06 10:34 ` Pankaj Jangid
2019-11-06 16:09 ` Eli Zaretskii
1 sibling, 1 reply; 7+ messages in thread
From: YUE Daian @ 2019-11-06 8:03 UTC (permalink / raw)
To: Pankaj Jangid, help-gnu-emacs
On 2019-11-06 10:38, Pankaj Jangid <pankaj.jangid@gmail.com> wrote:
>> I'd recommend you give more details. Such as *how* you "disable" your
>> themes and what settings you have noticed are still affected by the
>> (now disabled) themes.
>
> Okay. Here is my configuration,
>
> #+BEGIN_SRC emacs-lisp
> (setq-default custom-enabled-themes '(sanityinc-tomorrow-bright))
>
> ;; Ensure that themes will be applied even if they have not been customized
> (defun reapply-themes ()
> "Forcibly load the themes listed in `custom-enabled-themes'."
> (dolist (theme custom-enabled-themes)
> (unless (custom-theme-p theme)
> (load-theme theme))))
>
> (add-hook 'after-init-hook 'reapply-themes)
> #+END_SRC
>
> Now, to disable the theme I just commented these lines and restarted
> Emacs. This should start Emacs with default theme with white
> background. But the application starts with dark background although
> some of the settings are gone. The font colours etc are different.
>
> I am suspecting that this is because I have desktop-save-mode
> enabled. If I start with '-Q' option then everything is ok. Because then
> it doesn't read the desktop file.
>
> I want to understand how to completely wipe out theme settings even from
> saved-desktop. (If that is the reason).
>
> Regards,
> --
> Pankaj Jangid
I came across this problem before.
I do not know ~sanityinc-tomorrow-bright~, but some themes will modify
some settings once loaded.
Could you please try to load ~whiteboard~ theme (the default one) after
package initialization?
Loading it should really "initializing" the theme.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Enable/disable theme while using desktop-save-mode
2019-11-06 5:08 ` Pankaj Jangid
2019-11-06 8:03 ` YUE Daian
@ 2019-11-06 16:09 ` Eli Zaretskii
2019-11-06 18:34 ` Pankaj Jangid
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-11-06 16:09 UTC (permalink / raw)
To: help-gnu-emacs
> From: Pankaj Jangid <pankaj.jangid@gmail.com>
> Date: Wed, 06 Nov 2019 10:38:30 +0530
>
> I want to understand how to completely wipe out theme settings even from
> saved-desktop. (If that is the reason).
I suggest to carefully review your .emacs.desktop file, and find which
settings are being saved in it that cause this.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Enable/disable theme while using desktop-save-mode
2019-11-06 16:09 ` Eli Zaretskii
@ 2019-11-06 18:34 ` Pankaj Jangid
0 siblings, 0 replies; 7+ messages in thread
From: Pankaj Jangid @ 2019-11-06 18:34 UTC (permalink / raw)
To: help-gnu-emacs
>> I want to understand how to completely wipe out theme settings even from
>> saved-desktop. (If that is the reason).
>
> I suggest to carefully review your .emacs.desktop file, and find which
> settings are being saved in it that cause this.
Yes. Doing this now to find out which settings are persistent even after
the theme is disabled. Thanks for the pointers.
Regards,
--
Pankaj Jangid
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-11-06 18:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-05 16:37 Enable/disable theme while using desktop-save-mode Pankaj Jangid
2019-11-05 21:20 ` Stefan Monnier
2019-11-06 5:08 ` Pankaj Jangid
2019-11-06 8:03 ` YUE Daian
2019-11-06 10:34 ` Pankaj Jangid
2019-11-06 16:09 ` Eli Zaretskii
2019-11-06 18:34 ` Pankaj Jangid
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).