summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-09-28 18:17:56 (GMT)
committerBarry Warsaw <barry@python.org>2002-09-28 18:17:56 (GMT)
commit7f232121c96f8855353899aa93144b994a9ae38e (patch)
treea07056f9b6a82a350a2aa46bc88bbe4446dedd33 /Misc
parent56835dd96110625a21bfe20af0af3f9755d86ef9 (diff)
downloadcpython-7f232121c96f8855353899aa93144b994a9ae38e.zip
cpython-7f232121c96f8855353899aa93144b994a9ae38e.tar.gz
cpython-7f232121c96f8855353899aa93144b994a9ae38e.tar.bz2
(py-pychecker-run): Fix calculation of last command to include the
filename of the current buffer.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 61d7ef4..bf4c4d5 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -2770,12 +2770,17 @@ A `nomenclature' is a fancy way of saying AWordWithMixedCaseNotUnderscores."
(let ((default
(format "%s %s %s" py-pychecker-command
(mapconcat 'identity py-pychecker-command-args " ")
- (buffer-file-name))))
+ (buffer-file-name)))
+ (last (when py-pychecker-history
+ (let* ((lastcmd (car py-pychecker-history))
+ (cmd (cdr (reverse (split-string lastcmd))))
+ (newcmd (reverse (cons (buffer-file-name) cmd))))
+ (mapconcat 'identity newcmd " ")))))
(list
(read-shell-command "Run pychecker like this: "
- (if py-pychecker-history
- (car py-pychecker-history)
+ (if last
+ last
default)
'py-pychecker-history))))
(save-some-buffers (not py-ask-about-save) nil)