comparison lisp/kmacro.el @ 57854:b017a1c31a53

(group kmacro): Add :version. (kmacro-keyboard-quit): New function to cleanup on C-g. (kmacro-start-macro): Set defining-kbd-macro to append when appending to last macro.
author Kim F. Storm <storm@cua.dk>
date Mon, 01 Nov 2004 23:03:40 +0000
parents e12200cc9b00
children 9a437a7c791c e24e2e78deda
comparison
equal deleted inserted replaced
57853:d50014ac219f 57854:b017a1c31a53
1 ;;; kmacro.el --- enhanced keyboard macros 1 ;;; kmacro.el --- enhanced keyboard macros
2 2
3 ;; Copyright (C) 2002 Free Software Foundation, Inc. 3 ;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
4 4
5 ;; Author: Kim F. Storm <storm@cua.dk> 5 ;; Author: Kim F. Storm <storm@cua.dk>
6 ;; Keywords: keyboard convenience 6 ;; Keywords: keyboard convenience
7 7
8 ;; This file is part of GNU Emacs. 8 ;; This file is part of GNU Emacs.
118 118
119 (defgroup kmacro nil 119 (defgroup kmacro nil
120 "Simplified keyboard macro user interface." 120 "Simplified keyboard macro user interface."
121 :group 'keyboard 121 :group 'keyboard
122 :group 'convenience 122 :group 'convenience
123 :version "21.4"
123 :link '(emacs-commentary-link :tag "Commentary" "kmacro.el") 124 :link '(emacs-commentary-link :tag "Commentary" "kmacro.el")
124 :link '(emacs-library-link :tag "Lisp File" "kmacro.el")) 125 :link '(emacs-library-link :tag "Lisp File" "kmacro.el"))
125 126
126 (defcustom kmacro-call-mouse-event 'S-mouse-3 127 (defcustom kmacro-call-mouse-event 'S-mouse-3
127 "The mouse event used by kmacro to call a macro. 128 "The mouse event used by kmacro to call a macro.
219 ;;;###autoload (autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap) 220 ;;;###autoload (autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap)
220 221
221 (if kmacro-call-mouse-event 222 (if kmacro-call-mouse-event
222 (global-set-key (vector kmacro-call-mouse-event) 'kmacro-end-call-mouse)) 223 (global-set-key (vector kmacro-call-mouse-event) 'kmacro-end-call-mouse))
223 224
225
226 ;;; Called from keyboard-quit
227
228 (defun kmacro-keyboard-quit ()
229 (or (not defining-kbd-macro)
230 (eq defining-kbd-macro 'append)
231 (kmacro-ring-empty-p)
232 (kmacro-pop-ring)))
224 233
225 234
226 ;;; Keyboard macro counter 235 ;;; Keyboard macro counter
227 236
228 (defvar kmacro-counter 0 237 (defvar kmacro-counter 0
583 592
584 (start-kbd-macro append 593 (start-kbd-macro append
585 (and append 594 (and append
586 (if kmacro-execute-before-append 595 (if kmacro-execute-before-append
587 (> (car arg) 4) 596 (> (car arg) 4)
588 (= (car arg) 4))))))) 597 (= (car arg) 4))))
598 (if (and defining-kbd-macro append)
599 (setq defining-kbd-macro 'append)))))
589 600
590 601
591 ;;;###autoload 602 ;;;###autoload
592 (defun kmacro-end-macro (arg) 603 (defun kmacro-end-macro (arg)
593 "Finish defining a keyboard macro. 604 "Finish defining a keyboard macro.