From a0b3f21fa6ca6c553afd99be0067b1cebc400a87 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Wed, 2 Jul 2025 14:11:17 +0200 Subject: [PATCH] add more buttons --- lisp/my/my-tool-bar.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lisp/my/my-tool-bar.el b/lisp/my/my-tool-bar.el index b7a1609b..495eb143 100644 --- a/lisp/my/my-tool-bar.el +++ b/lisp/my/my-tool-bar.el @@ -42,6 +42,15 @@ "Button to run `keyboard-escape-quit'.") ;; "Button to run `keyboard-quit'." +(defun my-tool-bar-function-revert (event) + "Run `revert-buffer'." + (interactive "e") + (let () + (revert-buffer))) + +(defvar my-tool-bar-button-revert "Revert " + "Button to run `revert-buffer'.") + (defun my-tool-bar-function-fill (event) "Run `fill-region'." (interactive "e") @@ -92,6 +101,9 @@ You can hide these buttons by customizing `tab-bar-format' and removing menu-item ,my-tool-bar-button-cancle my-tool-bar-function-cancle :help "Cancle `keyboard-escape-quit'") (sep-1 menu-item ,(tab-bar-separator) ignore) + (revert + menu-item ,my-tool-bar-button-revert my-tool-bar-function-revert + :help "Re-read current buffer from its file `revert-buffer'") (fill menu-item ,my-tool-bar-button-fill my-tool-bar-function-fill :help "Fill text in region to fit between left and right margin `fill-region'") @@ -155,6 +167,19 @@ See `icon-preference' for the order of type preference." :version "29.1")) (setq my-tool-bar-button-cancle (icon-string 'my-tool-bar-icon-cancle)) + (unless (iconp 'my-tool-bar-icon-revert) + (define-icon my-tool-bar-icon-revert nil + `((image "refresh.xpm" + :height (1.5 . em) + :margin ,tab-bar-button-margin + :ascent center) + (text "Revert" + ;; :face tab-bar-tab-inactive + )) + "Icon for revert buffer." + :version "29.1")) + (setq my-tool-bar-button-revert (icon-string 'my-tool-bar-icon-revert)) + (unless (iconp 'my-tool-bar-icon-fill) (define-icon my-tool-bar-icon-fill nil `((image "newsticker/narrow.xpm"