GNU bug report logs - #7851
`customize's presentation of :type (repeat plist) declarations

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Sun, 16 Jan 2011 21:43:01 UTC

Severity: minor

Tags: fixed, patch

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 7851 in the body.
You can then email your comments to 7851 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7851; Package emacs. (Sun, 16 Jan 2011 21:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to MON KEY <monkey <at> sandpframing.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 16 Jan 2011 21:43:01 GMT) Full text and rfc822 format available.

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

From: MON KEY <monkey <at> sandpframing.com>
To: bug-gnu-emacs <at> gnu.org
Subject: `customize's presentation of :type (repeat plist) declarations
Date: Sun, 16 Jan 2011 16:43:27 -0500
`customize's presentation of variables defined with a type speciifer:

 :type '(repeat plist :value-type (repeat symbol))

do not present a sensibly in customize buffers.

For example:

(defcustom *tt--ugly-plist-custom*
  '((:KEY-PL0-0 (sym0-0a sym0-0b sym0-0c)
     :KEY-PL0-1 (sym0-1a sym0-1b sym0-1c))
    (:KEY-PL1-0 (sym1-0a sym1-0b sym1-0c)
     :KEY-PL1-1 (sym1-1a sym1-1b sym1-1c)))
  "This variable will have an ugly customize presentation.
Evaluating the following form:\n
 \(customize-variable '*tt--ugly-plist-custom*\)\n
presents a buffer named \"*Customize *Tt  Ugly Plist Custom*\".\n
Notice that for each plist the first pair of nested buttons [INS]
\[DEL] is indented deeper than subsequent pairs within the same plist
element. IOW, Instead of prsenting:\n
\[INS] [DEL] Plist:
             [INS] [DEL] Key: :KEY-PL0-0
                            Value: \(sym0-0a sym0-0b sym0-0c\)
             [INS] [DEL] Key: :KEY-PL0-1
                            Value: \(sym0-1a sym0-1b sym0-1c\)
             [INS]\n
\[INS] [DEL] Plist:
             [INS] [DEL] Key: :KEY-PL1-0
                            Value: \(sym1-0a sym1-0b sym1-0c\)
             [INS] [DEL] Key: :KEY-PL1-1
                            Value: \(sym1-1a sym1-1b sym1-1c\)
             [INS]\n\n
We instead get a customize presentation like this:\n
\[INS] [DEL] Plist:
                            [INS] [DEL] Key: :KEY-PL0-0
                            Value: \(sym0-0a sym0-0b sym0-0c\)
             [INS] [DEL] Key: :KEY-PL0-1
                            Value: \(sym0-1a sym0-1b sym0-1c\)
             [INS]\n
\[INS] [DEL] Plist:
                            [INS] [DEL] Key: :KEY-PL1-0
                            Value: \(sym1-0a sym1-0b sym1-0c\)
             [INS] [DEL] Key: :KEY-PL1-1
                            Value: \(sym1-1a sym1-1b sym1-1c\)
             [INS]\n\n
This indentation style \"plist\" custom types is confusing.\n"
  :type '(repeat plist :value-type (repeat symbol))
  :group 'emacs)

(customize-variable '*tt--ugly-plist-custom*)

emacs-version => 23.2.1

--
/s_P\




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7851; Package emacs. (Tue, 24 Sep 2019 22:36:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 7851 <at> debbugs.gnu.org
Cc: monkey <at> sandpframing.com
Subject: Re: bug#7851: `customize's presentation of :type (repeat plist)
 declarations
Date: Tue, 24 Sep 2019 18:22:39 -0300
[Message part 1 (text/plain, inline)]
tags 7851 patch
quit

MON KEY <monkey <at> sandpframing.com> writes:

> `customize's presentation of variables defined with a type speciifer:
>
>  :type '(repeat plist :value-type (repeat symbol))
>
> do not present a sensibly in customize buffers.
>

I can reproduce this.  The problem is that in some cases, the
code that does the indenting (by inserting space characters) doesn't
really check if it should indent or not.

Sometimes it checks for a preceding newline character, but since
`widget-specify-insert' narrows the buffer, it can easily fail to detect
that "\n".  Sometimes, it doesn't check if it should indent at all, like
in `widget-editable-list-format-handler'.

I propose the attached patch, that introduces a function to perform the
necessary checks before indenting, and then uses it in all places I've
found is necessary.

Best regards,
Mauro.
[Message part 2 (text/html, inline)]
[0001-Fix-indentation-of-widgets-Bug-7851.patch (text/x-patch, attachment)]

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

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

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 7851 <at> debbugs.gnu.org, monkey <at> sandpframing.com
Subject: Re: bug#7851: `customize's presentation of :type (repeat plist)
 declarations
Date: Wed, 25 Sep 2019 14:52:00 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> I propose the attached patch, that introduces a function to perform the
> necessary checks before indenting, and then uses it in all places I've
> found is necessary.

Looks good to me, so I've now applied it 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. (Wed, 25 Sep 2019 12:53:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 7851 <at> debbugs.gnu.org and MON KEY <monkey <at> sandpframing.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 Sep 2019 12:53:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 4 years and 178 days ago.

Previous Next


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