例如,我的.emacs中有这样的设置
(defun gtags-create-or-update ()
"Create or update the gnu global tag file."
(interactive)
(if (y-or-n-p-with-timeout
(format "Run gtags to create/update tag file for code at %s (default no)? "
default-directory)
5 nil) ; default - no run
(unless (= 0 (call-process "global" nil nil nil " -p")) ; tagfile doesn't exist?
(let ((olddir default-directory)
(topdir (read-directory-name
"gtags: top of source tree: " default-directory)))
(cd topdir)
(shell-command "gtags -v")
;; (shell-command "gtags && echo 'created tagfile'")
(cd olddir)) ; restore
;; tagfile already exists; update it
(shell-command "global -uv"))))
;; (shell-command "global -u && echo 'updated tagfile'")))
(add-hook 'c-mode-common-hook
(lambda ()
(require 'gtags)
(gtags-mode t)
(gtags-create-or-update)))当我显式地运行gtags-create-or-update时,emacs在微型缓冲区中提示我是否创建/更新标记文件。然而,当我打开一个c/cpp文件时,它总是弹出一个GUI窗口,询问我是或否,这是非常恼人的。我想知道为什么会发生这种情况。
发布于 2013-05-05 01:00:55
@phils在评论中说了什么。为了避免在GUI中出现对话框,您可以将use-dialog-box设置为nil,并将行(setq use-dialog-box nil)放入初始化文件中。
https://stackoverflow.com/questions/16371574
复制相似问题