gpt4 book ai didi

emacs - 使用语义定位符号时出现"void-variable last-command-char"错误

转载 作者:行者123 更新时间:2023-12-02 04:53:55 25 4
gpt4 key购买 nike

自从我使用 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)

    然后我按照 semantic-symref-rb-goto-match 函数,它是在 semantic-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键码。

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

最佳答案

将对 last-command-char 的引用替换为 last-command-event。当 last-command-char 存在时,它是 last-command-event 的别名。

关于emacs - 使用语义定位符号时出现"void-variable last-command-char"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18336117/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com