unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jamie Beardslee <jdb@jamzattack.xyz>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs Themes
Date: Fri, 20 Nov 2020 16:21:51 +1300	[thread overview]
Message-ID: <87h7pkzp9s.fsf@jamzattack.xyz> (raw)
In-Reply-To: trinity-ac06bfa0-818b-4c2d-acbf-7ad84a90ac81-1605838218526@3c-app-mailcom-bs14

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




  reply	other threads:[~2020-11-20  3:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  2:10 Emacs Themes Christopher Dimech
2020-11-20  3:21 ` Jamie Beardslee [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7pkzp9s.fsf@jamzattack.xyz \
    --to=jdb@jamzattack.xyz \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).