(while (not (or (and (>= char ?0) (< char next-digit))
(eq value 'keyboard-quit)))
;; Unread a SPC to lead to our new menu.
- (setq unread-command-events (cons ?\ unread-command-events))
+ (setq unread-command-events (cons ?\s unread-command-events))
(setq keys (read-key-sequence title))
(setq value
(lookup-key overriding-terminal-local-map keys t)
(end (widget-field-end field)))
(when size
(while (and (> end begin)
- (eq (char-after (1- end)) ?\ ))
+ (eq (char-after (1- end)) ?\s))
(setq end (1- end))))
(while (< begin end)
(let ((old (char-after begin)))
&optional button-from button-to
&rest args)
"Return a widget of type TYPE with endpoint FROM TO.
-Optional ARGS are extra keyword arguments for TYPE.
-and TO will be used as the widgets end points. If optional arguments
+No text will be inserted to the buffer, instead the text between FROM
+and TO will be used as the widgets end points. If optional arguments
BUTTON-FROM and BUTTON-TO are given, these will be used as the widgets
button end points.
Optional ARGS are extra keyword arguments for TYPE."
:group 'widgets)
(defun widget-narrow-to-field ()
- "Narrow to field"
+ "Narrow to field."
(interactive)
(let ((field (widget-field-find (point))))
(if field
(defun widget-field-find (pos)
"Return the field at POS.
-Unlike (get-char-property POS 'field) this, works with empty fields too."
+Unlike (get-char-property POS 'field), this works with empty fields too."
(let ((fields widget-field-list)
field found)
(while fields
;; Field too small.
(save-excursion
(goto-char end)
- (insert-char ?\ (- (+ begin size) end))))
+ (insert-char ?\s (- (+ begin size) end))))
((> (- end begin) size)
;; Field too large and
(if (or (< (point) (+ begin size))
(setq begin (point)))
(save-excursion
(goto-char end)
- (while (and (eq (preceding-char) ?\ )
+ (while (and (eq (preceding-char) ?\s)
(> (point) begin))
(delete-backward-char 1)))))))
(widget-specify-secret field))
((eq escape ?n)
(when (widget-get widget :indent)
(insert ?\n)
- (insert-char ? (widget-get widget :indent))))
+ (insert-char ?\s (widget-get widget :indent))))
((eq escape ?t)
(let ((image (widget-get widget :tag-glyph))
(tag (widget-get widget :tag)))
(when doc-text
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
- (insert-char ? (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
;; The `*' in the beginning is redundant.
(when (eq (aref doc-text 0) ?*)
(setq doc-text (substring doc-text 1)))
:action 'widget-url-link-action)
(defun widget-url-link-action (widget &optional event)
- "Open the url specified by WIDGET."
+ "Open the URL specified by WIDGET."
(browse-url (widget-value widget)))
;;; The `function-link' Widget.
:action 'widget-emacs-library-link-action)
(defun widget-emacs-library-link-action (widget &optional event)
- "Find the Emacs Library file specified by WIDGET."
+ "Find the Emacs library file specified by WIDGET."
(find-file (locate-library (widget-value widget))))
;;; The `emacs-commentary-link' Widget.
(insert value)
(and size
(< (length value) size)
- (insert-char ?\ (- size (length value))))
+ (insert-char ?\s (- size (length value))))
(unless (memq widget widget-field-list)
(setq widget-field-new (cons widget widget-field-new)))
(move-marker (cdr overlay) (point))
(while (and size
(not (zerop size))
(> to from)
- (eq (char-after (1- to)) ?\ ))
+ (eq (char-after (1- to)) ?\s))
(setq to (1- to)))
(let ((result (buffer-substring-no-properties from to)))
(when secret
If the item is checked, CHOSEN is a cons whose cdr is the value."
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
- (insert-char ? (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
(widget-specify-insert
(let* ((children (widget-get widget :children))
(buttons (widget-get widget :buttons))
;; (setq type (widget-convert type))
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
- (insert-char ? (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
(widget-specify-insert
(let* ((value (widget-get widget :value))
(children (widget-get widget :children))
;; (let ((widget-push-button-gui widget-editable-list-gui))
(cond ((eq escape ?i)
(and (widget-get widget :indent)
- (insert-char ?\ (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
(apply 'widget-create-child-and-convert
widget 'insert-button
(widget-get widget :append-button-args)))
(widget-specify-insert
(save-excursion
(and (widget-get widget :indent)
- (insert-char ?\ (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
(insert (widget-get widget :entry-format)))
;; Parse % escapes in format.
(while (re-search-forward "%\\(.\\)" nil t)
value (cdr answer))
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
- (insert-char ?\ (widget-get widget :indent)))
+ (insert-char ?\s (widget-get widget :indent)))
(push (cond ((null answer)
(widget-create-child widget arg))
((widget-get arg :inline)
(narrow-to-region from to)
(goto-char (point-min))
(while (search-forward "\n" nil t)
- (insert-char ?\ indent)))))))
+ (insert-char ?\s indent)))))))
;;; The `documentation-string' Widget.
(let ((before (substring doc 0 (match-beginning 0)))
(after (substring doc (match-beginning 0)))
button)
- (insert before ?\ )
+ (insert before ?\s)
(widget-documentation-link-add widget start (point))
(setq button
(widget-create-child-and-convert
(when shown
(setq start (point))
(when (and indent (not (zerop indent)))
- (insert-char ?\ indent))
+ (insert-char ?\s indent))
(insert after)
(widget-documentation-link-add widget start (point)))
(widget-put widget :buttons (list button)))
(widget-apply widget :notify widget event))))
(defun widget-color-notify (widget child &optional event)
- "Update the sample, and notofy the parent."
+ "Update the sample, and notify the parent."
(overlay-put (widget-get widget :sample-overlay)
'face (widget-apply widget :sample-face-get))
(widget-default-notify widget child event))