Why does byte-compiling the the following produce a warning?
(defmacro foomacro (shiftcode)
`(defun foo (&optional arg)
(interactive ,(concat shiftcode "p"))
(message "arg is %i" arg))
`(defun bar (&optional arg)
(interactive ,(concat shiftcode "Nenter a number: "))
(message "arg is %i" arg)))
;; provide backward compatibility for Emacs 22
(if (fboundp 'handle-shift-selection)
(foomacro "^")
(foomacro ""))
This is the warning I get:
$ emacs -Q --batch --eval '(byte-compile-file "foo.el")'
In foomacro:
foo.el:1:21:Warning: value returned from (concat shiftcode "p") is unused
If I get rid of bar
, the warning goes away:
(defmacro foomacro (shiftcode)
`(defun foo (&optional arg)
(interactive ,(concat shiftcode "p"))
(message "arg is %i" arg)))
;; provide backward compatibility for Emacs 22
(if (fboundp 'handle-shift-selection)
(foomacro "^")
(foomacro ""))
I'm using GNU Emacs 24.2.1.
progn
? The documentation fordefmacro
saysBODY...
indicating that more than one body form is acceptable. It also matches the documentation forprogn
. – Miniature