From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: unnecessary fringe-indicators defcustom creates trouble Date: Wed, 3 Aug 2005 20:03:04 -0500 (CDT) Message-ID: <200508040103.j74134v11621@raven.dms.auburn.edu> References: <200507290113.j6T1Drc18126@raven.dms.auburn.edu> <200508010247.j712l3B02940@raven.dms.auburn.edu> <200508012118.j71LI0N06793@raven.dms.auburn.edu> <200508022031.j72KVkP09810@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1123118006 10034 80.91.229.2 (4 Aug 2005 01:13:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2005 01:13:26 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 04 03:13:23 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E0UIU-0005qq-8G for ged-emacs-devel@m.gmane.org; Thu, 04 Aug 2005 03:13:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E0ULG-00062j-5o for ged-emacs-devel@m.gmane.org; Wed, 03 Aug 2005 21:16:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E0UJK-0005dn-SY for emacs-devel@gnu.org; Wed, 03 Aug 2005 21:14:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E0UJF-0005b8-S8 for emacs-devel@gnu.org; Wed, 03 Aug 2005 21:14:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E0UJD-0005Xg-E3 for emacs-devel@gnu.org; Wed, 03 Aug 2005 21:14:08 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E0ULM-0000Zi-Cr; Wed, 03 Aug 2005 21:16:20 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j7413Dqt011798; Wed, 3 Aug 2005 20:03:14 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j74134v11621; Wed, 3 Aug 2005 20:03:04 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41467 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41467 The patches below keep all the functionality available through the menu bar while getting rid of `fringe-indicators'. They implement some changes, but that is only because I believe that they are very much changes for the better and not because getting rid of `fringe-indicators' requires them. They can be undone, while still getting rid of `fringe-indicators'. The changes are: 1. More descriptive help-echos. 2. The extra choice "Other (customize)" for `indicate-buffer-boundaries'. If you select that one, you get a customization buffer for `indicate-buffer-boundaries'. This is just to inform people that additional choices are available. 3. The possibility to customize `indicate-empty-lines' and `indicate-buffer-boundaries' independently through the menu bar. This is desirable, because the two do by no means make each other useless. `indicate-empty-lines' does not show buffer beginning nor arrows. `indicate-buffer-boundaries' does not reliably indicate all empty lines: for instance, just using indicate-buffer-boundaries it is impossible to tell whether a buffer is completely empty or whether you are completely overscrolled. Also, the isolated end-of-buffer glyph can easily be overwritten by some other glyph, much more easily than all empty lines at the end of a buffer. I personally enable empty line indicators to the left and boundary indicators to the right. The two are absolutely not redundant. I also believe that it is confusing to somebody that has enabled `indicate-empty-lines' in some other way that enabling buffer boundary indicators in the right fringe gets rid of the empty line indicators in the left fringe. ===File ~/menu-bar-diff===================================== *** menu-bar.el 04 Jul 2005 19:48:43 -0500 1.261 --- menu-bar.el 03 Aug 2005 18:34:45 -0500 *************** *** 649,656 **** debug-on-quit debug-on-error tooltip-mode menu-bar-mode tool-bar-mode save-place uniquify-buffer-name-style fringe-mode ! fringe-indicators case-fold-search ! display-time-mode auto-compression-mode current-language-environment default-input-method ;; Saving `text-mode-hook' is somewhat questionable, ;; as we might get more than we bargain for, if --- 649,656 ---- debug-on-quit debug-on-error tooltip-mode menu-bar-mode tool-bar-mode save-place uniquify-buffer-name-style fringe-mode ! indicate-empty-lines indicate-buffer-boundaries ! case-fold-search display-time-mode auto-compression-mode current-language-environment default-input-method ;; Saving `text-mode-hook' is somewhat questionable, ;; as we might get more than we bargain for, if *************** *** 717,804 **** (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 () "Show customization buffer for `fringe-mode'." --- 717,808 ---- (frame-visible-p (symbol-value 'speedbar-frame)))))) + (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe")) ! (defvar menu-bar-showhide-fringe-ind-menu ! (make-sparse-keymap "Buffer boundaries")) ! (defun menu-bar-showhide-boundaries-menu-customize () ! "Show customization buffer for `indicate-buffer-boundaries'." (interactive) ! (customize-variable 'indicate-buffer-boundaries)) ! (define-key menu-bar-showhide-fringe-ind-menu [customize] ! '(menu-item "Other (customize)" ! menu-bar-showhide-boundaries-menu-customize ! :help "Additional choices available through Custom buffer" ! :visible (display-graphic-p))) (defun menu-bar-showhide-fringe-ind-mixed () ! "Display top and bottom indicators in opposite fringes, arrows in right." (interactive) ! (customize-set-variable 'indicate-buffer-boundaries ! '((t . right) (top . left)))) (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 indicate-buffer-boundaries ! '((t . right) (top . left)))))) (defun menu-bar-showhide-fringe-ind-box () "Display top and bottom indicators in opposite fringes." (interactive) ! (customize-set-variable 'indicate-buffer-boundaries ! '((top . left) (bottom . right)))) (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 indicate-buffer-boundaries ! '((top . left) (bottom . right)))))) (defun menu-bar-showhide-fringe-ind-right () ! "Display buffer boundaries and arrows in the right fringe." (interactive) ! (customize-set-variable 'indicate-buffer-boundaries 'right)) (define-key menu-bar-showhide-fringe-ind-menu [right] '(menu-item "In right fringe" menu-bar-showhide-fringe-ind-right ! :help "Show buffer boundaries and arrows in right fringe" :visible (display-graphic-p) ! :button (:radio . (eq indicate-buffer-boundaries 'right)))) (defun menu-bar-showhide-fringe-ind-left () ! "Display buffer boundaries and arrows in the left fringe." (interactive) ! (customize-set-variable 'indicate-buffer-boundaries 'left)) (define-key menu-bar-showhide-fringe-ind-menu [left] '(menu-item "In left fringe" menu-bar-showhide-fringe-ind-left ! :help "Show buffer boundaries and arrows in left fringe" :visible (display-graphic-p) ! :button (:radio . (eq indicate-buffer-boundaries 'left)))) (defun menu-bar-showhide-fringe-ind-none () ! "Do not display any buffer boundary indicators." (interactive) ! (customize-set-variable 'indicate-buffer-boundaries nil)) (define-key menu-bar-showhide-fringe-ind-menu [none] '(menu-item "No indicators" menu-bar-showhide-fringe-ind-none ! :help "Hide all buffer boundary indicators and arrows" :visible (display-graphic-p) ! :button (:radio . (eq indicate-buffer-boundaries nil)))) + (define-key menu-bar-showhide-fringe-menu [showhide-fringe-ind] + (list 'menu-item "Buffer boundaries" menu-bar-showhide-fringe-ind-menu + :visible `(display-graphic-p) + :help "Indicate buffer boundaries in fringe")) ! (define-key menu-bar-showhide-fringe-menu [indicate-empty-lines] ! (menu-bar-make-toggle toggle-indicate-empty-lines indicate-empty-lines ! "Empty line indicators" ! "Indicating of empty lines %s" ! "Indicate trailing empty lines in fringe")) (defun menu-bar-showhide-fringe-menu-customize () "Show customization buffer for `fringe-mode'." *************** *** 806,812 **** (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))) --- 810,816 ---- (customize-variable 'fringe-mode)) (define-key menu-bar-showhide-fringe-menu [customize] ! '(menu-item "Customize fringe" menu-bar-showhide-fringe-menu-customize :help "Detailed customization of fringe" :visible (display-graphic-p))) *************** *** 815,829 **** (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) - (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" --- 819,824 ---- ============================================================ ===File ~/fringe-diff======================================= *** fringe.el 09 Jul 2005 19:13:39 -0500 1.20 --- fringe.el 02 Aug 2005 07:49:07 -0500 *************** *** 260,302 **** 0) (float (frame-char-width)))) - ;; Fake defvar. Real definition using defcustom is below. The fake - ;; defvar is necessary because `fringe-indicators' and - ;; `set-fringe-indicators-1' mutually use each other. - (defvar fringe-indicators) - - (defun set-fringe-indicators-1 (ignore value) - "Set fringe indicators according to VALUE. - This is usually invoked when setting `fringe-indicators' via customize." - (setq fringe-indicators value) - (setq default-indicate-empty-lines nil) - (setq default-indicate-buffer-boundaries - (cond - ((memq value '(left right t)) - value) - ((eq value 'box) - '((top . left) (bottom . right))) - ((eq value 'mixed) - '((top . left) (t . right))) - ((eq value 'empty) - (setq default-indicate-empty-lines t) - nil) - (t nil)))) - - ;;;###autoload - (defcustom fringe-indicators nil - "Visually indicate buffer boundaries and scrolling. - Setting this variable, changes `default-indicate-buffer-boundaries'." - :type '(choice (const :tag "No indicators" nil) - (const :tag "On left" left) - (const :tag "On right" right) - (const :tag "Opposite, no arrows" box) - (const :tag "Opposite, arrows right" mixed) - (const :tag "Empty lines" empty)) - :group 'fringe - :require 'fringe - :set 'set-fringe-indicators-1) - (provide 'fringe) ;;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d --- 260,265 ---- ============================================================