all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Per Abrahamsen <abraham@dina.kvl.dk>
Cc: emacs-devel@gnu.org, Jens.Schmidt27@epost.de
Subject: Re: [Jens.Schmidt27@epost.de: Customize creating wrong defaults]
Date: Wed, 02 Oct 2002 15:26:20 +0200	[thread overview]
Message-ID: <rjr8f9q8eb.fsf@zuse.dina.kvl.dk> (raw)
In-Reply-To: <E17wanR-0001zr-00@fencepost.gnu.org> (Richard Stallman's message of "Wed, 02 Oct 2002 00:07:37 -0400")

Richard Stallman <rms@gnu.org> 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  <abraham@dina.kvl.dk>

	* 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	other threads:[~2002-10-02 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E17wGMQ-0006jm-00@fencepost.gnu.org>
2002-10-01 10:25 ` [Jens.Schmidt27@epost.de: Customize creating wrong defaults] Per Abrahamsen
2002-10-02  4:07   ` Richard Stallman
2002-10-02 13:26     ` Per Abrahamsen [this message]
2002-10-03  0:32       ` Richard Stallman
2002-10-03 13:47         ` Per Abrahamsen
2002-10-04  3:48           ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=rjr8f9q8eb.fsf@zuse.dina.kvl.dk \
    --to=abraham@dina.kvl.dk \
    --cc=Jens.Schmidt27@epost.de \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.