When I open an org-mode file that has a babel block in emacs-lisp format, afterwards, whenever I run save-some-buffers, I get the File to save in: prompt for the current org-mode file. I get this prompt every time I run save-some-buffers, and each time, I have to Quit out of it.

To try to make the prompt go away I tried accepting it and saving the current file again, which had the effect of overwriting the entire org-mode file with just the first emacs-lisp block.

How do I get org-mode to stop prompting me to save org files that contain Babel blocks?

  • As indicated in a previous thread, you need someone to help you write the second argument (a custom function) to save-some-buffers to provide you with custom exclusions -- based on perhaps major-mode and/or buffer-name and/or some other criteria that suits your personal needs. You are using t for the second optional argument to save-some-buffers, and when t is set for that second argument -- i.e., PRED -- it tries to save certain non-file-visiting-buffers and also file-visiting-buffers. See the doc-string for save-some-buffers for more details. – lawlist May 22 '15 at 5:33
  • This only happens when I run org-babel. I am successfully able to exclude other buffer types from save-some-buffers (e.g. grep buffers, helm buffers, etc) that save-some-buffers by default prompts me to save. – incandescentman May 22 '15 at 5:38
  • 1
    Sorry, my apologies. It is the first argument for this particular question: "This command first saves any buffers where buffer-save-without-query is non-nil, without asking. Optional argument (the prefix) non-nil means save all with no questions." So take a look at the value for buffer-save-without-query and make a decision whether you want the first optional argument to save-some-buffers set to t. You could also use C-u to set the first argument each time you call save-some-buffers. – lawlist May 22 '15 at 5:42
  • I'm not able to reproduce your issue. Would you provide some additional details such as your emacs version and org-mode version and a short org-mode file example that can be used for troubleshooting, please? – Melioratus Sep 15 '17 at 17:25

Your Answer

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

Browse other questions tagged or ask your own question.