emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal to add Popper to ELPA


From: Mauro Aranda
Subject: Re: Proposal to add Popper to ELPA
Date: Tue, 5 Sep 2023 18:05:36 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 5/9/23 17:49, Karthik Chikmagalur wrote:
>>  > -  :type '(restricted-sexp :match-alternatives (stringp symbolp
>> functionp consp))
>>  > -  :group 'popper)
>>  > +  :type '(repeat (string :tag "Regular Expression")
>>  > +         (symbol :tag "Major Mode")
>>  > +         (function :tag "Predicate Function")
>>  > +         ;; What is the consp in (restricted-sexp :match-alternatives
>> (stringp symbolp functionp consp))?
>>  > +         ))
>>
>> The different alternatives should be inside a choice:
>> :type '(repeat (choice (string :tag "Regular Expression")
>>                         (symbol :tag "Major Mode")
>>                         (function :tag "Predicate Function"))
>
> In addition, cons cells of the form '(string-or-symbol . hide) are
> allowed.  I'm not sure how to represent this in the customization types
> list.  I'm okay with omitting this from the customize interface, since
> it's a niche option that few users will need.

I didn't notice the strings were really regular expressions, so I
adapted the type to use regexp.

The cons widget, as below, does the job but it looks UGLY.  I'm in a
hurry now, so I can't take a look at how to make it prettier.

:type '(repeat (choice regexp
                       (symbol :tag "Major Mode")
                       (function :tag "Predicate Function")
                       (cons (choice regexp
                                     (symbol :tag "Major Mode"))
                             (const :tag "Hide" hide))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]