annotate lisp/kmacro.el @ 46083:bd954daa704a

New file.
author Kim F. Storm <storm@cua.dk>
date Fri, 28 Jun 2002 22:37:18 +0000
parents
children 33538dc6ac79
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46083
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
1 ;;; kmacro.el --- enhanced keyboard macros
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
2
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
3 ;; Copyright (C) 1996-2002 Free Software Foundation, Inc.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
4
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
5 ;; Author: Kim F. Storm <storm@cua.dk>
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
6 ;; Based on: iswitchb by Stephen Eglen <stephen@cns.ed.ac.uk>
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
7 ;; Keywords: extensions convenience
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
8
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
10
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
14 ;; any later version.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
15
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
19 ;; GNU General Public License for more details.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
20
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
25
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
26 ;;; Commentary:
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
27
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
28 ;; The kmacro package is an alternative user interface to emacs'
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
29 ;; keyboard macro functionality. This functionality is normally bound
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
30 ;; to C-x (, C-x ), and C-x C-e, but these bindings are too hard to
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
31 ;; type to be really useful for doing small repeated tasks.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
32
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
33 ;; With kmacro, two function keys are dedicated to keyboard macros,
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
34 ;; by default F7 and F8. Personally, I prefer F1 and F2, but those
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
35 ;; keys already have default bindings.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
36 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
37 ;; To start defining a keyboard macro, use F7. To end the macro,
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
38 ;; use F8, and to call the macro also use F8. This makes it very
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
39 ;; easy to repeat a macro immediately after defining it.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
40 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
41 ;; You can call the macro repeatedly by pressing F8 multiple times, or
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
42 ;; you can give a numeric prefix argument specifying the number of
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
43 ;; times to repeat the macro. Macro execution automatically
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
44 ;; terminates when point reaches the end of the buffer or if an error
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
45 ;; is signalled by ringing the bell.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
46
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
47 ;; If you enter F7 while defining the macro, the numeric value of
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
48 ;; `kmacro-counter' is inserted using the `kmacro-counter-format', and
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
49 ;; `kmacro-counter' is incremented by 1 (or the numeric prefix value
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
50 ;; of F7).
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
51 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
52 ;; The initial value of `kmacro-counter' is 0, or the numeric prefix
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
53 ;; value given to F7 when starting the macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
54 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
55 ;; Now, each time you call the macro using F8, the current
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
56 ;; value of `kmacro-counter' is inserted and incremented, making it
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
57 ;; easy to insert incremental numbers in the buffer.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
58 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
59 ;; Example:
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
60 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
61 ;; The following sequence: M-5 F7 x M-2 F7 y F8 F8 F8 F8
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
62 ;; inserts the following string: x5yx7yx9yx11y
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
63
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
64 ;; A macro can also be call using a mouse click, default S-mouse-3.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
65 ;; This calls the macro at the point where you click the mouse.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
66
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
67 ;; When you have defined another macro, which is thus called via F8,
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
68 ;; the previous macro is pushed onto a keyboard macro ring. The head
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
69 ;; macro on the ring can be executed using S-F8. You can cycle the
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
70 ;; macro ring using C-F8. You can also swap the last macro and the
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
71 ;; head of the macro ring using C-u F8.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
72
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
73 ;; You can edit the last macro using M-F7.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
74
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
75 ;; You can append to the last macro using C-u F7.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
76
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
77 ;; You can set the macro counter using C-F7, and you can set
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
78 ;; the macro counter format with S-F7..
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
79
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
80 ;; The following key bindings are performed:
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
81 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
82 ;; Normal While defining macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
83 ;; --------------------------- ------------------------------
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
84 ;; f7 Define macro Insert current counter value
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
85 ;; Prefix arg specifies initial and increase counter by prefix
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
86 ;; counter value (default 0) (default increment: 1)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
87 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
88 ;; C-u f7 APPENDs to last macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
89 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
90 ;; f8 Call last macro End macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
91 ;; Prefix arg specifies number
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
92 ;; of times to execute macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
93 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
94 ;; C-u f8 Swap last and head of macro ring.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
95 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
96 ;; S-f7 Set the format of the macro Ditto, but notice that the
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
97 ;; counter (default: %d). format is reset at the next
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
98 ;; invocation of the macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
99 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
100 ;; C-f7 Set the macro counter value Increase/decrease counter value
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
101 ;; to the prefix value. by the prefix value, or if prefix
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
102 ;; is C-u, set counter to 0.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
103 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
104 ;; M-f7 Edit the last macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
105 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
106 ;; S-f8 Call the previous macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
107 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
108 ;; C-f8 Cycle the macro ring.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
109 ;;
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
110 ;; S-mouse-3 Set point at click and End macro and execute macro at
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
111 ;; execute last macro. click.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
112
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
113 ;;; Code:
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
114
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
115 (provide 'kmacro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
116
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
117 ;;; Customization:
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
118
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
119 (defgroup kmacro nil
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
120 "Simplified keyboard macro user interface."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
121 :group 'keyboard
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
122 :group 'convenience
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
123 :link '(emacs-commentary-link :tag "Commentary" "kmacro.el")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
124 :link '(emacs-library-link :tag "Lisp File" "kmacro.el"))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
125
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
126 ;;;###autoload
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
127 (defcustom kmacro-initialize nil
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
128 "Setting this variable turns on the kmacro functionality.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
129 This binds the kmacro function keys in the global-map, so
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
130 unsetting this variable does not have any effect!"
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
131 :set #'(lambda (symbol value)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
132 (if value (kmacro-initialize))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
133 (set symbol value))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
134 :initialize 'custom-initialize-default
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
135 :require 'kmacro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
136 :link '(emacs-commentary-link "kmacro.el")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
137 :set-after '(kmacro-start-key kmacro-call-key kmacro-mouse-button)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
138 :version "21.4"
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
139 :type 'boolean
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
140 :group 'kmacro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
141
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
142 (defcustom kmacro-start-key 'f7
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
143 "The function key used by kmacro to start a macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
144 :type 'symbol
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
145 :group 'kmacro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
146
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
147 (defcustom kmacro-call-key 'f8
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
148 "The function key used by kmacro to end and call a macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
149 :type 'symbol
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
150 :group 'kmacro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
151
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
152 (defcustom kmacro-call-mouse-event 'S-mouse-3
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
153 "The mouse event used by kmacro to call a macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
154 :type 'symbol
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
155 :group 'kmacro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
156
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
157 ;; State variables
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
158
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
159 (defvar kmacro-counter 0
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
160 "*Current keyboard macro counter")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
161
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
162 (defvar kmacro-counter-format "%d"
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
163 "*Current keyboard macro counter format")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
164
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
165 (defvar kmacro-counter-format-start kmacro-counter-format
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
166 "Macro format at start of macro execution.")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
167
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
168 (defvar kmacro-last-counter 0 "Last counter inserted by key macro")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
169 (defvar kmacro-append-to nil "Last key macro if appending to macro")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
170 (defvar kmacro-ring nil "Key macro ring")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
171
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
172 (defvar kmacro-ring-max 4
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
173 "*Maximum number of key macros to save in key macro ring")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
174
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
175 (defun kmacro-display (macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
176 "Display a keyboard macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
177 (let (s)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
178 (if (stringp macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
179 (setq s (if (> (length macro) 50)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
180 (concat (substring macro 0 50) "...")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
181 macro))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
182 (if (vectorp macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
183 (let (v (i 0) (n (length macro)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
184 (setq s "")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
185 (while (and (< i n) (< (length s) 50))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
186 (setq v (aref macro i))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
187 (setq s (cond
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
188 ((numberp v) (concat s (char-to-string v)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
189 ((stringp v) (concat s v))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
190 ((symbolp v) (concat s "[" (symbol-name v) "]"))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
191 (t s)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
192 (setq i (1+ i)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
193 (if (< i n)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
194 (setq s (concat s "..."))))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
195 (message (format "Macro: %s" s))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
196
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
197
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
198 (defun kmacro-start-macro (arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
199 "Set kmacro-counter to ARG or 0 if missing, and start-kbd-macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
200 With \\[universal-argument], append to current keyboard macro (keep kmacro-counter).
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
201
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
202 When defining/executing macro, insert macro counter and increment with
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
203 ARG or 1 if missing.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
204 With \\[universal-argument], insert previous kmacro-counter (but do not modify counter).
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
205
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
206 The macro counter can be modified via \\[kmacro-set-counter].
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
207 The format of the counter can be modified via \\[kmacro-set-format]."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
208 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
209 (if (or defining-kbd-macro executing-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
210 (if (and current-prefix-arg (listp current-prefix-arg))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
211 (insert (format kmacro-counter-format kmacro-last-counter))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
212 (insert (format kmacro-counter-format kmacro-counter))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
213 (setq kmacro-last-counter kmacro-counter
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
214 kmacro-counter (+ kmacro-counter arg)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
215 (if (and current-prefix-arg (listp current-prefix-arg))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
216 (setq kmacro-append-to last-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
217 (setq kmacro-append-to nil
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
218 kmacro-counter (if current-prefix-arg arg 0)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
219 kmacro-last-counter kmacro-counter))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
220 (if last-kbd-macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
221 (let ((len (length kmacro-ring)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
222 (setq kmacro-ring (cons last-kbd-macro kmacro-ring))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
223 (if (>= len kmacro-ring-max)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
224 (setcdr (nthcdr len kmacro-ring) nil))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
225 (setq kmacro-counter-format-start kmacro-counter-format)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
226 (start-kbd-macro nil)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
227 (if kmacro-append-to (message "Appending to keyboard macro..."))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
228 ))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
229
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
230 (defun kmacro-call-macro (arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
231 "End kbd macro if currently being defined; else call last kbd macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
232 With numeric prefix argument, repeat macro that many times.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
233 With \\[universal-argument], swap current macro with head of macro ring."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
234 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
235 (cond
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
236 (defining-kbd-macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
237 (end-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
238 (if kmacro-append-to
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
239 (setq last-kbd-macro (concat kmacro-append-to last-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
240 kmacro-append-to nil)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
241 ((and current-prefix-arg (listp current-prefix-arg))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
242 (when kmacro-ring
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
243 (let ((head (car kmacro-ring)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
244 (setq kmacro-ring (cons last-kbd-macro (cdr kmacro-ring)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
245 (setq last-kbd-macro head)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
246 (kmacro-display last-kbd-macro))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
247 (t
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
248 (setq kmacro-counter-format kmacro-counter-format-start)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
249 (call-last-kbd-macro arg))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
250
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
251 (defun kmacro-call-macro-ring (arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
252 "End kbd macro if currently being defined; else call last kbd macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
253 With \\[universal-argument], display current macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
254 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
255 (if kmacro-ring
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
256 (execute-kbd-macro (car kmacro-ring) arg)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
257
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
258 (defun kmacro-end-call-mouse (event)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
259 "Move point to the position clicked with the mouse and call last kbd macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
260 If kbd macro currently being defined end it before activating it."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
261 (interactive "e")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
262 (when defining-kbd-macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
263 (end-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
264 (if kmacro-append-to
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
265 (setq last-kbd-macro (concat kmacro-append-to last-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
266 kmacro-append-to nil)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
267 (mouse-set-point event)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
268 (call-last-kbd-macro nil))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
269
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
270 (defun kmacro-cycle-macro-ring (&optional previous)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
271 "Cycle the keyboard macro ring on \\[kmacro-call-macro-ring].
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
272 Moves to the next element in the keyboard macro ring.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
273 With \\[universal-argument] prefix, move to the previous element in the ring.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
274 Displays the selected macro in the echo area."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
275 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
276 (if (null kmacro-ring)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
277 (message "No keymacros in ring")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
278 (cond
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
279 ((not (eq this-command last-command))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
280 nil)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
281 ((= (length kmacro-ring) 1)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
282 nil)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
283 (previous
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
284 (let* ((len (length kmacro-ring))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
285 (tail (nthcdr (- len 2) kmacro-ring))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
286 (elt (car (cdr tail))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
287 (setcdr tail nil)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
288 (setq kmacro-ring (cons elt kmacro-ring))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
289 (t
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
290 (let ((elt (car kmacro-ring)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
291 (setq kmacro-ring (cdr kmacro-ring))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
292 (nconc kmacro-ring (list elt)))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
293 (kmacro-display (car kmacro-ring))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
294
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
295 (defun kmacro-save-macro-on-key (arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
296 "When not defining or executing a macro, offer to save last macro on a key."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
297 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
298 (if (or defining-kbd-macro executing-kbd-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
299 nil
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
300 (or last-kbd-macro
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
301 (error "No keyboard macro defined"))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
302 (let ((key-seq (read-key-sequence "Save last macro on key: ")))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
303 (or (equal key-seq "")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
304 (define-key global-map key-seq last-kbd-macro))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
305 )
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
306
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
307 (defun kmacro-set-counter (arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
308 "Set kmacro-counter to ARG or 0 if missing.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
309 While defining/executing key macro, increase or decrease counter.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
310 With \\[universal-argument], unconditionally set counter to 0."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
311 (interactive "p")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
312 (setq kmacro-counter
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
313 (cond ((and current-prefix-arg (listp current-prefix-arg)) 0)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
314 ((or defining-kbd-macro executing-kbd-macro) (+ kmacro-counter arg))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
315 (current-prefix-arg arg)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
316 (t 0))))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
317
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
318 (defun kmacro-set-format (format)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
319 "Set macro counter format"
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
320 (interactive "sMacro Counter Format (printf format): ")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
321 (setq kmacro-counter-format
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
322 (if (equal format "")
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
323 "%d"
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
324 format))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
325
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
326 ;; redefine initial macro counter if we are not executing a macro.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
327 (if (not (or defining-kbd-macro executing-kbd-macro))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
328 (setq kmacro-counter-format-start kmacro-counter-format))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
329 )
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
330
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
331 (defun kmacro-edit-macro ()
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
332 "Edit keyboard macro."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
333 (interactive)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
334 (edit-kbd-macro "\r"))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
335
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
336 ;;;###autoload
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
337 (defun kmacro-initialize (&optional start-key call-key call-mouse)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
338 "Setup key bindings for the keyboard macro package.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
339 If specified, use keys START-KEY, CALL-KEY, and CALL-MOUSE.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
340 Don't bind to any mouse event if CALL-MOUSE is t.
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
341 Otherwise, use customized keys."
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
342
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
343 (setq start-key (or start-key kmacro-start-key 'f7))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
344 (setq call-key (or call-key kmacro-call-key 'f8))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
345 (setq call-mouse (or call-mouse kmacro-call-mouse-event 'S-mouse-3))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
346
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
347 (global-set-key (vector start-key) 'kmacro-start-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
348 (global-set-key (vector (list 'shift start-key)) 'kmacro-set-format)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
349 (global-set-key (vector (list 'control start-key)) 'kmacro-set-counter)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
350 (global-set-key (vector (list 'meta start-key)) 'kmacro-edit-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
351
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
352 (global-set-key (vector call-key) 'kmacro-call-macro)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
353 (global-set-key (vector (list 'shift call-key)) 'kmacro-call-macro-ring)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
354 (global-set-key (vector (list 'control call-key)) 'kmacro-cycle-macro-ring)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
355
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
356 (unless (eq call-mouse t)
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
357 (global-set-key (vector call-mouse) 'kmacro-end-call-mouse)))
bd954daa704a New file.
Kim F. Storm <storm@cua.dk>
parents:
diff changeset
358