emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm 4fc9d8e3f8 1/2: Improve eldoc in mode-line


From: ELPA Syncer
Subject: [nongnu] elpa/helm 4fc9d8e3f8 1/2: Improve eldoc in mode-line
Date: Sat, 30 Jul 2022 14:58:32 -0400 (EDT)

branch: elpa/helm
commit 4fc9d8e3f8bee14d6c02698fbdfc8192f9684327
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Improve eldoc in mode-line
---
 helm-eval.el | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/helm-eval.el b/helm-eval.el
index cc056d2ecc..a65d98858b 100644
--- a/helm-eval.el
+++ b/helm-eval.el
@@ -127,18 +127,20 @@ Should take one arg: the string to display."
     (condition-case err
         (when (member buf helm-eldoc-active-minibuffers-list)
           (with-current-buffer buf
-            (let* ((sym     (save-excursion
-                              (unless (looking-back ")\\|\"" (1- (point)))
-                                (forward-char -1))
-                              (eldoc-current-symbol)))
-                   (info-fn (eldoc-fnsym-in-current-sexp))
-                   (doc     (or (eldoc-get-var-docstring sym)
+            (let* ((info-fn (eldoc-fnsym-in-current-sexp))
+                   (vsym    (eldoc-current-symbol))
+                   (sym     (car info-fn))
+                   (vardoc  (eldoc-get-var-docstring vsym))
+                   (doc     (or vardoc
                                 (eldoc-get-fnsym-args-string
-                                 (car info-fn) (cadr info-fn))))
-                   (all (format "%s: %s"
-                                (propertize (symbol-name (or sym (car 
info-fn)))
-                                            'face 
'font-lock-function-name-face)
-                                doc)))
+                                 sym (cadr info-fn))))
+                   (all     (format "%s: %s"
+                                    (propertize
+                                     (symbol-name (if vardoc vsym sym))
+                                     'face (if vardoc
+                                               'font-lock-variable-name-face
+                                             'font-lock-function-name-face))
+                                    doc)))
               (when doc (funcall helm-eldoc-in-minibuffer-show-fn all)))))
       (error (message "Eldoc in minibuffer error: %S" err) nil))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]