From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Help using the right hook for loading theme on emacs daemon GUI Date: Fri, 25 Jan 2019 09:20:23 +0200 Message-ID: <838sz96w5k.fsf@gnu.org> References: <6c1611672809c8d7b5011edf0d2dd831@webmail.orcon.net.nz> <83va2e6t7r.fsf@gnu.org> <83d0ol7scu.fsf@gnu.org> <96a9c5ec62a7325429555fe939392450@webmail.orcon.net.nz> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7400"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org, kaushal.modi@gmail.com To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 25 08:20:44 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmvnA-0001o7-4M for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2019 08:20:44 +0100 Original-Received: from localhost ([127.0.0.1]:39545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmvn8-0005rA-7R for ged-emacs-devel@m.gmane.org; Fri, 25 Jan 2019 02:20:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmvmx-0005qm-7d for emacs-devel@gnu.org; Fri, 25 Jan 2019 02:20:31 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmvmu-0002Vs-Mh; Fri, 25 Jan 2019 02:20:29 -0500 Original-Received: from [176.228.60.248] (port=1414 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gmvmu-000739-7u; Fri, 25 Jan 2019 02:20:28 -0500 In-reply-to: <96a9c5ec62a7325429555fe939392450@webmail.orcon.net.nz> (message from Phil Sainty on Fri, 25 Jan 2019 14:42:53 +1300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232680 Archived-At: > Date: Fri, 25 Jan 2019 14:42:53 +1300 > From: Phil Sainty > Cc: kaushal.modi@gmail.com, emacs-devel@gnu.org > > I forgot to add -- the point I originally thought this docstring needed > to make was that FRAME will not be selected when the hook runs, and it > is > up to the function to select it if required. Well, since FRAME is being passed as an argument to the hook, it should be quite clear the frame is not selected, otherwise it would make no sense to pass that argument, right? But I see no harm in saying that explicitly. > I'd be inclined to have the docstring suggest that the following be used > in that scenario: > > (with-selected-frame FRAME > ...) I wouldn't make this so explicit. Selecting a frame affects Emacs in significant ways, and the hook might not need that at all. I think saying that the frame is not selected should be enough; any Lisp programmer can then decide for themselves whether they really need to select the frame for whatever they need to do in the hook.