comparison lisp/menu-bar.el @ 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 7bc75f3f915a
children 798f4c8b5626 f2ebccfa87d4
comparison
equal deleted inserted replaced
58597:fa269b651143 58598:e988bd99edf9
642 (setq need-save t))) 642 (setq need-save t)))
643 ;; These are set with `customize-set-variable'. 643 ;; These are set with `customize-set-variable'.
644 (dolist (elt '(scroll-bar-mode 644 (dolist (elt '(scroll-bar-mode
645 debug-on-quit debug-on-error menu-bar-mode tool-bar-mode 645 debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
646 save-place uniquify-buffer-name-style fringe-mode 646 save-place uniquify-buffer-name-style fringe-mode
647 case-fold-search 647 fringe-indicators case-fold-search
648 display-time-mode auto-compression-mode 648 display-time-mode auto-compression-mode
649 current-language-environment default-input-method 649 current-language-environment default-input-method
650 ;; Saving `text-mode-hook' is somewhat questionable, 650 ;; Saving `text-mode-hook' is somewhat questionable,
651 ;; as we might get more than we bargain for, if 651 ;; as we might get more than we bargain for, if
652 ;; other code may has added hooks as well. 652 ;; other code may has added hooks as well.
713 . (and (boundp 'speedbar-frame) 713 . (and (boundp 'speedbar-frame)
714 (frame-live-p (symbol-value 'speedbar-frame)) 714 (frame-live-p (symbol-value 'speedbar-frame))
715 (frame-visible-p 715 (frame-visible-p
716 (symbol-value 'speedbar-frame)))))) 716 (symbol-value 'speedbar-frame))))))
717 717
718
719 (defvar menu-bar-showhide-fringe-ind-menu (make-sparse-keymap "Indicators"))
720
721 ;; The real definition is in fringe.el.
722 ;; This is to prevent errors in the :radio conditions below.
723 (setq fringe-indicators nil)
724
725 (defun menu-bar-showhide-fringe-ind-empty ()
726 "Display empty line indicators in the left or right fringe."
727 (interactive)
728 (require 'fringe)
729 (customize-set-variable 'fringe-indicators 'empty))
730
731 (define-key menu-bar-showhide-fringe-ind-menu [empty]
732 '(menu-item "Empty lines only" menu-bar-showhide-fringe-ind-empty
733 :help "Show empty line indicators in fringe"
734 :visible (display-graphic-p)
735 :button (:radio . (eq fringe-indicators 'empty))))
736
737 (defun menu-bar-showhide-fringe-ind-mixed ()
738 "Display top and bottom indicators in opposite fringes, arrow in right."
739 (interactive)
740 (require 'fringe)
741 (customize-set-variable 'fringe-indicators 'mixed))
742
743 (define-key menu-bar-showhide-fringe-ind-menu [mixed]
744 '(menu-item "Opposite, arrows right" menu-bar-showhide-fringe-ind-mixed
745 :help "Show top/bottom indicators in opposite fringes, arrows in right"
746 :visible (display-graphic-p)
747 :button (:radio . (eq fringe-indicators 'mixed))))
748
749 (defun menu-bar-showhide-fringe-ind-box ()
750 "Display top and bottom indicators in opposite fringes."
751 (interactive)
752 (require 'fringe)
753 (customize-set-variable 'fringe-indicators 'box))
754
755 (define-key menu-bar-showhide-fringe-ind-menu [box]
756 '(menu-item "Opposite, no arrows" menu-bar-showhide-fringe-ind-box
757 :help "Show top/bottom indicators in opposite fringes, no arrows"
758 :visible (display-graphic-p)
759 :button (:radio . (eq fringe-indicators 'box))))
760
761 (defun menu-bar-showhide-fringe-ind-right ()
762 "Display fringe indicators in the right fringe."
763 (interactive)
764 (require 'fringe)
765 (customize-set-variable 'fringe-indicators 'right))
766
767 (define-key menu-bar-showhide-fringe-ind-menu [right]
768 '(menu-item "In right fringe" menu-bar-showhide-fringe-ind-right
769 :help "Show indicators in right fringe"
770 :visible (display-graphic-p)
771 :button (:radio . (eq fringe-indicators 'right))))
772
773 (defun menu-bar-showhide-fringe-ind-left ()
774 "Display fringe indicators in the left fringe."
775 (interactive)
776 (require 'fringe)
777 (customize-set-variable 'fringe-indicators 'left))
778
779 (define-key menu-bar-showhide-fringe-ind-menu [left]
780 '(menu-item "In left fringe" menu-bar-showhide-fringe-ind-left
781 :help "Show indicators in left fringe"
782 :visible (display-graphic-p)
783 :button (:radio . (eq fringe-indicators 'left))))
784
785 (defun menu-bar-showhide-fringe-ind-none ()
786 "Do not display any fringe indicators."
787 (interactive)
788 (require 'fringe)
789 (customize-set-variable 'fringe-indicators nil))
790
791 (define-key menu-bar-showhide-fringe-ind-menu [none]
792 '(menu-item "No indicators" menu-bar-showhide-fringe-ind-none
793 :help "Hide all fringe indicators"
794 :visible (display-graphic-p)
795 :button (:radio . (eq fringe-indicators nil))))
796
797
798
718 (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe")) 799 (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe"))
719 800
720 (defun menu-bar-showhide-fringe-menu-customize () 801 (defun menu-bar-showhide-fringe-menu-customize ()
721 "Show customization buffer for `fringe-mode'." 802 "Show customization buffer for `fringe-mode'."
722 (interactive) 803 (interactive)
729 810
730 (defun menu-bar-showhide-fringe-menu-customize-reset () 811 (defun menu-bar-showhide-fringe-menu-customize-reset ()
731 "Reset the fringe mode: display fringes on both sides of a window." 812 "Reset the fringe mode: display fringes on both sides of a window."
732 (interactive) 813 (interactive)
733 (customize-set-variable 'fringe-mode nil)) 814 (customize-set-variable 'fringe-mode nil))
815
816 (define-key menu-bar-showhide-fringe-menu [showhide-fringe-ind]
817 (list 'menu-item "Indicators" menu-bar-showhide-fringe-ind-menu
818 :visible `(display-graphic-p)
819 :help "Select fringe mode"))
734 820
735 ;; The real definition is in fringe.el. 821 ;; The real definition is in fringe.el.
736 ;; This is to prevent errors in the :radio conditions below. 822 ;; This is to prevent errors in the :radio conditions below.
737 (setq fringe-mode nil) 823 (setq fringe-mode nil)
738 824