all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs Themes
@ 2020-11-20  2:10 Christopher Dimech
  2020-11-20  3:21 ` Jamie Beardslee
  2020-11-20  6:26 ` Pankaj Jangid
  0 siblings, 2 replies; 6+ messages in thread
From: Christopher Dimech @ 2020-11-20  2:10 UTC (permalink / raw
  To: Help Gnu Emacs

Have two themes and would like to cycle between the two using
a keybinding.  How can I do it?

Currently I have

(add-to-list 'load-path
   "~/GAdmSw/GungaDin-1.0/el/modus-themes/")

;; Set custom-theme-load-path
(add-to-list 'custom-theme-load-path
   (file-name-as-directory
      "~/GAdmSw/GungaDin-1.0/el/modus-themes/"))

(load-theme 'modus-operandi t t)
(enable-theme 'modus-operandi)

(load-theme 'modus-vivendi t t)
(enable-theme 'modus-vivendi)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs Themes
  2020-11-20  2:10 Emacs Themes Christopher Dimech
@ 2020-11-20  3:21 ` Jamie Beardslee
  2020-11-20  4:20   ` Jean Louis
  2020-11-20  6:26 ` Pankaj Jangid
  1 sibling, 1 reply; 6+ messages in thread
From: Jamie Beardslee @ 2020-11-20  3:21 UTC (permalink / raw
  To: help-gnu-emacs

Christopher Dimech <dimech@gmx.com> writes:
> Have two themes and would like to cycle between the two using
> a keybinding.  How can I do it?

Here's how I'd do it:

(defun toggle-light-or-dark-theme ()
  (interactive)
  (if (member 'modus-operandi custom-enabled-themes)
      (progn
	(disable-theme 'modus-operandi)
	(load-theme 'modus-vivendi t))
    (disable-theme 'modus-vivendi)
    (load-theme 'modus-operandi t)))

And then of course you can bind it to a key with `global-set-key'.

--
Jamie




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs Themes
  2020-11-20  3:21 ` Jamie Beardslee
@ 2020-11-20  4:20   ` Jean Louis
  2020-11-20  6:27     ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Jean Louis @ 2020-11-20  4:20 UTC (permalink / raw
  To: Jamie Beardslee; +Cc: help-gnu-emacs

* Jamie Beardslee <jdb@jamzattack.xyz> [2020-11-20 06:23]:
> Christopher Dimech <dimech@gmx.com> writes:
> > Have two themes and would like to cycle between the two using
> > a keybinding.  How can I do it?
> 
> Here's how I'd do it:
> 
> (defun toggle-light-or-dark-theme ()
>   (interactive)
>   (if (member 'modus-operandi custom-enabled-themes)
>       (progn
> 	(disable-theme 'modus-operandi)
> 	(load-theme 'modus-vivendi t))
>     (disable-theme 'modus-vivendi)
>     (load-theme 'modus-operandi t)))
> 
> And then of course you can bind it to a key with `global-set-key'.

Nice and simple, I will use it for my favorite themes.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs Themes
  2020-11-20  2:10 Emacs Themes Christopher Dimech
  2020-11-20  3:21 ` Jamie Beardslee
@ 2020-11-20  6:26 ` Pankaj Jangid
  2020-11-20 10:28   ` Christopher Dimech
  1 sibling, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2020-11-20  6:26 UTC (permalink / raw
  To: Christopher Dimech; +Cc: Help Gnu Emacs

Christopher Dimech <dimech@gmx.com> writes:

> Currently I have
>
> (add-to-list 'load-path
>    "~/GAdmSw/GungaDin-1.0/el/modus-themes/")
>
> ;; Set custom-theme-load-path
> (add-to-list 'custom-theme-load-path
>    (file-name-as-directory
>       "~/GAdmSw/GungaDin-1.0/el/modus-themes/"))
>

Off-topic though...

28.x i.e. `master' has modus-themes included (built-in). So the above
code is required only if you want to load the bleeding edge version from
git repo of the theme.

For 27 branch, you can always fetch from MELPA.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs Themes
  2020-11-20  4:20   ` Jean Louis
@ 2020-11-20  6:27     ` Pankaj Jangid
  0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Jangid @ 2020-11-20  6:27 UTC (permalink / raw
  To: Jean Louis; +Cc: help-gnu-emacs, Jamie Beardslee

Jean Louis <bugs@gnu.support> writes:

> * Jamie Beardslee <jdb@jamzattack.xyz> [2020-11-20 06:23]:
>> Christopher Dimech <dimech@gmx.com> writes:
>> > Have two themes and would like to cycle between the two using
>> > a keybinding.  How can I do it?
>> 
>> Here's how I'd do it:
>> 
>> (defun toggle-light-or-dark-theme ()
>>   (interactive)
>>   (if (member 'modus-operandi custom-enabled-themes)
>>       (progn
>> 	(disable-theme 'modus-operandi)
>> 	(load-theme 'modus-vivendi t))
>>     (disable-theme 'modus-vivendi)
>>     (load-theme 'modus-operandi t)))
>> 
>> And then of course you can bind it to a key with `global-set-key'.
>
> Nice and simple, I will use it for my favorite themes.

This snippet is from the documentation of modus themes. Nice
documentation as well. There are other useful snippets as well.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs Themes
  2020-11-20  6:26 ` Pankaj Jangid
@ 2020-11-20 10:28   ` Christopher Dimech
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Dimech @ 2020-11-20 10:28 UTC (permalink / raw
  To: Pankaj Jangid; +Cc: Help Gnu Emacs


> Sent: Friday, November 20, 2020 at 7:26 AM
> From: "Pankaj Jangid" <pankaj@codeisgreat.org>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Emacs Themes
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > Currently I have
> >
> > (add-to-list 'load-path
> >    "~/GAdmSw/GungaDin-1.0/el/modus-themes/")
> >
> > ;; Set custom-theme-load-path
> > (add-to-list 'custom-theme-load-path
> >    (file-name-as-directory
> >       "~/GAdmSw/GungaDin-1.0/el/modus-themes/"))
> >
>
> Off-topic though...
>
> 28.x i.e. `master' has modus-themes included (built-in). So the above
> code is required only if you want to load the bleeding edge version from
> git repo of the theme.

Correct, I want to run from source and test code fixes.

> For 27 branch, you can always fetch from MELPA.
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-20 10:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-20  2:10 Emacs Themes Christopher Dimech
2020-11-20  3:21 ` Jamie Beardslee
2020-11-20  4:20   ` Jean Louis
2020-11-20  6:27     ` Pankaj Jangid
2020-11-20  6:26 ` Pankaj Jangid
2020-11-20 10:28   ` Christopher Dimech

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.