summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2015-07-02 09:03:45 +0200
committerMartin Rudalics <rudalics@gmx.at>2015-07-02 09:03:45 +0200
commit0245cc374015a67f5c17fec1342c8a35cbd41779 (patch)
tree951ee475718a5c39b918fa280713052876f89da0 /lisp/menu-bar.el
parentbb35a21c0e8a4b82ac04fa26a53f6ca394afbb24 (diff)
downloademacs-0245cc374015a67f5c17fec1342c8a35cbd41779.tar.gz
Improve accessibility of window dividers. (Bug#20183)
* lisp/faces.el (window-divider) (window-divider-first-pixel, window-divider-last-pixel): Change membership from `frames' to `window-divider' customization group. * lisp/frame.el (window-divider): New customization group. (window-divider-mode): New minor mode. (window-divider-default-bottom-width) (window-divider-default-right-width): New options. (frame--window-divider-previous-mode): New variable. (frame-window-divider-width-valid-p) (frame--window-divider-mode-apply) (frame--window-divider-mode-set-and-apply): New functions. * lisp/menu-bar.el (menu-bar-options-save): Save window-divider-mode settings. (menu-bar-window-divider-customize) (menu-bar-bottom-and-right-window-divider) (menu-bar-right-window-divider, menu-bar-bottom-window-divider) (menu-bar-no-window-divider): New functions. (menu-bar-showhide-window-divider-menu): New variable. (menu-bar-showhide-menu): Show/hide window divider menu. * lisp/mouse.el (mouse-split-window-vertically) (mouse-split-window-horizontally): Replace `error' by `user-error'. Bind `window-combination-resize' to nil. (top-level): Add/reorder mouse key bindings on mode- and vertical-line.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el92
1 files changed, 91 insertions, 1 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 22a0b8faaba..5a69084f98d 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -683,7 +683,7 @@ by \"Save Options\" in Custom buffers.")
(dolist (elt '(scroll-bar-mode
debug-on-quit debug-on-error
;; Somehow this works, when tool-bar and menu-bar don't.
- tooltip-mode
+ tooltip-mode window-divider-mode
save-place uniquify-buffer-name-style fringe-mode
indicate-empty-lines indicate-buffer-boundaries
case-fold-search font-use-system-font
@@ -711,6 +711,92 @@ by \"Save Options\" in Custom buffers.")
;; The "Show/Hide" submenu of menu "Options"
+(defun menu-bar-window-divider-customize ()
+ "Show customization buffer for `window-divider' group."
+ (interactive)
+ (customize-group 'window-divider))
+
+(defun menu-bar-bottom-and-right-window-divider ()
+ "Display dividers on the bottom and right of each window."
+ (interactive)
+ (customize-set-variable 'window-divider-mode t))
+
+(defun menu-bar-right-window-divider ()
+ "Display dividers only on the right of each window."
+ (interactive)
+ (customize-set-variable 'window-divider-mode 'right-only))
+
+(defun menu-bar-bottom-window-divider ()
+ "Display dividers only at the bottom of each window."
+ (interactive)
+ (customize-set-variable 'window-divider-mode 'bottom-only))
+
+(defun menu-bar-no-window-divider ()
+ "Do not display window dividers."
+ (interactive)
+ (customize-set-variable 'window-divider-mode nil))
+
+;; For the radio buttons below we check whether the respective dividers
+;; are displayed on the selected frame. This is not fully congruent
+;; with `window-divder-mode' but makes the menu entries work also when
+;; dividers are displayed by manipulating frame parameters directly.
+(defvar menu-bar-showhide-window-divider-menu
+ (let ((menu (make-sparse-keymap "Window Divider")))
+ (bindings--define-key menu [customize]
+ '(menu-item "Customize" menu-bar-window-divider-customize
+ :help "Customize window dividers"
+ :visible (memq (window-system) '(x w32))))
+
+ (bindings--define-key menu [bottom-and-right]
+ '(menu-item "Bottom and Right"
+ menu-bar-bottom-and-right-window-divider
+ :help "Display window divider on the bottom and right of each window"
+ :visible (memq (window-system) '(x w32))
+ :button (:radio
+ . (and (frame-window-divider-width-valid-p
+ (cdr (assq 'bottom-divider-width
+ (frame-parameters))))
+ (frame-window-divider-width-valid-p
+ (cdr (assq 'right-divider-width
+ (frame-parameters))))))))
+ (bindings--define-key menu [right-only]
+ '(menu-item "Right Only"
+ menu-bar-right-window-divider
+ :help "Display window divider on the right of each window only"
+ :visible (memq (window-system) '(x w32))
+ :button (:radio
+ . (and (not (frame-window-divider-width-valid-p
+ (cdr (assq 'bottom-divider-width
+ (frame-parameters)))))
+ (frame-window-divider-width-valid-p
+ (cdr (assq 'right-divider-width
+ (frame-parameters))))))))
+ (bindings--define-key menu [bottom-only]
+ '(menu-item "Bottom Only"
+ menu-bar-bottom-window-divider
+ :help "Display window divider on the bottom of each window only"
+ :visible (memq (window-system) '(x w32))
+ :button (:radio
+ . (and (frame-window-divider-width-valid-p
+ (cdr (assq 'bottom-divider-width
+ (frame-parameters))))
+ (not (frame-window-divider-width-valid-p
+ (cdr (assq 'right-divider-width
+ (frame-parameters)))))))))
+ (bindings--define-key menu [no-divider]
+ '(menu-item "None"
+ menu-bar-no-window-divider
+ :help "Do not display window dividers"
+ :visible (memq (window-system) '(x w32))
+ :button (:radio
+ . (and (not (frame-window-divider-width-valid-p
+ (cdr (assq 'bottom-divider-width
+ (frame-parameters)))))
+ (not (frame-window-divider-width-valid-p
+ (cdr (assq 'right-divider-width
+ (frame-parameters)))))))))
+ menu))
+
(defun menu-bar-showhide-fringe-ind-customize ()
"Show customization buffer for `indicate-buffer-boundaries'."
(interactive)
@@ -1072,6 +1158,10 @@ mail status in mode line"))
(frame-visible-p
(symbol-value 'speedbar-frame))))))
+ (bindings--define-key menu [showhide-window-divider]
+ `(menu-item "Window Divider" ,menu-bar-showhide-window-divider-menu
+ :visible (memq (window-system) '(x w32))))
+
(bindings--define-key menu [showhide-fringe]
`(menu-item "Fringe" ,menu-bar-showhide-fringe-menu
:visible (display-graphic-p)))