changeset 102101:93915a70e1a4

(custom-group-value-create): Don't throw an error when WIDGET has no doc-string. (Bug#2356)
author Martin Rudalics <rudalics@gmx.at>
date Wed, 18 Feb 2009 12:55:35 +0000
parents f4d8e2387c06
children 0d562146f921
files lisp/ChangeLog lisp/cus-edit.el
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 18 09:23:28 2009 +0000
+++ b/lisp/ChangeLog	Wed Feb 18 12:55:35 2009 +0000
@@ -1,3 +1,8 @@
+2009-02-18  Martin Rudalics  <rudalics@gmx.at>
+
+	* cus-edit.el (custom-group-value-create): Don't throw an error
+	when WIDGET has no doc-string.  (Bug#2356)
+
 2009-02-18  Juanma Barranquero  <lekktu@gmail.com>
 
 	* progmodes/cc-menus.el (imenu-progress-message):
--- a/lisp/cus-edit.el	Wed Feb 18 09:23:28 2009 +0000
+++ b/lisp/cus-edit.el	Wed Feb 18 12:55:35 2009 +0000
@@ -3877,7 +3877,8 @@
 	 (symbol (widget-value widget))
 	 (members (custom-group-members symbol
 					(and (eq custom-buffer-style 'tree)
-					     custom-browse-only-groups))))
+					     custom-browse-only-groups)))
+	 (doc (widget-docstring widget)))
     (cond ((and (eq custom-buffer-style 'tree)
 		(eq state 'hidden)
 		(or members (custom-unloaded-widget-p widget)))
@@ -4005,8 +4006,8 @@
 	   (let ((start (point)))
 	     (insert tag " group: ")
 	     (widget-specify-sample widget start (point)))
-	   (if (< (length (widget-docstring widget)) 50)
-	       (insert (widget-docstring widget)))
+	   (when (and doc (< (length doc) 50))
+	     (insert doc))
 	   ;; Create visibility indicator.
 	   (unless (eq custom-buffer-style 'links)
 	     (insert "--------")
@@ -4033,9 +4034,9 @@
 	   ;; Update buttons.
 	   (widget-put widget :buttons buttons)
 	   ;; Insert documentation.
-	   (if (>= (length (widget-docstring widget)) 50)
-	       (widget-add-documentation-string-button
-		widget :visibility-widget 'custom-visibility))
+	   (when (and doc (>= (length doc) 50))
+	     (widget-add-documentation-string-button
+	      widget :visibility-widget 'custom-visibility))
 
 	   ;; Parent groups.
 	   (if nil  ;;; This should test that the buffer