silex / elmacro Goto Github PK
View Code? Open in Web Editor NEWPackage to display keyboard macros or latest interactive commands as emacs lisp.
Package to display keyboard macros or latest interactive commands as emacs lisp.
First, thanks for an awesome library. I love it.
For some reason elmacro stops working after an C-g and only starts working again after toggling the mode off and on with (elmacro-mode) (elmacro-mode)
I understand that macro recording stops after C-g, however it can be resumed with C-u C-u C-x ( and one can even go in and edit the macro taking whatever caused the problem using C-x C-k C-e and have a working macro.
However is seems that elmacro is lost after the C-g, it doesn't seem to be able to use any macro recordings after that until it is reset by toggling the mode off and on.
It would be great if there would be some way to prevent C-g from causing such havoc on elmacro.
I'm certainly willing to edit the macro as needed (either in emacs macro editor, or via the list that elmacro generates) if I happen to cause a C-g as long as elmacro can continue to work and not get lost.
Thanks for any advice or help
In a buffer with emacs-lisp-mode and outshine-minor-mode, inserts are not correctly recorded, I get this when entering "hallo":
(defun last-macro ()
(interactive)
(outshine-self-insert-command 1)
(outshine-self-insert-command 1)
(outshine-self-insert-command 1)
(outshine-self-insert-command 1)
(outshine-self-insert-command 1))
If I disable outline, everyting works as expected.
Here's the relevant config which I use to enable outshine:
(require 'outshine)
(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
best,
Tom
UPDATE: same thing in org-mode, it records inserts as (org-self-insert-command 1)
.
Should be fairly easy to do. After the filtering refactor.
The README.md file at line 96 lists elmacro-clear-recorded-commands as the command to clear the recorded commands. However, in the refactoring done in the past the command was renamed to elmacro-clear-command-history.
Use Cask for this?
(evil-record-macro 113)
(command1)
(command2)
(command3)
(evil-record-macro nil)
Maybe refactor to introduce elmacro-macro-regexps
with pairs like "(evil-record-macro \d+)" . "(evil-record-macro nil)"
Given we have a register, maybe defun elmacro-show-evil-macro (register)
makes sense here.
Hi there.
I was really excited when I found elmacro! Unfortunately, I'm having problems with it. I've tried the example usage I saw on emacs.stackexchange:
F3 C-e M-b M-u C-a C-n F4
and then:
M-x elmacro-show-last-macro upcase-last-word
and got the error message:
You have to record a macro before using this command (F3/F4).
Please help! :'(
I have saved macros, from different sessions. I saved them using: M-x insert-kbd-macro
How is it possible to use "elmacro" with them? It seems elmacro only works with the last saved macro using F3 - F4. It doesn't seem to work with loaded macros.
extract macro with start-kbd-macro instead of kmacro-start-macro?
Something is wrong.
I got some time to try elmacro again, but if I use F3 inside a macro, it always shows "last-command-event" variable:
(defun last-macro2 ()
(interactive)
(setq last-command-event 13)
(org-return nil nil 1)
(setq last-command-event 13))
When I perform the following macro recording in org-mode:
(fset 'glossarer
[down home ?- ? S-end ?< ?< ?< ? ?: ?: delete ? ])
I get from elmacro-show-last-macro
this:
(defun last-macro ()
(interactive)
(next-line 1 1)
(beginning-of-visual-line 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(end-of-visual-line 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(org-self-insert-command 1)
(delete-forward-char 1 nil))
Which is not that useful.
The example macro is used to transform a line like this:
cursor-position
ABC
Meaning of ABC
to this:
- <<<ABC>>> :: Meaning of ABC
Note: I use smartparens.el
to insert <>
parens using this config:
(sp-with-modes 'org-mode
(sp-local-pair "<<" ">>" :unless '(sp-point-after-word-p) :post-handlers '(("[d1]" "SPC"))))
First off, thank you very much for this package, looks super promising!
However, looks like that the function elmacro-processor-prettify-inserts
fails to filter out the (setq last-command-event ...)
forms in Evil. This dosent' seem to be a problem without using Evil though.
Here's a simplest example of last-macro
:
(defun last-macro ()
(interactive)
(setq last-command-event 119) ; `w'
(evil-forward-word-begin nil)
(setq last-command-event 134217827)
(setq last-command-event 'f4))
Value should be nil by default, but if set to true it logs even what you do in smex
etc.
Maybe implement this as a processor where minibufferp
is recorded in elmacro-command-history
Right now your code that converts keyboard macros to equivalent Lisp commands seems very connected to the command history. It would be cleaner and more flexible if you could convert from a representation of the macro itself, either what insert-kbd-macro supplies or a command-event list (listify-key-sequence).
Suppose I create keyboard macros but don't execute them. I instead want to provide either
or a list of command events as input and have your program output a defun for the macro with each key sequence converted to the associated Lisp command call. That would be very useful. Would you add that? Would want to convert macros without polluting the command history.
Some people might not want commands to be recorded all the time and don't care about lossage?
Have an interface like:
(setq elmacro-record-type 'always)
(setq elmacro-record-type 'macro)
I think it's possible to transform isearch/phi-search into search-forward
calls. Maybe offer filters like isearch-refactor-filter
and isearch-minimal-filter
so people can choose the behavior?
Installation attempt from MELPA fails with an error:
File mode specification error: (void-function backward-sexp-mode)
Downloading the code from github and evaluating the code works, but running it gives an error after giving the name for the new function:
funcall: Symbol's function definition is void: backward-sexp-mode
Googling for "backward-sexp-mode" does not bring up anything.
I am running the latest emacs from git repo (v. 24.4.50.1). Where to find this dependency?
Something like browse-kill-ring
I have just installed elmacro on emacs 26.1.
When I try to invoke elmacro-show-last-macro, I get this error:
eval: Symbol’s value as variable is void: str
Where is str supposed to be defined?
Do you guys care about emacs 24.3 isearch support? Voice your opinion otherwise I'll just drop it.
elmacro will of course still work for everything, but isearch
use won't be completely reproducible.
This happens because the way isearch works changed quite a lot in emacs 24.4, and I'm planning a big refactor.
See related issue #5
elmacro-show-last-commands works, but elmacro-show-last-macro do not find the working macro.
In trying to record a macro I'm getting a bunch of file-notify-handle-event
calls:
(defun last-macro ()
(interactive)
(move-end-of-line 1)
(insert "fjdskl")
(file-notify-handle-event
`(file-notify
(307
(create)
".#observations.proto")
file-notify-callback))
(file-notify-handle-event
`(file-notify
(307
(write)
".#observations.proto")
file-notify-callback))
(file-notify-handle-event
`(file-notify
(306
(create)
".#observations.proto")
file-notify-callback))
I assumed this would be easy to filter out using elmacro-unwanted-commands-regexps
, so I set it equal to ("^(ido.*)$" "^(smex)$" "^(file-notify.*)$")
, but that doesn't work. I'm sure there is something simple I am missing.
Any hints on the right direction I should taking?
M-x checkdoc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.