GNU bug report logs - #17446
24.4.50; What is the situation around `called-interactively-p'?

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Fri, 9 May 2014 12:31:01 UTC

Severity: wishlist

Found in version 24.4.50

Fixed in version 25.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #98 received at 17446 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17446 <at> debbugs.gnu.org, Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Subject: Re: bug#17446: 24.4.50;
 What is the situation around `called-interactively-p'?
Date: Sun, 11 May 2014 07:58:08 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> 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.




This bug report was last modified 8 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.