当我使用语义来定位符号时,"void-variable last-command-char"错误

Jol*_*ing 2 emacs cedet emacs-semantic

由于我使用Emacs 24,当我试图找到符号出现的位置时,我总是会收到错误semantic-symref-symbol.细节是:

  1. semantic-symref-symbol当光标在我的源文件的某个符号上时,我按下一些键来调用,然后我得到一个列表,描述符号在*Symref缓冲区中的位置.
  2. 在列表的一个条目上,我按SPACERETURN键,它跳转到正确的位置,但同时,Emacs弹出*Backtrace*缓冲区在其他窗口中.其内容如下:

    Debugger entered--Lisp error: (void-variable last-command-char)
      semantic-symref-rb-goto-match(#<overlay from 97 to 126 in *Symref stateStack>)
      push-button(97)
      call-interactively(push-button nil nil)
    
    Run Code Online (Sandbox Code Playgroud)

    然后我遵循semantic-symref-rb-goto-matchsemantic-symref-list.el中定义的函数.elisp函数定义如下:

    (defun semantic-symref-rb-goto-match (&optional button)
      "Go to the file specified in the symref results buffer.
    BUTTON is the button that was clicked."
      (interactive)
      (let* ((tag (button-get button 'tag))
         (line (button-get button 'line))
         (buff (semantic-tag-buffer tag))
         (win (selected-window))
         )
        (switch-to-buffer-other-window buff)
        (goto-line line)
        (pulse-momentary-highlight-one-line (point))
        (when (eq last-command-char ? ) (select-window win))
        )
      )
    
    Run Code Online (Sandbox Code Playgroud)

    last-command-char在功能中找到了,但我不明白为什么Emacs抱怨(void-variable last-command-char).它应该是space或的关键代码return.

我想知道原因并解决这个问题.

小智 5

更换参照last-command-charlast-command-event.当它存在时,last-command-char是别名last-command-event.