简体   繁体   English

Emacs:如何在文本终端中启用突出显示的断点(emacs -nw)

[英]Emacs: How to enable highlighting breakpoints in a text terminal (emacs -nw)

Emacs doesn't show breakpoints in text mode. Emacs在文本模式下不显示断点。 I tried integrating the suggestions here and here , but failed (I am not a lisp programmer). 我尝试在此处此处整合建议,但失败了(我不是一位Lisp程序员)。

I tried: 我试过了:

(require 'gdb-mi)
(setq default-text-properties '(foo 1111))

(defun set_breakpt_cmds ()
  "set breakpoint and indicate on editor"
  (interactive)
  (gud-break)
  (gdb-put-breakpoint-icon "false" (get-text-property 1 'foo)))

(global-set-key (kbd "<f12>") 'set_breakpt_cmds)

The resulting error is 产生的错误是

Wrong number of arguments: (lambda (arg) "Set breakpoint at current line." (interactive "p") (if (not gud-running) (gud-call "dbstop \\ at %l in %f" arg))), 0

Note: A similar issue is this (following this ). 注:类似的问题是这个 (以下这个 )。 However the solution there doesn't fit me because I would like to be able to call the fix from .emacs file. 但是,那里的解决方案不适合我,因为我希望能够从.emacs文件中调用此修复程序。 This way it is easier to duplicate my emacs configuration when I setup a new linux box. 这样,在安装新的Linux机器时,更容易复制我的emacs配置。

Thanks 谢谢

The error you get comes from the fact that gud-break expects an argument (which isn't used), so just use (gud-break 1) . 您收到的错误来自gud-break需要一个参数(未使用)的事实,因此只需使用(gud-break 1)

The message reads as follow: 该消息的内容如下:

  • the error is of kind wrong number of arguments 错误是wrong number of arguments
  • when calling (lambda (arg) ...) (where we see that exactly one argument is expected) 调用(lambda (arg) ...) (在这里我们看到只需要一个参数)
  • and it was called with 0 arguments. 它以0参数调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM