为什么对以下内容进行字节编译会产生警告?
(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 ""))
这是我得到的警告:
$ emacs -Q --batch --eval '(byte-compile-file "foo.el")'
In foomacro:
foo.el:1:21:Warning: value returned from (concat shiftcode "p") is unused
如果我摆脱bar
,警告就会消失:
(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 ""))
我正在使用 GNU Emacs 24.2.1。