diff --git a/window-tool-bar.el b/window-tool-bar.el index 81c2ad5..2177217 100644 --- a/window-tool-bar.el +++ b/window-tool-bar.el @@ -18,13 +18,20 @@ ;;;###autoload (defun window-tool-bar-string () + "Return a (propertized) string for the tool bar. + +This is for when you want more customizations than +`window-tool-bar-mode' provides. Commonly added to +`tab-line-format', `header-line-format', or `mode-line-format'" (let ((toolbar-menu (cdr (keymap-global-lookup "")))) (mapconcat #'window-tool-bar--keymap-entry-to-string toolbar-menu " "))) (defun window-tool-bar--keymap-entry-to-string (menu-item) - "Convert MENU-ITEM into a (propertized) string representation." + "Convert MENU-ITEM into a (propertized) string representation. + +MENU-ITEM: Menu item to convert. See info node (elisp)Tool Bar." (pcase menu-item - (`(,key menu-item ,name . ,props) + (`(,key menu-item ,name . ,_) ;; Normal menu item, turn into propertized string button (let* ((str (format "[%s]" name)) (enable-form (plist-get menu-item :enable)) @@ -71,6 +78,7 @@ (setq tab-line-format nil))) (defun window-tool-bar--turn-on () + "Internal function called by `global-window-tool-bar-mode'." (window-tool-bar-mode 1)) ;;;###autoload