Fix to semantic-lex-spp-table-write-slot-value (Bug#6324).
authorEric M. Ludlam <zappo@gnu.org>
Thu, 3 Jun 2010 17:17:50 +0000 (13:17 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 3 Jun 2010 17:17:50 +0000 (13:17 -0400)
* cedet/semantic/lex-spp.el
(semantic-lex-spp-table-write-slot-value): Instead of erroring on
invalid values during save, just save a nil (Bug#6324).

lisp/ChangeLog
lisp/cedet/semantic/lex-spp.el

index 1611165..aafa464 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-03  Eric Ludlam  <zappo@gnu.org>
+
+       * cedet/semantic/lex-spp.el
+       (semantic-lex-spp-table-write-slot-value): Instead of erroring on
+       invalid values during save, just save a nil (Bug#6324).
+
 2010-06-03  Glenn Morris  <rgm@gnu.org>
 
        * desktop.el (desktop-clear-preserve-buffers):
index e76b8cd..58ad681 100644 (file)
@@ -1121,37 +1121,31 @@ The VALUE is a spp lexical table."
       (prin1 (car sym))
       (let* ((first (car (cdr sym)))
             (rest (cdr sym)))
-       (when (not (listp first))
-         (error "Error in macro \"%s\"" (car sym)))
-       (when (eq (car first) 'spp-arg-list)
-         (princ " ")
-         (prin1 first)
-         (setq rest (cdr rest))
-         )
-
-       (when rest
-         (princ " . ")
-         (let ((len (length (cdr rest))))
-           (cond ((< len 2)
-                  (condition-case nil
-                      (prin1 rest)
-                    (error
-                     (princ "nil ;; Error writing macro\n"))))
-                 ((< len semantic-lex-spp-macro-max-length-to-save)
-                  (princ "\n              ")
-                  (condition-case nil
-                      (prin1 rest)
-                    (error
-                     (princ "nil ;; Error writing macro\n          ")))
-                  )
-                 (t ;; Too Long!
-                  (princ "nil ;; Too Long!\n          ")
-                  ))))
-       )
-      (princ ")\n          ")
-      )
-    (princ ")\n"))
-)
+       (if (not (listp first))
+           (insert "nil ;; bogus macro found.\n")
+         (when (eq (car first) 'spp-arg-list)
+           (princ " ")
+           (prin1 first)
+           (setq rest (cdr rest)))
+
+         (when rest
+           (princ " . ")
+           (let ((len (length (cdr rest))))
+             (cond ((< len 2)
+                    (condition-case nil
+                        (prin1 rest)
+                      (error
+                       (princ "nil ;; Error writing macro\n"))))
+                   ((< len semantic-lex-spp-macro-max-length-to-save)
+                    (princ "\n              ")
+                    (condition-case nil
+                        (prin1 rest)
+                      (error
+                       (princ "nil ;; Error writing macro\n          "))))
+                   (t ;; Too Long!
+                    (princ "nil ;; Too Long!\n          ")))))))
+      (princ ")\n          "))
+    (princ ")\n")))
 
 ;;; MACRO TABLE DEBUG
 ;;