unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
To: 29443@debbugs.gnu.org
Subject: bug#29443: Document how to set themes depending on a condition
Date: Sun, 26 Nov 2017 01:40:16 +0800	[thread overview]
Message-ID: <873752ntof.fsf@jidanni.org> (raw)

In (info "(emacs) Custom Themes") after

    Setting or saving Custom themes actually works by customizing the
    variable ‘custom-enabled-themes’.  The value of this variable is a list
    of Custom theme names (as Lisp symbols, e.g., ‘tango’).  Instead of
    using the ‘*Custom Themes*’ buffer to set ‘custom-enabled-themes’, you
    can customize the variable using the usual customization interface,
    e.g., with ‘M-x customize-option’.

please add:

    Here's how to set a theme depending on a condition:

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     (if(/= 0(user-uid)) '(custom-enabled-themes (quote (wheatgrass)))))

    In the above we have added a condition to what Custom has put into the
    customization file we found on our disk.

    We set the wheatgrass theme if we are not root.

    One could go further and set different themes for different seasons. The
    sky's the limit!






             reply	other threads:[~2017-11-25 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-25 17:40 積丹尼 Dan Jacobson [this message]
2017-11-26 13:44 ` bug#29443: Document how to set themes depending on a condition Charles A. Roelli
2019-10-12 20:59   ` Lars Ingebrigtsen

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=873752ntof.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=29443@debbugs.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.
Code repositories for project(s) associated with this public inbox

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

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).