X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a985d2b09bb88f31b27b02c3131cb34c5879d767..a7e302dc1dc18770aaf9eeedfd638f73b574bc19:/lisp/menu-bar.el diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index a6541182e2..c4f094a179 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -989,49 +989,43 @@ The selected font will be the default on both the existing and future frames." (customize-set-variable 'horizontal-scroll-bar-mode nil)) (defvar menu-bar-showhide-scroll-bar-menu - (let ((menu (make-sparse-keymap "Scroll-bar"))) + (let ((menu (make-sparse-keymap "Scroll-bar")) + (vsb (frame-parameter nil 'vertical-scroll-bars)) + (hsb (frame-parameter nil 'horizontal-scroll-bars))) (bindings--define-key menu [horizontal] '(menu-item "Horizontal" menu-bar-horizontal-scroll-bar :help "Horizontal scroll bar" :visible (horizontal-scroll-bars-available-p) - :button (:radio . (cdr (assq 'horizontal-scroll-bars - (frame-parameters)))))) + :button (:radio . hsb))) (bindings--define-key menu [none-horizontal] '(menu-item "None-horizontal" menu-bar-no-horizontal-scroll-bar :help "Turn off horizontal scroll bars" :visible (horizontal-scroll-bars-available-p) - :button (:radio . (not (cdr (assq 'horizontal-scroll-bars - (frame-parameters))))))) + :button (:radio . (not hsb)))) (bindings--define-key menu [right] '(menu-item "On the Right" menu-bar-right-scroll-bar :help "Scroll-bar on the right side" :visible (display-graphic-p) - :button (:radio . (eq (cdr (assq 'vertical-scroll-bars - (frame-parameters))) - 'right)))) + :button (:radio . (eq vsb 'right)))) (bindings--define-key menu [left] '(menu-item "On the Left" menu-bar-left-scroll-bar :help "Scroll-bar on the left side" :visible (display-graphic-p) - :button (:radio . (eq (cdr (assq 'vertical-scroll-bars - (frame-parameters))) - 'left)))) + :button (:radio . (eq vsb 'left)))) (bindings--define-key menu [none] '(menu-item "None" menu-bar-no-scroll-bar :help "Turn off scroll-bar" :visible (display-graphic-p) - :button (:radio . (eq (cdr (assq 'vertical-scroll-bars - (frame-parameters))) - nil)))) + :button (:radio . (nilp vsb)))) menu)) (defun menu-bar-frame-for-menubar ()