unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Heerdegen via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: editable-list widgets: how to create one child automatically
Date: Thu, 14 Mar 2024 02:58:56 +0100	[thread overview]
Message-ID: <87o7bhwp3z.fsf@web.de> (raw)
In-Reply-To: 2745da17-e046-47d6-8ce7-8647ada33451@gmail.com

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

Mauro Aranda <maurooaranda@gmail.com> writes:

> (widget-create 'editable-list
>                :value (list my-first-default)
>                ;; Change according to the child type.
>                '(editable-field))
>
> Does that not do what you want?

I think I can't use this: I don't create an ad-hoc widget, I need an
`define-widget' expression to define the widget to behave accordingly
when created.

And the widget this is about is a part of a group widget definition so
there will never be an explicit `widget-create' call by me, the widget
will always be created implicitly by the parent.

And in this definition a :value spec is more or less ignored - in my
tests that child widget will always be created with a nil widget value.

I am attaching the code in question so that you don't have to guess -
you can find the relevant part by searching for the comment

  ;; Is there a better approach, Mauro?

or simply just your name.


Thanks so far,

Michael.


[-- Attachment #2: find-cmd-widget.el.zip --]
[-- Type: application/zip, Size: 12562 bytes --]

  reply	other threads:[~2024-03-14  1:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  7:23 editable-list widgets: how to create one child automatically Michael Heerdegen
2024-03-13 10:41 ` Mauro Aranda
2024-03-14  1:58   ` Michael Heerdegen via Users list for the GNU Emacs text editor [this message]
2024-03-14 11:19     ` Mauro Aranda
2024-03-15 12:53       ` Michael Heerdegen via Users list for the GNU Emacs text editor

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87o7bhwp3z.fsf@web.de \
    --to=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).