【发布时间】:2016-01-09 21:15:03
【问题描述】:
我正在尝试在 emacs 中 grep 光标下的当前单词。我在下面编写了代码,它引发了错误:参数数量错误...当我从 xx() 中删除 (grep) 并将其绑定到 f4 键(最后一行注释)时,在 f3 和 f4 grep 搜索光标下的单词之后。有谁知道为什么不能从 xx() 调用 (grep)? 谢谢,亚历克斯。
(require 'grep)
(defun xx ()
"setting up grep-command using current word under cursor as a search string"
(interactive)
(setq curWord (thing-at-point 'word))
(setq VALUE (concat "grep -nH -r --exclude='TAGS' --include='*.h' --include='*.cpp' --include='*.pl' --include='*.c' -e " curWord " /home/alex/code/") )
(grep-apply-setting 'grep-command VALUE)
(grep))
(global-set-key (kbd "<f3>") 'xx)
;(global-set-key (kbd "<f4>") 'grep )
【问题讨论】: