diff lib-src/make-docfile.c @ 5076:d555581e3cba

fix issues with display of argument docstrings -------------------- ChangeLog entries follow: -------------------- lib-src/ChangeLog addition: 2010-02-25 Ben Wing <ben@xemacs.org> * make-docfile.c: * make-docfile.c (write_c_args): Convert newlines to spaces so that argument lists are always on one line, because that's what function-documentation-1 expects. lisp/ChangeLog addition: c2010-02-25 Ben Wing <ben@xemacs.org> * autoload.el (make-autoload): Call cl-function-arglist with one arg. * cl-macs.el (cl-function-arglist): * cl-macs.el (cl-transform-lambda): Make cl-function-arglist take only one arg, the arglist; no function name passed. Also make sure to print () instead of nil when empty arglist, or function-documentation-1 won't recognize the arguments: line. * help.el (function-arglist): If empty arg, don't display extra space after function name.
author Ben Wing <ben@xemacs.org>
date Thu, 25 Feb 2010 04:10:52 -0600
parents f3a65dff1912
children 39d74978fd32
line wrap: on
line diff
--- a/lib-src/make-docfile.c	Tue Feb 23 05:11:15 2010 -0600
+++ b/lib-src/make-docfile.c	Thu Feb 25 04:10:52 2010 -0600
@@ -3,7 +3,7 @@
    Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1998, 1999 J. Kean Johnston.
-   Copyright (C) 2001, 2002 Ben Wing.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -651,11 +651,11 @@
 	}
 
       /* Print the C argument list as it would appear in lisp:
-	 print underscores as hyphens, and print commas and newlines
+	 print underscores as hyphens, and print commas, tabs and newlines
 	 as spaces.  Collapse adjacent spaces into one.  */
       if (c == '_')
 	c = '-';
-      else if (c == ',' /* || c == '\n' */)
+      else if (c == ',' || c == '\n' || c == '\t')
 	c = ' ';
       /* XEmacs change: handle \n below for readability */
 
@@ -682,18 +682,28 @@
 	  in_ident = 0;
 	  just_spaced = 0;
 	}
-      /* XEmacs change: if the character is carriage return or linefeed,
-	 escape it for the compiler */
+#if 0
+      /* [[ XEmacs change: if the character is carriage return or linefeed,
+	 escape it for the compiler ]] I doubt the clause with '\r' ever
+	 worked right, and outputting newlines now screws up the regexp
+	 in function-documentation-1, so don't do this; instead, we treat
+	 newlines like spaces. --ben */
       else if (c == '\n')
 	{
 	  putc('\\', out);
 	  putc('\n', out);
+	  c = ' ';
 	}
       else if (c == '\r')
 	{
 	  putc('\\', out);
 	  putc('\r', out);
 	}
+#else
+      else if (c == '\r') /* Just eat it, since we expect a newline to
+			     follow */
+	;
+#endif /* (not) 0 */
       else if (c != ' ' || !just_spaced)
 	{
 	  if (c >= 'a' && c <= 'z')