In Emacs I made very useful buttons.
F11 - start writing a macro.If F11 was pressed before - stop writing a
macro.
F12 - execute macro.

For example, I have a LaTeX file, in which I must write subscripts for
the line:

A1, A2, ..., An

transfer it to:

$A_1$, $A_2$, ..., $A_n$

1. I go to the beginning of the line.
2. Press F11 - macro writing has started.
3. Put $:

$A1, A2, ..., An

click -> (right arrow) _ -> $

and have:
$A_1$, A2, ..., An

4. F11 - macro writing has stopped.
5. Then I put the cursor before each "A" symbol, left and press F12 -
the sequence of my commands is repeated. And I have all the
subscripts.

Is it possible to make the same in leo?

Here is the elisp code for this stuff:

;; Toggle functionality
;; Holds kbd-macro
(defvar my-kbd-macro nil "Holds kbd-macro")
(defun my-define-kbd-macro ()
  (interactive)
  (setq my-kbd-macro (not my-kbd-macro))
  (if my-kbd-macro
      (start-kbd-macro nil)
      (end-kbd-macro)))

(global-set-key [f11] 'my-define-kbd-macro)
(global-set-key [f12] 'call-last-kbd-macro)

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to