Convert Emacs macro into Elisp?

Nope, sorry. There is no trivial way to convert an emacs macro into elisp Update: There's been some work on Emacs to start down this path. See this thread as a starting point.It's still not possible (June 2010), but there's activity The first reason I can think of is dealing with interactive commands and translating keystrokes into proper arguments for functions Think of the following sequence: C-x be .

Em TAB RET This begins the command to switch to a buffer, types three characters, uses TAB completion to complete it and RET to accept. The equivalent lisp for the end result (in an emacs session where the TAB completion is unique) is: (switch-to-buffer ". Emacs") Thinking of completion, there are also interactions with expansion of all types ( dabbrev hippie-expand etc. ) A starting point can be M-x edit-last-kbd-macro which (in my case) shows this: Keyboard Macro Editor.

Press C-c C-c to finish; press C-x k RET to cancel. ;; Original keys: C-x be . Em RET Command: last-kbd-macro Key: none Macro: C-x be ;; switch-to-buffer .

Em ;; self-insert-command * 3 ;; pabbrev-expand-maybe RET ;; newline-and-indent Which at least gives you some of the function names. But you'll see that RET is labeled as newline-and-indent which is incorrect because at the time of the macro execution, the minibuffer is active and the binding is in fact minibuffer-complete-and-exit Similarly, the proper binding for TAB is minibuffer-complete.

Nope, sorry. There is no trivial way to convert an emacs macro into elisp. Update: There's been some work on Emacs to start down this path.

See this thread as a starting point. It's still not possible (June 2010), but there's activity. The first reason I can think of is dealing with interactive commands and translating keystrokes into proper arguments for functions.

Think of the following sequence: C-x be . Em TAB RET This begins the command to switch to a buffer, types three characters, uses TAB completion to complete it and RET to accept. The equivalent lisp for the end result (in an emacs session where the TAB completion is unique) is: (switch-to-buffer ".

Emacs") Thinking of completion, there are also interactions with expansion of all types (dabbrev, hippie-expand, etc. ). A starting point can be M-x edit-last-kbd-macro which (in my case) shows this: ;; Keyboard Macro Editor. Press C-c C-c to finish; press C-x k RET to cancel.

;; Original keys: C-x be . Em RET Command: last-kbd-macro Key: none Macro: C-x be ;; switch-to-buffer . Em ;; self-insert-command * 3 ;; pabbrev-expand-maybe RET ;; newline-and-indent Which at least gives you some of the function names.

But you'll see that RET is labeled as 'newline-and-indent which is incorrect because at the time of the macro execution, the minibuffer is active and the binding is in fact 'minibuffer-complete-and-exit. Similarly, the proper binding for TAB is 'minibuffer-complete.

Thanks for the update, Trey. Looks interesting. – Sahas Aug 6 '10 at 4:50.

There is no trivial way to convert an emacs macro into elisp. Update: There's been some work on Emacs to start down this path. See this thread as a starting point.

It's still not possible (June 2010), but there's activity.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions