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

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

[elpa] externals/eldoc-eval cf49d3324e 06/28: * eldoc-eval.el: Remove ro


From: Stefan Monnier
Subject: [elpa] externals/eldoc-eval cf49d3324e 06/28: * eldoc-eval.el: Remove rolling function.
Date: Thu, 6 Jan 2022 08:34:53 -0500 (EST)

branch: externals/eldoc-eval
commit cf49d3324e3bb0f7acf2d05f63966a0437094e14
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    * eldoc-eval.el: Remove rolling function.
---
 eldoc-eval.el | 48 ++++++++++++++++++++++--------------------------
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/eldoc-eval.el b/eldoc-eval.el
index 7e21b47fbf..87ceeff497 100644
--- a/eldoc-eval.el
+++ b/eldoc-eval.el
@@ -146,33 +146,29 @@ See `with-eldoc-in-minibuffer'."
              'above (minibuffer-window)))
            (t (minibuffer-selected-window))))))
 
-(defun eldoc-show-in-mode-line (str)
+(defun eldoc-show-in-mode-line (input)
   "Display string STR in the mode-line next to minibuffer."
-  (let (mode-line-in-non-selected-windows)
-    (with-current-buffer (eldoc-current-buffer)
-      (make-local-variable 'mode-line-format)
-      (eldoc-maybe-roll-message-in-mode-line (concat " " str)))))
-
-(defun eldoc-maybe-roll-message-in-mode-line (str)
-  (let* ((max (window-width (get-buffer-window (eldoc-current-buffer))))
-         (len (length str))
-         (tmp-str str)
-         (mode-line-format str)
-         roll)
-    (catch 'break
-      (if (and (> len max) eldoc-mode-line-rolling-flag)
-          (progn
-            (while (setq roll (sit-for 0.3))
-              (setq tmp-str (substring tmp-str 2)
-                    mode-line-format (concat tmp-str " [<]" str))
-              (force-mode-line-update)
-              (when (< (length tmp-str) 2) (setq tmp-str str)))
-            (unless roll
-              (when eldoc-mode-line-stop-rolling-on-input
-                (setq eldoc-mode-line-rolling-flag nil))
-              (throw 'break nil)))
-          (force-mode-line-update)
-          (sit-for eldoc-show-in-mode-line-delay)))
+  (with-current-buffer (eldoc-current-buffer)
+    (let* ((max              (window-width (selected-window)))
+           (str              (concat " " input))
+           (len              (length str))
+           (tmp-str          str)
+           (mode-line-format str)
+           roll mode-line-in-non-selected-windows)
+      (catch 'break
+        (if (and (> len max) eldoc-mode-line-rolling-flag)
+            (progn
+              (while (setq roll (sit-for 0.3))
+                (setq tmp-str (substring tmp-str 2)
+                      mode-line-format (concat tmp-str " [<]" str))
+                (force-mode-line-update)
+                (when (< (length tmp-str) 2) (setq tmp-str str)))
+              (unless roll
+                (when eldoc-mode-line-stop-rolling-on-input
+                  (setq eldoc-mode-line-rolling-flag nil))
+                (throw 'break nil)))
+            (force-mode-line-update)
+            (sit-for eldoc-show-in-mode-line-delay))))
     (force-mode-line-update)))
 
 (defun eldoc-mode-line-toggle-rolling ()



reply via email to

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