From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: bug#29443: Document how to set themes depending on a condition Date: Sun, 26 Nov 2017 01:40:16 +0800 Message-ID: <873752ntof.fsf@jidanni.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1511634975 5262 195.159.176.226 (25 Nov 2017 18:36:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Nov 2017 18:36:15 +0000 (UTC) To: 29443@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 25 19:36:11 2017 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 1eIfJ8-0000jr-Cz for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Nov 2017 19:36:06 +0100 Original-Received: from localhost ([::1]:54053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIfJF-0007ba-OC for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Nov 2017 13:36:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIfJ7-0007Zz-QQ for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIfJ4-0005nl-N9 for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:36:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIfJ4-0005nh-JO for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eIfJ4-0008Fo-Du for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Nov 2017 18:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29443 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151163490431642 (code B ref -1); Sat, 25 Nov 2017 18:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2017 18:35:04 +0000 Original-Received: from localhost ([127.0.0.1]:58190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIfI7-0008EI-Nb for submit@debbugs.gnu.org; Sat, 25 Nov 2017 13:35:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIfI6-0008Dl-J0 for submit@debbugs.gnu.org; Sat, 25 Nov 2017 13:35:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIfI0-0005Nq-Lk for submit@debbugs.gnu.org; Sat, 25 Nov 2017 13:34:57 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41371) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIfI0-0005N9-I6 for submit@debbugs.gnu.org; Sat, 25 Nov 2017 13:34:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIfHz-0007Sq-E9 for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:34:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIfHw-0005Ka-B3 for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:34:55 -0500 Original-Received: from homie.mail.dreamhost.com ([208.97.132.208]:35052 helo=homiemail-a1.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIfHw-0005Je-1w for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2017 13:34:52 -0500 Original-Received: from homiemail-a1.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a1.g.dreamhost.com (Postfix) with ESMTP id 8DCA534806C for ; Sat, 25 Nov 2017 10:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type: content-transfer-encoding; s=jidanni.org; bh=2Pnts7DQGw7jucAS3ZO CTCeKQZA=; b=YdxkxyQaiwfb+r8aSR8Ab4wxhH/+jv40j8UK1mKYb2SAK6i5Xet TcIqc5rGU9SR/yIIMnTGrnZMSv4n7yRiQs2blO4bJrqc/2OAEdK7bMBPLTpfDtSv 4cqQFVwIZogJurrrWn0j6dND5zrDZUQCM/o2eKPfFFEZTik9319pdQUE= Original-Received: from jidanni.org (220-140-11-114.dynamic-ip.hinet.net [220.140.11.114]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by homiemail-a1.g.dreamhost.com (Postfix) with ESMTPSA id C842434806A for ; Sat, 25 Nov 2017 10:34:47 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:140372 Archived-At: In (info "(emacs) Custom Themes") after Setting or saving Custom themes actually works by customizing the variable =E2=80=98custom-enabled-themes=E2=80=99. The value of this = variable is a list of Custom theme names (as Lisp symbols, e.g., =E2=80=98tango=E2=80=99= ). Instead of using the =E2=80=98*Custom Themes*=E2=80=99 buffer to set =E2=80=98cu= stom-enabled-themes=E2=80=99, you can customize the variable using the usual customization interface, e.g., with =E2=80=98M-x customize-option=E2=80=99. 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(/=3D 0(user-uid)) '(custom-enabled-themes (quote (wheatgrass))))= ) In the above we have added a condition to what Custom has put into th= e 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!