From 683d4b6e92ae355510ffe106b5ec7c644abdcce7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 4 Feb 2015 21:47:22 -0500 Subject: [PATCH] * 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 5f6a9c8bc0b..73f155243f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-05 Stefan Monnier + + * 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 * progmodes/python.el (python-indent-calculate-indentation): Avoid diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9bfafeb20cd..65515362b4e 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 "#" -- 2.39.5