* 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 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
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
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.