From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf Schlatte Newsgroups: gmane.emacs.bugs Subject: bug#72818: 29.4; Cannot hook with use-package if variable is not `-hook'$ Date: Mon, 26 Aug 2024 13:15:50 +0200 Message-ID: References: <87seurh7xe.fsf@telenieko.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10083"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 72818@debbugs.gnu.org Cancel-Lock: sha1:tqpldC6FvFFkIHDroSn3XBN1wGY= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 26 13:17:44 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1siXjE-0002O5-26 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Aug 2024 13:17:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1siXil-00007c-Dt; Mon, 26 Aug 2024 07:17:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1siXij-000075-38 for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 07:17:13 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1siXih-0003QA-Ro for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 07:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Mime-Version:References:Date:From:To:In-Reply-To:Subject; bh=JsizqDN8jI5AuzEh3Fh3goP9Ba2jcM+yZrCzrOLAJao=; b=Yryj0Y/muER2716jxia6yJM0jVtF6dQEg8VIka+qgb7IMYJMsA0t4kKO+vQZJ0yz6jnl8601o1VT4wwGoTdQH2i5qJSyJKXQDBBHZS2Oi3+ZYMGJl2/I3PiPebOdsM4xHV3Gw4MhrYSgQ/z83Nh0r4KnGtwPMd0F6+ce3754oBcY35il6IPx4+xW4jAdM5asW4SKOo3tzngmlYeihdDmvEj6BR71oWmB/UZLo9kWVvgQAH9AkN+3QCO8g64Em7aHLNrj2MaN/RMyqkINWa1OI31e66Z6RKF3CsEs5b+xe+d6589XEjLZFDqPLAJ8/gcYn9/QLqv5wKy7UudegeUTag==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1siXjW-0001QO-H8 for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 07:18:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87seurh7xe.fsf@telenieko.com> Resent-From: Rudolf Schlatte Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Aug 2024 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72818 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17246710225361 (code B ref -1); Mon, 26 Aug 2024 11:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Aug 2024 11:17:02 +0000 Original-Received: from localhost ([127.0.0.1]:43808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siXiY-0001OD-6D for submit@debbugs.gnu.org; Mon, 26 Aug 2024 07:17:02 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siXiU-0001Nu-TA for submit@debbugs.gnu.org; Mon, 26 Aug 2024 07:17:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1siXhf-0008W3-G1 for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 07:16:07 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1siXhZ-0003Mv-QC for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 07:16:06 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1siXhW-0000eV-Jd for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 13:15:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290780 Archived-At: Marc Fargas writes: > Hi, > > In the Emacs LISP Manual you see: > > -- Variable: after-make-frame-functions > An abnormal hook run by ‘make-frame’ after it created the frame. > Each function in ‘after-make-frame-functions’ receives one > argument, the frame just created. > > This hook cannot be configured with `use-package' :hook keyword as it > does not end in `-hook'. > > The following example will result in `after-make-frame-functions-hook' > being created instead of adding the function to `after-make-frame-functions': > > (use-package fontaine ; Fonts! > :ensure t > :hook ((after-make-frame-functions . ; Apply fontaine to new frames > (lambda(frame) > (with-selected-frame frame > (fontaine-apply-current-preset))))) > ; :custom removed for brevity. > :config > (when (display-graphic-p) > (if (> (frame-monitor-attribute 'scale-factor) 1.0) > (fontaine-set-preset 'large) > (fontaine-set-preset 'regular)))) FWIW, I have customized `use-package-hook-name-suffix' to NIL since I prefer to be able to grep for where my hook variables are set. That this value is T by default might be a bit unfortunate, but I guess can't be changed since there is tons of documentation and code that relies on the implicit renaming in the `:hook' clauses of `use-package' forms.