From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipe Silva Newsgroups: gmane.emacs.help Subject: Re: properly setting up ~/.emacs.d for daemon usage Date: Mon, 12 Dec 2016 12:10:11 -0200 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 1481553077 11719 195.159.176.226 (12 Dec 2016 14:31:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 14:31:17 +0000 (UTC) To: help-gnu-emacs@gnu.org, =?UTF-8?Q?=C3=93scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 12 15:31:08 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 1cGRdC-0001Sr-QO for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 15:31:06 +0100 Original-Received: from localhost ([::1]:52176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGRdH-0005U6-0A for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 09:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGRL0-0007xB-T2 for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 09:12:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGRKy-0008Ge-1n for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 09:12:18 -0500 Original-Received: from mail-io0-f171.google.com ([209.85.223.171]:34667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGRKx-00088g-Rr for help-gnu-emacs@gnu.org; Mon, 12 Dec 2016 09:12:15 -0500 Original-Received: by mail-io0-f171.google.com with SMTP id p42so176552092ioo.1 for ; Mon, 12 Dec 2016 06:11:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=5XEeV1yDQr3u6XsDH9+CA8uDy478F53bGwCxUAwHPTs=; b=Q4FdqJxpX4CXG1JMssJ+Rvnk7Lq/8menXKr2h1RzdI+CQXXS+XhpAj8x6Z6bTO34oN AJnDvWHR6fQZjpJyd+3Ghh2uhwzctenSeNZ7FouixORVXjOIniM61mTBcXe0NA8HGmsA N8SRW66ld7l4J0CmSrtal0ZnS9/lXQl0iqj0SMt0rXz/wA6LafukDp3HZAyJalRnPBcr ujtflHqlkoKwYwxCyvxTj05hqme87V+p8WkPZoP3SWKFoWn5xYnAXp98UPXm3I7elQQY 73V84SrpbttihnJrFzPoqA0J8YJf7qr8M0ibT5nLPk/Us9r35ajmPQ/fHJweN/38LWNv QfGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=5XEeV1yDQr3u6XsDH9+CA8uDy478F53bGwCxUAwHPTs=; b=A0Z160ziiWDn1kMfj8s/9AZ/GWlrTnGYhWKxyiSMk7b3/QybxwjpI+QflvQlaG9JF2 R/TjkE4JpzCqNLmKa5STi0fSoERbZ7VoeVxBlFAt6JtXoqSYNQ/1AYMLA+lCqujlLTiu C4E2if1oSN/ekm/9thSCsGCChVlVEzIWwyBmAJvpUMFb271np/xBPx73YY3x35oq7hGB i+bmasSmXjN1wTwOLAiHAzIMtWgwWq1ZQM8DWEAOqWIhXSL84BIuLRGq8hXHmh1seOPw wmavW1QAv5P4vaD8+691UoWd+IfrOkqhxDZfrbndYYdlR3zN2WUw4dhLk6hkcJz3T3LS 9urw== X-Gm-Message-State: AKaTC03gloLF0ITM3rtwVsa4WGdyzGx8zYIRZNuXhoS6Ap5pvBhSDuC7NOgIvCNrbPkfS8v1xRD4OB6gq7AOVA== X-Received: by 10.36.31.200 with SMTP id d191mr8887629itd.70.1481551811884; Mon, 12 Dec 2016 06:10:11 -0800 (PST) Original-Received: by 10.79.152.10 with HTTP; Mon, 12 Dec 2016 06:10:11 -0800 (PST) In-Reply-To: <87eg1ew32r.fsf@wanadoo.es> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.223.171 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:111929 Archived-At: =E2=80=8B=C3=93scar, sure. Here are some specifics: 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 So If I load my emacs with emacs --daemon, in the configuration section that calls (load-theme), (display-graphic-p) will not work because emacs does not know if I'll go tty or gui. That type of code is prevalent in various other popular themes. Here's spacemacs using display-graphic-p: https://github.com/nashamri/spacemacs-theme/blob/master/spacemacs-common.el= #L69-L72 2) I would be glad if I could define two separate themes for gui and for tty. I'd even be willing to have two separate daemons: one for gui, and one for tty. I've already did that with success using (setq server-use-tcp t). and then: emacs --daemon=3Dgui emacs --daemon=3Dtty emacsclient --server-file=3D =E2=80=8Bgui -c -n emacsclient --server-file=3D =E2=80=8Btty -c -n =E2=80=8BBut this does not solve issue 1). 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. =E2=80=8BI think that sums it up, Thoughts? Thanks in advance Ninrod.=E2=80=8B On Mon, 12 Dec 2016 at 00:10 =C3=93scar Fuentes wrote: > Filipe Silva writes: > > > > [snip] > > > > > Make sense? How would an emacs user properly setup his ~/.emacs.d/ so > that > > > it plays well with the daemon feature? > > > > What's your specific problem? Themes should work fine regardless of you > > using --daemon. Just call load-theme as usual. > > > > If you want different settings for graphical frames than from text > > frames, use after-make-frame-functions. There, put a function that > > checks if the current frame is graphical/textual and apply the > > corresponding settings. > > > > FWIW, I use --daemon all the time and so far had no need for such > > function. If the above still does not resolve your problem, please show > > one of those snippets which depend on display-graphic-p. > > > > > >