diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-22 21:38:19 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-22 21:38:19 +0000 |
commit | 5ae3925159e2fb1f8f2f0ef5bd88294de84d1b41 (patch) | |
tree | a1fd6c1a9bec30e77a2e09ae58b935a57da5ed76 /lisp/edmacro.el | |
parent | df9887700f151d3a7de15b19f40a5afa1542e118 (diff) | |
download | emacs-5ae3925159e2fb1f8f2f0ef5bd88294de84d1b41.tar.gz |
(insert-kbd-macro): Duplicate definition deleted.
Diffstat (limited to 'lisp/edmacro.el')
-rw-r--r-- | lisp/edmacro.el | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 944bd856001..973ef680f80 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -716,41 +716,6 @@ If START or END is negative, it counts from the end." collect (if (= (logand ch ?\M-\^@) 0) ch (+ ch 128)))) res))) - -;;; The following probably ought to go in macros.el: - -;;;###autoload -(defun insert-kbd-macro (macroname &optional keys) - "Insert in buffer the definition of kbd macro NAME, as Lisp code. -Optional second arg KEYS means also record the keys it is on -\(this is the prefix argument, when calling interactively). - -This Lisp code will, when executed, define the kbd macro with the same -definition it has now. If you say to record the keys, the Lisp code -will also rebind those keys to the macro. Only global key bindings -are recorded since executing this Lisp code always makes global -bindings. - -To save a kbd macro, visit a file of Lisp code such as your `~/.emacs', -use this command, and then save the file." - (interactive "CInsert kbd macro (name): \nP") - (let (definition) - (if (string= (symbol-name macroname) "") - (progn - (setq definition (format-kbd-macro)) - (insert "(setq last-kbd-macro")) - (setq definition (format-kbd-macro macroname)) - (insert (format "(defalias '%s" macroname))) - (if (> (length definition) 50) - (insert " (read-kbd-macro\n") - (insert "\n (read-kbd-macro ")) - (prin1 definition (current-buffer)) - (insert "))\n") - (if keys - (let ((keys (where-is-internal macroname '(keymap)))) - (while keys - (insert (format "(global-set-key %S '%s)\n" (car keys) macroname)) - (setq keys (cdr keys))))))) (provide 'edmacro) |