[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Re: Emacs Survey: Toolbars
From: |
Stefan Monnier |
Subject: |
Re: [External] : Re: Emacs Survey: Toolbars |
Date: |
Fri, 26 Feb 2021 11:27:20 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> By "inside the window's text" do you mean anywhere
> within it, so for example a user could move it
I don't know what other people mean, but what I'm thinking of is
reflected in the chunk of code below I started writing some years ago.
You can `insert` the result into the buffer to put a toolbar wherever
you want (don't expect miracles: it has loads of shortcomings).
Stefan
(defun tool-bar-to-string (&optional map)
(let ((res ""))
(map-keymap
(lambda (k v)
(when (eq (car v) 'menu-item)
(let* ((name (nth 1 v)) ;Unused, AFAICT.
(cmd (nth 2 v))
(plist (nthcdr (if (consp (nth 3 v)) 4 3) v))
(help-echo (plist-get plist :help))
(image (plist-get plist :image))
(button (propertize " " 'help-echo help-echo
'keymap (let ((map (make-sparse-keymap)))
(define-key map [mouse-1] cmd)
map)
'face 'tool-bar ;; 'custom-button
'mouse-face 'custom-button-mouse
'rear-nonsticky '(display keymap help-echo)
'display image)))
(setq res (concat res (propertize " " 'display '(space :width 1)
'face 'custom-button
)
button)))))
(or map (key-binding [tool-bar])))
res))
- Re: Emacs Survey: Toolbars, Stefan Kangas, 2021/02/25
- Re: Emacs Survey: Toolbars, Eli Zaretskii, 2021/02/25
- Re: Emacs Survey: Toolbars, Lars Ingebrigtsen, 2021/02/26
- RE: [External] : Re: Emacs Survey: Toolbars, Drew Adams, 2021/02/26
- Re: [External] : Re: Emacs Survey: Toolbars,
Stefan Monnier <=
- *Menu* buffer, Tomas Hlavaty, 2021/02/26
- Re: *Menu* buffer, Eli Zaretskii, 2021/02/27
Re: Emacs Survey: Toolbars, martin rudalics, 2021/02/25