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: properly setting up ~/.emacs.d for daemon usage Date: Sun, 11 Dec 2016 11:10:12 -0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1481461913 18906 195.159.176.226 (11 Dec 2016 13:11:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 13:11:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 11 14:11:50 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 1cG3uv-0004Qv-QY for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Dec 2016 14:11:49 +0100 Original-Received: from localhost ([::1]:55664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG3v0-0006L9-0L for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Dec 2016 08:11:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG3uR-0006Js-7A for help-gnu-emacs@gnu.org; Sun, 11 Dec 2016 08:11:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cG3uM-000296-4w for help-gnu-emacs@gnu.org; Sun, 11 Dec 2016 08:11:19 -0500 Original-Received: from mail-io0-f169.google.com ([209.85.223.169]:35170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cG3uM-00028c-0M for help-gnu-emacs@gnu.org; Sun, 11 Dec 2016 08:11:14 -0500 Original-Received: by mail-io0-f169.google.com with SMTP id h30so131174720iod.2 for ; Sun, 11 Dec 2016 05:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=Eer8DZAXETimEzpH4V6wCShvVFEcO3a7w85Opw8cp5U=; b=tgg/tiEXqzrIbGYxNUnXb/xlmJmVbrHcpdSrSdCSXupYyNlci8pyCVp6+1I0ogWwhg xyl7KEaXwFOnuK6uOCOUa7p4kolbqgxf+pRngmzF/Uwhp2usoAca43kBtFS/tMcD/BGX g1Qce17r3A4btrk9okYhcDhQxwqxTe2/xnBcFVQDJnWuTyz3HTw5pQSLFMTYm2eGooXe we1X9DC/7fQOoT5sKIZ0uqwowsU6DqhLEtC+pDJ0KhpauCC7CumMj5jB5XKhCR5L3iby QWwozI7+iD/2EqkCN5f/jQQdDJedS3vtPg5NmU+zYl/VRGarPfYJzmZ+pQX1rdYKDtQH Ufvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Eer8DZAXETimEzpH4V6wCShvVFEcO3a7w85Opw8cp5U=; b=We/xy9Q+SgYe21L/gpDXjZ/Jj9+Too1uc5R9JYGUwBmn1T1op3F4x0msxS+NrMJgwn sOCxhSCMkjBPOE78Kcct0wiazV2+3GgQB7PUKK1C3PNHuPR2L0euJiRSwAmD0XlmYUvA MQG1TKQLS4HgSXgAttspicKZ3EiuVKoRHwrAG/7OjVIZrUydbsFZXW1zdg/aBfgsLRY7 BU4OPIrJJOtLdGHcGwmTpWLnxf3ogwbGzPX7SVoAVCjcDRNDIr0hJoQ0UgOUXBO6U3Xt NeZfpK0BeEyA+H1Fr40tI/3Bm16YHQVinWTPsX0JW5tVx63m8t8cQcPPrVYWX6sRrPP0 ky4Q== X-Gm-Message-State: AKaTC03iakBYRjpC6hnRtpOOMx5H9MeDNiF5cF2yuM2ghOmTX2336ULv96899ohdDW5dm75YGRU4KFNrDHkxPw== X-Received: by 10.36.190.206 with SMTP id i197mr13119349itf.70.1481461812955; Sun, 11 Dec 2016 05:10:12 -0800 (PST) Original-Received: by 10.79.152.10 with HTTP; Sun, 11 Dec 2016 05:10:12 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.223.169 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:111913 Archived-At: Dear users and developers of the mighty emacs editor, I'm deeply in love with the --deamon feature, but I'm encountering a scenario that I'm having a hard time to solve. When I start emacs with emacs --daemon, emacs does not know if I wan't to run emacs as a GUI or inside a terminal, therefore all the checks inside my ~/.emacs.d init code which use (display-graphic-p) will not work, e.g. emacs will think that I have no gui because display-graphic-p will return nil. likewise, using (daemon-p) while my `~/.emacs.d/` config is loading up will not work because emacs has not loaded yet: the daemon boostrap procedure is not complete so (daemon-p) dutifully returns nil. The end result is: if I later try to connect to said daemon using emacsclient pulling up a gui-frame, all the colors are off because emacs thought that I had no gui. Seems that the solution for that would be to put a hook somewhere that would activate when an emacs frame is created. In this hook, I'd have to put all my initialization code that is gui-dependent. Make sense? How would an emacs user properly setup his ~/.emacs.d/ so that it plays well with the daemon feature? thanks in advance, Ninrod