GNU bug report logs - #12533
24.2.50; incorrect behavior & formatting in Customize

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 28 Sep 2012 16:36:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.2.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 12533 <at> debbugs.gnu.org
Cc: Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Wed, 25 Sep 2019 18:26:00 -0300
[Message part 1 (text/plain, inline)]
tags 12533 patch
quit


"Drew Adams" <drew.adams <at> oracle.com> writes:

> emacs -Q
>
> (defcustom foo ()
>   "..."
>   :type '(repeat (cons
>                   string
>                   (choice
>                    (const flimpo)
>                    (const nil)
>                    (other t))))
>   :group 'edit)
>
> M-x customize-option foo
>
> Click button INS.
>
> (Optional: Enter something in field `String'.)
>
> Choose `Other' in `Value Menu'.
>
> An INS button pops up inappropriately under `Choice'.  If you click it
> then it shows that it expects another `repeat' cell, at the wrong level.

I can reproduce this.

> This broken behavior happens as long as you choose `Other' in `Value
> Menu'.  If you choose one of the other possibilities then Customize
> behaves correctly.
>
> To me this is clearly a bug.  But it is so all the way back through
> Emacs 20.  So I wonder - am I right?  I cannot believe that this
> behavior is correct.  What am I missing?
>

I think you are right.  And it happens with the `Other' option, which
creates a widget of type `other', because that widget was defined with a
format string that contains the %n escape at the end of the string.

That escape add spaces (for indentation), after inserting a newline.
But it's not useful when at the end of the format string, because that
indents unconditionally the contents of the buffer that follow the
widget.  The %n escape is better used in the middle of a format string,
to cause indentation of the contents that belong to the same widget.

Therefore, I think it is a mistake to have that %n in the format string
of the `other' widget, and I propose the attached patch.

Best regards,
Mauro.
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.