emacs -nw cscope 和终端问题

发布于 2024-11-07 12:11:13 字数 406 浏览 3 评论 0原文

term windows 中的 emacs 几乎没有问题。任何帮助表示赞赏。

一个。我通过 ssh 使用 emacs -nw 启动 emacs,并启用 cscope。当我搜索符号或定义后,在 cscope 缓冲区上按“输入”时,emacs 说 - 缓冲区是只读的。而 emacs 和 xwindows(gtk 或其他任何东西)上的相同功能将我带到编辑缓冲区上的文件和行。我怎样才能拥有与“emacs -nw”相同的功能。

b.此外,当我对 cscope 缓冲区中的符号进行下一个引用时,编辑/源缓冲区上的箭头标记仍保留在编辑缓冲区上。我怎样才能让它过去呢?

c.我的键映射到 cscope 函数,就像 xcscope.el 中一样。所有控制键都需要 Ctrl-F3 和 Ctrl-F4 起作用。我怎样才能也启用此功能。

非常感谢,

Few issues with emacs in term windows. Any help is appreciated.

a. I start emacs over ssh with emacs -nw with cscope enabled. After I search for a symbol or a definition, on the cscope buffer when i press 'enter', emacs says - Buffer is read-only. Whereas the same functionality on emacs with xwindows (gtk or anything else) takes me to the file and line on edit buffer. How can I have the same functionality with 'emacs -nw'.

b. Also the arrow mark on edit/source buffer when i do next reference for symbol from cscope buffer stays on the edit buffer. How can I make it go?

c. My keys are mapped to cscope functions just like in xcscope.el. All the control keys expect Ctrl-F3 and Ctrl-F4 work. How can I enable this too.

Thanks much,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乜一 2024-11-14 12:11:13

一个。将以下内容添加到您的 .emacs 文件中:

(define-key global-map (kbd "\r") [return])

我从 http://weenix 得到了答案.cs.brown.edu/mediawiki/index.php/Cscope

b.如果您在 cscope 缓冲区中按空格键,您将看到箭头。这只是一个展示的东西;文件没有改变。如果您想删除它,请将以下内容添加到您的 .emacs 文件中:

(setq cscope-allow-arrow-overlays nil)

a. Add the following to your .emacs file:

(define-key global-map (kbd "\r") [return])

I got the answer from http://weenix.cs.brown.edu/mediawiki/index.php/Cscope

b. If you hit the space bar in the cscope buffer, you will get the arrow. It's just a display thing; the file has not changed. If you want to get rid of it, add the following to your .emacs file:

(setq cscope-allow-arrow-overlays nil)
_畞蕅 2024-11-14 12:11:13

终端发送的按键序列与 emacs 可能期望的不同。您需要提供终端类型的翻译才能使 emacs 正常工作。例如,我有这个配置来设置我使用的终端(奇怪的字符是一个文字“转义”字符,您可以使用 "Cq" 输入:

(let ((map (if (boundp 'input-decode-map)
               input-decode-map function-key-map)))
  (define-key map (kbd "RET") [return])

  (define-key map "[OA" (kbd "<C-up>"))
  (define-key map "[OB" (kbd "<C-down>"))
  (define-key map "[OC" (kbd "<C-right>"))
  (define-key map "[OD" (kbd "<C-left>"))

  (define-key map "[A" (kbd "<C-up>"))
  (define-key map "[B" (kbd "<C-down>"))
  (define-key map "[C" (kbd "<C-right>"))
  (define-key map "[D" (kbd "<C-left>"))

  (define-key map "OA" (kbd "<M-up>"))
  (define-key map "OB" (kbd "<M-down>"))
  (define-key map "OC" (kbd "<M-right>"))
  (define-key map "OD" (kbd "<M-left>"))

  (define-key map "[OA" (kbd "<M-C-up>"))
  (define-key map "[OB" (kbd "<M-C-down>"))
  (define-key map "[OC" (kbd "<M-C-right>"))
  (define-key map "[OD" (kbd "<M-C-left>"))

  (define-key map "[[17~" (kbd "<C-f6>"))
  (define-key map "[[18~" (kbd "<C-f7>"))
  (define-key map "[[19~" (kbd "<C-f8>"))
  (define-key map "[[20~" (kbd "<C-f9>"))
  (define-key map "[[21~" (kbd "<C-f10>"))
  (define-key map "[[23~" (kbd "<C-f11>"))
  (define-key map "[[24~" (kbd "<C-f12>"))

  (define-key map "\e[1~" [home])
  (define-key map "\e[4~" [end])
  (define-key map "\e\e[1~" [M-home])
  (define-key map "\e\e[4~" [M-end])
)

在某些终端中,您可以通过键入“Cv”然后输入所需的键来获取键代码,这应该输出终端为您在“Cv”之后按下的键发送的实际键代码。

terminal send different key sequences than emacs may be expecting. you need to provide translations for the terminal type in order to get emacs to work correctly. for example, i have this config to setup the terminal i use (the weird char is a literal "escape" char, which you can type in using "C-q <esc>":

(let ((map (if (boundp 'input-decode-map)
               input-decode-map function-key-map)))
  (define-key map (kbd "RET") [return])

  (define-key map "[OA" (kbd "<C-up>"))
  (define-key map "[OB" (kbd "<C-down>"))
  (define-key map "[OC" (kbd "<C-right>"))
  (define-key map "[OD" (kbd "<C-left>"))

  (define-key map "[A" (kbd "<C-up>"))
  (define-key map "[B" (kbd "<C-down>"))
  (define-key map "[C" (kbd "<C-right>"))
  (define-key map "[D" (kbd "<C-left>"))

  (define-key map "OA" (kbd "<M-up>"))
  (define-key map "OB" (kbd "<M-down>"))
  (define-key map "OC" (kbd "<M-right>"))
  (define-key map "OD" (kbd "<M-left>"))

  (define-key map "[OA" (kbd "<M-C-up>"))
  (define-key map "[OB" (kbd "<M-C-down>"))
  (define-key map "[OC" (kbd "<M-C-right>"))
  (define-key map "[OD" (kbd "<M-C-left>"))

  (define-key map "[[17~" (kbd "<C-f6>"))
  (define-key map "[[18~" (kbd "<C-f7>"))
  (define-key map "[[19~" (kbd "<C-f8>"))
  (define-key map "[[20~" (kbd "<C-f9>"))
  (define-key map "[[21~" (kbd "<C-f10>"))
  (define-key map "[[23~" (kbd "<C-f11>"))
  (define-key map "[[24~" (kbd "<C-f12>"))

  (define-key map "\e[1~" [home])
  (define-key map "\e[4~" [end])
  (define-key map "\e\e[1~" [M-home])
  (define-key map "\e\e[4~" [M-end])
)

in some terminals, you can get the key code by typing "C-v" and then the desired keys. this should output the actual keycodes that the terminal sends for the keys you pressed after the "C-v".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文