X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/e18afed7d695edac870ddf55aabc85c0a95a4b5f..51721edc6ba92f9c7cb6a2daab45bb538a696f3d:/lisp/repeat.el diff --git a/lisp/repeat.el b/lisp/repeat.el index e577c461bc..0b3eed52e8 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -1,6 +1,6 @@ ;;; repeat.el --- convenient way to repeat the previous command -*- lexical-binding: t -*- -;; Copyright (C) 1998, 2001-2012 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2014 Free Software Foundation, Inc. ;; Author: Will Mengarini ;; Created: Mo 02 Mar 98 @@ -109,9 +109,11 @@ (defvar repeat-message-function nil "If non-nil, function used by `repeat' command to say what it's doing. Message is something like \"Repeating command glorp\". -To disable such messages, set this variable to `ignore'. To customize -display, assign a function that takes one string as an arg and displays -it however you want.") +A value of `ignore' will disable such messages. To customize +display, assign a function that takes one string as an arg and +displays it however you want. +If this variable is nil, the normal `message' function will be +used to display the messages.") (defcustom repeat-on-final-keystroke t "Allow `repeat' to re-execute for repeating lastchar of a key sequence. @@ -193,9 +195,9 @@ this function is always whether the value of `this-command' would've been ;;;###autoload (defun repeat (repeat-arg) "Repeat most recently executed command. -With prefix arg, apply new prefix arg to that command; otherwise, -use the prefix arg that was used before (if any). -This command is like the `.' command in the vi editor. +If REPEAT-ARG is non-nil (interactively, with a prefix argument), +supply a prefix argument to that command. Otherwise, give the +command the same prefix argument it was given before, if any. If this command is invoked by a multi-character key sequence, it can then be repeated by repeating the final character of that @@ -278,7 +280,7 @@ recently executed command not bound to an input event\"." (execute-kbd-macro last-repeatable-command)) (call-interactively last-repeatable-command)))) (when repeat-repeat-char - (set-temporary-overlay-map + (set-transient-map (let ((map (make-sparse-keymap))) (define-key map (vector repeat-repeat-char) (if (null repeat-message-function) 'repeat @@ -289,6 +291,10 @@ recently executed command not bound to an input event\"." (interactive) (let ((repeat-message-function fun)) (setq this-command 'repeat) + ;; Beware: messing with `real-this-command' is *bad*, but we + ;; need it so `last-repeatable-command' can be recognized + ;; later (bug#12232). + (setq real-this-command 'repeat) (call-interactively 'repeat)))))) map)))))