Emacs 禁用或设置为“始终否”:;选项已更改--是否保存它们?(是或否)“;

Emacs 禁用或设置为“始终否”:;选项已更改--是否保存它们?(是或否)“;,emacs,emacs24,aquamacs,Emacs,Emacs24,Aquamacs,我如何才能在退出时禁用此提示:“选项已更改--保存它们?(y或n)” 或者,我希望这个特定问题的答案总是“否”,而不需要进一步的键盘输入来退出 我的Aquamacs 2.4的init.el文件正在更改选项,我不想通过对问题说“是”来创建customizations.el 谢谢 这是customizations.el中的代码,如果我在退出时回答提示“是”,则生成该代码 (custom-set-variables '(aquamacs-additional-fontsets nil t) '(a

我如何才能在退出时禁用此提示:“选项已更改--保存它们?(y或n)”

或者,我希望这个特定问题的答案总是“否”,而不需要进一步的键盘输入来退出

我的Aquamacs 2.4的init.el文件正在更改选项,我不想通过对问题说“是”来创建customizations.el

谢谢

这是customizations.el中的代码,如果我在退出时回答提示“是”,则生成该代码

(custom-set-variables
 '(aquamacs-additional-fontsets nil t)
 '(aquamacs-customization-version-id 215 t)
 '(aquamacs-tool-bar-user-customization nil t)
 '(default-frame-alist (quote ((background-mode . light) (border-color . "black") (mouse-color . "black") (background-color . "white") (foreground-color . "black") (menu-bar-lines . 1) (cursor-type . box) (vertical-scroll-bars . right) (internal-border-width . 0) (left-fringe . 1) (right-fringe) (fringe) (cursor-color . "red") (tool-bar-lines . 0))))
 '(global-flyspell-mode t)
 '(global-hl-line-mode t)
 '(global-linum-mode t)
 '(global-show-newlines-mode t)
 '(ns-tool-bar-display-mode (quote both) t)
 '(ns-tool-bar-size-mode (quote regular) t)
 '(size-indication-mode t)
 '(visual-line-mode nil t))

(custom-set-faces
 '(emacs-lisp-mode-default ((t (:inherit autoface-default :height 180 :family "Courier"))) t)
 '(latex-mode-default ((t (:inherit default height 180 :family "Courier"))))
 '(plain-tex-mode-default ((t (:inherit default :height 180 :family "Courier"))) t)
 '(text-mode-default ((t (:inherit autoface-default :stipple nil :strike-through nil :underline nil :slant normal :weight normal :height 180 :width normal :family "Courier"))))
 '(whitespace ((((class color) (background light)) (:background "white" :foreground "red" :weight ultra-bold :width ultra-expanded))))
 '(whitespace-space ((((class color) (background light)) (:foreground "red")))))

以下是退出时可见的调试消息:

Debugger entered--Lisp error: (quit)
  old-y-or-n-p("Options have changed - save them? ")
  (if (and long (not aquamacs-quick-yes-or-no-prompt)) (old-yes-or-no-p text) (old-y-or-n-p text))
  (let ((text ...)) (if (and long ...) (old-yes-or-no-p text) (old-y-or-n-p text)))
  (progn (and (fboundp ...) smart-frame-positioning-mode (smart-move-minibuffer-inside-screen f)) (let (...) (if ... ... ...)))
  (if (or (and last-nonmenu-event ...) (not use-dialog-box) (not window-system)) (progn (and ... smart-frame-positioning-mode ...) (let ... ...)) (let (...) (if ... ...) ret))
  (let ((f ...)) (make-frame-visible f) (raise-frame f) (if (or ... ... ...) (progn ... ...) (let ... ... ret)))
  aquamacs-ask-for-confirmation("Options have changed - save them? \nYour customizations will be lost if you don't save them." nil "Save" "Don't Save")
  (progn (aquamacs-ask-for-confirmation "Options have changed - save them? \nYour customizations will be lost if you don't save them." nil "Save" "Don't Save"))
  (if (eq aquamacs-save-options-on-quit (quote ask)) (progn (aquamacs-ask-for-confirmation "Options have changed - save them? \nYour customizations will be lost if you don't save them." nil "Save" "Don't Save")) aquamacs-save-options-on-quit)
  (and (or aquamacs-faces-changed (filter-list changed ...)) (if (eq aquamacs-save-options-on-quit ...) (progn ...) aquamacs-save-options-on-quit))
  (if (and (or aquamacs-faces-changed ...) (if ... ... aquamacs-save-options-on-quit)) (aquamacs-menu-bar-options-save))
  (let* ((changed ...)) (if (and ... ...) (aquamacs-menu-bar-options-save)))
  (condition-case nil (let* (...) (if ... ...)) (error nil))
  aquamacs-ask-to-save-options()
  run-hook-with-args-until-failure(aquamacs-ask-to-save-options)
  (and (or (not ...) (let ... ... ...)) (run-hook-with-args-until-failure (quote kill-emacs-query-functions)) (or (null confirm-kill-emacs) (funcall confirm-kill-emacs "Really exit Aquamacs? ")) (kill-emacs))
  (progn (setq timer-idle-list) (save-some-buffers arg t) (and (or ... ...) (run-hook-with-args-until-failure ...) (or ... ...) (kill-emacs)))
  (unwind-protect (progn (setq timer-idle-list) (save-some-buffers arg t) (and ... ... ... ...)) (setq timer-idle-list saved-timer-idle-list))
  (let ((saved-timer-idle-list timer-idle-list)) (unwind-protect (progn ... ... ...) (setq timer-idle-list saved-timer-idle-list)))
  aquamacs-save-buffers-kill-emacs(nil)
  call-interactively(aquamacs-save-buffers-kill-emacs nil nil)

有一点需要注意,我没有Aquamacs,我可以在堆栈跟踪中看到答案

看看:

C-hv
aquamacs退出时保存选项
RET

您的
init.el
创建的具体更改是什么?我刚刚在问题中添加了init.el。这太多了。请把范围缩小到相关部分。谢谢你的建议。我修改了该问题,使其仅包含customizations.el,如果我在退出时回答提示“是”,则会创建该问题。init.el的相关部分镜像customizations.el。我们的目标是永远不要创建customizations.el,并且在提示保存对选项的更改时始终说“不”,然后退出。我认为这可能是Aquamacs的问题(或者至少,我在Emacs 24.3源代码中没有找到该消息)。尝试退出时的
M-x切换调试
,然后当它问这个问题时键入
C-g
,你会得到一个堆栈跟踪,显示它的确切来源。太棒了!是的,你的建议确实使我获得了足够的信息来追踪它。我把这个代码片段放到init.el文件中,问题就解决了——也就是说,不再创建customizations.el或在退出时保存选项——不再提示。(自定义设置变量(aquamacs在退出时保存选项为零))非常感谢--非常感谢!