]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/python.el
(compilation-disable-input): Default to nil.
[gnu-emacs] / lisp / progmodes / python.el
index 10845b236304f3db8e12b8c0663cb33e1da47572..f54314319029dcca090a3df152bd3e152a898206 100644 (file)
@@ -21,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -70,7 +70,7 @@
 (autoload 'compilation-start "compile")
 
 (defgroup python nil
-  "Silly walks in the Python language"
+  "Silly walks in the Python language."
   :group 'languages
   :version "22.1"
   :link '(emacs-commentary-link "python"))
@@ -949,6 +949,7 @@ See `python-check-command' for the default."
                                    (if name
                                        (file-name-nondirectory name))))))))
   (setq python-saved-check-command command)
+  (require 'compile)                    ;To define compilation-* variables.
   (save-some-buffers (not compilation-ask-about-save) nil)
   (let ((compilation-error-regexp-alist
         (cons '("(\\([^,]+\\), line \\([0-9]+\\))" 1 2)
@@ -1066,7 +1067,7 @@ For running multiple processes in multiple buffers, see `python-buffer'.
   ;; Still required by `comint-redirect-send-command', for instance
   ;; (and we need to match things like `>>> ... >>> '):
   (set (make-local-variable 'comint-prompt-regexp)
-       (rx (and line-start (1+ (and (repeat 3 (any ">.")) ?\ )))))
+       (rx (and line-start (1+ (and (repeat 3 (any ">.")) ?\s)))))
   (set (make-local-variable 'compilation-error-regexp-alist)
        python-compilation-regexp-alist)
   (compilation-shell-minor-mode 1))
@@ -1127,8 +1128,8 @@ Don't save anything for STR matching `inferior-python-filter-regexp'."
        ((string-match ".*\n" s)
         s)
        ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s)))
-            (eq t (compare-strings s nil nil "_emacs_out " nil
-                                   (min (length "_emacs_out ") (length s)))))
+            (let ((end (min (length "_emacs_out ") (length s))))
+              (eq t (compare-strings s nil end "_emacs_out " nil end))))
         (setq python-preoutput-leftover s)
         "")
         (t s)))
@@ -1680,7 +1681,7 @@ Repeating the command scrolls the completion window."
 ;;;; Modes.
 
 (defvar outline-heading-end-regexp)
-(defvar eldoc-print-current-symbol-info-function)
+(defvar eldoc-documentation-function)
 
 ;;;###autoload
 (define-derived-mode python-mode fundamental-mode "Python"
@@ -1740,7 +1741,7 @@ lines count as headers.
        'python-beginning-of-defun)
   (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
   (setq imenu-create-index-function #'python-imenu-create-index)
-  (set (make-local-variable 'eldoc-print-current-symbol-info-function)
+  (set (make-local-variable 'eldoc-documentation-function)
        #'python-eldoc-function)
   (add-hook 'eldoc-mode-hook
            '(lambda () (run-python 0 t)) nil t) ; need it running