diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2016-07-05 08:33:29 +0300 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2016-07-06 06:05:15 +0300 |
commit | a7e302dc1dc18770aaf9eeedfd638f73b574bc19 (patch) | |
tree | 7452f77ec6aa99f6155aafec4366eccaa28e0eb5 /lisp/menu-bar.el | |
parent | b1a64dba04146b1424eacd3bc363e5f0edeac2b2 (diff) | |
download | emacs-a7e302dc1dc18770aaf9eeedfd638f73b574bc19.tar.gz |
Prefer 'frame-parameter' where it is expected to be a bit faster
* lisp/international/mule-diag.el (mule-diag):
* lisp/menu-bar.el (menu-bar-showhide-scroll-bar-menu):
* lisp/mouse.el (mouse-drag-line, font-menu-add-default):
* lisp/scroll-bar.el (toggle-scroll-bar, toggle-horizontal-scroll-bar):
* lisp/faces.el (x-resolve-font-name): Use 'frame-parameter'.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r-- | lisp/menu-bar.el | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index a6541182e24..c4f094a1793 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 () |