summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-08-07 22:24:16 (GMT)
committerBarry Warsaw <barry@python.org>1998-08-07 22:24:16 (GMT)
commit1b3442493ab345771b1cbfb8b35e3ed3f0ca43b6 (patch)
tree3c11688dd9e828368299fbd59f6aa6e8fbe030ba /Misc
parent4d10b43c2669c9649e158c2c1be745c584cfcaca (diff)
downloadcpython-1b3442493ab345771b1cbfb8b35e3ed3f0ca43b6.zip
cpython-1b3442493ab345771b1cbfb8b35e3ed3f0ca43b6.tar.gz
cpython-1b3442493ab345771b1cbfb8b35e3ed3f0ca43b6.tar.bz2
(py-execute-region): When temp-names are broken (Emacs 19.34), a
serial number isn't enough to uniquify the temp file name -- what if two users are on the same machine? Add in the (emacs-pid) to help further. Should never be tickled on Emacs 20, XEmacs 20, 21.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index abc20ab..fe177b7 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -1329,9 +1329,13 @@ is inserted at the end. See also the command `py-clear-queue'."
(error "Region is empty"))
(let* ((proc (get-process "Python"))
(temp (if (memq 'broken-temp-names py-emacs-features)
- (prog1
- (format "python-%d" py-serial-number)
- (setq py-serial-number (1+ py-serial-number)))
+ (let
+ ((sn py-serial-number)
+ (pid (and (fboundp 'emacs-pid) (emacs-pid))))
+ (setq py-serial-number (1+ py-serial-number))
+ (if pid
+ (format "python-%d-%d" sn pid)
+ (format "python-%d" sn)))
(make-temp-name "python-")))
(file (expand-file-name temp py-temp-directory)))
(write-region start end file nil 'nomsg)