GNU bug report logs -
#25308
Shorten long "ui-lines" in Custom buffers
Previous Next
Reported by: Jonas Bernoulli <jonas <at> bernoul.li>
Date: Sat, 31 Dec 2016 13:26:02 UTC
Severity: normal
Fixed in version 27.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25308 in the body.
You can then email your comments to 25308 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sat, 31 Dec 2016 13:26:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jonas Bernoulli <jonas <at> bernoul.li>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 31 Dec 2016 13:26:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Custom buffers contain two long lines, the first separating the initial
buttons from the options shown below, and the second is for symmetry, I
suppose. This is implemented in `custom-group-value-create'.
These lines are 999 characters long. When point ends up on the "line
line", then it ends up at the *end* of that line, scrolling all content
except for the line itself off-window. This happens both with C-n/C-p,
as well as when using the mouse scroll wheel.
This is very distracting and I would suggest that these lines be removed
completely. If that is not an option, then I would suggest to make the
lines short enough for them to almost always end before the window edge.
80 characters instead of 999 would do, I think.
If that is considered to be too ugly, then I would suggest setting the
`:align-to' to be just long enough to reach the edge of the window (but
never longer) at the time `custom-group-value-create' is called, using
something like:
(list 'space :align-to
`(+ (0 . right)
,(min (window-hscroll)
(- (line-end-position)
(line-beginning-position)))))
Thanks for considering these options.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sat, 31 Dec 2016 13:58:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 25308 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Date: Sat, 31 Dec 2016 14:26:06 +0100
>
> Custom buffers contain two long lines, the first separating the initial
> buttons from the options shown below, and the second is for symmetry, I
> suppose. This is implemented in `custom-group-value-create'.
>
> These lines are 999 characters long. When point ends up on the "line
> line", then it ends up at the *end* of that line, scrolling all content
> except for the line itself off-window. This happens both with C-n/C-p,
> as well as when using the mouse scroll wheel.
The scrolling only happens for me if I set truncate-lines to a non-nil
value. Is that what you see? Or perhaps you invoke Customize in a
partial-width window, in which case truncate-partial-width-windows is
non-nil by default?
If lines are not truncated, there's no horizontal scrolling.
> If that is considered to be too ugly, then I would suggest setting the
> `:align-to' to be just long enough to reach the edge of the window (but
> never longer) at the time `custom-group-value-create' is called, using
> something like:
>
> (list 'space :align-to
> `(+ (0 . right)
> ,(min (window-hscroll)
> (- (line-end-position)
> (line-beginning-position)))))
Does this really work when a window has its lines truncated?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sun, 29 Sep 2019 17:56:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 25308 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Custom buffers contain two long lines, the first separating the initial
>> buttons from the options shown below, and the second is for symmetry, I
>> suppose. This is implemented in `custom-group-value-create'.
>>
>> These lines are 999 characters long. When point ends up on the "line
>> line", then it ends up at the *end* of that line, scrolling all content
>> except for the line itself off-window. This happens both with C-n/C-p,
>> as well as when using the mouse scroll wheel.
>
> The scrolling only happens for me if I set truncate-lines to a non-nil
> value. Is that what you see? Or perhaps you invoke Customize in a
> partial-width window, in which case truncate-partial-width-windows is
> non-nil by default?
>
> If lines are not truncated, there's no horizontal scrolling.
I can't reproduce the error, either (without truncate-lines). But
truncate-lines is not set in Customize buffers by default, so I don't
really think this is a bug. However, I agree with Jonas that the lines
aren't very pretty.
The worst bit is perhaps that the make the little arrow in the right
fringe appear... and they aren't symmetrical, since they use
'underline: They're very close to the text at the start, but far away
from the final line of text.
I'd rather just remove those lines completely -- I think that'd be less
busy.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sun, 03 Nov 2019 13:14:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 25308 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Jonas Bernoulli <jonas <at> bernoul.li>
>> Date: Sat, 31 Dec 2016 14:26:06 +0100
>>
>> Custom buffers contain two long lines, the first separating the initial
>> buttons from the options shown below, and the second is for symmetry, I
>> suppose. This is implemented in `custom-group-value-create'.
>>
>> These lines are 999 characters long. When point ends up on the "line
>> line", then it ends up at the *end* of that line, scrolling all content
>> except for the line itself off-window. This happens both with C-n/C-p,
>> as well as when using the mouse scroll wheel.
>
> The scrolling only happens for me if I set truncate-lines to a non-nil
> value. Is that what you see? Or perhaps you invoke Customize in a
> partial-width window, in which case truncate-partial-width-windows is
> non-nil by default?
>
> If lines are not truncated, there's no horizontal scrolling.
I see the same thing here.
>> If that is considered to be too ugly, then I would suggest setting the
>> `:align-to' to be just long enough to reach the edge of the window (but
>> never longer) at the time `custom-group-value-create' is called, using
>> something like:
>>
>> (list 'space :align-to
>> `(+ (0 . right)
>> ,(min (window-hscroll)
>> (- (line-end-position)
>> (line-beginning-position)))))
>
> Does this really work when a window has its lines truncated?
Yes, it works on both text based and graphical displays. Please see
the attached patch.
Lars suggested to remove the lines entirely, but I think I prefer to
not change that for now. Perhaps it would make more sense as part of
a bigger overhaul of the look and feel of customize.
Any comments?
Best regards,
Stefan Kangas
[0001-Handle-truncate-lines-in-customize-group.patch (text/x-diff, inline)]
From 432de377610215219ad9c61ad63950fd914eb883 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas <at> gmail.com>
Date: Sun, 3 Nov 2019 14:07:37 +0100
Subject: [PATCH] Handle truncate-lines in customize-group
* lisp/cus-edit.el (custom-group--draw-horizontal-line): New
function to draw horizontal lines which handles a non-nil value of
'truncate-lines'. (Bug#25308)
(custom-group-value-create): Use it.
Co-authored-by: Jonas Bernoulli <jonas <at> bernoul.li>
---
lisp/cus-edit.el | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index b9fd3e0a2d..081d4c9213 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4062,6 +4062,22 @@ custom-group-members
(push entry members)))
(nreverse members))))
+(defun custom-group--draw-horizontal-line ()
+ "Draw a horizontal line at point.
+This works for both graphical and text displays."
+ (let ((p (point)))
+ (insert "\n")
+ (put-text-property p (1+ p) 'face '(:underline t))
+ (overlay-put (make-overlay p (1+ p))
+ 'before-string
+ (propertize "\n" 'face '(:underline t)
+ 'display
+ (list 'space :align-to
+ `(+ (0 . right)
+ ,(min (window-hscroll)
+ (- (line-end-position)
+ (line-beginning-position)))))))))
+
(defun custom-group-value-create (widget)
"Insert a customize group for WIDGET in the current buffer."
(unless (eq (widget-get widget :custom-state) 'hidden)
@@ -4188,15 +4204,7 @@ custom-group-value-create
;; Nested style.
(t ;Visible.
- ;; Draw a horizontal line (this works for both graphical
- ;; and text displays):
- (let ((p (point)))
- (insert "\n")
- (put-text-property p (1+ p) 'face '(:underline t))
- (overlay-put (make-overlay p (1+ p))
- 'before-string
- (propertize "\n" 'face '(:underline t)
- 'display '(space :align-to 999))))
+ (custom-group--draw-horizontal-line)
;; Add parent groups references above the group.
(when (eq level 1)
@@ -4287,13 +4295,7 @@ custom-group-value-create
(widget-put widget :children children)
(custom-group-state-update widget))
;; End line
- (let ((p (1+ (point))))
- (insert "\n\n")
- (put-text-property p (1+ p) 'face '(:underline t))
- (overlay-put (make-overlay p (1+ p))
- 'before-string
- (propertize "\n" 'face '(:underline t)
- 'display '(space :align-to 999))))))))
+ (custom-group--draw-horizontal-line)))))
(defvar custom-group-menu
`(("Set for Current Session" custom-group-set
--
2.20.1
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sun, 03 Nov 2019 14:35:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 25308 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> Yes, it works on both text based and graphical displays. Please see
> the attached patch.
>
> Lars suggested to remove the lines entirely, but I think I prefer to
> not change that for now. Perhaps it would make more sense as part of
> a bigger overhaul of the look and feel of customize.
>
> Any comments?
I haven't tried the patch, but it looks good to me.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sun, 03 Nov 2019 15:49:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 25308 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefan <at> marxist.se>
> Cc: Jonas Bernoulli <jonas <at> bernoul.li>, 25308 <at> debbugs.gnu.org
> Date: Sun, 03 Nov 2019 14:13:05 +0100
>
> Yes, it works on both text based and graphical displays. Please see
> the attached patch.
>
> Lars suggested to remove the lines entirely, but I think I prefer to
> not change that for now. Perhaps it would make more sense as part of
> a bigger overhaul of the look and feel of customize.
>
> Any comments?
If your patch works, I have no comments.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Sun, 03 Nov 2019 16:49:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 25308 <at> debbugs.gnu.org (full text, mbox):
close 25308 27.1
thanks
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Stefan Kangas <stefan <at> marxist.se>
>> Cc: Jonas Bernoulli <jonas <at> bernoul.li>, 25308 <at> debbugs.gnu.org
>> Date: Sun, 03 Nov 2019 14:13:05 +0100
>>
>> Yes, it works on both text based and graphical displays. Please see
>> the attached patch.
>>
>> Lars suggested to remove the lines entirely, but I think I prefer to
>> not change that for now. Perhaps it would make more sense as part of
>> a bigger overhaul of the look and feel of customize.
>>
>> Any comments?
>
> If your patch works, I have no comments.
Thanks. Now pushed to master as commit 84a3793b19.
Best regards,
Stefan Kangas
bug marked as fixed in version 27.1, send any further explanations to
25308 <at> debbugs.gnu.org and Jonas Bernoulli <jonas <at> bernoul.li>
Request was from
Stefan Kangas <stefan <at> marxist.se>
to
control <at> debbugs.gnu.org
.
(Sun, 03 Nov 2019 16:49:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25308
; Package
emacs
.
(Mon, 04 Nov 2019 13:22:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 25308 <at> debbugs.gnu.org (full text, mbox):
Thanks!
GNU bug Tracking System <help-debbugs <at> gnu.org> writes:
> This is an automatic notification regarding your bug report
> #25308: Shorten long "ui-lines" in Custom buffers,
> which was filed against the emacs package.
>
> Thank you for your report, which has now been closed.
> You can view the full report at
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25308
>
> If you require further information, please followup to 25308 <at> debbugs.gnu.org.
>
> debbugs.gnu.org maintainers
> (administrator, GNU bugs database)
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 03 Dec 2019 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.