comparison lisp/macros.el @ 256:7e4c7ef44243

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Thu, 09 May 1991 21:50:34 +0000
parents 8977ce293397
children 2dd411fe2f72
comparison
equal deleted inserted replaced
255:cdf87250ed27 256:7e4c7ef44243
16 ;; You should have received a copy of the GNU General Public License 16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GNU Emacs; see the file COPYING. If not, write to 17 ;; along with GNU Emacs; see the file COPYING. If not, write to
18 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 20
21 ;;;###autoload
21 (defun name-last-kbd-macro (symbol) 22 (defun name-last-kbd-macro (symbol)
22 "Assign a name to the last keyboard macro defined. 23 "Assign a name to the last keyboard macro defined.
23 Argument SYMBOL is the name to define. 24 Argument SYMBOL is the name to define.
24 The symbol's function definition becomes the keyboard macro string. 25 The symbol's function definition becomes the keyboard macro string.
25 Such a \"function\" cannot be called from Lisp, but it is a valid editor command." 26 Such a \"function\" cannot be called from Lisp, but it is a valid editor command."
30 (not (stringp (symbol-function symbol))) 31 (not (stringp (symbol-function symbol)))
31 (error "Function %s is already defined and not a keyboard macro." 32 (error "Function %s is already defined and not a keyboard macro."
32 symbol)) 33 symbol))
33 (fset symbol last-kbd-macro)) 34 (fset symbol last-kbd-macro))
34 35
36 ;;;###autoload
35 (defun insert-kbd-macro (macroname &optional keys) 37 (defun insert-kbd-macro (macroname &optional keys)
36 "Insert in buffer the definition of kbd macro NAME, as Lisp code. 38 "Insert in buffer the definition of kbd macro NAME, as Lisp code.
37 Optional second arg KEYS means also record the keys it is on 39 Optional second arg KEYS means also record the keys it is on
38 (this is the prefix argument, when calling interactively). 40 (this is the prefix argument, when calling interactively).
39 41
59 (insert " '") 61 (insert " '")
60 (prin1 macroname (current-buffer)) 62 (prin1 macroname (current-buffer))
61 (insert ")\n") 63 (insert ")\n")
62 (setq keys (cdr keys)))))) 64 (setq keys (cdr keys))))))
63 65
66 ;;;###autoload
64 (defun kbd-macro-query (flag) 67 (defun kbd-macro-query (flag)
65 "Query user during kbd macro execution. 68 "Query user during kbd macro execution.
66 With prefix argument, enters recursive edit, reading keyboard 69 With prefix argument, enters recursive edit, reading keyboard
67 commands even within a kbd macro. You can give different commands 70 commands even within a kbd macro. You can give different commands
68 each time the macro executes. 71 each time the macro executes.
98 ((= char ?\C-l) 101 ((= char ?\C-l)
99 (recenter nil)) 102 (recenter nil))
100 ((= char ?\C-r) 103 ((= char ?\C-r)
101 (let (executing-macro defining-kbd-macro) 104 (let (executing-macro defining-kbd-macro)
102 (recursive-edit)))))))))) 105 (recursive-edit))))))))))
106
107 ;;;###autoload (define-key ctl-x-map "q" 'kbd-macro-query)