Emacs抱怨函数无效?
当我在缓冲区上按以下代码时,Emacs抱怨Emacs抱怨函数无效?,emacs,elisp,Emacs,Elisp,当我在缓冲区上按以下代码时,Emacs抱怨功能无效:(选择当前行)。为什么? (defun select-current-line () "Select the current line" (interactive) (end-of-line) ; move to end of line (set-mark (line-beginning-position))) (defun my-isend () (interactive) (if (and transient-m
功能无效:(选择当前行)
。为什么?
(defun select-current-line ()
"Select the current line"
(interactive)
(end-of-line) ; move to end of line
(set-mark (line-beginning-position)))
(defun my-isend ()
(interactive)
(if (and transient-mark-mode mark-active)
(isend-send)
((select-current-line)
(isend-send)))
)
(global-set-key (kbd "C-c c") 'my-isend)
这并不重要,但对于那些感兴趣的人来说,定义如下。您缺少一个将语句分组的
progn
表单:
(取消我的isend()
(互动)
(如果(和瞬态标记模式标记激活)
(我发送)
(项目
(选择当前行)
(我发送)
如果没有
progn
表单,((选择当前行)(isend send))
被解释为应用于调用isend send
的结果的(选择当前行)
函数,不带参数。但是(选择当前行)
不是有效的函数名。在其他LISP中,如果select current line
的返回值本身是一个函数,那么这种构造可能是有效的,然后该函数将应用于(isend-send)
。但Emacs LISP的情况并非如此,而且这也无法实现您想要实现的目标……只是出于好奇,为什么要这样做?在没有活动区域的情况下调用isend send
,已经发送了当前行,因此我不知道您想要实现哪种行为。无论如何,请随时打开功能请求。。。