Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
5072:cc74f60c150e | 5076:d555581e3cba |
---|---|
1 /* Generate doc-string file for XEmacs from source files. | 1 /* Generate doc-string file for XEmacs from source files. |
2 Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 2001 | 2 Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 2001 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 Copyright (C) 1995 Board of Trustees, University of Illinois. | 4 Copyright (C) 1995 Board of Trustees, University of Illinois. |
5 Copyright (C) 1998, 1999 J. Kean Johnston. | 5 Copyright (C) 1998, 1999 J. Kean Johnston. |
6 Copyright (C) 2001, 2002 Ben Wing. | 6 Copyright (C) 2001, 2002, 2010 Ben Wing. |
7 | 7 |
8 This file is part of XEmacs. | 8 This file is part of XEmacs. |
9 | 9 |
10 XEmacs is free software; you can redistribute it and/or modify | 10 XEmacs is free software; you can redistribute it and/or modify |
11 it under the terms of the GNU General Public License as published by | 11 it under the terms of the GNU General Public License as published by |
649 } | 649 } |
650 } | 650 } |
651 } | 651 } |
652 | 652 |
653 /* Print the C argument list as it would appear in lisp: | 653 /* Print the C argument list as it would appear in lisp: |
654 print underscores as hyphens, and print commas and newlines | 654 print underscores as hyphens, and print commas, tabs and newlines |
655 as spaces. Collapse adjacent spaces into one. */ | 655 as spaces. Collapse adjacent spaces into one. */ |
656 if (c == '_') | 656 if (c == '_') |
657 c = '-'; | 657 c = '-'; |
658 else if (c == ',' /* || c == '\n' */) | 658 else if (c == ',' || c == '\n' || c == '\t') |
659 c = ' '; | 659 c = ' '; |
660 /* XEmacs change: handle \n below for readability */ | 660 /* XEmacs change: handle \n below for readability */ |
661 | 661 |
662 #if 0 | 662 #if 0 |
663 /* In C code, `default' is a reserved word, so we spell it | 663 /* In C code, `default' is a reserved word, so we spell it |
680 if (c == '-' && ! C_IDENTIFIER_CHAR_P (p[1])) | 680 if (c == '-' && ! C_IDENTIFIER_CHAR_P (p[1])) |
681 { | 681 { |
682 in_ident = 0; | 682 in_ident = 0; |
683 just_spaced = 0; | 683 just_spaced = 0; |
684 } | 684 } |
685 /* XEmacs change: if the character is carriage return or linefeed, | 685 #if 0 |
686 escape it for the compiler */ | 686 /* [[ XEmacs change: if the character is carriage return or linefeed, |
687 escape it for the compiler ]] I doubt the clause with '\r' ever | |
688 worked right, and outputting newlines now screws up the regexp | |
689 in function-documentation-1, so don't do this; instead, we treat | |
690 newlines like spaces. --ben */ | |
687 else if (c == '\n') | 691 else if (c == '\n') |
688 { | 692 { |
689 putc('\\', out); | 693 putc('\\', out); |
690 putc('\n', out); | 694 putc('\n', out); |
695 c = ' '; | |
691 } | 696 } |
692 else if (c == '\r') | 697 else if (c == '\r') |
693 { | 698 { |
694 putc('\\', out); | 699 putc('\\', out); |
695 putc('\r', out); | 700 putc('\r', out); |
696 } | 701 } |
702 #else | |
703 else if (c == '\r') /* Just eat it, since we expect a newline to | |
704 follow */ | |
705 ; | |
706 #endif /* (not) 0 */ | |
697 else if (c != ' ' || !just_spaced) | 707 else if (c != ' ' || !just_spaced) |
698 { | 708 { |
699 if (c >= 'a' && c <= 'z') | 709 if (c >= 'a' && c <= 'z') |
700 /* Upcase the letter. */ | 710 /* Upcase the letter. */ |
701 c += 'A' - 'a'; | 711 c += 'A' - 'a'; |