all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 12533@debbugs.gnu.org
Subject: bug#12533: 24.2.50; incorrect behavior & formatting in Customize
Date: Wed, 25 Sep 2019 18:26:00 -0300	[thread overview]
Message-ID: <CABczVwdXROsS01rD5agbAo2go2S6UvHyZB3krZEYZ7EuOkLDng@mail.gmail.com> (raw)
In-Reply-To: <2DEA28BB84D4428985626E49AD69DE46@us.oracle.com>

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

tags 12533 patch
quit


"Drew Adams" <drew.adams@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.

[-- Attachment #2: Type: text/html, Size: 2163 bytes --]

  reply	other threads:[~2019-09-25 21:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28 16:28 bug#12533: 24.2.50; incorrect behavior & formatting in Customize Drew Adams
2019-09-25 21:26 ` Mauro Aranda [this message]
2019-09-25 21:27   ` Mauro Aranda
2019-09-26  7:22     ` Eli Zaretskii
2019-09-26 11:17       ` Mauro Aranda
2019-09-26 14:53         ` Mauro Aranda
2019-09-26 15:16           ` Lars Ingebrigtsen
2019-09-27 12:32             ` Mauro Aranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABczVwdXROsS01rD5agbAo2go2S6UvHyZB3krZEYZ7EuOkLDng@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=12533@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.