unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39074: 27.0.60; [PATCH] Horizontal line messes with variable value display in Custom buffers
@ 2020-01-10 17:27 Kévin Le Gouguec
  2020-01-10 19:04 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Kévin Le Gouguec @ 2020-01-10 17:27 UTC (permalink / raw)
  To: 39074

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

Hi,

Unless I'm mistaken, commit 84a3793b19 introduced a bug when the user
pushes the button to show the value of the last variable in a Custom
buffer.  From emacs -Q:

- M-x customize-group RET visual-line RET
- move point to the "Show Value" button for "Visual Line Fringe
  Indicators" (shown with the etc/images/custom/right icon on a GUI)
- hit RET
- the variable's description has moved *after* the horizontal line
  (cf. screenshot)


[-- Attachment #2: custom-horizontal-line.png --]
[-- Type: image/png, Size: 62602 bytes --]

[-- Attachment #3: Type: text/plain, Size: 416 bytes --]


AFAICT, this is because the function that was introduced to de-duplicate
the horizontal line code does

(let ((p (point)))
  (insert "\n")
  …)

whereas the code to draw the last line did:

(let ((p (1+ (point))))
  (insert "\n\n")
  …)

If I'm not mistaken, this can be fixed simply by adding (insert "\n")
before the final call to custom-group--draw-horizontal-line, as done in
this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0001-Fix-glitch-with-horizontal-lines-in-Custom-buffers.patch --]
[-- Type: text/x-diff, Size: 886 bytes --]

From 889dd1b972a72120b51e72d1ac74110891597a58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Wed, 8 Jan 2020 18:35:49 +0100
Subject: [PATCH] Fix glitch with horizontal lines in Custom buffers

Bug introduced in 2019-11-03T16:45:48Z!stefankangas@gmail.com.

* lisp/cus-edit.el (custom-group-value-create): add a blank line
before drawing the final horizontal line.
---
 lisp/cus-edit.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 79c235783d..0ca3f1ede8 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4295,6 +4295,7 @@ custom-group-value-create
 	     (widget-put widget :children children)
 	     (custom-group-state-update widget))
 	   ;; End line
+           (insert "\n")
            (custom-group--draw-horizontal-line)))))
 
 (defvar custom-group-menu
-- 
2.20.1


[-- Attachment #5: Type: text/plain, Size: 1079 bytes --]


I'm not entirely sure why this extra newline is necessary; I haven't
done much digging other than looking at the commit that introduced this
issue.  Maybe the rest of custom-group-value-create does something fishy
and this patch only works around that…

WDYT?


Thank you for your time.


In GNU Emacs 28.0.50 (build 4, i686-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
 of 2020-01-08 built on little-buster
Repository revision: 724af7671590cd91df37f64df6be73f6dca0144d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

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

* bug#39074: 27.0.60; [PATCH] Horizontal line messes with variable value display in Custom buffers
  2020-01-10 17:27 bug#39074: 27.0.60; [PATCH] Horizontal line messes with variable value display in Custom buffers Kévin Le Gouguec
@ 2020-01-10 19:04 ` Eli Zaretskii
  2020-01-10 21:53   ` Kévin Le Gouguec
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-01-10 19:04 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 39074

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Date: Fri, 10 Jan 2020 18:27:59 +0100
> 
> Unless I'm mistaken, commit 84a3793b19 introduced a bug when the user
> pushes the button to show the value of the last variable in a Custom
> buffer.  From emacs -Q:
> 
> - M-x customize-group RET visual-line RET
> - move point to the "Show Value" button for "Visual Line Fringe
>   Indicators" (shown with the etc/images/custom/right icon on a GUI)
> - hit RET
> - the variable's description has moved *after* the horizontal line
>   (cf. screenshot)

Thanks, should be fixed now.





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

* bug#39074: 27.0.60; [PATCH] Horizontal line messes with variable value display in Custom buffers
  2020-01-10 19:04 ` Eli Zaretskii
@ 2020-01-10 21:53   ` Kévin Le Gouguec
  0 siblings, 0 replies; 3+ messages in thread
From: Kévin Le Gouguec @ 2020-01-10 21:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39074-done

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, should be fixed now.

Confirmed, thank you!





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

end of thread, other threads:[~2020-01-10 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-10 17:27 bug#39074: 27.0.60; [PATCH] Horizontal line messes with variable value display in Custom buffers Kévin Le Gouguec
2020-01-10 19:04 ` Eli Zaretskii
2020-01-10 21:53   ` Kévin Le Gouguec

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).