1

例如,我的 .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 会在 minibuffer 中提示我是否创建/更新标记文件。但是,当我打开 ac/cpp 文件时,它总是会弹出一个 GUI 窗口询问我是或否,这非常烦人。我想知道为什么会这样。

4

1 回答 1

0

@phils 在评论中说了什么。为了避免 GUI Emacs 中出现对话框,您可以将 设置use-dialog-boxnil将行放入(setq use-dialog-box nil)初始化文件中。

于 2013-05-04T17:00:54.760 回答