]> granicus.if.org Git - python/commitdiff
(py-pychecker-run): Fix calculation of last command to include the
authorBarry Warsaw <barry@python.org>
Sat, 28 Sep 2002 18:17:56 +0000 (18:17 +0000)
committerBarry Warsaw <barry@python.org>
Sat, 28 Sep 2002 18:17:56 +0000 (18:17 +0000)
filename of the current buffer.

Misc/python-mode.el

index 61d7ef4629f938b22671dc0d41872bddad703949..bf4c4d5f605a1d58f49f1b00279750da238666e5 100644 (file)
@@ -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)