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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12533 in the body.
You can then email your comments to 12533 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Fri, 28 Sep 2012 16:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 28 Sep 2012 16:36:02 GMT) Full text and rfc822 format available.

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

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.2.50; incorrect behavior & formatting in Customize
Date: Fri, 28 Sep 2012 09:28:17 -0700
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.
 
If you click the outer (i.e., the correct) INS button, it behaves
normally.  But if you then choose `Other' in its `Value Menu' you get
the same problem again.
 
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?
 
In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600)
 of 2012-09-17 on MARVIN
Bzr revision: 110062 cyd <at> gnu.org-20120917054104-r93rtwkrtva73ewe
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Wed, 25 Sep 2019 21:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 12533 <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)]

Added tag(s) patch. Request was from Mauro Aranda <maurooaranda <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 25 Sep 2019 21:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Wed, 25 Sep 2019 21:28:01 GMT) Full text and rfc822 format available.

Message #13 received at 12533 <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:27:16 -0300
[Message part 1 (text/plain, inline)]
Oops, here's the patch.
[Message part 2 (text/html, inline)]
[0001-Don-t-indent-unrelated-widgets-following-widget-of-t.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Thu, 26 Sep 2019 07:23:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 12533 <at> debbugs.gnu.org
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Thu, 26 Sep 2019 10:22:37 +0300
> From: Mauro Aranda <maurooaranda <at> gmail.com>
> Date: Wed, 25 Sep 2019 18:27:16 -0300
> 
> Oops, here's the patch.

Thanks, but can you also add some tests for this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Thu, 26 Sep 2019 11:18:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 12533 <at> debbugs.gnu.org
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Thu, 26 Sep 2019 08:17:03 -0300
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> Date: Wed, 25 Sep 2019 18:27:16 -0300
>>
>> Oops, here's the patch.
>
> Thanks, but can you also add some tests for this?

Sure.  Will do.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Thu, 26 Sep 2019 14:55:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 12533 <at> debbugs.gnu.org
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Thu, 26 Sep 2019 11:53:55 -0300
[Message part 1 (text/plain, inline)]
I've added three tests to the patch:
1) One that should fail, because of the use of %n at the end.
2) One that should pass, because \n is used instead of %n.
3) Another one that should pass, because %n is used correctly,
at the middle of the format string.

Let me know what you think.

Best regards,
Mauro.
[Message part 2 (text/html, inline)]
[0001-Don-t-indent-unrelated-widgets-following-widget-of-t.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Thu, 26 Sep 2019 15:17:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 12533 <at> debbugs.gnu.org
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Thu, 26 Sep 2019 17:16:52 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> I've added three tests to the patch:
> 1) One that should fail, because of the use of %n at the end.
> 2) One that should pass, because \n is used instead of %n.
> 3) Another one that should pass, because %n is used correctly,
> at the middle of the format string.
>
> Let me know what you think.

Thanks, looks great; applied to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Sep 2019 15:18:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 12533 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Sep 2019 15:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12533; Package emacs. (Fri, 27 Sep 2019 12:34:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12533 <at> debbugs.gnu.org
Subject: Re: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Fri, 27 Sep 2019 09:32:59 -0300
[Message part 1 (text/plain, inline)]
Thanks!
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Oct 2019 11:24:07 GMT) Full text and rfc822 format available.

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.