emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 683d4b6: * lisp/progmodes/python.el: Preserve compa


From: Stefan Monnier
Subject: [Emacs-diffs] master 683d4b6: * lisp/progmodes/python.el: Preserve compatibility with Emacs-24
Date: Thu, 05 Feb 2015 02:47:27 +0000

branch: master
commit 683d4b6e92ae355510ffe106b5ec7c644abdcce7
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/progmodes/python.el: Preserve compatibility with Emacs-24
    
    (python-mode): Don't assume eldoc-documentation-function has a non-nil
    default.
---
 lisp/ChangeLog           |    6 ++++++
 lisp/progmodes/python.el |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5f6a9c8..73f1552 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-05  Stefan Monnier  <address@hidden>
+
+       * progmodes/python.el: Try to preserve compatibility with Emacs-24.
+       (python-mode): Don't assume eldoc-documentation-function has a non-nil
+       default.
+
 2015-02-04  Sam Steingold  <address@hidden>
 
        * progmodes/python.el (python-indent-calculate-indentation): Avoid
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9bfafeb..6551536 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4684,8 +4684,12 @@ Arguments START and END narrow the buffer region to work 
on."
                                                  (current-column))))
          (^ '(- (1+ (current-indentation))))))
 
-  (add-function :before-until (local 'eldoc-documentation-function)
-                #'python-eldoc-function)
+  (if (null eldoc-documentation-function)
+      ;; Emacs<25
+      (setq (make-local-variable 'eldoc-documentation-function)
+            #'python-eldoc-function)
+    (add-function :before-until (local 'eldoc-documentation-function)
+                  #'python-eldoc-function))
 
   (add-to-list 'hs-special-modes-alist
                `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#"



reply via email to

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