diff options
| author | Stefan Monnier | 2003-05-17 20:29:40 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-17 20:29:40 +0000 |
| commit | 7c0a9c8f30222f112d9ee9e35527131d10e0bdc9 (patch) | |
| tree | 9bb5f60f6689f358019b8f13eb09df6f53dc4bcb | |
| parent | 47714441724d5579d844c9ef4730dda10f02d2c9 (diff) | |
| download | emacs-7c0a9c8f30222f112d9ee9e35527131d10e0bdc9.tar.gz emacs-7c0a9c8f30222f112d9ee9e35527131d10e0bdc9.zip | |
(pp-to-string, Info-goto-node): Don't autoload.
(widget-choose, widget-map-buttons): Use with-current-buffer.
(widget-field-add-space): Change to nil (and to defconst).
(widget-info-link-action): Use `info'.
| -rw-r--r-- | lisp/wid-edit.el | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index c4501ba43e1..d1a87c5d135 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*- | 1 | ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*- |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| 5 | ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | 5 | ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -63,9 +63,6 @@ | |||
| 63 | "Character position of the end of event if that exists, or nil." | 63 | "Character position of the end of event if that exists, or nil." |
| 64 | (posn-point (event-end event))) | 64 | (posn-point (event-end event))) |
| 65 | 65 | ||
| 66 | (autoload 'pp-to-string "pp") | ||
| 67 | (autoload 'Info-goto-node "info") | ||
| 68 | |||
| 69 | (defun widget-button-release-event-p (event) | 66 | (defun widget-button-release-event-p (event) |
| 70 | "Non-nil if EVENT is a mouse-button-release event object." | 67 | "Non-nil if EVENT is a mouse-button-release event object." |
| 71 | (and (eventp event) | 68 | (and (eventp event) |
| @@ -236,8 +233,7 @@ minibuffer." | |||
| 236 | ;; Define SPC as a prefix char to get to this menu. | 233 | ;; Define SPC as a prefix char to get to this menu. |
| 237 | (define-key overriding-terminal-local-map " " | 234 | (define-key overriding-terminal-local-map " " |
| 238 | (setq map (make-sparse-keymap title))) | 235 | (setq map (make-sparse-keymap title))) |
| 239 | (save-excursion | 236 | (with-current-buffer (get-buffer-create " widget-choose") |
| 240 | (set-buffer (get-buffer-create " widget-choose")) | ||
| 241 | (erase-buffer) | 237 | (erase-buffer) |
| 242 | (insert "Available choices:\n\n") | 238 | (insert "Available choices:\n\n") |
| 243 | (while items | 239 | (while items |
| @@ -304,7 +300,8 @@ minibuffer." | |||
| 304 | ;; | 300 | ;; |
| 305 | ;; These functions are for specifying text properties. | 301 | ;; These functions are for specifying text properties. |
| 306 | 302 | ||
| 307 | (defvar widget-field-add-space t | 303 | ;; We can set it to nil now that get_local_map uses get_pos_property. |
| 304 | (defconst widget-field-add-space nil | ||
| 308 | "Non-nil means add extra space at the end of editable text fields. | 305 | "Non-nil means add extra space at the end of editable text fields. |
| 309 | If you don't add the space, it will become impossible to edit a zero | 306 | If you don't add the space, it will become impossible to edit a zero |
| 310 | size field.") | 307 | size field.") |
| @@ -570,7 +567,7 @@ respectively." | |||
| 570 | (widget nil) | 567 | (widget nil) |
| 571 | (parent nil) | 568 | (parent nil) |
| 572 | (overlays (if buffer | 569 | (overlays (if buffer |
| 573 | (save-excursion (set-buffer buffer) (overlay-lists)) | 570 | (with-current-buffer buffer (overlay-lists)) |
| 574 | (overlay-lists)))) | 571 | (overlay-lists)))) |
| 575 | (setq overlays (append (car overlays) (cdr overlays))) | 572 | (setq overlays (append (car overlays) (cdr overlays))) |
| 576 | (while (setq cur (pop overlays)) | 573 | (while (setq cur (pop overlays)) |
| @@ -1104,12 +1101,12 @@ When not inside a field, move to the previous button or field." | |||
| 1104 | 1101 | ||
| 1105 | ;;; Setting up the buffer. | 1102 | ;;; Setting up the buffer. |
| 1106 | 1103 | ||
| 1107 | (defvar widget-field-new nil) | 1104 | (defvar widget-field-new nil |
| 1108 | ;; List of all newly created editable fields in the buffer. | 1105 | "List of all newly created editable fields in the buffer.") |
| 1109 | (make-variable-buffer-local 'widget-field-new) | 1106 | (make-variable-buffer-local 'widget-field-new) |
| 1110 | 1107 | ||
| 1111 | (defvar widget-field-list nil) | 1108 | (defvar widget-field-list nil |
| 1112 | ;; List of all editable fields in the buffer. | 1109 | "List of all editable fields in the buffer.") |
| 1113 | (make-variable-buffer-local 'widget-field-list) | 1110 | (make-variable-buffer-local 'widget-field-list) |
| 1114 | 1111 | ||
| 1115 | (defun widget-at (&optional pos) | 1112 | (defun widget-at (&optional pos) |
| @@ -1675,7 +1672,7 @@ If END is omitted, it defaults to the length of LIST." | |||
| 1675 | 1672 | ||
| 1676 | (defun widget-info-link-action (widget &optional event) | 1673 | (defun widget-info-link-action (widget &optional event) |
| 1677 | "Open the info node specified by WIDGET." | 1674 | "Open the info node specified by WIDGET." |
| 1678 | (Info-goto-node (widget-value widget))) | 1675 | (info (widget-value widget))) |
| 1679 | 1676 | ||
| 1680 | ;;; The `url-link' Widget. | 1677 | ;;; The `url-link' Widget. |
| 1681 | 1678 | ||