From 7f232121c96f8855353899aa93144b994a9ae38e Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 28 Sep 2002 18:17:56 +0000 Subject: [PATCH] (py-pychecker-run): Fix calculation of last command to include the filename of the current buffer. --- Misc/python-mode.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 61d7ef4629..bf4c4d5f60 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) -- 2.40.0