From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: properly setting up ~/.emacs.d for daemon usage Date: Tue, 13 Dec 2016 23:49:30 +0000 Message-ID: References: <87eg1ew32r.fsf@wanadoo.es> <871sxdw48l.fsf@wanadoo.es> <87k2b3v6pc.fsf@wanadoo.es> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1481673101 20016 195.159.176.226 (13 Dec 2016 23:51:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2016 23:51:41 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , Help Gnu Emacs mailing list To: Filipe Silva Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 00:51:37 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 1cGwr9-0004Lj-N9 for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 00:51:35 +0100 Original-Received: from localhost ([::1]:44662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGwrE-00076u-0S for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Dec 2016 18:51:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGwqk-0006yd-Uq for help-gnu-emacs@gnu.org; Tue, 13 Dec 2016 18:51:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGwqg-0005Sg-Th for help-gnu-emacs@gnu.org; Tue, 13 Dec 2016 18:51:10 -0500 Original-Received: from mail-vk0-f41.google.com ([209.85.213.41]:36691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGwqg-0005Qu-Q6 for help-gnu-emacs@gnu.org; Tue, 13 Dec 2016 18:51:06 -0500 Original-Received: by mail-vk0-f41.google.com with SMTP id p9so4205795vkd.3 for ; Tue, 13 Dec 2016 15:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hVUv8f3Q92Ye7caY6ioJXZ2bfYqSA8GOMgAcOW6nGZU=; b=rl/ZvrAElS/giwyxpmhWKTriI97hTMEC55o38hzoL8OZg/S4Kj9S3efVZ3A9JOtBAo Go0VRftQOSeBaydRwd5RbEFUQUHMr+cQXlLeaFQ/lrkEBTWoPsfvhfyo+LqoTImBKxvo v436dEMiHXVBRpL7KANTqWVcqNYolnynesgKJkaZVLKUcFfVU6Tt0Wsh86MDltrtdGDa ySqEX6IOm6LPDuxmfKGhZQ2KZ+oHd9ZoLgkk0y20s8dVq9CgHEewqlt1G5bP14jw3DGi v3ANhDWqkZqZINNl8g5kBl5hE2O6BjVNdaXKVae38yJtyMzw4oH3+a9RlweNmPs+q5zR yWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hVUv8f3Q92Ye7caY6ioJXZ2bfYqSA8GOMgAcOW6nGZU=; b=e42XKiCLVn8jj2NxlUFNFpDIUdJ25d15e+TqBLMQ9gq0e2UnXLcV3RsmEnLBN0vH8R waHWgh9syxSobh4/26G7ceeX7pxXKGs8Qoy4sIpQioXRwm3WdCcbwPiAPiV8b1Kyd9Gl FjZ1VpFT4NBNqGc2ZMIiTXHybwwbIZ/I1JuejGxzbHJESH6YVfzW9LyI5raWeIporjyQ SBa6jtDykquyM3y9A2SDmVM3a9jBH1XYbZ18gXeGt5gG8Px/aN1hJzwSzO7/urjB9Y1y Pht8LYEcHZnStaIXNS5iF0v+KZOHK/1sRKGLwRcqKzMJwKd1qhE69Ri5GR2Q8wLhk3CH dtSg== X-Gm-Message-State: AKaTC03wZOipESl0lHsJ1im+s+PRYdXQGGQYDv23KeIaaPukYjOGY/Ye1R/waNSrFZ/ZxqsiEqUepk56KnpjAg== X-Received: by 10.176.71.134 with SMTP id v6mr71337951uac.174.1481672982525; Tue, 13 Dec 2016 15:49:42 -0800 (PST) In-Reply-To: <87k2b3v6pc.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.213.41 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:111946 Archived-At: Hi Filipe, I have stumbled across this in the past. Here's the solution that works for me to get a config that works when daemonp is nil/non-nil and display-graphic-p is nil/non-nil: https://github.com/kaushalmodi/.emacs.d/blob/master/init.el Search for focus-in-hook in there and look at that code and the comment explanation above that. I am traveling, else I would have typed clean directly reusable code snippets over here. Another way to deal with setup that works regardless of the session being daemonp is to load the setup after some delay. I do that for loading desktop sessions: ;; Delay desktop setup by a second. ;; - This speeds up emacs init, and ;; - Also (n)linum and other packages would already be loaded which the files ;; being loaded from the saved desktop might need. (use-package setup-desktop :defer 1) So there are no daemonp startup issues like "linum font face not defined", etc. About loading themes, I do that in window-setup-hook, because that always runs whether or not daemonp is non-nil. Search for window-setup-hook in https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-visual.el Hope this helps. -- Kaushal Modi