all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* unnecessary fringe-indicators defcustom creates trouble
@ 2005-07-29  1:13 Luc Teirlinck
  2005-07-29 15:29 ` Kim F. Storm
  2005-08-01  0:45 ` Richard M. Stallman
  0 siblings, 2 replies; 14+ messages in thread
From: Luc Teirlinck @ 2005-07-29  1:13 UTC (permalink / raw)


Just loading fringe.el overrides my customizations for
indicate-empty-lines and indicate-buffer-boundaries.  It resets both
to nil, which is extremely annoying, because I have come to depend on
indicate-empty-lines.  The culprit is the :set function for
`fringe-indicators', a completely unnecessary variable, since it is
just a clumsy intertwining of indicate-empty-lines and
indicate-buffer-boundaries and it is much less powerful than the
combination of these two.  I have personally indicate-empty-lines set
to t and indicate-buffer-boundaries set to ((top . left)).  That is
one example of several useful combinations that are impossible to
achieve with fringe-indicators.  If you currently use one of these
combinations or just use `indicate-empty-lines', you are in constant
danger of your customizations being overridden by the
fringe-indicators bully.

`indicate-empty-lines' is already a defcustomed variable (actually set
in startup.el).  `indicate-buffer-boundaries' is not, but it should be
and the patches below make it customizable through startup.el.  Once
this is done, there is no longer any need for the annoying
fringe-indicators variable.  Neither `indicate-empty-lines' nor
`indicate-buffer-boundaries' use a :set function, so neither can
override anything that the user does not want it to override.  Because
`indicate-empty-lines' and `indicate-buffer-boundaries' are related in
their goals, they belong in the same customization buffer.  Therefore
the patches below change the custom group of `indicate-empty-lines'
from `display' to `fringe', which was the group of fringe-indicators
before my patches and of indicate-buffer-boundaries after my patches.

There are also some changes to the menu bar.  These are necessary,
because the menu bar used fringe-indicators.  The present layout of
the menu bar is problematic anyway.  Both indicate-empty-lines and
fringe-indicators are in the "fringe" submenu, where they do not
belong.  They belong directly under Show-Hide.  The patches below put
the most important and easiest to understand one, indicate-empty-lines
directly under Show-Hide, making it easier to find.  My patches
currently just remove the remaining functionality of fringe-indicators
from the menu bar.  It would be possible to put that functionality
back on the menu bar (in a more logical way) using
`indicate-buffer-boundaries' instead of fringe-indicators, but I doubt
that it is important enough.  We can not just put any customization
possibility of minor, or even of average, importance on the menu bar;
the menu bar is not a complete substitute for Custom.

Here are my patches.  I can install them if desired.

===File ~/cus-start.el-diff=================================
*** cus-start.el	07 Jul 2005 17:34:08 -0500	1.72
--- cus-start.el	28 Jul 2005 18:48:25 -0500	
***************
*** 65,71 ****
  	     (ctl-arrow display boolean)
  	     (truncate-lines display boolean)
  	     (selective-display-ellipses display boolean)
! 	     (indicate-empty-lines display boolean "21.1")
  	     (scroll-up-aggressively windows
  				     (choice (const :tag "off" nil) number)
  				     "21.1")
--- 65,105 ----
  	     (ctl-arrow display boolean)
  	     (truncate-lines display boolean)
  	     (selective-display-ellipses display boolean)
! 	     (indicate-empty-lines fringe boolean "21.1")
! 	     (indicate-buffer-boundaries
! 	      fringe
! 	      (choice
! 	       (const :tag "No indicators" nil)
! 	       (const :tag "On left, with arrows" left)
! 	       (const :tag "On right, with arrows" right)
! 	       (const :tag "On left, no arrows" t)
! 	       (set :tag "Other"
! 		    (choice :tag "Default"
! 			    :value (t . left)
! 			    (const :tag "Do not show" (t . nil))
! 			    (const :tag "On the left" (t . left))
! 			    (const :tag "On the right" (t . right)))
! 		    (choice :tag "Top"
! 			    :value (top . left)
! 			    (const :tag "Do not show" (top . nil))
! 			    (const :tag "On the left" (top . left))
! 			    (const :tag "On the right" (top . right)))
! 		    (choice :tag "Bottom"
! 			    :value (bottom . left)
! 			    (const :tag "Do not show" (bottom . nil))
! 			    (const :tag "On the left" (bottom . left))
! 			    (const :tag "On the right" (bottom . right)))
! 		    (choice :tag "Up arrow"
! 			    :value (up . left)
! 			    (const :tag "Do not show" (up . nil))
! 			    (const :tag "On the left" (up . left))
! 			    (const :tag "On the right" (up . right)))
! 		    (choice :tag "Down arrow"
! 			    :value (down . left)
! 			    (const :tag "Do not show" (down . nil))
! 			    (const :tag "On the left" (down . left))
! 			    (const :tag "On the right" (down . right)))))
! 	      "22.1")
  	     (scroll-up-aggressively windows
  				     (choice (const :tag "off" nil) number)
  				     "21.1")
============================================================

===File ~/fringe.el-diff====================================
*** fringe.el	09 Jul 2005 19:13:39 -0500	1.20
--- fringe.el	27 Jul 2005 22:36:51 -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 ----
============================================================

===File ~/menubar.el-diff===================================
*** menu-bar.el	04 Jul 2005 19:48:43 -0500	1.261
--- menu-bar.el	28 Jul 2005 16:23:29 -0500	
***************
*** 649,655 ****
  		   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,
--- 649,655 ----
  		   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 case-fold-search
  		   display-time-mode auto-compression-mode
  		   current-language-environment default-input-method
  		   ;; Saving `text-mode-hook' is somewhat questionable,
***************
*** 717,802 ****
  			      (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"))
  
--- 717,727 ----
  			      (frame-visible-p
  			       (symbol-value 'speedbar-frame))))))
  
! (define-key menu-bar-showhide-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"))
  
  (defvar menu-bar-showhide-fringe-menu (make-sparse-keymap "Fringe"))
  
***************
*** 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"
--- 740,745 ----
============================================================

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-07-29  1:13 unnecessary fringe-indicators defcustom creates trouble Luc Teirlinck
@ 2005-07-29 15:29 ` Kim F. Storm
  2005-07-30  4:02   ` Luc Teirlinck
  2005-08-01  0:45 ` Richard M. Stallman
  1 sibling, 1 reply; 14+ messages in thread
From: Kim F. Storm @ 2005-07-29 15:29 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

>
> Here are my patches.  I can install them if desired.

Fine with me, but others may object to removing the ability to set the
indicators from the menu bar...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-07-29 15:29 ` Kim F. Storm
@ 2005-07-30  4:02   ` Luc Teirlinck
  0 siblings, 0 replies; 14+ messages in thread
From: Luc Teirlinck @ 2005-07-30  4:02 UTC (permalink / raw)
  Cc: emacs-devel

Kim Storm wrote:

   Fine with me, but others may object to removing the ability to set the
   indicators from the menu bar...

My patches do not _preclude_ re-adding them to the menubar.  But since
we can not possibly add _all_ options to the menu bar (to avoid people
ever having to use Custom), it would seem that the most important
criteria for adding an option to the menubar are that it either should
be something that many users would want to set straight when they
begin using Emacs, before having read any documentation (like say,
disabling the blinking cursor) or something that people might want to
change several times during a session.  indicate-buffer-boundaries
fits neither criterion.

Enabling a user to set all possible 81 values of indicate-buffer-boundaries
through the menu bar is possible, but would be rather elaborate.
Allowing to set only a subset of the possible values through the
menubar might give problems when trying to indicate which value is
enabled in the menubar, if the user chose another value in some other way.

The option did not exist in 21.4, so it never was customizable through
the menubar in any released version.  It is a complex option and hence
is better customized through Custom.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-07-29  1:13 unnecessary fringe-indicators defcustom creates trouble Luc Teirlinck
  2005-07-29 15:29 ` Kim F. Storm
@ 2005-08-01  0:45 ` Richard M. Stallman
  2005-08-01  2:47   ` Luc Teirlinck
  2005-08-01  4:04   ` Luc Teirlinck
  1 sibling, 2 replies; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-01  0:45 UTC (permalink / raw)
  Cc: emacs-devel

    `indicate-empty-lines' is already a defcustomed variable (actually set
    in startup.el).  `indicate-buffer-boundaries' is not, but it should be
    and the patches below make it customizable through startup.el.

That sounds like a good idea.  Your change in cus-start.el is a good one
(assuming the details are right--I will take your word for that).

								    Once
    this is done, there is no longer any need for the annoying
    fringe-indicators variable.

The reason for this is to make it simple to request the usual options.
This is the right thing for the menu bar.

But I agree it shouldn't get in the way of setting the other variables
directly, if you want to do that.  So I propose this change.
(I will also change the doc strings of default-indicate-empty-lines
and default-indicate-buffer-boundaries.)


*** fringe.el	10 Jul 2005 13:00:16 -0400	1.20
--- fringe.el	30 Jul 2005 20:30:12 -0400	
***************
*** 269,298 ****
    "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)
--- 269,304 ----
    "Set fringe indicators according to VALUE.
  This is usually invoked when setting `fringe-indicators' via customize."
    (setq fringe-indicators value)
!   (unless (eq fringe-indicators 'other)
!     (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'
! and `default-indicate-empty-lines'.
! The value `other' means don't set them at all;
! if you use that value, you can customize
! those individual variables directly."
    :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)
! 		 (const :tag "Other" other))
    :group 'fringe
    :require 'fringe
    :set 'set-fringe-indicators-1)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-01  0:45 ` Richard M. Stallman
@ 2005-08-01  2:47   ` Luc Teirlinck
  2005-08-01 16:45     ` Richard M. Stallman
  2005-08-01  4:04   ` Luc Teirlinck
  1 sibling, 1 reply; 14+ messages in thread
From: Luc Teirlinck @ 2005-08-01  2:47 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

   The reason for this is to make it simple to request the usual options.

I do not see why you need a separate variable for that.  Why can one
not use indicate-empty-lines and indicate-buffer-boundaries to do
that?  Actually, I believe that the one option that makes sense for
most people is to set indicate-empty-lines to t (which my patches
allow to do via the menu bar).  But if for some reason that would not
be sufficient (for the menu bar) one could always (for instance)
change the current three non-alist values of
`indicate-buffer-boundaries' (left, right, other non-nil symbol) to
the values used by `fringe-indicators' (left, right, box, mixed),
thereby making fringe-indicators unnecessary, even for current
menu-bar functionality.

   But I agree it shouldn't get in the way of setting the other variables
   directly, if you want to do that.  So I propose this change.
   (I will also change the doc strings of default-indicate-empty-lines
   and default-indicate-buffer-boundaries.)

Still looks very unnatural and contorted to me.  But if you are going
to do it that way, then the docstring of fringe-indicators should say
that setting it to a value different from 'other outside Custom (or
the menu bar) does not work.  You would also need to change the Emacs
manual and the `default-indicate-empty-lines' docstring.

Another problem is that the first line of the indicate-empty-lines
docstring is pretty self-explanatory.  So somebody setting this
through Custom may not click on MORE and see the warning about first
setting fringe-indicators to 'other.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-01  0:45 ` Richard M. Stallman
  2005-08-01  2:47   ` Luc Teirlinck
@ 2005-08-01  4:04   ` Luc Teirlinck
  1 sibling, 0 replies; 14+ messages in thread
From: Luc Teirlinck @ 2005-08-01  4:04 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

   But I agree it shouldn't get in the way of setting the other variables
   directly, if you want to do that.  So I propose this change.

This is going to be very ugly when explained in the Emacs manual.  In
the Emacs manual you still will have to use (default-)indicate-empty-lines
and (default-)indicate-buffer-boundaries, because only they can be
given buffer local values (in the non default- version) and only they
can be set in .emacs (in the default- version).  Then you will have to
explain that to be able to safely use the default- versions, you have
to set the menu bar variable fringe-indicators to 'other, to avoid
having your customizations overridden by inadvertently loading fringe.el.

This is all unnecessarily complicated.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-01  2:47   ` Luc Teirlinck
@ 2005-08-01 16:45     ` Richard M. Stallman
       [not found]       ` <200508012118.j71LI0N06793@raven.dms.auburn.edu>
  0 siblings, 1 reply; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-01 16:45 UTC (permalink / raw)
  Cc: emacs-devel

       The reason for this is to make it simple to request the usual options.

    I do not see why you need a separate variable for that.  Why can one
    not use indicate-empty-lines and indicate-buffer-boundaries to do
    that?

Because they are more complex.  This is simple.
It is meant for less experienced users.

      You would also need to change the Emacs
    manual

If you tell me precisely where, I will do that.

    Another problem is that the first line of the indicate-empty-lines
    docstring is pretty self-explanatory.  So somebody setting this
    through Custom may not click on MORE and see the warning about first
    setting fringe-indicators to `other'.

To avoid small problem risks like that is probably impossible.
It would not be worth making a major change because of this.
Can you think of nay small change to avoid this risk?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
       [not found]       ` <200508012118.j71LI0N06793@raven.dms.auburn.edu>
@ 2005-08-02 17:44         ` Richard M. Stallman
  2005-08-02 20:31           ` Luc Teirlinck
  0 siblings, 1 reply; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-02 17:44 UTC (permalink / raw)
  Cc: emacs-devel

    I do not believe that getting rid of a cumbersome redundant variable
    is a major change.

It is major compared with the problem you're talking about.

I've told you my decision and explained it; I don't want to
spend more time on the issue.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-02 17:44         ` Richard M. Stallman
@ 2005-08-02 20:31           ` Luc Teirlinck
  2005-08-03 19:09             ` Richard M. Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: Luc Teirlinck @ 2005-08-02 20:31 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

   I've told you my decision and explained it;

Not in a very clear way.  You said:

   However, if you can design a simpler method that implements the same
   menu bar options, that would be better.

Does that include methods that would get rid of fringe-indicators?

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-02 20:31           ` Luc Teirlinck
@ 2005-08-03 19:09             ` Richard M. Stallman
  2005-08-04  1:03               ` Luc Teirlinck
  0 siblings, 1 reply; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-03 19:09 UTC (permalink / raw)
  Cc: emacs-devel

       However, if you can design a simpler method that implements the same
       menu bar options, that would be better.

    Does that include methods that would get rid of fringe-indicators?

Yes, it does.  fringe-indicators is a means to an end, which is to
make it easy to customize the most common things to do with the fringes.
I wouldn't mind switching to another.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-03 19:09             ` Richard M. Stallman
@ 2005-08-04  1:03               ` Luc Teirlinck
  2005-08-04  2:49                 ` Luc Teirlinck
  2005-08-06 18:36                 ` Richard M. Stallman
  0 siblings, 2 replies; 14+ messages in thread
From: Luc Teirlinck @ 2005-08-04  1:03 UTC (permalink / raw)
  Cc: emacs-devel

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 ----
============================================================

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-04  1:03               ` Luc Teirlinck
@ 2005-08-04  2:49                 ` Luc Teirlinck
  2005-08-06 18:36                   ` Richard M. Stallman
  2005-08-06 18:36                 ` Richard M. Stallman
  1 sibling, 1 reply; 14+ messages in thread
From: Luc Teirlinck @ 2005-08-04  2:49 UTC (permalink / raw)
  Cc: rms, emacs-devel

>From my previous message:

   for instance, just using indicate-buffer-boundaries it is
   impossible to tell whether a buffer is completely empty or whether
   you are completely overscrolled.

To be more concrete, enable all boundary indicators, including arrows,
to the left.  Create an empty buffer.  The boundary indicators
actually give the impression that the buffer is non-empty.  Typing RET
does not change the indicators, so you can not tell whether the buffer
is empty or not.

Now overscroll a buffer ending in a newline completely.  The "Bottom"
indicator now suggests that there is an extra blank line at the end of
the buffer, whereas there is not.  Note that if you put point on line
4 or line 5 of the scratch buffer (with its default initial content)
and do M-0 C-l, the result looks exactly the same.  In the first case,
the indicated blank line is real, in the second it is fake, but you
can not tell the difference.  This one is very confusing.
Inexperienced users often overscroll completely (by accident), which
often confuses them.  indicate-empty-lines shows them what happened,
whereas indicate-buffer-boundaries gives them the impression that the
reason why they were able to scroll this far was the extra blank line
at the end of the buffer.

I wonder whether it would not be more logical to not show any
indicators in an empty buffer and to just show an up arrow in a
completely overscrolled buffer.  You can not see the end of the
buffer, it is scrolled out of view.  So why indicate it?

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-04  1:03               ` Luc Teirlinck
  2005-08-04  2:49                 ` Luc Teirlinck
@ 2005-08-06 18:36                 ` Richard M. Stallman
  1 sibling, 0 replies; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-06 18:36 UTC (permalink / raw)
  Cc: emacs-devel

I tried your patch, and it looks clean enough in the menu bar.
So please install it, and thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: unnecessary fringe-indicators defcustom creates trouble
  2005-08-04  2:49                 ` Luc Teirlinck
@ 2005-08-06 18:36                   ` Richard M. Stallman
  0 siblings, 0 replies; 14+ messages in thread
From: Richard M. Stallman @ 2005-08-06 18:36 UTC (permalink / raw)
  Cc: teirllm, emacs-devel

    To be more concrete, enable all boundary indicators, including arrows,
    to the left.  Create an empty buffer.  The boundary indicators
    actually give the impression that the buffer is non-empty.  Typing RET
    does not change the indicators, so you can not tell whether the buffer
    is empty or not.

I think what we are seeing here is that the end-of-buffer indicator
goes on the wrong line.  It goes at the last nonempty line.  I think
it should go at the end of the buffer, which (in the case of ending in
a newline) is one line further down.

Perhaps there should be a different-looking end-of-buffer indicator
for the case of ending in a newline.  It could look like the normal
end-of-buffer indicator rotated 180 degrees, so that it would effectively
suggest "the buffer ends just above this line".  This is not crucial,
but it would make things clearer.

    Now overscroll a buffer ending in a newline completely.  The "Bottom"
    indicator now suggests that there is an extra blank line at the end of
    the buffer, whereas there is not.

In this one case, the end-of-buffer indicator goes in the right place.
But if you assume it's one line too high, as it usually is,
you will think the buffer has an extra newline.

    I wonder whether it would not be more logical to not show any
    indicators in an empty buffer and to just show an up arrow in a
    completely overscrolled buffer.  You can not see the end of the
    buffer, it is scrolled out of view.  So why indicate it?

That would be one consistent thing to do, but I think it is important
to indicate buffer ends when they are visible.  Making the change I've
suggested would also be consistent.

Kim, could you implement this change and ack this message?
(Others please don't do a reply to this message.
If you want to say something further about this,
please don't do it as a "reply".)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-08-06 18:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-29  1:13 unnecessary fringe-indicators defcustom creates trouble Luc Teirlinck
2005-07-29 15:29 ` Kim F. Storm
2005-07-30  4:02   ` Luc Teirlinck
2005-08-01  0:45 ` Richard M. Stallman
2005-08-01  2:47   ` Luc Teirlinck
2005-08-01 16:45     ` Richard M. Stallman
     [not found]       ` <200508012118.j71LI0N06793@raven.dms.auburn.edu>
2005-08-02 17:44         ` Richard M. Stallman
2005-08-02 20:31           ` Luc Teirlinck
2005-08-03 19:09             ` Richard M. Stallman
2005-08-04  1:03               ` Luc Teirlinck
2005-08-04  2:49                 ` Luc Teirlinck
2005-08-06 18:36                   ` Richard M. Stallman
2005-08-06 18:36                 ` Richard M. Stallman
2005-08-01  4:04   ` Luc Teirlinck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.