Commit f663baa7 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/simple.el (repeat-complex-command--called-interactively-skip):

New function.
(repeat-complex-command): Use it.

Fixes: debbugs:14136
parent dd4f8b74
2013-08-28 Stefan Monnier <>
* simple.el (repeat-complex-command--called-interactively-skip):
New function.
(repeat-complex-command): Use it (bug#14136).
* progmodes/cc-mode.el: Minor cleanup of var declarations.
(c-define-abbrev-table): Add `doc' argument.
(c-mode-abbrev-table, c++-mode-abbrev-table)
......@@ -1404,11 +1404,25 @@ to get different commands to edit and resubmit."
;; add it to the history.
(or (equal newcmd (car command-history))
(setq command-history (cons newcmd command-history)))
(eval newcmd))
;; Trick called-interactively-p into thinking that `newcmd' is
;; an interactive call (bug#14136).
(add-hook 'called-interactively-p-functions
(eval newcmd))
(remove-hook 'called-interactively-p-functions
(if command-history
(error "Argument %d is beyond length of command history" arg)
(error "There are no previous complex commands to repeat")))))
(defun repeat-complex-command--called-interactively-skip (i _frame1 frame2)
(and (eq 'eval (cadr frame2))
(eq 'repeat-complex-command
(cadr (backtrace-frame i #'called-interactively-p)))
(defvar extended-command-history nil)
(defun read-extended-command ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment