From d20d69c098377609caaafafbe98dc118ff8a6e77 Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Tue, 23 Oct 2012 12:57:31 -0400
Subject: [PATCH] * lisp/repeat.el (repeat): Set real-this-command.

Fixes: debbugs:12232
---
 lisp/ChangeLog | 2 ++
 lisp/repeat.el | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 16c4983d385..593b2a935b7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2012-10-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* repeat.el (repeat): Set real-this-command (bug#12232).
+
 	* htmlfontify.el (hfy-post-html-hook):
 	* filesets.el (filesets-cache-fill-content-hook):
 	* arc-mode.el (archive-extract-hook):
diff --git a/lisp/repeat.el b/lisp/repeat.el
index e38442a434b..a6c803ae773 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -289,6 +289,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)))))
 
-- 
2.39.5