X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/e9367b9c2a7ea98700e7a3967abfc7f18fcbbd8f..d6046e457f578c8494afdd0f3a7ab1282927be13:/lisp/wid-edit.el diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 9951501685..583ab54fbc 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -490,7 +490,7 @@ Otherwise, just return the value." :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))) @@ -1111,19 +1111,25 @@ With optional ARG, move across that many fields." "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." @@ -2657,7 +2663,9 @@ when he invoked the menu." (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 @@ -2919,7 +2927,7 @@ link for that string." "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"