]> code.delx.au - gnu-emacs/blobdiff - lisp/wid-edit.el
(recover-session): Add leading space on added text lines.
[gnu-emacs] / lisp / wid-edit.el
index 9951501685dd10768ec6b7512bddfe5338e6f451..583ab54fbc2008dd92989d12cc30689fa0d348e3 100644 (file)
@@ -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"