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:41:26 +0300 Message-ID: <550f45677fb17c42053fe5e39aeb8dcd0c98d5ff.camel@yandex.ru> References: <7874555c5ba73c3b6b7c9c07e6bde015aa1c7fc7.camel@yandex.ru> <87o8q01mcp.fsf@tcd.ie> <37002b9ea3a869d7498f683cc5b573e8867cfcab.camel@yandex.ru> 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="45231"; 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:42:10 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 1jhgZu-000BeY-EI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 23:42:10 +0200 Original-Received: from localhost ([::1]:33134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhgZt-000100-Em for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 17:42:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhgZl-0000zj-W4 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhgZl-00064D-NB for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:42:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhgZl-0005e2-Kn for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 17:42: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:42: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.159147969721653 (code B ref 41682); Sat, 06 Jun 2020 21:42:01 +0000 Original-Received: (at 41682) by debbugs.gnu.org; 6 Jun 2020 21:41:37 +0000 Original-Received: from localhost ([127.0.0.1]:52622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhgZM-0005dB-OC for submit@debbugs.gnu.org; Sat, 06 Jun 2020 17:41:37 -0400 Original-Received: from forward101j.mail.yandex.net ([5.45.198.241]:35759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhgZK-0005cq-Hd for 41682@debbugs.gnu.org; Sat, 06 Jun 2020 17:41:35 -0400 Original-Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward101j.mail.yandex.net (Yandex) with ESMTP id D1C3D1BE039F; Sun, 7 Jun 2020 00:41:27 +0300 (MSK) Original-Received: from myt6-9bdf92ffd111.qloud-c.yandex.net (myt6-9bdf92ffd111.qloud-c.yandex.net [2a02:6b8:c12:468a:0:640:9bdf:92ff]) by mxback20j.mail.yandex.net (mxback/Yandex) with ESMTP id XS2APGASST-fR3S8Ok3; Sun, 07 Jun 2020 00:41:27 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591479687; bh=yEAvH2zi+SiMXp/yFKJehv9d30i+O9UGcV7WrYRbjko=; h=In-Reply-To:Cc:To:From:Subject:References:Date:Message-ID; b=wFKTLECMOK/nalb2RSHe4MuJZ/PGJE8qapali3PDzISuPtqlEHGwuLdUafV6tbnZS pW+oCiholCxHEhcEu3op8AUOXf97xAbmLe0ILoL0eMnYY5MtF5mBSF3l2Hg2Svwooc cE0z161Q0XI0GdOQZXNUjbjdMlsAoTGxntCBWK+0= Authentication-Results: mxback20j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by myt6-9bdf92ffd111.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 8sf54ugYQa-fRXGVsH2; Sun, 07 Jun 2020 00:41:27 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <37002b9ea3a869d7498f683cc5b573e8867cfcab.camel@yandex.ru> 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:181638 Archived-At: On Sun, 2020-06-07 at 00:39 +0300, Konstantin Kharlamov wrote: > 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? I should add, according to documentation at least one of `'python.el` or `"python.el"` should be working.