changeset 81766:a9af9c6eaaad

(file-coding-system-alist): Fix custom type.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 08 Jul 2007 23:41:26 +0000
parents 7effaa2c79bd
children d08e3bd69644
files lisp/ChangeLog lisp/cus-start.el
diffstat 2 files changed, 24 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jul 08 19:35:50 2007 +0000
+++ b/lisp/ChangeLog	Sun Jul 08 23:41:26 2007 +0000
@@ -1,3 +1,7 @@
+2007-07-08  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* cus-start.el (file-coding-system-alist): Fix custom type.
+
 2007-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* vc-cvs.el (vc-cvs-revert): Use vc-default-revert.
--- a/lisp/cus-start.el	Sun Jul 08 19:35:50 2007 +0000
+++ b/lisp/cus-start.el	Sun Jul 08 23:41:26 2007 +0000
@@ -116,15 +116,26 @@
 	      mule
 	      (alist
 	       :key-type (regexp :tag "File regexp")
-	       :value-type (choice
-			    :value (undecided . undecided)
-			    (cons :tag "Encoding/decoding pair"
-				  :value (undecided . undecided)
-				  (coding-system :tag "Decoding")
-				  (coding-system :tag "Encoding"))
-			    (coding-system :tag "Single coding system"
-					   :value undecided)
-			    (function :value ignore))))
+	       :value-type
+	       (choice
+		:value (undecided . undecided)
+		(cons :tag "Encoding/decoding pair"
+		      :value (undecided . undecided)
+		      (coding-system :tag "Decoding")
+		      (coding-system :tag "Encoding"))
+		(coding-system
+		 :tag "Single coding system"
+		 :value undecided
+		 :validate
+		 (lambda (widget)
+		   (unless (or (coding-system-p (widget-value widget))
+			       (functionp (widget-value widget)))
+		     (widget-put
+		      widget
+		      :error (format "Invalid coding system: %S"
+				     (widget-value widget)))
+		     widget)))
+		(function :value ignore))))
 	     (selection-coding-system mule coding-system)
 	     ;; dired.c
 	     (completion-ignored-extensions dired