From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Date: Sun, 07 Jun 2020 00:39:30 +0300 Message-ID: <37002b9ea3a869d7498f683cc5b573e8867cfcab.camel@yandex.ru> References: <7874555c5ba73c3b6b7c9c07e6bde015aa1c7fc7.camel@yandex.ru> <87o8q01mcp.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="37677"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.36.3 Cc: 41682@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 06 23:40:09 2020 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 1jhgXx-0009he-BK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 23:40:09 +0200 Original-Received: from localhost ([::1]:60348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhgXw-0000Ng-9f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 17:40:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhgXq-0000Kb-8A for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhgXp-0005f4-UW for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhgXp-0005ZO-RU for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jun 2020 21:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41682 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 41682-submit@debbugs.gnu.org id=B41682.159147958221378 (code B ref 41682); Sat, 06 Jun 2020 21:40:01 +0000 Original-Received: (at 41682) by debbugs.gnu.org; 6 Jun 2020 21:39:42 +0000 Original-Received: from localhost ([127.0.0.1]:52605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhgXV-0005Yj-K7 for submit@debbugs.gnu.org; Sat, 06 Jun 2020 17:39:41 -0400 Original-Received: from forward100p.mail.yandex.net ([77.88.28.100]:32952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhgXS-0005YT-O4 for 41682@debbugs.gnu.org; Sat, 06 Jun 2020 17:39:39 -0400 Original-Received: from mxback28o.mail.yandex.net (mxback28o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::79]) by forward100p.mail.yandex.net (Yandex) with ESMTP id A2B3E598040C; Sun, 7 Jun 2020 00:39:31 +0300 (MSK) Original-Received: from sas2-ee0cb368bd51.qloud-c.yandex.net (sas2-ee0cb368bd51.qloud-c.yandex.net [2a02:6b8:c08:b7a3:0:640:ee0c:b368]) by mxback28o.mail.yandex.net (mxback/Yandex) with ESMTP id X6Nm6WuvY0-dVeu8xRb; Sun, 07 Jun 2020 00:39:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591479571; bh=4sbIhXm0PtQMC0U6nGhn2kNqCmGJ/l4aQhUDLcxoy+c=; h=In-Reply-To:Cc:To:From:Subject:References:Date:Message-ID; b=rxSjdmVB5ha7tSkGvc/PdPJHz8drAeaZJ6Zb0nWpdUD7FggoSE6QN5pmPE2VqUlr5 qyQ2vdKco2K7M1FXbvITkwXc7wvgPur5A7fd3YD1IiRgMSK+pYrLK9bmGnQDrxvcGq 41V12W+Xr/IegCPi88DKBk4jfNI3dPAadyGcXtlI= Authentication-Results: mxback28o.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by sas2-ee0cb368bd51.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id KQDir2v2k8-dUWeTQVW; Sun, 07 Jun 2020 00:39:30 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <87o8q01mcp.fsf@tcd.ie> 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" Xref: news.gmane.io gmane.emacs.bugs:181637 Archived-At: On Wed, 2020-06-03 at 11:21 +0100, Basil L. Contovounesios wrote: > tags 41682 + notabug > quit > > Konstantin Kharlamov writes: > > > Functions added with (eval-after-load 'makefile-gmake-mode …) do > > not > > trigger when the mode is enabled > > I think you've misunderstood what eval-after-load does. > > 'makefile-gmake-mode' is a major mode function defined in the file > make-mode.el which provides the named feature 'make-mode'. See > (info "(elisp) Named Features") and (info "(elisp) Hooks for > Loading"). > > https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html > https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html > > eval-after-load, and its newer, preferred sibling with-eval-after- > load, > register some Lisp to be run when a file or named feature is or has > already been loaded. > > If you want to register some Lisp to run only once, after make- > mode.el > is loaded (and makefile-gmake-mode has been defined), then you should > write: > > (with-eval-after-load 'make-mode > (foo) > (bar)) > > If you want to register some Lisp to run every time makefile-gmake- > mode > is enabled, then you should write: > > (add-hook 'makefile-gmake-mode-hook #'foo) > > If you want to register some Lisp to run every time any make-mode.el > major mode is enabled, then you should write: > > (add-hook 'makefile-mode-hook #'foo) > > Is there some other case you're trying to address, or can this bug be > closed? > Thank you, I migrated my emacs config to use the `with-eval-after-load` you suggested, but stumbled upon a problem that it doesn't seem to work with python-mode. I tried as an argument `'python`, `'python-mode`, ``python.el`, `"python"`, `"python.el"` — none of that works for me. The code I'm trying to execute is simply: (with-eval-after-load 'python '(modify-syntax-entry ?_ "w" python-mode-syntax-table)) Simply removing the "with-" makes it work. Is there anything special about this macro I should know?