* lisp/progmodes/python.el: Preserve compatibility with Emacs-24

(python-mode): Don't assume eldoc-documentation-function has a non-nil
default.
This commit is contained in:
Stefan Monnier 2015-02-04 21:47:22 -05:00
parent 4188e3cc2b
commit 683d4b6e92
2 changed files with 12 additions and 2 deletions

View 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 "#"