2013-08-20 13 views
2

由於我使用Emacs 24,當我嘗試找到符號 發生在semantic-symref-symbol的位置時,我總是會出錯。詳情如下:當我使用語義來定位符號時出現「void-variable last-command-char」錯誤

  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) 
    

    然後我按照semantic-symref-rb-goto-match功能,這是在語義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)) 
        ) 
    ) 
    

    我發現在功能上last-command-char,但我不明白爲什麼 Emacs的抱怨(void-variable last-command-char)。它應該是 是spacereturn的關鍵代碼。

我想知道的原因,並解決這個問題。

+0

我沒有收到錯誤。請提供發生錯誤的最小文件。 –

+0

@ abo-abo每次使用'semantic-symref-symbol'時,我都會得到這個錯誤。我使用'void main(){}'的內容做了一個最小化的c源文件,我在'main'上推'C-c r'來找到'main'的位置,我得到一個只有一個條目的列表。然後我在列表的唯一條目上推SPACE或RETURN鍵,光標會跳到正確的位置,但是我也會得到'* backtrace *'緩衝區,它指出「void-variable last-command-char」。根據* Drew *給出的答案,原因是從Emacs 24.3開始,變量'last-command-char'被刪除。但是,我使用的cedet也是內置在Emacs中的。 –

回答

0

last-command-char已從Emacs 24.3中刪除。它仍然在Emacs 24.2中定義。它在24.3 NEWS提到:

** Some obsolete functions, variables, and faces have been removed: 
*** `last-input-char', `last-command-char', `unread-command-char' 

在Emacs的24.2,C-h v last-command-char說,自從至少Emacs的19.34,它已經過時了。

請向代碼的所有者舉報錯誤。

+0

是的,我正在使用Emacs 24.3,cedet內置了emacs。我應該將它作爲GNU Emacs的bug報告嗎?我會嘗試最新版本的獨立cedet。謝謝,德魯。 –

+0

如果調用代碼來自GNU Emacs,那麼肯定是'M-x report-emacs-bug'。否則,請將其報告給該代碼的作者。 – Drew

5

last-command-event替換對last-command-char的引用。當它存在時,last-command-charlast-command-event的別名。

相關問題