emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA vers


From: Noam Postavsky
Subject: [Emacs-diffs] master 2291d9a: Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
Date: Tue, 27 Feb 2018 20:21:55 -0500 (EST)

branch: master
commit 2291d9ae888961ce7e4f22675244f535db54df56
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix python.el for Emacs 24, bump ELPA version to 0.26.1 (Bug#30633)
    
    Since python.el is distributed via GNU ELPA, it should be functional
    in earlier Emacs versions.  Also fix some compile warnings.
    * lisp/progmodes/python.el: Bump version to 0.26.1.  Define
    `prog-first-column' and `file-local-name' also at compile time, as
    needed.
    (inferior-python-mode-hook): Declare for the benefit of Emacs 24.3.
    (python-nav-end-of-statement): Fix format string for assertion error.
    (python-shell-tramp-refresh-process-environment): Don't `function'
    quote a symbol which might not be fbound.
    (python-mode): Only use prettify-symbols settings if they're bound.
---
 lisp/progmodes/python.el | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 530eb2f..142e6eb 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabián E. Gallina <address@hidden>
 ;; URL: https://github.com/fgallina/python.el
-;; Version: 0.26
+;; Version: 0.26.1
 ;; Package-Requires: ((emacs "24.1") (cl-lib "1.0"))
 ;; Maintainer: address@hidden
 ;; Created: Jul 2010
@@ -287,9 +287,20 @@
 ;;; 24.x Compat
 
 
-(unless (fboundp 'prog-first-column)
-  (defun prog-first-column ()
-    0))
+(eval-and-compile
+  (unless (fboundp 'prog-first-column)
+    (defun prog-first-column ()
+      0))
+  (unless (fboundp 'file-local-name)
+    (defun file-local-name (file)
+      "Return the local name component of FILE.
+It returns a file name which can be used directly as argument of
+`process-file', `start-file-process', or `shell-command'."
+      (or (file-remote-p file 'localname) file))))
+
+;; In Emacs 24.3 and earlier, `define-derived-mode' does not define
+;; the hook variable, it only puts documentation on the symbol.
+(defvar inferior-python-mode-hook)
 
 
 ;;; Bindings
@@ -1509,7 +1520,8 @@ of the statement."
                        ;; narrowing.
                        (cl-assert (> string-start last-string-end)
                                   :show-args
-                                  "Overlapping strings detected")
+                                  "
+Overlapping strings detected (start=%d, last-end=%d)")
                        (goto-char string-start)
                        (if (python-syntax-context 'paren)
                            ;; Ended up inside a paren, roll again.
@@ -2148,7 +2160,7 @@ of `exec-path'."
 (defun python-shell-tramp-refresh-process-environment (vec env)
   "Update VEC's process environment with ENV."
   ;; Stolen from `tramp-open-connection-setup-interactive-shell'.
-  (let ((env (append (when (fboundp #'tramp-get-remote-locale)
+  (let ((env (append (when (fboundp 'tramp-get-remote-locale)
                        ;; Emacs<24.4 compat.
                        (list (tramp-get-remote-locale vec)))
                     (copy-sequence env)))
@@ -5381,8 +5393,10 @@ REPORT-FN is Flymake's callback function."
            "`outline-level' function for Python mode."
            (1+ (/ (current-indentation) python-indent-offset))))
 
-  (set (make-local-variable 'prettify-symbols-alist)
-       python--prettify-symbols-alist)
+  (when (and (boundp 'prettify-symbols-alist)
+             (boundp 'python--prettify-symbols-alist))
+    (set (make-local-variable 'prettify-symbols-alist)
+         python--prettify-symbols-alist))
 
   (python-skeleton-add-menu-items)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]