我甚至不知道这个lisp语法的正确术语,所以我不知道我用来提问的词语是否合理。但我相信这个问题是有道理的。emacs:如何在宏中定义的代码上使用edebug?
所以让我给你看看。 cc-mode(cc-fonts.el)有一些名为“匹配器”的东西,它们是代码的一部分,用于决定如何实现代码区域。这听起来很简单,但matcher代码是一种我不完全了解的形式,使用反引号和逗号,逗号和逗号等等,此外它嵌入在c-lang-defcost中,它本身就是一个宏。我不知道该怎么称呼,但我想在该代码上运行edebug。
看:
(c-lang-defconst c-basic-matchers-after
"Font lock matchers for various things that should be fontified after
generic casts and declarations are fontified. Used on level 2 and
higher."
t `(;; Fontify the identifiers inside enum lists. (The enum type
;; name is handled by `c-simple-decl-matchers' or
;; `c-complex-decl-matchers' below.
,@(when (c-lang-const c-brace-id-list-kwds)
`((,(c-make-font-lock-search-function
(concat
"\\<\\("
(c-make-keywords-re nil (c-lang-const c-brace-id-list-kwds))
"\\)\\>"
;; Disallow various common punctuation chars that can't come
;; before the '{' of the enum list, to avoid searching too far.
"[^\]\[{}();,/#=]*"
"{")
'((c-font-lock-declarators limit t nil)
(save-match-data
(goto-char (match-end 0))
(c-put-char-property (1- (point)) 'c-type
'c-decl-id-start)
(c-forward-syntactic-ws))
(goto-char (match-end 0)))))))
我就口齿不清语法阅读了找出那些东西是什么,从调用它们,但除此之外,我怎么能在后面的注释中的代码运行edebug那读取;; Fontify the identifiers inside enum lists.
?
我知道如何在defun上运行edebug - 只需在函数的定义中调用edebug-defun
,然后关闭。有没有相应的事情我需要做的edebug cc模式匹配代码形式?
def-edebug-spec
做什么,我会在这里使用它?如果是这样,怎么样?
这已经有一段时间了,但我相信edebug会处理反向宏(')及其适当内联(,和@)的特殊构造。没有办法在定义中的子表达式上使用edebug。相反,你必须对整个defun或顶级表达进行整理。 – dlaliberte 2011-07-28 13:54:57