I'm out of ideas here - my emacs crashes when popup dialog is opened. The x-popup-dialog function is probably to blame but I found no workaround to this. My Emacs version is 23.1.1 . Unfortunately some functionality of emacs calls this (e.x. customize asks whether it should save the changes) which causes the crash.

Does anybody know how to fix it or disable it?


Here's a quick elisp bit that will completely disable the graphical dialog for you:

(defadvice yes-or-no-p (around prevent-dialog activate)
  "Prevent yes-or-no-p from activating a dialog"
  (let ((use-dialog-box nil))
(defadvice y-or-n-p (around prevent-dialog-yorn activate)
  "Prevent y-or-n-p from activating a dialog"
  (let ((use-dialog-box nil))

Add this to your .emacs and it'll disable the use of the graphical dialog for the two forms of yes-or-no prompts that emacs uses.

  • That made my day. However how to prevent other events from poping dialog box? I.e. flymake insist on popping this dialog when it encounters fatal error - which crashes emacs again. Is there a way to do it on global level? – radekg Mar 31 '10 at 15:40
  • Actually, for flymake that was as easy as setting the custom-variable. – radekg Mar 31 '10 at 16:05
  • 1
    In addition to the above, you also need: (defadvice message-box (around prevent-dialog activate) "Prevent message-box from activating a dialog" (apply #'message (ad-get-args 0))) – mernst Sep 23 '14 at 10:15
  • This answer did not completely work for me, cmd-T still opens the native font chooser – Dustin Getz Feb 14 '15 at 19:01

Wow. I had never noticed that, but x-popup-dialog seems to be a problem for me too. At least the example dialog crashed for me. How do you get customize to bring up a dialog? I can't reproduce it.

In general the rule is: if you do it from the keyboard it won't use up a dialog. e.g. use C-x k instead of the mouse to close a buffer and you'll get no dialog. Another, more heavy-handed way, is to set use-dialog-box to nil (though that doesn't stop x-popup-dialog from working if called directly so it may not fix the problem). To fix that you would probably have to advise x-popup-dialog, reimplement it using for example completing-read and never call ad-do-it. Or you could fix the bug. I'm not sure which would be easier :-)

  • Customize asks whether I want to save all changes for the buffer when hitting "Save for futher sessions". I thought in carbon-emacs it uses mini-buffer. :/ I will try setting use-dialog to nil and see whether it helps. But this will happen when I get home. Thanks for the answer! – radekg Mar 29 '10 at 7:42
  • 1
    custom pops up a dialog if you mouse click a button, and uses the minibuffer if you hit enter on the button – Justin Smith Apr 9 '10 at 0:43
  • The main problem for me is things like "cmd-T" for when I thought my browser was focused – Dustin Getz Feb 14 '15 at 19:02
  • @DustinGetz, that's a completely different problem underneath. You can fix that by unbinding the particular key, e.g. (global-set-key "\M-t" nil) – Ivan Andrus Feb 14 '15 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.