diff options
| author | Jared Finder | 2024-01-08 13:20:25 -0800 |
|---|---|---|
| committer | Eli Zaretskii | 2024-01-11 12:49:27 +0200 |
| commit | c7aa5c6d2b838e2fd84db4cbdafdbd546dd87832 (patch) | |
| tree | 57fbe80d2706e6185cd76b5c2dd1441a214f50a1 | |
| parent | dc1f18e9d0863a03e00134b36279101f0747fcfb (diff) | |
| download | emacs-c7aa5c6d2b838e2fd84db4cbdafdbd546dd87832.tar.gz emacs-c7aa5c6d2b838e2fd84db4cbdafdbd546dd87832.zip | |
Populate tool-bar bindings on text terminals
* lisp/tool-bar.el (tool-bar-make-keymap-1): Populate on text
terminals. (Bug#68334)
| -rw-r--r-- | lisp/tool-bar.el | 19 |
1 files 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." | |||
| 165 | base-keymap) | 165 | base-keymap) |
| 166 | base-keymap))) | 166 | base-keymap))) |
| 167 | 167 | ||
| 168 | ;; This function should return binds even if images can not be | ||
| 169 | ;; displayed so the tool bar can still be displayed on terminals. | ||
| 168 | (defun tool-bar-make-keymap-1 (&optional map) | 170 | (defun tool-bar-make-keymap-1 (&optional map) |
| 169 | "Generate an actual keymap from `tool-bar-map', without caching. | 171 | "Generate an actual keymap from `tool-bar-map', without caching. |
| 170 | MAP is either a keymap to use as a source for menu items, or nil, | 172 | 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." | |||
| 180 | (consp image-exp) | 182 | (consp image-exp) |
| 181 | (not (eq (car image-exp) 'image)) | 183 | (not (eq (car image-exp) 'image)) |
| 182 | (fboundp (car image-exp))) | 184 | (fboundp (car image-exp))) |
| 183 | (if (not (display-images-p)) | 185 | (let ((image (and (display-images-p) |
| 184 | (setq bind nil) | 186 | (eval image-exp)))) |
| 185 | (let ((image (eval image-exp))) | 187 | (unless (and image (image-mask-p image)) |
| 186 | (unless (and image (image-mask-p image)) | 188 | (setq image (append image '(:mask heuristic)))) |
| 187 | (setq image (append image '(:mask heuristic)))) | 189 | (setq bind (copy-sequence bind) |
| 188 | (setq bind (copy-sequence bind) | 190 | plist (nthcdr (if (consp (nth 4 bind)) 5 4) |
| 189 | plist (nthcdr (if (consp (nth 4 bind)) 5 4) | 191 | bind)) |
| 190 | bind)) | 192 | (plist-put plist :image image))) |
| 191 | (plist-put plist :image image)))) | ||
| 192 | bind)) | 193 | bind)) |
| 193 | (or map tool-bar-map))) | 194 | (or map tool-bar-map))) |
| 194 | 195 | ||