changeset 78089:0ab3d57d551f

(file-coding-system-alist): Fix custom type.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 08 Jul 2007 23:41:36 +0000
parents 4545583b711c
children 39b6c880bfa3
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 18:07:46 2007 +0000
+++ b/lisp/ChangeLog	Sun Jul 08 23:41:36 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  Chong Yidong  <cyd@stupidchicken.com>
 
 	* longlines.el (longlines-wrap-region): Avoid marking buffer as
--- a/lisp/cus-start.el	Sun Jul 08 18:07:46 2007 +0000
+++ b/lisp/cus-start.el	Sun Jul 08 23:41:36 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