From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#12533: 24.2.50; incorrect behavior & formatting in Customize Date: Wed, 25 Sep 2019 18:26:00 -0300 Message-ID: References: <2DEA28BB84D4428985626E49AD69DE46@us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006049ad0593674dd9" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="206146"; mail-complaints-to="usenet@blaine.gmane.org" To: 12533@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 25 23:27:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDEof-000rVQ-Nd for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Sep 2019 23:27:17 +0200 Original-Received: from localhost ([::1]:57446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDEoe-0007l4-9M for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Sep 2019 17:27:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52025) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDEoU-0007ee-Cs for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2019 17:27:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDEoR-0006Js-Sz for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2019 17:27:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDEoR-0006II-Lc for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2019 17:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iDEoQ-0003UC-Hz for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2019 17:27:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <2DEA28BB84D4428985626E49AD69DE46@us.oracle.com> Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Sep 2019 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12533 X-GNU-PR-Package: emacs Original-Received: via spool by 12533-submit@debbugs.gnu.org id=B12533.156944678913332 (code B ref 12533); Wed, 25 Sep 2019 21:27:02 +0000 Original-Received: (at 12533) by debbugs.gnu.org; 25 Sep 2019 21:26:29 +0000 Original-Received: from localhost ([127.0.0.1]:42492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDEnr-0003Sv-A8 for submit@debbugs.gnu.org; Wed, 25 Sep 2019 17:26:29 -0400 Original-Received: from mail-lj1-f182.google.com ([209.85.208.182]:38505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDEnj-0003SL-QT for 12533@debbugs.gnu.org; Wed, 25 Sep 2019 17:26:21 -0400 Original-Received: by mail-lj1-f182.google.com with SMTP id b20so7216567ljj.5 for <12533@debbugs.gnu.org>; Wed, 25 Sep 2019 14:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=8MavbG38h9gXwVokXuUKPDvsQb1VFLaUJeYohLcZnGk=; b=OcOqp1NPX0DFKy+HFwvQcU9xJU9Tx30Bgg4AI6YtC0mi1A7irkUnLxO6QEsh2mvbwc lGPFsFxELg9W8Zr3W5gwazb6j+E4wMIHG21xmUbm5zIisx21y2BuJ+3XBvvtaudf3Uv8 2wm58CMfwNU3tF+TqbDhFWiffAKakH5SfeYbfoumsw2hw6DbuNVa57kkV0QPXKOmnso+ gapKykStuhxWVz6UwRckklFPwvQgLpm7hQ8mOnd7Do/bo8Oq6NNKBUObz+nlaACFe0T1 C/MT+wTD8PN8qI42NZUPZnzlkxA17KTnW6hFKJBZW0IcTvBR9T76w/A8uPd4U7eIOKVJ wYIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=8MavbG38h9gXwVokXuUKPDvsQb1VFLaUJeYohLcZnGk=; b=WUHx449d45k6SUdvgS80jAE5hZlcDJlAe+rH1Z93hStHRJv2Hss1fvuLe3sqwRSGAt lrJwcwojCcTYdCHRAiWwUvEBLFxezhHeYRlqGogqGPJpALaN8spgf28MoD9p/A3sOePl UTAB/BSJI4DwNeADqpTs6qj3CzNz/3LA757Hrv285f4bX0tK4lxtM37lpADaSJ26Qjxd bpQUuA/TkM4jWpV1zJF/dGfMrS2bMcD/ugSxslL7ltqEFZkxdvZV1WdK9Fjr0171pbbE MhExHeOwAfm9Pl/rzCx0WOSu2MjIK7tjNXl3PC4sSyyOlpsQd/j0Uxu1vHEhNVL7iNad QtzQ== X-Gm-Message-State: APjAAAUshOiKdEEnQkiqnAUt+kr4M0wZRsHOP4WuFKqFwZXwAV2A9X2t Gu71EryfOOdALKlKnM05DhEP7Xc+nPHLVJZzw0c8fjbA X-Google-Smtp-Source: APXvYqyAedRoy4fDEFTMQxa3vtb4wFr5Hu9AHhAwZ2YsZlTGDYilIwDYrpMBcQzghEfzvD+m83WlXLX/f/cmisSnHpk= X-Received: by 2002:a2e:91cf:: with SMTP id u15mr250032ljg.184.1569446772622; Wed, 25 Sep 2019 14:26:12 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167193 Archived-At: --0000000000006049ad0593674dd9 Content-Type: text/plain; charset="UTF-8" tags 12533 patch quit "Drew Adams" 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. --0000000000006049ad0593674dd9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
tags 12533 patch
quit


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

> emacs -Q
> =C2=A0
> (defcustom foo ()
&= gt; =C2=A0 "..."
> =C2=A0 :type '(repeat (cons
> = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 string
&g= t; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (choice> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(const flimpo)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(const nil)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(other t))))
> =C2=A0 :group 'e= dit)
> =C2=A0
> M-x customize-option foo
> =C2=A0
>= Click button INS.
> =C2=A0
> (Optional: Enter something in fie= ld `String'.)
> =C2=A0
> Choose `Other' in `Value Menu&= #39;.
> =C2=A0
> An INS button pops up inappropriately under `C= hoice'.=C2=A0 If you click it
> then it shows that it expects ano= ther `repeat' cell, at the wrong level.

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

= I think you are right.=C2=A0 And it happens with the `Other' option, wh= ich
creates a widget of type `other', because that widget was define= d with a
format string that contains the %n escape at the end of the str= ing.

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

Therefore, I think it is a mistake to have that %n in the form= at string
of the `other' widget, and I propose the attached patch.
Best regards,
Mauro.
--0000000000006049ad0593674dd9--