diff options
| author | Richard M. Stallman | 1998-04-02 06:41:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-04-02 06:41:37 +0000 |
| commit | 17030183307147ca954f4346fb2b71a2bd8d1d4b (patch) | |
| tree | 5ec922d5e253751a339887ee7635fccda941d1ad | |
| parent | 4084d128919837556441de2b37d66b6e52345d1f (diff) | |
| download | emacs-17030183307147ca954f4346fb2b71a2bd8d1d4b.tar.gz emacs-17030183307147ca954f4346fb2b71a2bd8d1d4b.zip | |
(widget-beginning-of-line): Don't set zmacs-region-stays.
(widget-end-of-line): Likewise.
(widget-glyph-click): Use read-event.
(widget-color-choice-list): Delete compatibility code.
(widget-color-sample-face-get): Likewise.
(widget-choose): Likewise.
(widget-event-point): Fix paren error.
| -rw-r--r-- | lisp/wid-edit.el | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index b473c3eb1c5..15d7f6b5dfa 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | (defun widget-event-point (event) | 38 | (defun widget-event-point (event) |
| 39 | "Character position of the end of event if that exists, or nil." | 39 | "Character position of the end of event if that exists, or nil." |
| 40 | (posn-point (event-end event)))) | 40 | (posn-point (event-end event))) |
| 41 | 41 | ||
| 42 | (defalias 'widget-read-event 'read-event) | 42 | (defalias 'widget-read-event 'read-event) |
| 43 | 43 | ||
| @@ -202,23 +202,6 @@ minibuffer." | |||
| 202 | ;; We are in Emacs-19, pressed by the mouse | 202 | ;; We are in Emacs-19, pressed by the mouse |
| 203 | (x-popup-menu event | 203 | (x-popup-menu event |
| 204 | (list title (cons "" items)))) | 204 | (list title (cons "" items)))) |
| 205 | ((and (< (length items) widget-menu-max-size) | ||
| 206 | event (fboundp 'popup-menu) window-system) | ||
| 207 | ;; We are in XEmacs, pressed by the mouse | ||
| 208 | (let ((val (get-popup-menu-response | ||
| 209 | (cons title | ||
| 210 | (mapcar | ||
| 211 | (function | ||
| 212 | (lambda (x) | ||
| 213 | (if (stringp x) | ||
| 214 | (vector x nil nil) | ||
| 215 | (vector (car x) (list (car x)) t)))) | ||
| 216 | items))))) | ||
| 217 | (setq val (and val | ||
| 218 | (listp (event-object val)) | ||
| 219 | (stringp (car-safe (event-object val))) | ||
| 220 | (car (event-object val)))) | ||
| 221 | (cdr (assoc val items)))) | ||
| 222 | (widget-menu-minibuffer-flag | 205 | (widget-menu-minibuffer-flag |
| 223 | ;; Read the choice of name from the minibuffer. | 206 | ;; Read the choice of name from the minibuffer. |
| 224 | (setq items (widget-remove-if 'stringp items)) | 207 | (setq items (widget-remove-if 'stringp items)) |
| @@ -994,7 +977,7 @@ Recommended as a parent keymap for modes using widgets.") | |||
| 994 | (if (eq extent (event-glyph-extent last)) | 977 | (if (eq extent (event-glyph-extent last)) |
| 995 | (set-extent-property extent 'end-glyph down-glyph) | 978 | (set-extent-property extent 'end-glyph down-glyph) |
| 996 | (set-extent-property extent 'end-glyph up-glyph)) | 979 | (set-extent-property extent 'end-glyph up-glyph)) |
| 997 | (setq last (next-event event))) | 980 | (setq last (read-event event))) |
| 998 | ;; Release glyph. | 981 | ;; Release glyph. |
| 999 | (when down-glyph | 982 | (when down-glyph |
| 1000 | (set-extent-property extent 'end-glyph up-glyph)) | 983 | (set-extent-property extent 'end-glyph up-glyph)) |
| @@ -1107,9 +1090,7 @@ With optional ARG, move across that many fields." | |||
| 1107 | (start (and field (widget-field-start field)))) | 1090 | (start (and field (widget-field-start field)))) |
| 1108 | (if (and start (not (eq start (point)))) | 1091 | (if (and start (not (eq start (point)))) |
| 1109 | (goto-char start) | 1092 | (goto-char start) |
| 1110 | (call-interactively 'beginning-of-line))) | 1093 | (call-interactively 'beginning-of-line)))) |
| 1111 | ;; XEmacs: preserve the region | ||
| 1112 | (setq zmacs-region-stays t)) | ||
| 1113 | 1094 | ||
| 1114 | (defun widget-end-of-line () | 1095 | (defun widget-end-of-line () |
| 1115 | "Go to end of field or end of line, whichever is first." | 1096 | "Go to end of field or end of line, whichever is first." |
| @@ -1118,9 +1099,7 @@ With optional ARG, move across that many fields." | |||
| 1118 | (end (and field (widget-field-end field)))) | 1099 | (end (and field (widget-field-end field)))) |
| 1119 | (if (and end (not (eq end (point)))) | 1100 | (if (and end (not (eq end (point)))) |
| 1120 | (goto-char end) | 1101 | (goto-char end) |
| 1121 | (call-interactively 'end-of-line))) | 1102 | (call-interactively 'end-of-line)))) |
| 1122 | ;; XEmacs: preserve the region | ||
| 1123 | (setq zmacs-region-stays t)) | ||
| 1124 | 1103 | ||
| 1125 | (defun widget-kill-line () | 1104 | (defun widget-kill-line () |
| 1126 | "Kill to end of field or end of line, whichever is first." | 1105 | "Kill to end of field or end of line, whichever is first." |
| @@ -3372,13 +3351,9 @@ To use this type, you must define :match or :match-alternatives." | |||
| 3372 | (widget-value widget) | 3351 | (widget-value widget) |
| 3373 | (error (widget-get widget :value)))) | 3352 | (error (widget-get widget :value)))) |
| 3374 | (symbol (intern (concat "fg:" value)))) | 3353 | (symbol (intern (concat "fg:" value)))) |
| 3375 | (if (string-match "XEmacs" emacs-version) | 3354 | (condition-case nil |
| 3376 | (prog1 symbol | 3355 | (facemenu-get-face symbol) |
| 3377 | (or (find-face symbol) | 3356 | (error 'default)))) |
| 3378 | (set-face-foreground (make-face symbol) value))) | ||
| 3379 | (condition-case nil | ||
| 3380 | (facemenu-get-face symbol) | ||
| 3381 | (error 'default))))) | ||
| 3382 | 3357 | ||
| 3383 | (defvar widget-color-choice-list nil) | 3358 | (defvar widget-color-choice-list nil) |
| 3384 | ;; Variable holding the possible colors. | 3359 | ;; Variable holding the possible colors. |
| @@ -3386,10 +3361,8 @@ To use this type, you must define :match or :match-alternatives." | |||
| 3386 | (defun widget-color-choice-list () | 3361 | (defun widget-color-choice-list () |
| 3387 | (unless widget-color-choice-list | 3362 | (unless widget-color-choice-list |
| 3388 | (setq widget-color-choice-list | 3363 | (setq widget-color-choice-list |
| 3389 | (if (fboundp 'read-color-completion-table) | 3364 | (mapcar '(lambda (color) (list color)) |
| 3390 | (read-color-completion-table) | 3365 | (x-defined-colors)))) |
| 3391 | (mapcar '(lambda (color) (list color)) | ||
| 3392 | (x-defined-colors))))) | ||
| 3393 | widget-color-choice-list) | 3366 | widget-color-choice-list) |
| 3394 | 3367 | ||
| 3395 | (defvar widget-color-history nil | 3368 | (defvar widget-color-history nil |