GNU bug report logs - #66136
29.1; byte-compiler reports "misplaced interactive spec" with empty fct in lexical environment

Previous Next

Package: emacs;

Reported by: "Jens Schmidt" <jschmidt4gnu <at> vodafonemail.de>

Date: Thu, 21 Sep 2023 13:12:02 UTC

Severity: normal

Found in version 29.1

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
To: 66136 <at> debbugs.gnu.org
Subject: bug#66136: 29.1; byte-compiler reports "misplaced interactive spec" with empty fct in lexical environment
Date: Thu, 21 Sep 2023 22:20:32 +0200
Smaller test case is

-------------------- foo.el --------------------
;;; -*- lexical-binding: t -*-

(defun delete-process <at> emacs-fix (arg)
  "Allows interactive calls."
  (interactive "^P"))
-------------------- foo.el --------------------

And even smaller might be (but I cannot interpret the results for sure)
that

-------------------- bad case --------------------
(byte-compile-preprocess
 '(defun delete-process <at> emacs-fix
    (arg)
    "Allows interactive calls."
    (interactive "^P")))

=>

(defalias 'delete-process <at> emacs-fix
  #'(lambda (arg) "Allows interactive calls."
      (macroexp--funcall-if-compiled
       '#[0 "\300:\203\0\303\304\300\"\202\0\304\300!\205\0\305\302\306\301#\207"
	  [lexical "Unused lexical argument ‘arg’" arg apply
		   byte-compile-warning-enabled-p byte-compile-warn-x
		   "%s"]
	  4...])
      ;; this dangling interactive form ultimately seems to
      ;; trigger the warning
      (interactive "^P")))
-------------------- bad case --------------------

while

-------------------- good case --------------------
(byte-compile-preprocess
 '(defun delete-process <at> emacs-fix
    (arg)
    "Allows interactive calls."
    (interactive "^P")
    nil))

=>

(defalias 'delete-process <at> emacs-fix
  #'(lambda (arg) "Allows interactive calls."
      (interactive "^P")
      (macroexp--funcall-if-compiled
       '#[0 "\300:\203\0\303\304\300\"\202\0\304\300!\205\0\305\302\306\301#\207"
	  [lexical "Unused lexical argument ‘arg’" arg apply
		   byte-compile-warning-enabled-p byte-compile-warn-x
		   "%s"]
	  4])
      nil))
-------------------- good case --------------------

so `byte-compile-preprocess' could be the culprit here, inserting the
warning wrapped into the `macroexp--funcall-if-compiled' in the wrong
place.




This bug report was last modified 1 year and 300 days ago.

Previous Next


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