summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-05-19 16:25:04 (GMT)
committerBarry Warsaw <barry@python.org>1998-05-19 16:25:04 (GMT)
commit3bfed5b6b115803978c9664353f47b06bf7b5b93 (patch)
treef75e00d18d8607e487a8d7b986fdade60712dbbc
parent1d0364b2dc5a606a31053abf44fe3f901efb7baa (diff)
downloadcpython-3bfed5b6b115803978c9664353f47b06bf7b5b93.zip
cpython-3bfed5b6b115803978c9664353f47b06bf7b5b93.tar.gz
cpython-3bfed5b6b115803978c9664353f47b06bf7b5b93.tar.bz2
(py-ask-about-save): New variable used in
py-execute-import-or-reload. Same semantics as compilation-ask-about-save.
-rw-r--r--Misc/python-mode.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index e4d3dd0..644f1ef 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -307,7 +307,15 @@ the Emacs bell is also rung as a warning."
"*Jump to innermost exception frame in *Python Output* buffer.
When this variable is non-nil and ane exception occurs when running
Python code synchronously in a subprocess, jump immediately to the
-source code of the innermost frame.")
+source code of the innermost frame."
+ :type 'boolean
+ :group 'python)
+
+(defcustom py-ask-about-save t
+ "If not nil, ask about which buffers to save before executing some code.
+Otherwise, all modified buffers are saved without asking."
+ :type 'boolean
+ :group 'python)
(defcustom py-backspace-function 'backward-delete-char-untabify
"*Function called by `py-electric-backspace' when deleting backwards."
@@ -1385,7 +1393,8 @@ the latest version. If the file's name does not end in \".py\", then
do execfile instead. If the current buffer is not visiting a file, do
`py-execute-buffer' instead. If the file local variable
`py-master-file' is non-nil, import or reload the named file instead
-of the buffer's file. The file is saved if necessary.
+of the buffer's file. The file may be saved based on the value of
+`py-execute-import-or-reload-save-p'.
See the `\\[py-execute-region]' docs for an account of some subtleties.
@@ -1406,9 +1415,8 @@ This is may be preferable to `\\[py-execute-buffer]' because:
(let ((file (buffer-file-name (current-buffer))))
(if file
(progn
-; (if (buffer-modified-p)
-; ;; avoid message if unmodified
-; (save-buffer))
+ ;; Maybe save some buffers
+ (save-some-buffers (not py-ask-about-save) nil)
(py-execute-string
(if (string-match "\\.py$" file)
(let ((f (file-name-sans-extension