From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: properly setting up ~/.emacs.d for daemon usage Date: Mon, 12 Dec 2016 23:46:47 +0700 Message-ID: References: <87eg1ew32r.fsf@wanadoo.es> 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 1481569976 8329 195.159.176.226 (12 Dec 2016 19:12:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 19:12:56 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , "help-gnu-emacs@gnu.org" To: Filipe Silva Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 12 20:12:51 2016 Return-path: Envelope-to: geh-help-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 1cGW1q-0000rv-Gn for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 20:12:50 +0100 Original-Received: from localhost ([::1]:33220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGW1t-0006tl-Ry for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 14:12:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGTlt-00005X-64 for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 11:48:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGTlq-0001Ww-2k for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 11:48:13 -0500 Original-Received: from mail-wm0-f67.google.com ([74.125.82.67]:34114) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGTlp-0001Wc-Rs for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 11:48:09 -0500 Original-Received: by mail-wm0-f67.google.com with SMTP id g23so12451907wme.1 for ; Mon, 12 Dec 2016 08:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=HeCTwz7RZsP5vO8+0sB/NYhb7aFLqWCbMHAnywKL53o=; b=KiqQJ1aAWL+oOlgD+LaSPG5jiEFl3lLc89G+ieYn3RCwRSVlrk1utsJtp7C6zDUfod Pj+01FXLaIbWbQpMw8Qk1N/lkCu9Op5r3Wpd1HBqBbP2CVMfmSKw2oo+FG8qhMvqqeH5 PH2jiDT02+o289K28eM75YeecspKy2xaJXuXDdaJ74x33NTyWTT1kGQXtKy00mStSREc E4w/OSnBUEKWxQWN1zie8/sdko2UqNfPGH3HK2vCBEDhsQbZeGFgehDixmFUJgj+DwUB LArN2hZ9SZbBzQjssEXvpFFhkXqiKOPp7DwoCmFTmQs4LsrcyW3/Ko/bkdShL926t1nk tUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=HeCTwz7RZsP5vO8+0sB/NYhb7aFLqWCbMHAnywKL53o=; b=lK10IMxi/czw598LYjvAeMfBGmV2PH/cr4nDkpRYDeN1kXJl7otrzyVma2V4ezEzFk AVmip53ze/0h6t7zd59neymw+Kxv2uSmIoMwUe/sLaeGLVCVniq8hkaQtBepOaWxP96s NoA0M8iL5+hunqQjDhq50PqE1zc0lclN2aUz5yZP0yewkRPYU10RQ5A+akLvls1Qtgnk 1cdKsOs0ShXx+NU9j/ONX0fQCFLtcART8Zd3Q9HsIpkE7gTMYid766dvvBI6sZAWY8RE CddmVzgcZK+ojM2Sdpm3Gf5T08YejJqzEHFy0yso8CcJGJkGMyNGJHQ5I/xzmWomBVAC trGw== X-Gm-Message-State: AKaTC01XGOP+/cUIPq7OV0flAXFyevqOSCqAs8s2xr0pJe79o4a037hfag6ZPtWtUxkUPcWAdThY8spsVo7BRw== X-Received: by 10.25.242.7 with SMTP id q7mr11087286lfh.19.1481561228551; Mon, 12 Dec 2016 08:47:08 -0800 (PST) Original-Received: by 10.114.77.161 with HTTP; Mon, 12 Dec 2016 08:46:47 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: VqlCn5wAlBegVD7omt4ao80iPvE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.67 X-Mailman-Approved-At: Mon, 12 Dec 2016 14:08:17 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111934 Archived-At: On Mon, Dec 12, 2016 at 9:10 PM, Filipe Silva wrot= e: > 1) The gui theme I use, zerodark (By Nicolas Petton, who is redesign > elpa.gnu.org), queries display-graphic-p everytime it goes about defining= a > palete element: > > https://github.com/NicolasPetton/zerodark-theme/blob/master/zerodark-them= e.el#L158-L162 (defun true-color-p () "Return non-nil on displays that support 256 colors." (or (display-graphic-p) (=3D (tty-display-color-cells) 16777216))) (let ((class '((class color) (min-colors 89))) (default (if (true-color-p) "#abb2bf" "#afafaf")) [=E2=80=A6] (background (if (true-color-p) "#282c34" "#333333")) [=E2=80=A6]) (custom-theme-set-faces 'zerodark `(default ((,class (:background ,background :foreground ,default)))= ) [=E2=80=A6]) There should be no reason to check capabilities of the current display at theme initialization time. Instead, the theme should state its preferred attributes for each supported type of display and let the face system deal with it. What the above code does is, taking into account only the frame which is selected at the time of initialization: * if its display is graphical or its terminal supports exactly 16777216 colors, then it sets the default face for 89-or-more-colored displays to #abb2bf on #282c34; * alternatively, if the display of that frame is non-graphical and its terminal supports a number of color other than 16777216, then it sets the default face for 89-or-more-colored displays to #afafaf on #333333. What it seems it *intended* to be doing is, unconditionally: * set the default face to #abb2bf on #282c34 for any color display supporting at least 16777216 colors (and it should not matter if it=E2=80= =99s graphical as long as it supports 24-bit color); and * set the default face to #afafaf on #333333 for all other displays; and * hope nothing breaks too badly on displays that are too primitive to display even that (which notably includes the Linux tty). (let ((truecolor '((class color) (min-colors 16777216)))) (custom-theme-set-faces 'zerodark `(default ((default (:background "#333333" :foreground "#afafaf")) (,truecolor (:background "#282c34" :foreground "#abb2bf"= )))) [=E2=80=A6]) > 3) there are some packages, like > https://github.com/7696122/evil-terminal-cursor-changer, > that only make sense in a tty frame. Since emacs --daemon does not know > what I'm going to use, (unless I use approach 2. which does not solve iss= ue > 1.) I can't really setup a condition that loads or not the package > accordingly. So load them always, and report bugs against them if they break in presence of frames of type they don=E2=80=99t expect.