bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17446: 24.4.50; What is the situation around `called-interactively-p


From: Michael Heerdegen
Subject: bug#17446: 24.4.50; What is the situation around `called-interactively-p'?
Date: Sun, 11 May 2014 07:58:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

>   (when (symbolp fun) (setq this-command fun))  ?

call-interactively doesn't set `this-command'.  Nor does
`repeat-complex-command'.  Should one of them set it?

Example:

--8<---------------cut here---------------start------------->8---
(defvar the-string nil)

(defun test (string)
  (interactive (list (if (eq this-command last-command)
                         the-string
                       (setq the-string (read-string "Enter string: ")))))
  (message (concat "You "
                   (if (eq this-command last-command) "had" "have")
                   " entered "
                   the-string)))

(global-set-key [f12] #'test)
--8<---------------cut here---------------end--------------->8---

If you repeat `test' via repeat-complex-command and hit f12 after that,
it doesn't behave as expected (i.e., message "You had entered ...").
Should it?

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]