commit: Improve style and add tests for 'built-in-symbol-file'.

Stephen Turnbull unwelcome-guest at alioth.debian.org
Thu Jan 3 04:34:27 EST 2008


changeset:   4381:3906442b491b42211630c8b8cd8a8cc05060ce4a
tag:         tip
user:        Stephen J. Turnbull <stephen at xemacs.org>
date:        Thu Jan 03 01:33:59 2008 -0800
files:       src/ChangeLog src/doc.c tests/ChangeLog tests/automated/symbol-tests.el
description:
Improve style and add tests for 'built-in-symbol-file'.


diff -r 461fdb92f3b61866f7787d1922376603c9cc4c96 -r 3906442b491b42211630c8b8cd8a8cc05060ce4a src/ChangeLog
--- a/src/ChangeLog	Wed Jan 02 22:11:03 2008 +0100
+++ b/src/ChangeLog	Thu Jan 03 01:33:59 2008 -0800
@@ -1,3 +1,7 @@ 2008-01-02  Aidan Kehoe  <kehoea at parhasa
+2008-01-03  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* doc.c (Fbuilt_in_symbol_file): Improve style.
+
 2008-01-02  Aidan Kehoe  <kehoea at parhasard.net>
 
 	* emacs.c (main_1): 
diff -r 461fdb92f3b61866f7787d1922376603c9cc4c96 -r 3906442b491b42211630c8b8cd8a8cc05060ce4a src/doc.c
--- a/src/doc.c	Wed Jan 02 22:11:03 2008 +0100
+++ b/src/doc.c	Thu Jan 03 01:33:59 2008 -0800
@@ -519,8 +519,7 @@ If TYPE is `defvar', then variable defin
       fun = Findirect_function (symbol);
 
       if (SUBRP (fun) || (CONSP(fun) && (EQ (Qmacro, Fcar_safe (fun)))
-                          && !NILP(fun = Fcdr_safe (fun))
-                          && (SUBRP (fun))))
+                          && (fun = Fcdr_safe (fun), SUBRP (fun))))
 	{
 	  if (XSUBR (fun)->doc == 0)
 	    return Qnil;
diff -r 461fdb92f3b61866f7787d1922376603c9cc4c96 -r 3906442b491b42211630c8b8cd8a8cc05060ce4a tests/ChangeLog
--- a/tests/ChangeLog	Wed Jan 02 22:11:03 2008 +0100
+++ b/tests/ChangeLog	Thu Jan 03 01:33:59 2008 -0800
@@ -1,3 +1,8 @@ 2007-12-29  Stephen J. Turnbull  <stephe
+2008-01-03  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* automated/symbol-tests.el (Symbol documentation): Add tests to
+	check documentation extraction.
+
 2007-12-29  Stephen J. Turnbull  <stephen at xemacs.org>
 
 	* automated/test-harness.el (test-harness-test-compiled):
diff -r 461fdb92f3b61866f7787d1922376603c9cc4c96 -r 3906442b491b42211630c8b8cd8a8cc05060ce4a tests/automated/symbol-tests.el
--- a/tests/automated/symbol-tests.el	Wed Jan 02 22:11:03 2008 +0100
+++ b/tests/automated/symbol-tests.el	Thu Jan 03 01:33:59 2008 -0800
@@ -332,3 +332,23 @@
 ;  (Assert (equal (catch 'test-tag
 ;		   (set mysym 'foo))
 ;		 `(,mysym (foo) make-local nil nil))))
+
+;; ----------------------------------------------------------------
+;; Symbol documentation
+;; ----------------------------------------------------------------
+
+;; built-in variable documentation
+(Assert (string= (built-in-symbol-file 'internal-doc-file-name)
+		 "doc.c"))
+
+;; built-in function documentation
+(Assert (string= (built-in-symbol-file 'built-in-symbol-file)
+		 "doc.c"))
+
+;; built-in macro documentation
+(Assert (string= (built-in-symbol-file 'when)
+		 "eval.c"))
+
+;; #### we should handle symbols defined in Lisp, dumped, autoloaded,
+;; and required, too.
+




More information about the XEmacs-Patches mailing list