diff options
| author | Richard M. Stallman | 1996-09-22 21:38:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-22 21:38:19 +0000 |
| commit | a5a973dde7b8a695285b1cde46018cf59cbc14f1 (patch) | |
| tree | 5c9402f8cfa8a50c19ad45169a2c8a95dd371ecd | |
| parent | a46fb9a190aee7724a861697a159ac989159be4b (diff) | |
| download | emacs-a5a973dde7b8a695285b1cde46018cf59cbc14f1.tar.gz emacs-a5a973dde7b8a695285b1cde46018cf59cbc14f1.zip | |
(insert-kbd-macro): Duplicate definition deleted.
| -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." | |||
| 716 | collect (if (= (logand ch ?\M-\^@) 0) | 716 | collect (if (= (logand ch ?\M-\^@) 0) |
| 717 | ch (+ ch 128)))) | 717 | ch (+ ch 128)))) |
| 718 | res))) | 718 | res))) |
| 719 | |||
| 720 | ;;; The following probably ought to go in macros.el: | ||
| 721 | |||
| 722 | ;;;###autoload | ||
| 723 | (defun insert-kbd-macro (macroname &optional keys) | ||
| 724 | "Insert in buffer the definition of kbd macro NAME, as Lisp code. | ||
| 725 | Optional second arg KEYS means also record the keys it is on | ||
| 726 | \(this is the prefix argument, when calling interactively). | ||
| 727 | |||
| 728 | This Lisp code will, when executed, define the kbd macro with the same | ||
| 729 | definition it has now. If you say to record the keys, the Lisp code | ||
| 730 | will also rebind those keys to the macro. Only global key bindings | ||
| 731 | are recorded since executing this Lisp code always makes global | ||
| 732 | bindings. | ||
| 733 | |||
| 734 | To save a kbd macro, visit a file of Lisp code such as your `~/.emacs', | ||
| 735 | use this command, and then save the file." | ||
| 736 | (interactive "CInsert kbd macro (name): \nP") | ||
| 737 | (let (definition) | ||
| 738 | (if (string= (symbol-name macroname) "") | ||
| 739 | (progn | ||
| 740 | (setq definition (format-kbd-macro)) | ||
| 741 | (insert "(setq last-kbd-macro")) | ||
| 742 | (setq definition (format-kbd-macro macroname)) | ||
| 743 | (insert (format "(defalias '%s" macroname))) | ||
| 744 | (if (> (length definition) 50) | ||
| 745 | (insert " (read-kbd-macro\n") | ||
| 746 | (insert "\n (read-kbd-macro ")) | ||
| 747 | (prin1 definition (current-buffer)) | ||
| 748 | (insert "))\n") | ||
| 749 | (if keys | ||
| 750 | (let ((keys (where-is-internal macroname '(keymap)))) | ||
| 751 | (while keys | ||
| 752 | (insert (format "(global-set-key %S '%s)\n" (car keys) macroname)) | ||
| 753 | (setq keys (cdr keys))))))) | ||
| 754 | 719 | ||
| 755 | (provide 'edmacro) | 720 | (provide 'edmacro) |
| 756 | 721 | ||