changeset 51047:497252d655f0

(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'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 17 May 2003 20:29:40 +0000
parents 2c49296df7d3
children 7ac9c3bea5ea
files lisp/wid-edit.el
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wid-edit.el	Sat May 17 20:03:22 2003 +0000
+++ b/lisp/wid-edit.el	Sat May 17 20:29:40 2003 +0000
@@ -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 <abraham@dina.kvl.dk>
 ;; 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 @@
 	   ;; 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 @@
 ;;
 ;; 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 @@
 	(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 @@
 
 ;;; 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 @@
 
 (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.