changeset 1873:c0bb56c2da36

[xemacs-hg @ 2004-01-22 02:50:25 by james] Remove duplicate sexp widget definitions.
author james
date Thu, 22 Jan 2004 02:50:26 +0000
parents 3a60a1df125c
children 31c960994dba
files lisp/ChangeLog lisp/wid-edit.el
diffstat 2 files changed, 4 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jan 21 22:50:32 2004 +0000
+++ b/lisp/ChangeLog	Thu Jan 22 02:50:26 2004 +0000
@@ -1,3 +1,7 @@
+2004-01-21  Jerry James  <james@xemacs.org>
+
+	* wid-edit.el: Remove duplicate sexp widget definitions.
+
 2004-01-08  Nickolay Pakoulin  <npak@ispras.ru>
 
 	* info.el (Info-insert-file-contents): Use `shell-command-switch'
--- a/lisp/wid-edit.el	Wed Jan 21 22:50:32 2004 +0000
+++ b/lisp/wid-edit.el	Thu Jan 22 02:50:26 2004 +0000
@@ -3616,69 +3616,6 @@
     (widget-apply widget :notify widget event)
     (widget-setup)))
 
-(define-widget 'sexp 'editable-field
-  "An arbitrary Lisp expression."
-  :tag "Lisp expression"
-  :format "%{%t%}: %v"
-  :value nil
-  :validate 'widget-sexp-validate
-  :match (lambda (widget value) t)
-  :value-to-internal 'widget-sexp-value-to-internal
-  :value-to-external (lambda (widget value) (read value))
-  :prompt-history 'widget-sexp-prompt-value-history
-  :prompt-value 'widget-sexp-prompt-value)
-
-(defun widget-sexp-value-to-internal (widget value)
-  ;; Use cl-prettyprint for printer representation.
-  (let ((pp (if (symbolp value)
-		(prin1-to-string value)
-	      (widget-prettyprint-to-string value))))
-    (if (> (length pp) 40)
-	(concat "\n" pp)
-      pp)))
-
-(defun widget-sexp-validate (widget)
-  ;; Valid if we can read the string and there is no junk left after it.
-  (save-excursion
-    (let ((buffer (set-buffer (get-buffer-create " *Widget Scratch*"))))
-      (erase-buffer)
-      (insert (widget-apply widget :value-get))
-      (goto-char (point-min))
-      (condition-case data
-	  (let ((value (read buffer)))
-	    (if (eobp)
-		(if (widget-apply widget :match value)
-		    nil
-		  (widget-put widget :error (widget-get widget :type-error))
-		  widget)
-	      (widget-put widget
-			  :error (format "Junk at end of expression: %s"
-					 (buffer-substring (point)
-							   (point-max))))
-	      widget))
-	(error (widget-put widget :error (error-message-string data))
-	       widget)))))
-
-(defvar widget-sexp-prompt-value-history nil
-  "History of input to `widget-sexp-prompt-value'.")
-
-(defun widget-sexp-prompt-value (widget prompt value unbound)
-  ;; Read an arbitrary sexp.
-  (let ((found (read-string prompt
-			    (if unbound nil (cons (prin1-to-string value) 0))
-			    (widget-get widget :prompt-history))))
-    (save-excursion
-      (let ((buffer (set-buffer (get-buffer-create " *Widget Scratch*"))))
-	(erase-buffer)
-	(insert found)
-	(goto-char (point-min))
-	(let ((answer (read buffer)))
-	  (unless (eobp)
-	    (signal 'error
-		    (list "Junk at end of expression"
-			  (buffer-substring (point) (point-max)))))
-	  answer)))))
-
 (define-widget 'restricted-sexp 'sexp
   "A Lisp expression restricted to values that match.