modifying the variable *screen-mode-line-format* has no effect if the mode line was turned on with `enable-mode-line'

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

modifying the variable *screen-mode-line-format* has no effect if the mode line was turned on with `enable-mode-line'

Alex Kost
Hello.

Compare these 2 variants:

1.
   (enable-mode-line (current-screen) (current-head) nil)  ;; disable
   (setf *screen-mode-line-format* "foo")
   (toggle-mode-line (current-screen) (current-head))
   (setf *screen-mode-line-format* "bar")

And "foo" transforms into "bar" (respecting *mode-line-timeout*).

2.
   (enable-mode-line (current-screen) (current-head) nil)  ;; disable
   (setf *screen-mode-line-format* "foo")
   (enable-mode-line (current-screen) (current-head) t)
   (setf *screen-mode-line-format* "bar")

And "foo" remains the same.

This happens because `enable-mode-line' passes the value of the variable
(*screen-mode-line-format*) to `toggle-mode-line' instead of its symbol
('*screen-mode-line-format*).

It's not clear for me if it's a bug or a feature, but i think it's
inappropriate behavior.  So i suggest to make this slight modification:

diff --git a/mode-line.lisp b/mode-line.lisp
index d30dfb9..af74855 100644
--- a/mode-line.lisp
+++ b/mode-line.lisp
@@ -527,7 +527,7 @@
       (if (head-mode-line head)
           (when format
             (setf (mode-line-format (head-mode-line head)) format))
-          (toggle-mode-line screen head (or format *screen-mode-line-format*)))
+          (toggle-mode-line screen head (or format '*screen-mode-line-format*)))
       (when (head-mode-line head)
         (toggle-mode-line screen head))))

_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel