X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/e333157cba3b4ffd7c25f8210a6aa5a21ae10de7..001d88b62ecb8163a148656acb103b354ce7613a:/lisp/progmodes/python.el diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index ad69f8779e..ba3cdfe17c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5153,12 +5153,14 @@ returned as is." (current-column)))) (^ '(- (1+ (current-indentation)))))) - (if (null eldoc-documentation-function) - ;; Emacs<25 - (set (make-local-variable 'eldoc-documentation-function) - #'python-eldoc-function) - (add-function :before-until (local 'eldoc-documentation-function) - #'python-eldoc-function)) + (if (boundp 'eldoc-documentation-functions) + (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t) + (if (null eldoc-documentation-function) + ;; Emacs<25 + (set (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