* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
@ 2020-06-03 8:19 Konstantin Kharlamov
2020-06-03 8:23 ` bug#41682: Konstantin Kharlamov
2020-06-03 10:21 ` bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Basil L. Contovounesios
0 siblings, 2 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-03 8:19 UTC (permalink / raw)
To: 41682
Functions added with (eval-after-load 'makefile-gmake-mode …) do not
trigger when the mode is enabled
# Steps to reproduce:
1. Run: emacs -Q --eval '(eval-after-load 'makefile-gmake-mode '(save-
buffers-kill-emacs))'
2. In Emacs window opened execute: M-x makefile-gmake-mode
## Expected
Emacs quits (because the save-buffers-kill-emacs gets executed)
## Actual
Mode gets enabled, but nothing happens otherwise.
# Version
GNU Emacs 27.0.50 (build 15, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.17.3) of 2020-06-01
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682:
2020-06-03 8:19 bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Konstantin Kharlamov
@ 2020-06-03 8:23 ` Konstantin Kharlamov
2020-06-03 10:21 ` bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Basil L. Contovounesios
1 sibling, 0 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-03 8:23 UTC (permalink / raw)
To: 41682
Sorry, a typo, this line:
> 1. Run: emacs -Q --eval '(eval-after-load 'makefile-gmake-mode
'(save-buffers-kill-emacs))'
Should be:
1. emacs -Q --eval "(eval-after-load 'makefile-gmake-mode '(save-
buffers-kill-emacs))"
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-03 8:19 bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Konstantin Kharlamov
2020-06-03 8:23 ` bug#41682: Konstantin Kharlamov
@ 2020-06-03 10:21 ` Basil L. Contovounesios
2020-06-03 10:25 ` Konstantin Kharlamov
2020-06-06 21:39 ` Konstantin Kharlamov
1 sibling, 2 replies; 9+ messages in thread
From: Basil L. Contovounesios @ 2020-06-03 10:21 UTC (permalink / raw)
To: Konstantin Kharlamov; +Cc: 41682
tags 41682 + notabug
quit
Konstantin Kharlamov <hi-angel@yandex.ru> 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?
--
Basil
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-03 10:21 ` bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Basil L. Contovounesios
@ 2020-06-03 10:25 ` Konstantin Kharlamov
2020-06-03 10:30 ` Basil L. Contovounesios
2020-06-06 21:39 ` Konstantin Kharlamov
1 sibling, 1 reply; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-03 10:25 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 41682
On Wed, 2020-06-03 at 11:21 +0100, Basil L. Contovounesios wrote:
> tags 41682 + notabug
> quit
>
> Konstantin Kharlamov <hi-angel@yandex.ru> 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 for through explanation! Sure, this bug can be closed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-03 10:25 ` Konstantin Kharlamov
@ 2020-06-03 10:30 ` Basil L. Contovounesios
0 siblings, 0 replies; 9+ messages in thread
From: Basil L. Contovounesios @ 2020-06-03 10:30 UTC (permalink / raw)
To: Konstantin Kharlamov; +Cc: 41682-done
Konstantin Kharlamov <hi-angel@yandex.ru> writes:
> On Wed, 2020-06-03 at 11:21 +0100, Basil L. Contovounesios wrote:
>
>> Is there some other case you're trying to address, or can this bug be
>> closed?
>
> Thank you for through explanation! Sure, this bug can be closed.
Thanks for confirming, closing.
--
Basil
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-03 10:21 ` bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Basil L. Contovounesios
2020-06-03 10:25 ` Konstantin Kharlamov
@ 2020-06-06 21:39 ` Konstantin Kharlamov
2020-06-06 21:41 ` Konstantin Kharlamov
2020-06-06 22:26 ` Basil L. Contovounesios
1 sibling, 2 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-06 21:39 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 41682
On Wed, 2020-06-03 at 11:21 +0100, Basil L. Contovounesios wrote:
> tags 41682 + notabug
> quit
>
> Konstantin Kharlamov <hi-angel@yandex.ru> 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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-06 21:39 ` Konstantin Kharlamov
@ 2020-06-06 21:41 ` Konstantin Kharlamov
2020-06-06 22:26 ` Basil L. Contovounesios
1 sibling, 0 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-06 21:41 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 41682
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 <hi-angel@yandex.ru> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-06 21:39 ` Konstantin Kharlamov
2020-06-06 21:41 ` Konstantin Kharlamov
@ 2020-06-06 22:26 ` Basil L. Contovounesios
2020-06-06 22:36 ` Konstantin Kharlamov
1 sibling, 1 reply; 9+ messages in thread
From: Basil L. Contovounesios @ 2020-06-06 22:26 UTC (permalink / raw)
To: Konstantin Kharlamov; +Cc: 41682
Konstantin Kharlamov <hi-angel@yandex.ru> writes:
> 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?
Yes, its BODY should not be quoted:
(with-eval-after-load 'python
(modify-syntax-entry ?_ "w" python-mode-syntax-table))
--
Basil
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks
2020-06-06 22:26 ` Basil L. Contovounesios
@ 2020-06-06 22:36 ` Konstantin Kharlamov
0 siblings, 0 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-06 22:36 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 41682
Thank you!
On Sat, 2020-06-06 at 23:26 +0100, Basil L. Contovounesios wrote:
> Konstantin Kharlamov <hi-angel@yandex.ru> writes:
>
> > 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?
>
> Yes, its BODY should not be quoted:
>
> (with-eval-after-load 'python
> (modify-syntax-entry ?_ "w" python-mode-syntax-table))
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-06-06 22:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-03 8:19 bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Konstantin Kharlamov
2020-06-03 8:23 ` bug#41682: Konstantin Kharlamov
2020-06-03 10:21 ` bug#41682: makefile-gmake-mode does not trigger "eval-after-load"'s hooks Basil L. Contovounesios
2020-06-03 10:25 ` Konstantin Kharlamov
2020-06-03 10:30 ` Basil L. Contovounesios
2020-06-06 21:39 ` Konstantin Kharlamov
2020-06-06 21:41 ` Konstantin Kharlamov
2020-06-06 22:26 ` Basil L. Contovounesios
2020-06-06 22:36 ` Konstantin Kharlamov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.