:value-to-internal value)))
(defun widget-default-get (widget)
- "Extract the defaylt value of WIDGET."
+ "Extract the default value of WIDGET."
(or (widget-get widget :value)
(widget-apply widget :default-get)))
"Go to beginning of field or beginning of line, whichever is first."
(interactive)
(let* ((field (widget-field-find (point)))
- (start (and field (widget-field-start field))))
- (if (and start (not (eq start (point))))
- (goto-char start)
- (call-interactively 'beginning-of-line))))
+ (start (and field (widget-field-start field)))
+ (bol (save-excursion
+ (beginning-of-line)
+ (point))))
+ (goto-char (if start
+ (max start bol)
+ bol))))
(defun widget-end-of-line ()
"Go to end of field or end of line, whichever is first."
(interactive)
(let* ((field (widget-field-find (point)))
- (end (and field (widget-field-end field))))
- (if (and end (not (eq end (point))))
- (goto-char end)
- (call-interactively 'end-of-line))))
+ (end (and field (widget-field-end field)))
+ (eol (save-excursion
+ (end-of-line)
+ (point))))
+ (goto-char (if end
+ (min end eol)
+ eol))))
(defun widget-kill-line ()
"Kill to end of field or end of line, whichever is first."
(setq child (widget-create-child-value
widget type value))
(setq child (widget-create-child-value
- widget type (widget-default-get type)))))
+ widget type
+ (widget-apply type :value-to-external
+ (widget-default-get type))))))
(t
(error "Unknown escape `%c'" escape)))))
(widget-put widget
"Matches any value, but doesn't let the user edit the value.
This is useful as last item in a `choice' widget.
You should use this widget type with a default value,
-as in (other DEFAULT) or (other :tag "NAME" DEFAULT).
+as in (other DEFAULT) or (other :tag \"NAME\" DEFAULT).
If the user selects this alternative, that specifies DEFAULT
as the value."
:tag "Other"