[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/wid-edit.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/wid-edit.el |
Date: |
Thu, 21 Jul 2005 07:42:03 -0400 |
Index: emacs/lisp/wid-edit.el
diff -c emacs/lisp/wid-edit.el:1.142 emacs/lisp/wid-edit.el:1.143
*** emacs/lisp/wid-edit.el:1.142 Tue Jul 19 11:43:26 2005
--- emacs/lisp/wid-edit.el Thu Jul 21 11:41:54 2005
***************
*** 275,281 ****
(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 keys (read-key-sequence title))
(setq value
(lookup-key overriding-terminal-local-map keys t)
--- 275,281 ----
(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 ?\s unread-command-events))
(setq keys (read-key-sequence title))
(setq value
(lookup-key overriding-terminal-local-map keys t)
***************
*** 377,383 ****
(end (widget-field-end field)))
(when size
(while (and (> end begin)
! (eq (char-after (1- end)) ?\ ))
(setq end (1- end))))
(while (< begin end)
(let ((old (char-after begin)))
--- 377,383 ----
(end (widget-field-end field)))
(when size
(while (and (> end begin)
! (eq (char-after (1- end)) ?\s))
(setq end (1- end))))
(while (< begin end)
(let ((old (char-after begin)))
***************
*** 796,803 ****
&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
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."
--- 796,803 ----
&optional button-from button-to
&rest args)
"Return a widget of type TYPE with endpoint FROM TO.
! 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."
***************
*** 1105,1111 ****
:group 'widgets)
(defun widget-narrow-to-field ()
! "Narrow to field"
(interactive)
(let ((field (widget-field-find (point))))
(if field
--- 1105,1111 ----
:group 'widgets)
(defun widget-narrow-to-field ()
! "Narrow to field."
(interactive)
(let ((field (widget-field-find (point))))
(if field
***************
*** 1213,1219 ****
(defun widget-field-find (pos)
"Return the field at POS.
! Unlike (get-char-property POS 'field) this, works with empty fields too."
(let ((fields widget-field-list)
field found)
(while fields
--- 1213,1219 ----
(defun widget-field-find (pos)
"Return the field at POS.
! Unlike (get-char-property POS 'field), this works with empty fields too."
(let ((fields widget-field-list)
field found)
(while fields
***************
*** 1263,1269 ****
;; Field too small.
(save-excursion
(goto-char end)
! (insert-char ?\ (- (+ begin size) end))))
((> (- end begin) size)
;; Field too large and
(if (or (< (point) (+ begin size))
--- 1263,1269 ----
;; Field too small.
(save-excursion
(goto-char end)
! (insert-char ?\s (- (+ begin size) end))))
((> (- end begin) size)
;; Field too large and
(if (or (< (point) (+ begin size))
***************
*** 1274,1280 ****
(setq begin (point)))
(save-excursion
(goto-char end)
! (while (and (eq (preceding-char) ?\ )
(> (point) begin))
(delete-backward-char 1)))))))
(widget-specify-secret field))
--- 1274,1280 ----
(setq begin (point)))
(save-excursion
(goto-char end)
! (while (and (eq (preceding-char) ?\s)
(> (point) begin))
(delete-backward-char 1)))))))
(widget-specify-secret field))
***************
*** 1434,1440 ****
((eq escape ?n)
(when (widget-get widget :indent)
(insert ?\n)
! (insert-char ? (widget-get widget :indent))))
((eq escape ?t)
(let ((image (widget-get widget :tag-glyph))
(tag (widget-get widget :tag)))
--- 1434,1440 ----
((eq escape ?n)
(when (widget-get widget :indent)
(insert ?\n)
! (insert-char ?\s (widget-get widget :indent))))
((eq escape ?t)
(let ((image (widget-get widget :tag-glyph))
(tag (widget-get widget :tag)))
***************
*** 1498,1504 ****
(when doc-text
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
! (insert-char ? (widget-get widget :indent)))
;; The `*' in the beginning is redundant.
(when (eq (aref doc-text 0) ?*)
(setq doc-text (substring doc-text 1)))
--- 1498,1504 ----
(when doc-text
(and (eq (preceding-char) ?\n)
(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)))
***************
*** 1751,1757 ****
:action 'widget-url-link-action)
(defun widget-url-link-action (widget &optional event)
! "Open the url specified by WIDGET."
(browse-url (widget-value widget)))
;;; The `function-link' Widget.
--- 1751,1757 ----
:action 'widget-url-link-action)
(defun widget-url-link-action (widget &optional event)
! "Open the URL specified by WIDGET."
(browse-url (widget-value widget)))
;;; The `function-link' Widget.
***************
*** 1791,1797 ****
:action 'widget-emacs-library-link-action)
(defun widget-emacs-library-link-action (widget &optional event)
! "Find the Emacs Library file specified by WIDGET."
(find-file (locate-library (widget-value widget))))
;;; The `emacs-commentary-link' Widget.
--- 1791,1797 ----
:action 'widget-emacs-library-link-action)
(defun widget-emacs-library-link-action (widget &optional event)
! "Find the Emacs library file specified by WIDGET."
(find-file (locate-library (widget-value widget))))
;;; The `emacs-commentary-link' Widget.
***************
*** 1872,1878 ****
(insert value)
(and size
(< (length value) size)
! (insert-char ?\ (- size (length value))))
(unless (memq widget widget-field-list)
(setq widget-field-new (cons widget widget-field-new)))
(move-marker (cdr overlay) (point))
--- 1872,1878 ----
(insert value)
(and size
(< (length value) size)
! (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))
***************
*** 1905,1911 ****
(while (and size
(not (zerop size))
(> to from)
! (eq (char-after (1- to)) ?\ ))
(setq to (1- to)))
(let ((result (buffer-substring-no-properties from to)))
(when secret
--- 1905,1911 ----
(while (and size
(not (zerop size))
(> to from)
! (eq (char-after (1- to)) ?\s))
(setq to (1- to)))
(let ((result (buffer-substring-no-properties from to)))
(when secret
***************
*** 2186,2192 ****
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)))
(widget-specify-insert
(let* ((children (widget-get widget :children))
(buttons (widget-get widget :buttons))
--- 2186,2192 ----
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 ?\s (widget-get widget :indent)))
(widget-specify-insert
(let* ((children (widget-get widget :children))
(buttons (widget-get widget :buttons))
***************
*** 2366,2372 ****
;; (setq type (widget-convert type))
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
! (insert-char ? (widget-get widget :indent)))
(widget-specify-insert
(let* ((value (widget-get widget :value))
(children (widget-get widget :children))
--- 2366,2372 ----
;; (setq type (widget-convert type))
(and (eq (preceding-char) ?\n)
(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))
***************
*** 2544,2550 ****
;; (let ((widget-push-button-gui widget-editable-list-gui))
(cond ((eq escape ?i)
(and (widget-get widget :indent)
! (insert-char ?\ (widget-get widget :indent)))
(apply 'widget-create-child-and-convert
widget 'insert-button
(widget-get widget :append-button-args)))
--- 2544,2550 ----
;; (let ((widget-push-button-gui widget-editable-list-gui))
(cond ((eq escape ?i)
(and (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)))
***************
*** 2656,2662 ****
(widget-specify-insert
(save-excursion
(and (widget-get widget :indent)
! (insert-char ?\ (widget-get widget :indent)))
(insert (widget-get widget :entry-format)))
;; Parse % escapes in format.
(while (re-search-forward "%\\(.\\)" nil t)
--- 2656,2662 ----
(widget-specify-insert
(save-excursion
(and (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)
***************
*** 2720,2726 ****
value (cdr answer))
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
! (insert-char ?\ (widget-get widget :indent)))
(push (cond ((null answer)
(widget-create-child widget arg))
((widget-get arg :inline)
--- 2720,2726 ----
value (cdr answer))
(and (eq (preceding-char) ?\n)
(widget-get widget :indent)
! (insert-char ?\s (widget-get widget :indent)))
(push (cond ((null answer)
(widget-create-child widget arg))
((widget-get arg :inline)
***************
*** 2859,2865 ****
(narrow-to-region from to)
(goto-char (point-min))
(while (search-forward "\n" nil t)
! (insert-char ?\ indent)))))))
;;; The `documentation-string' Widget.
--- 2859,2865 ----
(narrow-to-region from to)
(goto-char (point-min))
(while (search-forward "\n" nil t)
! (insert-char ?\s indent)))))))
;;; The `documentation-string' Widget.
***************
*** 2879,2885 ****
(let ((before (substring doc 0 (match-beginning 0)))
(after (substring doc (match-beginning 0)))
button)
! (insert before ?\ )
(widget-documentation-link-add widget start (point))
(setq button
(widget-create-child-and-convert
--- 2879,2885 ----
(let ((before (substring doc 0 (match-beginning 0)))
(after (substring doc (match-beginning 0)))
button)
! (insert before ?\s)
(widget-documentation-link-add widget start (point))
(setq button
(widget-create-child-and-convert
***************
*** 2893,2899 ****
(when shown
(setq start (point))
(when (and indent (not (zerop indent)))
! (insert-char ?\ indent))
(insert after)
(widget-documentation-link-add widget start (point)))
(widget-put widget :buttons (list button)))
--- 2893,2899 ----
(when shown
(setq start (point))
(when (and indent (not (zerop indent)))
! (insert-char ?\s indent))
(insert after)
(widget-documentation-link-add widget start (point)))
(widget-put widget :buttons (list button)))
***************
*** 3594,3600 ****
(widget-apply widget :notify widget event))))
(defun widget-color-notify (widget child &optional event)
! "Update the sample, and notofy the parent."
(overlay-put (widget-get widget :sample-overlay)
'face (widget-apply widget :sample-face-get))
(widget-default-notify widget child event))
--- 3594,3600 ----
(widget-apply widget :notify widget event))))
(defun widget-color-notify (widget child &optional event)
! "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))