emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Customize creating wrong defaults]


From: Per Abrahamsen
Subject: Re: address@hidden: Customize creating wrong defaults]
Date: Wed, 02 Oct 2002 15:26:20 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8)

Richard Stallman <address@hidden> writes:

> How about this?  Do it in the node Composite Types, in
> lispref/customize.texi, and do it by (1) adding a subnode to explain
> the problem and give an examplem and (2) adding a brief note and xref
> to that subnode in the vairous table entries for the composite types
> for which this is necessary.

Actually, testing it I found that customize got a good default value
in more cases than I had expected, and a rather simple fix seems to
get the rest of the cases right too.  So let's fix the code instead of
the documentation.

2002-10-02  Per Abrahamsen  <address@hidden>

        * wid-edit.el (widget-default-get): Change to return external
        value. 
        (widget-choice-action): Update caller.
        (widget-editable-list-entry-create): Update caller.

cd /home/user_2/abraham/ftp/emacs/lisp/
diff -c wid-edit.el_ORIG wid-edit.el
*** wid-edit.el_ORIG    Wed Oct  2 15:13:47 2002
--- wid-edit.el Wed Oct  2 15:18:20 2002
***************
*** 508,516 ****
                                         :value-to-internal value)))
  
  (defun widget-default-get (widget)
!   "Extract the default value of WIDGET."
!   (or (widget-get widget :value)
!       (widget-apply widget :default-get)))
  
  (defun widget-match-inline (widget vals)
    "In WIDGET, match the start of VALS."
--- 508,517 ----
                                         :value-to-internal value)))
  
  (defun widget-default-get (widget)
!   "Extract the default external value of WIDGET."
!   (widget-apply widget :value-to-external 
!               (or (widget-get widget :value)
!                   (widget-apply widget :default-get))))
  
  (defun widget-match-inline (widget vals)
    "In WIDGET, match the start of VALS."
***************
*** 1993,2001 ****
        (when this-explicit
        (widget-put widget :explicit-choice current)
        (widget-put widget :explicit-choice-value (widget-get widget :value)))
!       (widget-value-set
!        widget (widget-apply current
!                           :value-to-external (widget-default-get current)))
        (widget-setup)
        (widget-apply widget :notify widget event)))
    (run-hook-with-args 'widget-edit-functions widget))
--- 1994,2000 ----
        (when this-explicit
        (widget-put widget :explicit-choice current)
        (widget-put widget :explicit-choice-value (widget-get widget :value)))
!       (widget-value-set widget (widget-default-get current))
        (widget-setup)
        (widget-apply widget :notify widget event)))
    (run-hook-with-args 'widget-edit-functions widget))
***************
*** 2621,2629 ****
                    (setq child (widget-create-child-value
                                 widget type value))
                  (setq child (widget-create-child-value
!                              widget type
!                              (widget-apply type :value-to-external
!                                            (widget-default-get type))))))
               (t
                (error "Unknown escape `%c'" escape)))))
       (widget-put widget
--- 2620,2626 ----
                    (setq child (widget-create-child-value
                                 widget type value))
                  (setq child (widget-create-child-value
!                              widget type (widget-default-get type)))))
               (t
                (error "Unknown escape `%c'" escape)))))
       (widget-put widget

Compilation exited abnormally with code 1 at Wed Oct  2 15:20:07




reply via email to

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