diff lisp/wid-edit.el @ 43295:ce2590f06ba0

2002-02-14 Per Abrahamsen <abraham@dina.kvl.dk> * facemenu.el (describe-text-done): New function. (describe-text-mode-map): New variable. (describe-text-mode-hook): New option. (describe-text-mode): New function. (describe-text-widget): New function. (describe-text-sexp): New function. (describe-text-properties): New function. (describe-text-category): New command. (describe-text-at): New command. (facemenu-menu): Replace `list-text-properties-at' with `describe-text-at' in the menu. * wid-edit.el (widgetp): New function. * wid-edit.el (widget-keymap, widget-insert, widget-setup): Autoloaded. * emacs-lisp/pp.el (pp-to-string): Autoloaded. * wid-browse.el: Removed version and x-url keywords.
author Per Abrahamsen <abraham@dina.kvl.dk>
date Thu, 14 Feb 2002 16:47:11 +0000
parents 0cfd64a10789
children 683707b691b8
line wrap: on
line diff
--- a/lisp/wid-edit.el	Thu Feb 14 01:55:43 2002 +0000
+++ b/lisp/wid-edit.el	Thu Feb 14 16:47:11 2002 +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 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: FSF
@@ -468,6 +468,14 @@
   "Return the type of WIDGET, a symbol."
   (car widget))
 
+;;;###autoload
+(defun widgetp (widget)
+  "Return non-nil iff WIDGET is a widget."
+  (if (symbolp widget)
+      (get widget 'widget-type)
+    (and (consp widget)
+	 (get (widget-type widget) 'widget-type))))
+
 (defun widget-get-indirect (widget property)
   "In WIDGET, get the value of PROPERTY.
 If the value is a symbol, return its binding.
@@ -747,6 +755,7 @@
     ;; Return the newly create widget.
     widget))
 
+;;;###autoload
 (defun widget-insert (&rest args)
   "Call `insert' with ARGS even if surrounding text is read only."
   (let ((inhibit-read-only t)
@@ -801,6 +810,7 @@
 
 ;;; Keymap and Commands.
 
+;;;###autoload
 (defvar widget-keymap
   (let ((map (make-sparse-keymap)))
     (define-key map "\t" 'widget-forward)
@@ -1083,6 +1093,7 @@
   (or (get-char-property (or pos (point)) 'button)
       (widget-field-at pos)))
 
+;;;###autoload
 (defun widget-setup ()
   "Setup current buffer so editing string widgets works."
   (let ((inhibit-read-only t)