unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What's the point of byte-compile-define-keymap?
@ 2021-11-27 16:36 Alan Mackenzie
  2021-11-28 13:30 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2021-11-27 16:36 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

It looks to me that byte-compile-define-keymap (in
lisp/emacs-lisp/bytecomp.el) saves its FORM argument in ORIG-FORM and
always returns it unchanged.  This looks like an oversight.

Also, would this function not better be named
byte-compile-FILE-FORM-define-keymap, since it is the value of a
byte-hunk-handler symbol property.

Also[2], is this function really necessary?  Is define-keymap used
sufficiently often to justify a special byte-hunk-handler for it?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the point of byte-compile-define-keymap?
  2021-11-27 16:36 What's the point of byte-compile-define-keymap? Alan Mackenzie
@ 2021-11-28 13:30 ` Lars Ingebrigtsen
  2021-11-28 13:43   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-28 13:30 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> It looks to me that byte-compile-define-keymap (in
> lisp/emacs-lisp/bytecomp.el) saves its FORM argument in ORIG-FORM and
> always returns it unchanged.  This looks like an oversight.

It was rewritten from a byte-optimize function (but it doesn't optimise
anything any more), so it should probably be cleaned up a bit more.

> Also, would this function not better be named
> byte-compile-FILE-FORM-define-keymap, since it is the value of a
> byte-hunk-handler symbol property.
>
> Also[2], is this function really necessary?  Is define-keymap used
> sufficiently often to justify a special byte-hunk-handler for it?

It just used to issue warnings for invalid keymap syntaxes at compile
time.  And, yes, it will be used everywhere.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the point of byte-compile-define-keymap?
  2021-11-28 13:30 ` Lars Ingebrigtsen
@ 2021-11-28 13:43   ` Stefan Monnier
  2021-11-28 13:45     ` Lars Ingebrigtsen
  2021-11-28 17:15     ` Mattias Engdegård
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2021-11-28 13:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Alan Mackenzie, emacs-devel

> It just used to issue warnings for invalid keymap syntaxes at compile
> time.  And, yes, it will be used everywhere.

BTW, you can use a `compiler-macro` for that instead of modifying the
byte-compiler.


        Stefan




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the point of byte-compile-define-keymap?
  2021-11-28 13:43   ` Stefan Monnier
@ 2021-11-28 13:45     ` Lars Ingebrigtsen
  2021-11-28 17:15     ` Mattias Engdegård
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-28 13:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Alan Mackenzie, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> BTW, you can use a `compiler-macro` for that instead of modifying the
> byte-compiler.

Somebody just volunteered to rewrite these using compiler macros
off-list.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the point of byte-compile-define-keymap?
  2021-11-28 13:43   ` Stefan Monnier
  2021-11-28 13:45     ` Lars Ingebrigtsen
@ 2021-11-28 17:15     ` Mattias Engdegård
  1 sibling, 0 replies; 5+ messages in thread
From: Mattias Engdegård @ 2021-11-28 17:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Alan Mackenzie, Lars Ingebrigtsen, Emacs developers

28 nov. 2021 kl. 14.43 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> you can use a `compiler-macro` for that instead of modifying the
> byte-compiler.

Done, fixing a compiler-macro annoyance while at it.
People who get build errors may need to bootstrap.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-28 17:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 16:36 What's the point of byte-compile-define-keymap? Alan Mackenzie
2021-11-28 13:30 ` Lars Ingebrigtsen
2021-11-28 13:43   ` Stefan Monnier
2021-11-28 13:45     ` Lars Ingebrigtsen
2021-11-28 17:15     ` Mattias Engdegård

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).