all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Filipe Silva <filipe.silva@gmail.com>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: properly setting up ~/.emacs.d for daemon usage
Date: Mon, 12 Dec 2016 23:46:47 +0700	[thread overview]
Message-ID: <CAP_d_8VxthbshgcMHPVOq1sj23JN8KLVZrT_u0U1Jb=yZE-hzA@mail.gmail.com> (raw)
In-Reply-To: <CAEwkUWPizZCq3Bzn9cc3CyVzeqg9Z9CRH-9CfJAKUhyPdZq3OA@mail.gmail.com>

On Mon, Dec 12, 2016 at 9:10 PM, Filipe Silva <filipe.silva@gmail.com> wrote:

> 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-theme.el#L158-L162

    (defun true-color-p ()
      "Return non-nil on displays that support 256 colors."
      (or
        (display-graphic-p)
        (= (tty-display-color-cells) 16777216)))

    (let ((class '((class color) (min-colors 89)))
          (default (if (true-color-p) "#abb2bf" "#afafaf"))
          […]
          (background (if (true-color-p) "#282c34" "#333333"))
          […])
      (custom-theme-set-faces
        'zerodark
        `(default ((,class (:background ,background :foreground ,default))))
        […])

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’s
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"))))
        […])

> 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 issue
> 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’t expect.



  parent reply	other threads:[~2016-12-12 16:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 13:10 properly setting up ~/.emacs.d for daemon usage Filipe Silva
2016-12-11 21:47 ` Óscar Fuentes
2016-12-12 14:10   ` Filipe Silva
2016-12-12 15:34     ` Óscar Fuentes
2016-12-12 18:47       ` Filipe Silva
2016-12-12 19:48         ` Óscar Fuentes
2016-12-13 11:07         ` Yuri Khan
2016-12-13 21:31           ` Filipe Silva
2016-12-13 21:51             ` Óscar Fuentes
2016-12-13 23:49               ` Kaushal Modi
2016-12-14 11:26                 ` Filipe Silva
2016-12-13 22:53             ` Filipe Silva
2016-12-13 23:14               ` Óscar Fuentes
2016-12-12 16:46     ` Yuri Khan [this message]
2016-12-12 19:29       ` Eli Zaretskii
2016-12-11 23:17 ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to='CAP_d_8VxthbshgcMHPVOq1sj23JN8KLVZrT_u0U1Jb=yZE-hzA@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=filipe.silva@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ofv@wanadoo.es \
    /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 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.