unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: :format strings in Custom ending in %h
Date: Fri, 22 Aug 2003 21:44:41 -0500 (CDT)	[thread overview]
Message-ID: <200308230244.h7N2ifk01430@raven.dms.auburn.edu> (raw)
In-Reply-To: <rjhe4aj5sd.fsf@zuse.dina.kvl.dk> (message from Per Abrahamsen on Fri, 22 Aug 2003 13:22:26 +0200)

Per Abrahamsen wrote:

   The patch I posted solved the problem for me.

Not only does that not work empirically for me, I believe that the
following excerpts from wid-edit.el show that your patch can not
possibly have any effect.  Did you really follow my recipe literally
and did you really not use any code that is different from the current
uncustomized CVS?

The problem seems to be:

(define-widget 'other 'sexp
(define-widget 'sexp 'editable-field
(define-widget 'editable-field 'default

Why not:

(define-widget 'other 'item

with suitable further adjustments, which would, combined with your
patch, solve the problem (or so I believe) ?

(define-widget 'other 'sexp
  "Matches any value, but doesn't let the user edit the value.

So why pattern if after an editable-field?

The details:

Your patch in:

(define-widget 'item 'default

putting in:

 :value-delete 'widget-children-value-delete

can, I believe, not possibly have any effect for 'other.  I followed
the sequence of define-widget's starting at 'other up to 'default:

(define-widget 'other 'sexp
(define-widget 'sexp 'editable-field
(define-widget 'editable-field 'default
  "An editable text field."
  :convert-widget 'widget-value-convert-widget
  :keymap widget-field-keymap
  :format "%v"
  :help-echo "M-TAB: complete field; RET: enter value"
  :value ""
  :prompt-internal 'widget-field-prompt-internal
  :prompt-history 'widget-field-history
  :prompt-value 'widget-field-prompt-value
  :action 'widget-field-action
  :validate 'widget-field-validate
  :valid-regexp ""
  :error "Field's value doesn't match allowed forms"
  :value-create 'widget-field-value-create
  :value-delete 'widget-field-value-delete
  :value-get 'widget-field-value-get
  :match 'widget-field-match)

The last define-widget contains:

  :value-delete 'widget-field-value-delete

The two previous define-widgets do not override this.
Where does 'item fit into all of this?

Your patch works for 'const because:

(define-widget 'const 'item

But my example involves 'other.

I checked with edebug that :value-delete for the widget in question is
indeed 'widget-field-value-delete, as expected from the above code
excerpts.

Sincerely,

Luc.

  parent reply	other threads:[~2003-08-23  2:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-21  1:54 :format strings in Custom ending in %h Luc Teirlinck
2003-08-21 12:22 ` Per Abrahamsen
2003-08-21 20:50   ` Luc Teirlinck
2003-08-21 21:00   ` Luc Teirlinck
2003-08-22 11:22     ` Per Abrahamsen
2003-08-22 14:41       ` Luc Teirlinck
2003-08-24 15:38         ` Per Abrahamsen
2003-08-24 17:17           ` Luc Teirlinck
2003-08-24 18:30             ` Per Abrahamsen
2003-10-20 18:05               ` Luc Teirlinck
2003-10-20 21:10                 ` Luc Teirlinck
2003-10-22  9:24                   ` Richard Stallman
2003-10-22  9:41                     ` Per Abrahamsen
2003-10-23 18:37                       ` Richard Stallman
2003-10-24 16:00                         ` Per Abrahamsen
2003-10-25 22:26                           ` Richard Stallman
2003-10-21 12:03                 ` Per Abrahamsen
2003-08-23  2:44       ` Luc Teirlinck [this message]
2003-08-23 15:32       ` Luc Teirlinck
2003-08-23  3:25   ` Luc Teirlinck
2003-08-23 18:09     ` Luc Teirlinck
2003-08-23 18:32       ` Luc Teirlinck
  -- strict thread matches above, loose matches on Subject: below --
2003-08-21  1:42 Luc Teirlinck

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=200308230244.h7N2ifk01430@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@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 public inbox

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

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).