aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/simple.el16
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bb802db3b1b..690aca9540f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12013-08-28 Stefan Monnier <monnier@iro.umontreal.ca> 12013-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * simple.el (repeat-complex-command--called-interactively-skip):
4 New function.
5 (repeat-complex-command): Use it (bug#14136).
6
3 * progmodes/cc-mode.el: Minor cleanup of var declarations. 7 * progmodes/cc-mode.el: Minor cleanup of var declarations.
4 (c-define-abbrev-table): Add `doc' argument. 8 (c-define-abbrev-table): Add `doc' argument.
5 (c-mode-abbrev-table, c++-mode-abbrev-table) 9 (c-mode-abbrev-table, c++-mode-abbrev-table)
diff --git a/lisp/simple.el b/lisp/simple.el
index 6825c41becc..c5e5b313b7b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1404,11 +1404,25 @@ to get different commands to edit and resubmit."
1404 ;; add it to the history. 1404 ;; add it to the history.
1405 (or (equal newcmd (car command-history)) 1405 (or (equal newcmd (car command-history))
1406 (setq command-history (cons newcmd command-history))) 1406 (setq command-history (cons newcmd command-history)))
1407 (eval newcmd)) 1407 (unwind-protect
1408 (progn
1409 ;; Trick called-interactively-p into thinking that `newcmd' is
1410 ;; an interactive call (bug#14136).
1411 (add-hook 'called-interactively-p-functions
1412 #'repeat-complex-command--called-interactively-skip)
1413 (eval newcmd))
1414 (remove-hook 'called-interactively-p-functions
1415 #'repeat-complex-command--called-interactively-skip)))
1408 (if command-history 1416 (if command-history
1409 (error "Argument %d is beyond length of command history" arg) 1417 (error "Argument %d is beyond length of command history" arg)
1410 (error "There are no previous complex commands to repeat"))))) 1418 (error "There are no previous complex commands to repeat")))))
1411 1419
1420(defun repeat-complex-command--called-interactively-skip (i _frame1 frame2)
1421 (and (eq 'eval (cadr frame2))
1422 (eq 'repeat-complex-command
1423 (cadr (backtrace-frame i #'called-interactively-p)))
1424 1))
1425
1412(defvar extended-command-history nil) 1426(defvar extended-command-history nil)
1413 1427
1414(defun read-extended-command () 1428(defun read-extended-command ()