unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	 emacs-devel@gnu.org,  Andrea Corallo <akrl@sdf.org>
Subject: Re: Native compilation of Keyboard Macros
Date: Sat, 17 Sep 2022 21:40:56 +0300	[thread overview]
Message-ID: <865yhlc093.fsf@mail.linkov.net> (raw)
In-Reply-To: <87k061g8m2.fsf@posteo.net> (Philip Kaludercic's message of "Sat,  17 Sep 2022 18:26:45 +0000")

>> 1. at level of complex command execution, such as from the history
>>    retrieved by `repeat-complex-command` (C-x ESC ESC), for example:
>>
>>    (rgrep "macro" "* .*" "emacs/lisp/")
>>
>> 2. at level of commands corresponding to all typed keys,
>>    such as retrieved by `view-lossage` (C-h l),
>>    for example, for the same as above:
>>
>>    M-x                ;; execute-extended-command
>>    r                  ;; self-insert-command
>>    g                  ;; self-insert-command
>>    r                  ;; self-insert-command
>>    <tab>              ;; minibuffer-complete
>
> Intuitively I would expect the first level to make more sense, though I
> see that when considering commands like `self-insert-command' you
> couldn't just deduce all the command invocations and wrap them in a
> `progn' body.  At the same time, what is there to compile on the second
> level?  You still need to look up all the commands and invoke them.  As
> Stefan said, it is perhaps necessary to either detect what commands can
> be safely converted into repeat-complex-command'-esque representations
> (and what commands can be assisted/transformed), and only optimise if
> that is possible.

Keyboard macros are executed on the keys level, so even the decision
what complex command to execute might depend on the position of that
command in the completion list of `M-x', e.g.:

      M-x        ;; execute-extended-command
      r          ;; self-insert-command
      <tab>      ;; minibuffer-complete
      <kp-prior> ;; switch-to-completions
      <tab>      ;; next-completion
      <tab>      ;; next-completion
      <tab>      ;; next-completion
      <tab>      ;; next-completion
      <return>   ;; choose-completion



  reply	other threads:[~2022-09-17 18:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 18:56 Native compilation of Keyboard Macros Philip Kaludercic
2022-09-16 19:27 ` Stefan Monnier
2022-09-17 17:52   ` Juri Linkov
2022-09-17 18:26     ` Philip Kaludercic
2022-09-17 18:40       ` Juri Linkov [this message]
2022-09-17 20:00         ` Philip Kaludercic
2022-09-18  3:12           ` Stefan Monnier
2022-09-18  5:02   ` Visuwesh
2022-09-18 13:46     ` Stefan Monnier
2022-09-16 19:54 ` Óscar Fuentes
2022-09-17 14:49   ` Philip Kaludercic
2022-09-17 15:33     ` Óscar Fuentes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=865yhlc093.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=akrl@sdf.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).