emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4a09341 1/2: Fix issues turned up by previous pytho


From: Noam Postavsky
Subject: [Emacs-diffs] master 4a09341 1/2: Fix issues turned up by previous python.el change
Date: Thu, 1 Mar 2018 22:14:22 -0500 (EST)

branch: master
commit 4a0934192176fb8e372170f5f028edcf0f8cbdc3
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Fix issues turned up by previous python.el change
    
    See [1] for more discussion.
    * lisp/progmodes/python.el (python--prettify-symbols-alist): Define
    the obsolete alias before the variable proper, so that we correctly
    get the user's settings regardless of which name they set.
    (python-nav-end-of-statement): Add missing backslash.
    (python-shell-send-file): Call `expand-file-name' before
    `file-local-name', the expansion of "~" could be different on remote
    filenames.
    (python-mode): Declare prettify-symbols-alist instead of checking if
    it's bound.  Use the non-obsolete python-prettify-symbols-alist name,
    rather than checking if the obsolete name is bound (it always is too,
    but the Emacs 24 byte compiler doesn't recognize that
    define-obsolete-variable-alias defines a variable).
    
    [1]: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00826.html
---
 lisp/progmodes/python.el | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 142e6eb..afafd1b 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -647,15 +647,15 @@ The type returned can be `comment', `string' or `paren'."
    ((python-rx string-delimiter)
     (0 (ignore (python-syntax-stringify))))))
 
+(define-obsolete-variable-alias 'python--prettify-symbols-alist
+  'python-prettify-symbols-alist "26.1")
+
 (defvar python-prettify-symbols-alist
   '(("lambda"  . ?λ)
     ("and" . ?∧)
     ("or" . ?∨))
   "Value for `prettify-symbols-alist' in `python-mode'.")
 
-(define-obsolete-variable-alias 'python--prettify-symbols-alist
-  'python-prettify-symbols-alist "26.1")
-
 (defsubst python-syntax-count-quotes (quote-char &optional point limit)
   "Count number of quotes around point (max is 3).
 QUOTE-CHAR is the quote char to count.  Optional argument POINT is
@@ -1520,7 +1520,7 @@ of the statement."
                        ;; narrowing.
                        (cl-assert (> string-start last-string-end)
                                   :show-args
-                                  "
+                                  "\
 Overlapping strings detected (start=%d, last-end=%d)")
                        (goto-char string-start)
                        (if (python-syntax-context 'paren)
@@ -3196,10 +3196,10 @@ t when called interactively."
                      (insert-file-contents
                       (or temp-file-name file-name))
                      (python-info-encoding)))
-         (file-name (expand-file-name (file-local-name file-name)))
+         (file-name (file-local-name (expand-file-name file-name)))
          (temp-file-name (when temp-file-name
-                           (expand-file-name
-                            (file-local-name temp-file-name)))))
+                           (file-local-name (expand-file-name
+                                             temp-file-name)))))
     (python-shell-send-string
      (format
       (concat
@@ -5299,6 +5299,7 @@ REPORT-FN is Flymake's callback function."
     (save-excursion (insert (make-string 2 last-command-event)))))
 
 (defvar electric-indent-inhibit)
+(defvar prettify-symbols-alist)
 
 ;;;###autoload
 (define-derived-mode python-mode prog-mode "Python"
@@ -5393,10 +5394,8 @@ REPORT-FN is Flymake's callback function."
            "`outline-level' function for Python mode."
            (1+ (/ (current-indentation) python-indent-offset))))
 
-  (when (and (boundp 'prettify-symbols-alist)
-             (boundp 'python--prettify-symbols-alist))
-    (set (make-local-variable 'prettify-symbols-alist)
-         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]