Mercurial > hg > xemacs-beta
diff lisp/utils/edmacro.el @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 0132846995bd |
children | b405438285a2 |
line wrap: on
line diff
--- a/lisp/utils/edmacro.el Mon Aug 13 09:47:55 2007 +0200 +++ b/lisp/utils/edmacro.el Mon Aug 13 09:49:09 2007 +0200 @@ -5,7 +5,7 @@ ;; Author: Dave Gillespie <daveg@synaptics.com> ;; Hrvoje Niksic <hniksic@srce.hr> -- XEmacs port ;; Maintainer: Hrvoje Niksic <hniksic@srce.hr> -;; Version: 3.16 +;; Version: 3.17 ;; Keywords: abbrev ;; This file is part of XEmacs. @@ -757,42 +757,6 @@ (and macro (if verbose "\n" " "))))))) 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))) - (while keys - (insert (format "(global-set-key %S '%s)\n" (car keys) macroname)) - (pop keys)))))) - (provide 'edmacro) ;;; edmacro.el ends here