Mercurial > emacs
comparison lisp/kmacro.el @ 90016:ff0e824afa37
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-594
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-598
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-599
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-600
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-602
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-603
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-604
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-609
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-611
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-614
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-42
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-43
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-44
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-46
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-47
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-48
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-49
Add {arch}/=commit-merge-make-log
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-50
{arch}/=commit-merge-make-log: Don't die if there are no ChangeLog changes
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 14 Oct 2004 08:50:09 +0000 |
parents | 58db929d96c6 e12200cc9b00 |
children | e24e2e78deda |
comparison
equal
deleted
inserted
replaced
90015:9ee566735998 | 90016:ff0e824afa37 |
---|---|
246 | 246 |
247 (defun kmacro-insert-counter (arg) | 247 (defun kmacro-insert-counter (arg) |
248 "Insert macro counter and increment with ARG or 1 if missing. | 248 "Insert macro counter and increment with ARG or 1 if missing. |
249 With \\[universal-argument], insert previous kmacro-counter (but do not modify counter)." | 249 With \\[universal-argument], insert previous kmacro-counter (but do not modify counter)." |
250 (interactive "P") | 250 (interactive "P") |
251 (setq kmacro-initial-counter-value nil) | 251 (if kmacro-initial-counter-value |
252 (setq kmacro-counter kmacro-initial-counter-value | |
253 kmacro-initial-counter-value nil)) | |
252 (if (and arg (listp arg)) | 254 (if (and arg (listp arg)) |
253 (insert (format kmacro-counter-format kmacro-last-counter)) | 255 (insert (format kmacro-counter-format kmacro-last-counter)) |
254 (insert (format kmacro-counter-format kmacro-counter)) | 256 (insert (format kmacro-counter-format kmacro-counter)) |
255 (kmacro-add-counter (prefix-numeric-value arg)))) | 257 (kmacro-add-counter (prefix-numeric-value arg)))) |
256 | 258 |
273 | 275 |
274 (defun kmacro-set-counter (arg) | 276 (defun kmacro-set-counter (arg) |
275 "Set kmacro-counter to ARG or prompt if missing. | 277 "Set kmacro-counter to ARG or prompt if missing. |
276 With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the macro." | 278 With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the macro." |
277 (interactive "NMacro counter value: ") | 279 (interactive "NMacro counter value: ") |
278 (setq kmacro-last-counter kmacro-counter | 280 (if (not (or defining-kbd-macro executing-kbd-macro)) |
279 kmacro-counter (if (and current-prefix-arg (listp current-prefix-arg)) | 281 (kmacro-display-counter (setq kmacro-initial-counter-value arg)) |
280 kmacro-counter-value-start | 282 (setq kmacro-last-counter kmacro-counter |
281 arg)) | 283 kmacro-counter (if (and current-prefix-arg (listp current-prefix-arg)) |
282 ;; setup initial macro counter value if we are not executing a macro. | 284 kmacro-counter-value-start |
283 (setq kmacro-initial-counter-value | 285 arg)) |
284 (and (not (or defining-kbd-macro executing-kbd-macro)) | 286 (unless executing-kbd-macro |
285 kmacro-counter)) | 287 (kmacro-display-counter)))) |
286 (unless executing-kbd-macro | |
287 (kmacro-display-counter))) | |
288 | 288 |
289 | 289 |
290 (defun kmacro-add-counter (arg) | 290 (defun kmacro-add-counter (arg) |
291 "Add numeric prefix arg (prompt if missing) to macro counter. | 291 "Add numeric prefix arg (prompt if missing) to macro counter. |
292 With \\[universal-argument], restore previous counter value." | 292 With \\[universal-argument], restore previous counter value." |
293 (interactive "NAdd to macro counter: ") | 293 (interactive "NAdd to macro counter: ") |
294 (setq kmacro-initial-counter-value nil) | 294 (if kmacro-initial-counter-value |
295 (setq kmacro-counter kmacro-initial-counter-value | |
296 kmacro-initial-counter-value nil)) | |
295 (let ((last kmacro-last-counter)) | 297 (let ((last kmacro-last-counter)) |
296 (setq kmacro-last-counter kmacro-counter | 298 (setq kmacro-last-counter kmacro-counter |
297 kmacro-counter (if (and current-prefix-arg (listp current-prefix-arg)) | 299 kmacro-counter (if (and current-prefix-arg (listp current-prefix-arg)) |
298 last | 300 last |
299 kmacro-counter (+ kmacro-counter arg)))) | 301 kmacro-counter (+ kmacro-counter arg)))) |
392 (if macro | 394 (if macro |
393 (let* ((x 60) | 395 (let* ((x 60) |
394 (m (format-kbd-macro macro)) | 396 (m (format-kbd-macro macro)) |
395 (l (length m)) | 397 (l (length m)) |
396 (z (and nil trunc (> l x)))) | 398 (z (and nil trunc (> l x)))) |
397 (message (format "%s: %s%s" (or descr "Macro") | 399 (message (format "%s%s: %s%s" (or descr "Macro") |
400 (if (= kmacro-counter 0) "" | |
401 (format " [%s]" | |
402 (format kmacro-counter-format-start kmacro-counter))) | |
398 (if z (substring m 0 (1- x)) m) (if z "..." "")))) | 403 (if z (substring m 0 (1- x)) m) (if z "..." "")))) |
399 (message (or empty "No keyboard macros defined")))) | 404 (message (or empty "No keyboard macros defined")))) |
400 | 405 |
401 | 406 |
402 (defun kmacro-repeat-on-last-key (keys) | 407 (defun kmacro-repeat-on-last-key (keys) |