changeset 45492:955cc9eaf87a

(menu-bar-options-save): Add fringe-mode. (menu-bar-showhide-fringe-menu): New menu. (menu-bar-showhide-menu): Add Fringe sub-menu.
author Simon Josefsson <jas@extundo.com>
date Fri, 24 May 2002 09:52:21 +0000
parents 798c9867ab0c
children 6d49cede6000
files lisp/menu-bar.el
diffstat 1 files changed, 62 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Fri May 24 01:14:25 2002 +0000
+++ b/lisp/menu-bar.el	Fri May 24 09:52:21 2002 +0000
@@ -583,7 +583,7 @@
     ;; These are set with `customize-set-variable'.
     (dolist (elt '(line-number-mode column-number-mode scroll-bar-mode
 		   debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
-		   save-place uniquify-buffer-name-style
+		   save-place uniquify-buffer-name-style fringe-mode
 		   case-fold-search cua-mode show-paren-mode
 		   transient-mark-mode global-font-lock-mode
 		   display-time-mode auto-compression-mode
@@ -653,6 +653,67 @@
 			      (frame-visible-p
 			       (symbol-value 'speedbar-frame))))))
 
+(setq menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe"))
+
+(defun menu-bar-showhide-fringe-menu-customize ()
+  "Show customization buffer for `fringe-mode'."
+  (interactive)
+  (customize-variable 'fringe-mode))
+
+(define-key menu-bar-showhide-fringe-menu [customize]
+  '(menu-item "Customize" menu-bar-showhide-fringe-menu-customize
+	      :help "Detailed customization of fringe"
+	      :visible (display-graphic-p)))
+
+(defun menu-bar-showhide-fringe-menu-customize-reset ()
+  "Reset the default fringe mode."
+  (interactive)
+  (customize-set-variable 'fringe-mode nil))
+
+(define-key menu-bar-showhide-fringe-menu [default]
+  '(menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset
+	      :help "Default width fringe on both left and right side"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-mode nil))))
+
+(defun menu-bar-showhide-fringe-menu-customize-left ()
+  "Make fringes appear only on the left."
+  (interactive)
+  (customize-set-variable 'fringe-mode nil '(nil . 0)))
+
+(define-key menu-bar-showhide-fringe-menu [left]
+  '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left
+	      :help "Fringe only on the left side"
+	      :visible (display-graphic-p)
+	      :button (:radio . (equal fringe-mode '(nil . 0)))))
+
+(defun menu-bar-showhide-fringe-menu-customize-right ()
+  "Make fringes appear only on the right."
+  (interactive)
+  (customize-set-variable 'fringe-mode nil '(0 . nil)))
+
+(define-key menu-bar-showhide-fringe-menu [right]
+  '(menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right
+	      :help "Fringe only on the right side"
+	      :visible (display-graphic-p)
+	      :button (:radio . (equal fringe-mode '(0 . nil)))))
+
+(defun menu-bar-showhide-fringe-menu-customize-disable ()
+  "Make fringes disappear."
+  (interactive)
+  (customize-set-variable 'fringe-mode nil 0))
+
+(define-key menu-bar-showhide-fringe-menu [none]
+  '(menu-item "None" menu-bar-showhide-fringe-menu-customize-disable
+	      :help "Turn off fringe"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-mode 0))))
+
+(define-key menu-bar-showhide-menu [showhide-fringe]
+  (list 'menu-item "Fringe" menu-bar-showhide-fringe-menu
+	:visible `(display-graphic-p)
+	:help "Select fringe mode"))
+
 (defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-bar"))
 
 (define-key menu-bar-showhide-scroll-bar-menu [right]