aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2003-05-17 20:29:40 +0000
committerStefan Monnier <[email protected]>2003-05-17 20:29:40 +0000
commit7c0a9c8f30222f112d9ee9e35527131d10e0bdc9 (patch)
tree9bb5f60f6689f358019b8f13eb09df6f53dc4bcb
parent47714441724d5579d844c9ef4730dda10f02d2c9 (diff)
(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.el23
1 files changed, 10 insertions, 13 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index c4501ba43e..d1a87c5d13 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1,6 +1,6 @@
;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*-
;;
-;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <[email protected]>
;; Maintainer: FSF
@@ -63,9 +63,6 @@
"Character position of the end of event if that exists, or nil."
(posn-point (event-end event)))
-(autoload 'pp-to-string "pp")
-(autoload 'Info-goto-node "info")
-
(defun widget-button-release-event-p (event)
"Non-nil if EVENT is a mouse-button-release event object."
(and (eventp event)
@@ -236,8 +233,7 @@ minibuffer."
;; Define SPC as a prefix char to get to this menu.
(define-key overriding-terminal-local-map " "
(setq map (make-sparse-keymap title)))
- (save-excursion
- (set-buffer (get-buffer-create " widget-choose"))
+ (with-current-buffer (get-buffer-create " widget-choose")
(erase-buffer)
(insert "Available choices:\n\n")
(while items
@@ -304,7 +300,8 @@ minibuffer."
;;
;; These functions are for specifying text properties.
-(defvar widget-field-add-space t
+;; We can set it to nil now that get_local_map uses get_pos_property.
+(defconst widget-field-add-space nil
"Non-nil means add extra space at the end of editable text fields.
If you don't add the space, it will become impossible to edit a zero
size field.")
@@ -570,7 +567,7 @@ respectively."
(widget nil)
(parent nil)
(overlays (if buffer
- (save-excursion (set-buffer buffer) (overlay-lists))
+ (with-current-buffer buffer (overlay-lists))
(overlay-lists))))
(setq overlays (append (car overlays) (cdr overlays)))
(while (setq cur (pop overlays))
@@ -1104,12 +1101,12 @@ When not inside a field, move to the previous button or field."
;;; Setting up the buffer.
-(defvar widget-field-new nil)
-;; List of all newly created editable fields in the buffer.
+(defvar widget-field-new nil
+ "List of all newly created editable fields in the buffer.")
(make-variable-buffer-local 'widget-field-new)
-(defvar widget-field-list nil)
-;; List of all editable fields in the buffer.
+(defvar widget-field-list nil
+ "List of all editable fields in the buffer.")
(make-variable-buffer-local 'widget-field-list)
(defun widget-at (&optional pos)
@@ -1675,7 +1672,7 @@ If END is omitted, it defaults to the length of LIST."
(defun widget-info-link-action (widget &optional event)
"Open the info node specified by WIDGET."
- (Info-goto-node (widget-value widget)))
+ (info (widget-value widget)))
;;; The `url-link' Widget.