Search code examples
emacsipythonpython-mode

Is it possible not to be asked to save the buffer before compile?


I'd like to know if there's some way not be prompted with: "Buffer changed, save first? (y or n)" everytime I execute the buffer [C-c C-c] after some change. I came across the variable py-ask-about-save, which has the following documentation:

If not nil, ask about which buffers to save before executing some code.
Otherwise, all modified buffers are saved without asking.

which is a behavior I could accept. However

(setq py-ask-about-save nil)

has no effect. Is there some other thing I should be aware of?

Indeed, it would be even better if C-c C-c had no effect saving any buffer, but only be responsible for executing the code.


Solution

  • The variable py-prompt-on-changed-p appears to be what the O.P. is seeking. The doc-string states:

    When called interactively, ask for save before a changed buffer is sent to interpreter.
    

    See also line 10284: http://bazaar.launchpad.net/~python-mode-devs/python-mode/python-mode/view/head:/python-mode.el