emacs-devel
[Top][All Lists]
Advanced

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

Re: :format strings in Custom ending in %h


From: Luc Teirlinck
Subject: Re: :format strings in Custom ending in %h
Date: Fri, 22 Aug 2003 21:44:41 -0500 (CDT)

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.






reply via email to

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