emacs-diffs
[Top][All Lists]
Advanced

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

master c7aa5c6d2b8: Populate tool-bar bindings on text terminals


From: Eli Zaretskii
Subject: master c7aa5c6d2b8: Populate tool-bar bindings on text terminals
Date: Thu, 11 Jan 2024 05:50:52 -0500 (EST)

branch: master
commit c7aa5c6d2b838e2fd84db4cbdafdbd546dd87832
Author: Jared Finder <jared@finder.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Populate tool-bar bindings on text terminals
    
    * lisp/tool-bar.el (tool-bar-make-keymap-1): Populate on text
    terminals.  (Bug#68334)
---
 lisp/tool-bar.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 4ca81fb01e0..96b61c7b229 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -165,6 +165,8 @@ color capability and based on the available image 
libraries."
             base-keymap)
       base-keymap)))
 
+;; This function should return binds even if images can not be
+;; displayed so the tool bar can still be displayed on terminals.
 (defun tool-bar-make-keymap-1 (&optional map)
   "Generate an actual keymap from `tool-bar-map', without caching.
 MAP is either a keymap to use as a source for menu items, or nil,
@@ -180,15 +182,14 @@ in which case the value of `tool-bar-map' is used 
instead."
                         (consp image-exp)
                         (not (eq (car image-exp) 'image))
                         (fboundp (car image-exp)))
-               (if (not (display-images-p))
-                   (setq bind nil)
-                 (let ((image (eval image-exp)))
-                   (unless (and image (image-mask-p image))
-                     (setq image (append image '(:mask heuristic))))
-                   (setq bind (copy-sequence bind)
-                         plist (nthcdr (if (consp (nth 4 bind)) 5 4)
-                                       bind))
-                   (plist-put plist :image image))))
+               (let ((image (and (display-images-p)
+                                  (eval image-exp))))
+                 (unless (and image (image-mask-p image))
+                   (setq image (append image '(:mask heuristic))))
+                 (setq bind (copy-sequence bind)
+                       plist (nthcdr (if (consp (nth 4 bind)) 5 4)
+                                     bind))
+                 (plist-put plist :image image)))
              bind))
          (or map tool-bar-map)))
 



reply via email to

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