changeset 58598:e988bd99edf9

(menu-bar-options-save): Add fringe-indicators. (menu-bar-showhide-fringe-ind-menu): New keymap. (menu-bar-showhide-fringe-ind-empty) (menu-bar-showhide-fringe-ind-mixed) (menu-bar-showhide-fringe-ind-box) (menu-bar-showhide-fringe-ind-right) (menu-bar-showhide-fringe-ind-left) (menu-bar-showhide-fringe-ind-none): New defuns. (menu-bar-showhide-fringe-menu): Add "Indicators" sub-menu.
author Kim F. Storm <storm@cua.dk>
date Sun, 28 Nov 2004 00:56:43 +0000
parents fa269b651143
children 119590228e9a
files lisp/menu-bar.el
diffstat 1 files changed, 87 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Sun Nov 28 00:56:28 2004 +0000
+++ b/lisp/menu-bar.el	Sun Nov 28 00:56:43 2004 +0000
@@ -644,7 +644,7 @@
     (dolist (elt '(scroll-bar-mode
 		   debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
 		   save-place uniquify-buffer-name-style fringe-mode
-		   case-fold-search 
+		   fringe-indicators case-fold-search
 		   display-time-mode auto-compression-mode
 		   current-language-environment default-input-method
 		   ;; Saving `text-mode-hook' is somewhat questionable,
@@ -715,6 +715,87 @@
 			      (frame-visible-p
 			       (symbol-value 'speedbar-frame))))))
 
+
+(defvar menu-bar-showhide-fringe-ind-menu (make-sparse-keymap "Indicators"))
+
+;; The real definition is in fringe.el.
+;; This is to prevent errors in the :radio conditions below.
+(setq fringe-indicators nil)
+
+(defun menu-bar-showhide-fringe-ind-empty ()
+  "Display empty line indicators in the left or right fringe."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators 'empty))
+
+(define-key menu-bar-showhide-fringe-ind-menu [empty]
+  '(menu-item "Empty lines only" menu-bar-showhide-fringe-ind-empty
+	      :help "Show empty line indicators in fringe"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators 'empty))))
+
+(defun menu-bar-showhide-fringe-ind-mixed ()
+  "Display top and bottom indicators in opposite fringes, arrow in right."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators 'mixed))
+
+(define-key menu-bar-showhide-fringe-ind-menu [mixed]
+  '(menu-item "Opposite, arrows right" menu-bar-showhide-fringe-ind-mixed
+	      :help "Show top/bottom indicators in opposite fringes, arrows in right"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators 'mixed))))
+
+(defun menu-bar-showhide-fringe-ind-box ()
+  "Display top and bottom indicators in opposite fringes."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators 'box))
+
+(define-key menu-bar-showhide-fringe-ind-menu [box]
+  '(menu-item "Opposite, no arrows" menu-bar-showhide-fringe-ind-box
+	      :help "Show top/bottom indicators in opposite fringes, no arrows"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators 'box))))
+
+(defun menu-bar-showhide-fringe-ind-right ()
+  "Display fringe indicators in the right fringe."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators 'right))
+
+(define-key menu-bar-showhide-fringe-ind-menu [right]
+  '(menu-item "In right fringe" menu-bar-showhide-fringe-ind-right
+	      :help "Show indicators in right fringe"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators 'right))))
+
+(defun menu-bar-showhide-fringe-ind-left ()
+  "Display fringe indicators in the left fringe."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators 'left))
+
+(define-key menu-bar-showhide-fringe-ind-menu [left]
+  '(menu-item "In left fringe" menu-bar-showhide-fringe-ind-left
+	      :help "Show indicators in left fringe"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators 'left))))
+
+(defun menu-bar-showhide-fringe-ind-none ()
+  "Do not display any fringe indicators."
+  (interactive)
+  (require 'fringe)
+  (customize-set-variable 'fringe-indicators nil))
+
+(define-key menu-bar-showhide-fringe-ind-menu [none]
+  '(menu-item "No indicators" menu-bar-showhide-fringe-ind-none
+	      :help "Hide all fringe indicators"
+	      :visible (display-graphic-p)
+	      :button (:radio . (eq fringe-indicators nil))))
+
+
+
 (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe"))
 
 (defun menu-bar-showhide-fringe-menu-customize ()
@@ -732,6 +813,11 @@
   (interactive)
   (customize-set-variable 'fringe-mode nil))
 
+(define-key menu-bar-showhide-fringe-menu [showhide-fringe-ind]
+  (list 'menu-item "Indicators" menu-bar-showhide-fringe-ind-menu
+	:visible `(display-graphic-p)
+	:help "Select fringe mode"))
+
 ;; The real definition is in fringe.el.
 ;; This is to prevent errors in the :radio conditions below.
 (setq fringe-mode nil)