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: Wed, 14 Dec 2016 09:26:42 -0200 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 1481714893 10241 195.159.176.226 (14 Dec 2016 11:28:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 11:28:13 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , Help Gnu Emacs mailing list To: Kaushal Modi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 12:28: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 1cH7jD-0001ro-Ff for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 12:28:07 +0100 Original-Received: from localhost ([::1]:46878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH7jH-0001TH-Nf for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 06:28:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cH7is-0001PF-IW for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 06:27:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cH7ip-0001v9-Gx for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 06:27:46 -0500 Original-Received: from mail-io0-f181.google.com ([209.85.223.181]:35027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cH7ip-0001uy-BS for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 06:27:43 -0500 Original-Received: by mail-io0-f181.google.com with SMTP id h30so34600680iod.2 for ; Wed, 14 Dec 2016 03:27:43 -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 :cc; bh=fLnR3NXPjtt+S0LmUJEGfd45lRIqPLvUvrjL24Dy7eM=; b=cn/PILthjQYlYu432eLQj9wQxdHse/Bro/JZ38LKj7HTHFzsfr/0bv4q3B17HF2yd7 6+yKgDGaRz5KC9fZ5kxA/NjO9WqJBaKRRjb4Qxm6BFUOarKtGoKa/K1X6NdNqaG5x+DB WY02OUkiSZA4kM8ToNzlYtc9Y5UJTn1iPHMsNwU3frQxQHCayKlk/OPv2AWJcOfAAhhv zB331asDuqLJ2GxuU88hiEduC0I7kCymCyOtXtmlGE/8PO4FEXsCjujd1c+DI1YJMR1O F1ExLO6Zqi+6jkUc/hwxVAtYmFwEiGXqox2pGDFxFmAdwvifc0oSSMc7Q4w0zQbg8Qwq 7sxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fLnR3NXPjtt+S0LmUJEGfd45lRIqPLvUvrjL24Dy7eM=; b=HTRXdisWId899gjCyQJFfvod2ru6uCWlK0+uJy4UNUVkh9I+lSqmdNMIE5/6LVG0a0 uhVFvP27siik1trs3UmjGBO+FipUrr/3xE5lQVdC9Ep5YeSvFgjSDuOs55Xe+kbV95ku 8o3cjaatqYu46DaEAGsnBCFwHriB6yldK3I6+uzTOxMDg3tOdH8JEWP+H1gIqfvWCbn+ bAs6C+MSBsE3Q5b5z8X/MNlTx2FmtxXmCBlKdgOINb9JuReSRzq3K2+9UtSGDqYfZh9T 1IluSkyXBDoyaMCJ8ubyIU1WKlImNkX5bRJxqhNpDzm0uV5t+wamGAVOkZiZ6cVa8W7Z dDqQ== X-Gm-Message-State: AKaTC02Uk1mCqZQozqQ3MOn8MpAoc0bb56q+CCaui7uFJ6OWEKA7ObiKXQS5ijMhNorFyrNvIIKR34XOZc8zXQ== X-Received: by 10.107.63.198 with SMTP id m189mr90905794ioa.56.1481714802762; Wed, 14 Dec 2016 03:26:42 -0800 (PST) Original-Received: by 10.79.152.10 with HTTP; Wed, 14 Dec 2016 03:26:42 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.223.181 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:111953 Archived-At: Kaushal, I found it: https://github.com/kaushalmodi/.emacs.d/blob/master/init.el#L345-L358 This looks very interesting. I'll try that. Thanks. Ninrod On Tue, Dec 13, 2016 at 9:49 PM, Kaushal Modi wrote: > 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 >