From 94213c51394e6d30d33cf7ea0798766e7689d742 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Thu, 23 Apr 2015 21:26:12 +0200 Subject: Fix eldoc compatibility with emacs-25 (#998). * helm-eval.el: Do it. --- helm-eval.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'helm-eval.el') diff --git a/helm-eval.el b/helm-eval.el index 20e33346..205916e4 100644 --- a/helm-eval.el +++ b/helm-eval.el @@ -38,10 +38,26 @@ Should take one arg: the string to display." :group 'helm-eval) -(declare-function eldoc-current-symbol "eldoc") -(declare-function eldoc-get-fnsym-args-string "eldoc" (sym &optional index)) -(declare-function eldoc-get-var-docstring "eldoc" (sym)) -(declare-function eldoc-fnsym-in-current-sexp "eldoc") +;;; Eldoc compatibility between emacs-24 and emacs-25 +;; +(if (require 'elisp-mode nil t) ; emacs-25 + ;; Maybe the eldoc functions have been + ;; already aliased by eldoc-eval. + (cl-loop for f in '(eldoc-current-symbol + eldoc-fnsym-in-current-sexp + eldoc-get-fnsym-args-string + eldoc-get-var-docstring) + for a in '(elisp--current-symbol + elisp--fnsym-in-current-sexp + elisp--get-fnsym-args-string + elisp--get-var-docstring) + unless (fboundp f) + do (defalias f a)) + ;; Emacs-24. + (declare-function eldoc-current-symbol "eldoc") + (declare-function eldoc-get-fnsym-args-string "eldoc" (sym &optional index)) + (declare-function eldoc-get-var-docstring "eldoc" (sym)) + (declare-function eldoc-fnsym-in-current-sexp "eldoc")) ;;; Evaluation Result ;; -- cgit v1.2.3