]> code.delx.au - gnu-emacs/blobdiff - lisp/kmacro.el
Merge Org 7.8.03
[gnu-emacs] / lisp / kmacro.el
index e191228ff9dffb763af825830979c6ca8c11af90..6915640944abc212c7197fc077449901cfcd1240 100644 (file)
@@ -1,7 +1,6 @@
 ;;; kmacro.el --- enhanced keyboard macros
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2002-2011  Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard convenience
@@ -480,7 +479,7 @@ without repeating the prefix."
     (kmacro-display (car (car kmacro-ring)) "2nd macro")))
 
 
-(defun kmacro-cycle-ring-next (&optional arg)
+(defun kmacro-cycle-ring-next (&optional _arg)
   "Move to next keyboard macro in keyboard macro ring.
 Displays the selected macro in the echo area."
   (interactive)
@@ -499,7 +498,7 @@ Displays the selected macro in the echo area."
 (put 'kmacro-cycle-ring-next 'kmacro-repeat 'ring)
 
 
-(defun kmacro-cycle-ring-previous (&optional arg)
+(defun kmacro-cycle-ring-previous (&optional _arg)
   "Move to previous keyboard macro in keyboard macro ring.
 Displays the selected macro in the echo area."
   (interactive)
@@ -527,7 +526,7 @@ Displays the selected macro in the echo area."
     (kmacro-display last-kbd-macro t)))
 
 
-(defun kmacro-delete-ring-head (&optional arg)
+(defun kmacro-delete-ring-head (&optional _arg)
   "Delete current macro from keyboard macro ring."
   (interactive)
   (unless (kmacro-ring-empty-p t)
@@ -748,7 +747,7 @@ If kbd macro currently being defined end it before activating it."
 ;; Create a separate keymap installed as a minor-mode keymap (e.g. in
 ;; the emulation-mode-map-alists) in which macro bindings are made
 ;; independent of any other bindings.  When first binding is made,
-;; the kemap is created, installed, and enabled.  Key seq. C-x C-k +
+;; the keymap is created, installed, and enabled.  Key seq. C-x C-k +
 ;; can then be used to toggle the use of this keymap on and off.
 ;; This means that it would be safe(r) to bind ordinary keys like
 ;; letters and digits, provided that we inhibit the keymap while
@@ -778,7 +777,7 @@ If kbd macro currently being defined end it before activating it."
        mac))
 
 
-(defun kmacro-bind-to-key (arg)
+(defun kmacro-bind-to-key (_arg)
   "When not defining or executing a macro, offer to bind last macro to a key.
 The key sequences [C-x C-k 0] through [C-x C-k 9] and [C-x C-k A]
 through [C-x C-k Z] are reserved for user bindings, and to bind to
@@ -838,7 +837,7 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command
   (put symbol 'kmacro t))
 
 
-(defun kmacro-view-macro (&optional arg)
+(defun kmacro-view-macro (&optional _arg)
   "Display the last keyboard macro.
 If repeated, it shows previous elements in the macro ring."
   (interactive)
@@ -917,34 +916,35 @@ without repeating the prefix."
 (defvar kmacro-step-edit-help)          ;; kmacro step edit help enabled
 (defvar kmacro-step-edit-num-input-keys) ;; to ignore duplicate pre-command hook
 
-(defvar kmacro-step-edit-map (make-sparse-keymap)
+(defvar kmacro-step-edit-map
+  (let ((map (make-sparse-keymap)))
+    ;; query-replace-map answers include: `act', `skip', `act-and-show',
+    ;; `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
+    ;; `automatic', `backup', `exit-prefix', and `help'.")
+    ;; Also: `quit', `edit-replacement'
+
+    (set-keymap-parent map query-replace-map)
+
+    (define-key map "\t" 'act-repeat)
+    (define-key map [tab] 'act-repeat)
+    (define-key map "\C-k" 'skip-rest)
+    (define-key map "c" 'automatic)
+    (define-key map "f" 'skip-keep)
+    (define-key map "q" 'quit)
+    (define-key map "d" 'skip)
+    (define-key map "\C-d" 'skip)
+    (define-key map "i" 'insert)
+    (define-key map "I" 'insert-1)
+    (define-key map "r" 'replace)
+    (define-key map "R" 'replace-1)
+    (define-key map "a" 'append)
+    (define-key map "A" 'append-end)
+    map)
   "Keymap that defines the responses to questions in `kmacro-step-edit-macro'.
 This keymap is an extension to the `query-replace-map', allowing the
 following additional answers: `insert', `insert-1', `replace', `replace-1',
 `append', `append-end', `act-repeat', `skip-end', `skip-keep'.")
 
-;; query-replace-map answers include: `act', `skip', `act-and-show',
-;; `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
-;; `automatic', `backup', `exit-prefix', and `help'.")
-;; Also: `quit', `edit-replacement'
-
-(set-keymap-parent kmacro-step-edit-map query-replace-map)
-
-(define-key kmacro-step-edit-map "\t" 'act-repeat)
-(define-key kmacro-step-edit-map [tab] 'act-repeat)
-(define-key kmacro-step-edit-map "\C-k" 'skip-rest)
-(define-key kmacro-step-edit-map "c" 'automatic)
-(define-key kmacro-step-edit-map "f" 'skip-keep)
-(define-key kmacro-step-edit-map "q" 'quit)
-(define-key kmacro-step-edit-map "d" 'skip)
-(define-key kmacro-step-edit-map "\C-d" 'skip)
-(define-key kmacro-step-edit-map "i" 'insert)
-(define-key kmacro-step-edit-map "I" 'insert-1)
-(define-key kmacro-step-edit-map "r" 'replace)
-(define-key kmacro-step-edit-map "R" 'replace-1)
-(define-key kmacro-step-edit-map "a" 'append)
-(define-key kmacro-step-edit-map "A" 'append-end)
-
 (defvar kmacro-step-edit-prefix-commands
   '(universal-argument universal-argument-more universal-argument-minus
                       digit-argument negative-argument)
@@ -1020,7 +1020,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
          (setq executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events))
                next-index executing-kbd-macro-index)))))
 
-    ;; Query the user; stop macro exection temporarily
+    ;; Query the user; stop macro execution temporarily.
     (let ((macro executing-kbd-macro)
          (executing-kbd-macro nil)
          (defining-kbd-macro nil))
@@ -1270,5 +1270,4 @@ To customize possible responses, change the \"bindings\" in `kmacro-step-edit-ma
 
 (provide 'kmacro)
 
-;; arch-tag: d3fe0b24-ae41-47de-a4d6-41a77d5559f0
 ;;; kmacro.el ends here