]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/python.el: Preserve compatibility with Emacs-24
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Feb 2015 02:47:22 +0000 (21:47 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Feb 2015 02:47:22 +0000 (21:47 -0500)
(python-mode): Don't assume eldoc-documentation-function has a non-nil
default.

lisp/ChangeLog
lisp/progmodes/python.el

index 5f6a9c8bc0b19494dc9a0f582609dd0d5f24993b..73f155243f562ec6bc641ff03b0293d97067caab 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * 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  <sds@gnu.org>
 
        * progmodes/python.el (python-indent-calculate-indentation): Avoid
index 9bfafeb20cdc08f9c6b09d8989f830301d7a2cd7..65515362b4eb8a2e485d2307721b581ab9d049f4 100644 (file)
@@ -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 "#"