# HG changeset patch # User Pavel Jank # Date 1004276429 0 # Node ID ea36983f19d323d6326d32dd6fe56d63fc761d5d # Parent a126125a6d01e9556aaffc5e1f5eec8e4ea359c8 (bug_reporting_address): New function. Use it when displaying usage message. diff -r a126125a6d01 -r ea36983f19d3 src/emacs.c --- a/src/emacs.c Sun Oct 28 10:56:21 2001 +0000 +++ b/src/emacs.c Sun Oct 28 13:40:29 2001 +0000 @@ -285,8 +285,10 @@ \n\ Various environment variables and window system resources also affect\n\ Emacs' operation. See the main documentation.\n\ -\n\ -Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\ +\n" + +#define USAGE3 "\ +Report bugs to %s. First, please see the Bugs\n\ section of the Emacs manual or the file BUGS.\n" @@ -713,6 +715,38 @@ #endif /* DOUG_LEA_MALLOC */ + +#define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org" +#define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org" + +/* This function is used to determine an address to which bug report should + be sent. */ + +char *bug_reporting_address () +{ + int count=0; + Lisp_Object temp; + char *string; + + temp = Fsymbol_value (intern ("emacs-version")); + + /* When `emacs-version' is invalid, use normal address. */ + if (!STRINGP(temp)) + return REPORT_EMACS_BUG_ADDRESS; + + string = XSTRING (temp)->data; + + do { + if (*string=='.') + count++; + } while (string++,*string); + + /* When `emacs-version' has at least three dots, it is development or + pretest version of Emacs. */ + return (count>=3) ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS; +} + + /* ARGSUSED */ int main (argc, argv, envp) @@ -978,6 +1012,7 @@ { printf (USAGE1, argv[0]); printf (USAGE2); + printf (USAGE3, bug_reporting_address()); exit (0); }