Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103425. ------------------------------------------------------------ revno: 103425 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-02-26 09:44:38 +0200 message: Fix the MS-Windows build after revision 103424. emacsclient.c (xstrdup) [WINDOWSNT]: Function added back. (w32_getenv): Use xstrdup to return all values in malloc'ed storage. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-02-26 05:43:51 +0000 +++ lib-src/ChangeLog 2011-02-26 07:44:38 +0000 @@ -1,3 +1,9 @@ +2011-02-26 Eli Zaretskii + + * emacsclient.c (xstrdup) [WINDOWSNT]: Function added back. + (w32_getenv): Use xstrdup to return all values in malloc'ed + storage. + 2011-02-26 Paul Eggert * ebrowse.c (parse_qualified_param_ident_or_type): Make it clear === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2011-02-26 00:17:02 +0000 +++ lib-src/emacsclient.c 2011-02-26 07:44:38 +0000 @@ -293,6 +293,20 @@ #ifdef WINDOWSNT +/* Like strdup but get a fatal error if memory is exhausted. */ + +char * +xstrdup (const char *s) +{ + char *result = strdup (s); + if (result == NULL) + { + perror ("strdup"); + exit (EXIT_FAILURE); + } + return result; +} + #define REG_ROOT "SOFTWARE\\GNU\\Emacs" /* Retrieve an environment variable from the Emacs subkeys of the registry. @@ -328,9 +342,11 @@ /* getenv wrapper for Windows - This is needed to duplicate Emacs's behavior, which is to look for environment - variables in the registry if they don't appear in the environment. -*/ + Value is allocated on the heap, and can be free'd. + + This is needed to duplicate Emacs's behavior, which is to look for + environment variables in the registry if they don't appear in the + environment. */ char * w32_getenv (char *envvar) { @@ -338,15 +354,16 @@ DWORD dwType; if (value = getenv (envvar)) - /* Found in the environment. */ - return value; + /* Found in the environment. strdup it, because values returned + by getenv cannot be free'd. */ + return xstrdup (value); if (! (value = w32_get_resource (HKEY_CURRENT_USER, envvar, &dwType)) && ! (value = w32_get_resource (HKEY_LOCAL_MACHINE, envvar, &dwType))) { /* "w32console" is what Emacs on Windows uses for tty-type under -nw. */ if (strcmp (envvar, "TERM") == 0) - return "w32console"; + return xstrdup ("w32console"); /* Found neither in the environment nor in the registry. */ return NULL; } ------------------------------------------------------------ revno: 103424 [merge] committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-02-25 21:54:36 -0800 message: Merge: lib-src changes mostly to avoid GCC warnings diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-02-23 15:22:28 +0000 +++ lib-src/ChangeLog 2011-02-26 05:43:51 +0000 @@ -1,3 +1,49 @@ +2011-02-26 Paul Eggert + + * ebrowse.c (parse_qualified_param_ident_or_type): Make it clear + to reader (and to the compiler) that the loop always executes at + least once. This prevents a warning with recent GCC. + (BROWSE_STRUCT): Remove unused macro. + + * fakemail.c: Include . + (put_line): Explicitly ignore fwrite return value, for benefit of + recent glibc + gcc. + (close_the_streams): Diagnose output errors instead of merely + exiting with nonzero status. + (my_fclose, main): Diagnose input errors, and exit with nonzero status. + Formerly, input errors were silently ignored. + + * ebrowse.c (putstr): Rename from PUTSTR and turn into a function. + All callers changed. This is cleaner, and avoids GCC warnings about + passing NULL to fputs. + (insert_keyword): Rename parameter to avoid shadowing diagnostic. + +2011-02-25 Paul Eggert + + * emacsclient.c (main): Avoid dangling 'if'. + (xstrdup): Remove; no longer needed. + (get_current_dir_name, w32_getenv, get_server_config, find_tty): + (set_local_socket, main): + Use const char *, not char *, for pointers that are not assigned + through. + (IF_LINT): New macro. + (set_local_socket, main): Use it to suppress warnings with + GCC -Wuninitialized. + + * emacsclient.c: Redo local variables to avoid shadowing problems. + (message, socket_status, start_daemon_and_retry_set_socket): + Rename locals. + (main): Move decl of "i". + + * etags.c (ISUPPER): Move to inside the only #ifdef where it's used. + This avoids an unused-macro warning with some GCC settings. + + * make-docfile.c (write_globals): Change char * to char const * + to avoid a GCC "assignment discards qualifiers" diagnostic + in some configurations. + (scan_c_file): Refactor local variable decls to make their scope + more accurate and to avoid a GCC -Wuninitialized diagnostic. + 2011-02-22 Eli Zaretskii * etags.c (canonicalize_filename, ISUPPER): Fix last change. === modified file 'lib-src/ebrowse.c' --- lib-src/ebrowse.c 2011-02-21 23:22:34 +0000 +++ lib-src/ebrowse.c 2011-02-26 05:43:51 +0000 @@ -77,7 +77,6 @@ #define TREE_HEADER_STRUCT "[ebrowse-hs " #define TREE_STRUCT "[ebrowse-ts " #define MEMBER_STRUCT "[ebrowse-ms " -#define BROWSE_STRUCT "[ebrowse-bs " #define CLASS_STRUCT "[ebrowse-cs " /* The name of the symbol table entry for global functions, variables, @@ -1108,22 +1107,23 @@ /* Write string S to the output file FP in a Lisp-readable form. If S is null, write out `()'. */ -#define PUTSTR(s, fp) \ - do { \ - if (!s) \ - { \ - putc ('(', fp); \ - putc (')', fp); \ - putc (' ', fp); \ - } \ - else \ - { \ - putc ('"', fp); \ - fputs (s, fp); \ - putc ('"', fp); \ - putc (' ', fp); \ - } \ - } while (0) +static inline void +putstr (const char *s, FILE *fp) +{ + if (!s) + { + putc ('(', fp); + putc (')', fp); + putc (' ', fp); + } + else + { + putc ('"', fp); + fputs (s, fp); + putc ('"', fp); + putc (' ', fp); + } +} /* A dynamically allocated buffer for constructing a scope name. */ @@ -1216,16 +1216,16 @@ for (n = 0; m; m = m->next, ++n) { fputs (MEMBER_STRUCT, fp); - PUTSTR (m->name, fp); - PUTSTR (NULL, fp); /* FIXME? scope for globals */ + putstr (m->name, fp); + putstr (NULL, fp); /* FIXME? scope for globals */ fprintf (fp, "%u ", (unsigned) m->flags); - PUTSTR (m->filename, fp); - PUTSTR (m->regexp, fp); + putstr (m->filename, fp); + putstr (m->regexp, fp); fprintf (fp, "%u ", (unsigned) m->pos); fprintf (fp, "%u ", (unsigned) m->vis); putc (' ', fp); - PUTSTR (m->def_filename, fp); - PUTSTR (m->def_regexp, fp); + putstr (m->def_filename, fp); + putstr (m->def_regexp, fp); fprintf (fp, "%u", (unsigned) m->def_pos); putc (']', fp); putc ('\n', fp); @@ -1243,20 +1243,20 @@ dump_sym (FILE *fp, struct sym *root) { fputs (CLASS_STRUCT, fp); - PUTSTR (root->name, fp); + putstr (root->name, fp); /* Print scope, if any. */ if (root->namesp) - PUTSTR (sym_scope (root), fp); + putstr (sym_scope (root), fp); else - PUTSTR (NULL, fp); + putstr (NULL, fp); /* Print flags. */ fprintf (fp, "%u", root->flags); - PUTSTR (root->filename, fp); - PUTSTR (root->regexp, fp); + putstr (root->filename, fp); + putstr (root->regexp, fp); fprintf (fp, "%u", (unsigned) root->pos); - PUTSTR (root->sfilename, fp); + putstr (root->sfilename, fp); putc (']', fp); putc ('\n', fp); } @@ -1323,7 +1323,7 @@ if (!f_append) { fputs (TREE_HEADER_STRUCT, fp); - PUTSTR (EBROWSE_FILE_VERSION, fp); + putstr (EBROWSE_FILE_VERSION, fp); putc ('\"', fp); if (!f_structs) @@ -2062,11 +2062,11 @@ } -/* Insert a keyword NAME with token value TK into the keyword hash +/* Insert a keyword NAME with token value TKV into the keyword hash table. */ static void -insert_keyword (const char *name, int tk) +insert_keyword (const char *name, int tkv) { const char *s; unsigned h = 0; @@ -2077,7 +2077,7 @@ h %= KEYWORD_TABLE_SIZE; k->name = name; - k->tk = tk; + k->tk = tkv; k->next = keyword_table[h]; keyword_table[h] = k; } @@ -2951,7 +2951,9 @@ static char *id = NULL; static int id_size = 0; - while (LOOKING_AT (IDENT)) + assert (LOOKING_AT (IDENT)); + + do { int len = strlen (yytext) + 1; if (len > id_size) @@ -2974,6 +2976,7 @@ else break; } + while (LOOKING_AT (IDENT)); } === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2011-02-21 18:06:25 +0000 +++ lib-src/emacsclient.c 2011-02-26 00:17:02 +0000 @@ -112,6 +112,13 @@ /* Additional space when allocating buffers for filenames, etc. */ #define EXTRA_SPACE 100 +/* Use this to suppress gcc's `...may be used before initialized' warnings. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + /* Name used to invoke this program. */ const char *progname; @@ -190,20 +197,6 @@ return result; } -/* Like strdup but get a fatal error if memory is exhausted. */ - -static char * -xstrdup (const char *s) -{ - char *result = strdup (s); - if (result == NULL) - { - perror ("strdup"); - exit (EXIT_FAILURE); - } - return result; -} - /* From sysdep.c */ #if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) @@ -233,7 +226,7 @@ get_current_dir_name (void) { char *buf; - char *pwd; + const char *pwd; struct stat dotstat, pwdstat; /* If PWD is accurate, use it instead of calling getwd. PWD is sometimes a nicer name, and using it may avoid a fatal error if a @@ -353,7 +346,7 @@ { /* "w32console" is what Emacs on Windows uses for tty-type under -nw. */ if (strcmp (envvar, "TERM") == 0) - return xstrdup ("w32console"); + return "w32console"; /* Found neither in the environment nor in the registry. */ return NULL; } @@ -474,13 +467,13 @@ /* Display a normal or error message. On Windows, use a message box if compiled as a Windows app. */ static void -message (int is_error, const char *message, ...) +message (int is_error, const char *format, ...) { char msg[2048]; va_list args; - va_start (args, message); - vsprintf (msg, message, args); + va_start (args, format); + vsprintf (msg, format, args); va_end (args); #ifdef WINDOWSNT @@ -918,7 +911,7 @@ config = fopen (server_file, "rb"); else { - char *home = egetenv ("HOME"); + const char *home = egetenv ("HOME"); if (home) { @@ -1025,10 +1018,10 @@ is zero, or return 0 if NOABORT is non-zero. */ static int -find_tty (char **tty_type, char **tty_name, int noabort) +find_tty (const char **tty_type, const char **tty_name, int noabort) { - char *type = egetenv ("TERM"); - char *name = ttyname (fileno (stdout)); + const char *type = egetenv ("TERM"); + const char *name = ttyname (fileno (stdout)); if (!name) { @@ -1080,11 +1073,11 @@ 0 - success: none of the above */ static int -socket_status (char *socket_name) +socket_status (char *name) { struct stat statbfr; - if (stat (socket_name, &statbfr) == -1) + if (stat (name, &statbfr) == -1) return 2; if (statbfr.st_uid != geteuid ()) @@ -1205,7 +1198,7 @@ int default_sock = !socket_name; int saved_errno = 0; const char *server_name = "server"; - const char *tmpdir; + const char *tmpdir IF_LINT ( = NULL); if (socket_name && !strchr (socket_name, '/') && !strchr (socket_name, '\\')) @@ -1260,10 +1253,10 @@ associated with the name. This is reminiscent of the logic that init_editfns uses to set the global Vuser_full_name. */ - char *user_name = (char *) egetenv ("LOGNAME"); + const char *user_name = egetenv ("LOGNAME"); if (!user_name) - user_name = (char *) egetenv ("USER"); + user_name = egetenv ("USER"); if (user_name) { @@ -1483,8 +1476,8 @@ else { char emacs[] = "emacs"; - char daemon[] = "--daemon"; - char *d_argv[] = {emacs, daemon, 0 }; + char daemon_option[] = "--daemon"; + char *d_argv[] = {emacs, daemon_option, 0 }; if (socket_name != NULL) { /* Pass --daemon=socket_name as argument. */ @@ -1504,10 +1497,12 @@ int main (int argc, char **argv) { - int i, rl, needlf = 0; + int rl, needlf = 0; char *cwd, *str; char string[BUFSIZ+1]; - int null_socket_name, null_server_file, start_daemon_if_needed; + int null_socket_name IF_LINT ( = 0); + int null_server_file IF_LINT ( = 0); + int start_daemon_if_needed; int exit_status = EXIT_SUCCESS; main_argv = argv; @@ -1543,21 +1538,21 @@ null_server_file = (server_file == NULL); } - if ((emacs_socket = set_socket (alternate_editor - || start_daemon_if_needed)) == INVALID_SOCKET) - if (start_daemon_if_needed) - { - /* Reset socket_name and server_file if they were NULL - before the set_socket call. */ - if (null_socket_name) - socket_name = NULL; - if (null_server_file) - server_file = NULL; - - start_daemon_and_retry_set_socket (); - } - else - fail (); + emacs_socket = set_socket (alternate_editor || start_daemon_if_needed); + if (emacs_socket == INVALID_SOCKET) + { + if (! start_daemon_if_needed) + fail (); + + /* Reset socket_name and server_file if they were NULL + before the set_socket call. */ + if (null_socket_name) + socket_name = NULL; + if (null_server_file) + server_file = NULL; + + start_daemon_and_retry_set_socket (); + } cwd = get_current_dir_name (); if (cwd == 0) @@ -1615,7 +1610,7 @@ frame is available. */ if (tty || (current_frame && !eval)) { - char *tty_type, *tty_name; + const char *tty_type, *tty_name; if (find_tty (&tty_type, &tty_name, !tty)) { @@ -1635,6 +1630,7 @@ if ((argc - optind > 0)) { + int i; for (i = optind; i < argc; i++) { === modified file 'lib-src/etags.c' --- lib-src/etags.c 2011-02-22 18:08:53 +0000 +++ lib-src/etags.c 2011-02-25 23:26:55 +0000 @@ -236,7 +236,6 @@ #define ISALNUM(c) isalnum (CHAR(c)) #define ISALPHA(c) isalpha (CHAR(c)) #define ISDIGIT(c) isdigit (CHAR(c)) -#define ISUPPER(c) isupper (CHAR(c)) #define ISLOWER(c) islower (CHAR(c)) #define lowcase(c) tolower (CHAR(c)) @@ -6648,6 +6647,7 @@ #ifdef DOS_NT /* Canonicalize drive letter case. */ +# define ISUPPER(c) isupper (CHAR(c)) if (fn[0] != '\0' && fn[1] == ':' && ISUPPER (fn[0])) fn[0] = lowcase (fn[0]); === modified file 'lib-src/fakemail.c' --- lib-src/fakemail.c 2011-02-21 18:06:25 +0000 +++ lib-src/fakemail.c 2011-02-26 05:36:51 +0000 @@ -62,6 +62,8 @@ /* This is to declare cuserid. */ #include + +#include /* Type definitions */ @@ -405,8 +407,8 @@ for (rem = the_streams; rem != ((stream_list) NULL); rem = rem->rest_streams) - no_problems = (no_problems && - ((*rem->action) (rem->handle) == 0)); + if (no_problems && (*rem->action) (rem->handle) != 0) + error ("output error", NULL); the_streams = ((stream_list) NULL); return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE); } @@ -427,6 +429,8 @@ { putc ('\n', the_file); fflush (the_file); + if (ferror (the_file)) + return EOF; return fclose (the_file); } @@ -496,7 +500,7 @@ } } /* Output that much, then break the line. */ - fwrite (s, 1, breakpos - s, rem->handle); + ignore_value (fwrite (s, 1, breakpos - s, rem->handle)); column = 8; /* Skip whitespace and prepare to print more addresses. */ @@ -729,6 +733,9 @@ put_string (buf); } + if (no_problems && (ferror (stdin) || fclose (stdin) != 0)) + error ("input error", NULL); + exit (close_the_streams ()); } === modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2011-02-21 19:37:54 +0000 +++ lib-src/make-docfile.c 2011-02-25 22:21:01 +0000 @@ -617,7 +617,7 @@ qsort (globals, num_globals, sizeof (struct global), compare_globals); for (i = 0; i < num_globals; ++i) { - char *type; + char const *type; switch (globals[i].type) { @@ -658,12 +658,8 @@ FILE *infile; register int c; register int commas; - register int defunflag; - register int defvarperbufferflag; - register int defvarflag; int minargs, maxargs; int extension = filename[strlen (filename) - 1]; - enum global_type type; if (extension == 'o') filename[strlen (filename) - 1] = 'c'; @@ -693,6 +689,10 @@ while (!feof (infile)) { int doc_keyword = 0; + int defunflag = 0; + int defvarperbufferflag = 0; + int defvarflag = 0; + enum global_type type = INVALID; if (c != '\n' && c != '\r') { @@ -726,7 +726,6 @@ continue; defvarflag = 1; - defunflag = 0; c = getc (infile); defvarperbufferflag = (c == 'P'); @@ -738,8 +737,6 @@ type = LISP_OBJECT; else if (c == 'B') type = BOOLEAN; - else - type = INVALID; } c = getc (infile); @@ -758,8 +755,6 @@ continue; c = getc (infile); defunflag = c == 'U'; - defvarflag = 0; - defvarperbufferflag = 0; } else continue; ------------------------------------------------------------ revno: 103423 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2011-02-25 23:52:19 +0000 message: Merge changes made in Gnus trunk. auth-source.el (auth-source-search): Cache empty result sets. password-cache.el (password-in-cache-p): Convenience function to check if a key is in the cache, even if the value is nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-25 18:30:00 +0000 +++ lisp/ChangeLog 2011-02-25 23:52:19 +0000 @@ -1,3 +1,8 @@ +2011-02-25 Teodor Zlatanov + + * password-cache.el (password-in-cache-p): Convenience function to + check if a key is in the cache, even if the value is nil. + 2011-02-25 Jambunathan K * emacs-lisp/package-x.el (package--archive-contents-from-url) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-25 12:53:00 +0000 +++ lisp/gnus/ChangeLog 2011-02-25 23:52:19 +0000 @@ -1,5 +1,7 @@ 2011-02-25 Teodor Zlatanov + * auth-source.el (auth-source-search): Cache empty result sets. + * auth-source.el (auth-source-save-behavior): New variable to replace `auth-source-never-create'. (auth-source-netrc-create): Use it. === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-25 12:53:00 +0000 +++ lisp/gnus/auth-source.el 2011-02-25 23:52:19 +0000 @@ -524,10 +524,13 @@ (keys (loop for i below (length spec) by 2 unless (memq (nth i spec) ignored-keys) collect (nth i spec))) + (cached (auth-source-remembered-p spec)) + ;; note that we may have cached results but found is still nil + ;; (there were no results from the search) (found (auth-source-recall spec)) filtered-backends accessor-key backend) - (if (and found auth-source-do-cache) + (if (and cached auth-source-do-cache) (auth-source-do-debug "auth-source-search: found %d CACHED results matching %S" (length found) spec) @@ -580,7 +583,8 @@ "auth-source-search: CREATED %d results (max %d) matching %S" (length found) max spec)) - (when (and found auth-source-do-cache) + ;; note we remember the lack of result too, if it's applicable + (when auth-source-do-cache (auth-source-remember spec found))) found)) @@ -654,6 +658,11 @@ (password-read-from-cache (concat auth-source-magic (format "%S" spec)))) +(defun auth-source-remembered-p (spec) + "Check if SPEC is remembered." + (password-in-cache-p + (concat auth-source-magic (format "%S" spec)))) + (defun auth-source-forget (spec) "Forget any cached data matching SPEC exactly. @@ -664,7 +673,10 @@ ;;; (loop for sym being the symbols of password-data when (string-match (concat "^" auth-source-magic) (symbol-name sym)) collect (symbol-name sym)) ;;; (auth-source-remember '(:host "wedd") '(4 5 6)) +;;; (auth-source-remembered-p '(:host "wedd")) ;;; (auth-source-remember '(:host "xedd") '(1 2 3)) +;;; (auth-source-remembered-p '(:host "xedd")) +;;; (auth-source-remembered-p '(:host "zedd")) ;;; (auth-source-recall '(:host "xedd")) ;;; (auth-source-recall '(:host t)) ;;; (auth-source-forget+ :host t) === modified file 'lisp/password-cache.el' --- lisp/password-cache.el 2011-02-13 00:25:29 +0000 +++ lisp/password-cache.el 2011-02-25 23:52:19 +0000 @@ -76,6 +76,12 @@ key (symbol-value (intern-soft key password-data)))) +(defun password-in-cache-p (key) + "Check if KEY is in the cache." + (and password-cache + key + (intern-soft key password-data))) + (defun password-read (prompt &optional key) "Read password, for use with KEY, from user, or from cache if wanted. KEY indicate the purpose of the password, so the cache can ------------------------------------------------------------ revno: 103422 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-02-25 11:08:18 -0800 message: * src/dired.c: Add comment and code explaining magic number. diff: === modified file 'src/dired.c' --- src/dired.c 2011-02-25 06:30:50 +0000 +++ src/dired.c 2011-02-25 19:08:18 +0000 @@ -937,7 +937,11 @@ Lisp_Object dirname; struct stat sdir; #endif /* BSD4_2 */ - char modes[12]; + + /* An array to hold the mode string generated by filemodestring, + including its terminating space and null byte. */ + char modes[sizeof "-rwxr-xr-x "]; + Lisp_Object handler; struct gcpro gcpro1; char *uname = NULL, *gname = NULL; ------------------------------------------------------------ revno: 103421 author: Jambunathan K committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-02-25 13:30:00 -0500 message: Fix package uploading for newly made or local archives. * emacs-lisp/package-x.el (package--archive-contents-from-url) (package--archive-contents-from-file): New functions. (package-update-news-on-upload): New var. (package-upload-buffer-internal): Extract archive-contents from package-archive-upload-base if it is not found at archive-url. Obey package-update-news-on-upload. (package-upload-buffer, package-upload-file): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-24 08:45:25 +0000 +++ lisp/ChangeLog 2011-02-25 18:30:00 +0000 @@ -1,3 +1,13 @@ +2011-02-25 Jambunathan K + + * emacs-lisp/package-x.el (package--archive-contents-from-url) + (package--archive-contents-from-file): New functions. + (package-update-news-on-upload): New var. + (package-upload-buffer-internal): Extract archive-contents from + package-archive-upload-base if it is not found at archive-url. + Obey package-update-news-on-upload. + (package-upload-buffer, package-upload-file): Doc fix. + 2011-02-24 Glenn Morris * files-x.el (modify-dir-local-variable): Handle dir-locals from === modified file 'lisp/emacs-lisp/package-x.el' --- lisp/emacs-lisp/package-x.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/package-x.el 2011-02-25 18:30:00 +0000 @@ -40,6 +40,9 @@ (defvar package-archive-upload-base nil "Base location for uploading to package archive.") +(defvar package-update-news-on-upload nil + "Whether package upload should also update NEWS and RSS feeds.") + (defun package--encode (string) "Encode a string by replacing some characters with XML entities." ;; We need a special case for translating "&" to "&". @@ -86,6 +89,36 @@ (unless old-buffer (kill-buffer (current-buffer))))))) +(defun package--archive-contents-from-url (archive-url) + "Parse archive-contents file at ARCHIVE-URL. +Return the file contents, as a string, or nil if unsuccessful." + (ignore-errors + (when archive-url + (let* ((buffer (url-retrieve-synchronously + (concat archive-url "archive-contents")))) + (set-buffer buffer) + (package-handle-response) + (re-search-forward "^$" nil 'move) + (forward-char) + (delete-region (point-min) (point)) + (prog1 (package-read-from-string + (buffer-substring-no-properties (point-min) (point-max))) + (kill-buffer buffer)))))) + +(defun package--archive-contents-from-file (file) + "Parse the given archive-contents file." + (if (not (file-exists-p file)) + ;; no existing archive-contents, possibly a new ELPA repo. + (list package-archive-version) + (let ((dont-kill (find-buffer-visiting file))) + (with-current-buffer (let ((find-file-visit-truename t)) + (find-file-noselect file)) + (prog1 + (package-read-from-string + (buffer-substring-no-properties (point-min) (point-max))) + (unless dont-kill + (kill-buffer (current-buffer)))))))) + (defun package-maint-add-news-item (title description archive-url) "Add a news item to the ELPA web pages. TITLE is the title of the news item. @@ -111,11 +144,20 @@ EXTENSION is the file extension, a string. It can be either \"el\" or \"tar\". +The variable `package-archive-upload-base' specifies the upload +destination. If this is nil, signal an error. + Optional arg ARCHIVE-URL is the URL of the destination archive. -If nil, the \"gnu\" archive is used." - (unless archive-url - (or (setq archive-url (cdr (assoc "gnu" package-archives))) - (error "No destination URL"))) +If it is non-nil, compute the new \"archive-contents\" file +starting from the existing \"archive-contents\" at that URL. In +addition, if `package-update-news-on-upload' is non-nil, call +`package--update-news' to add a news item at that URL. + +If ARCHIVE-URL is nil, compute the new \"archive-contents\" file +from the \"archive-contents\" at `package-archive-upload-base', +if it exists." + (unless package-archive-upload-base + (error "No destination specified in `package-archive-upload-base'")) (save-excursion (save-restriction (let* ((file-type (cond @@ -131,21 +173,14 @@ (pkg-version (aref pkg-info 3)) (commentary (aref pkg-info 4)) (split-version (version-to-list pkg-version)) - (pkg-buffer (current-buffer)) - - ;; Download latest archive-contents. - (buffer (url-retrieve-synchronously - (concat archive-url "archive-contents")))) - - ;; Parse archive-contents. - (set-buffer buffer) - (package-handle-response) - (re-search-forward "^$" nil 'move) - (forward-char) - (delete-region (point-min) (point)) - (let ((contents (package-read-from-string - (buffer-substring-no-properties (point-min) - (point-max)))) + (pkg-buffer (current-buffer))) + + ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or + ;; from `package-archive-upload-base' otherwise. + (let ((contents (or (package--archive-contents-from-url archive-url) + (package--archive-contents-from-file + (concat package-archive-upload-base + "archive-contents")))) (new-desc (vector split-version requires desc file-type))) (if (> (car contents) package-archive-version) (error "Unrecognized archive version %d" (car contents))) @@ -176,7 +211,6 @@ (symbol-name pkg-name) "-readme.txt"))) (set-buffer pkg-buffer) - (kill-buffer buffer) (write-region (point-min) (point-max) (concat package-archive-upload-base file-name "-" pkg-version @@ -184,8 +218,10 @@ nil nil nil 'excl) ;; Write a news entry. - (package--update-news (concat file-name "." extension) - pkg-version desc archive-url) + (and package-update-news-on-upload + archive-url + (package--update-news (concat file-name "." extension) + pkg-version desc archive-url)) ;; special-case "package": write a second copy so that the ;; installer can easily find the latest version. @@ -196,7 +232,9 @@ nil nil nil 'ask))))))) (defun package-upload-buffer () - "Upload a single .el file to ELPA from the current buffer." + "Upload the current buffer as a single-file Emacs Lisp package. +The variable `package-archive-upload-base' specifies the upload +destination." (interactive) (save-excursion (save-restriction @@ -205,6 +243,13 @@ (package-upload-buffer-internal pkg-info "el"))))) (defun package-upload-file (file) + "Upload the Emacs Lisp package FILE to the package archive. +Interactively, prompt for FILE. The package is considered a +single-file package if FILE ends in \".el\", and a multi-file +package if FILE ends in \".tar\". + +The variable `package-archive-upload-base' specifies the upload +destination." (interactive "fPackage file name: ") (with-temp-buffer (insert-file-contents-literally file) ------------------------------------------------------------ revno: 103420 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2011-02-25 12:53:00 +0000 message: Merge changes made in Gnus trunk. auth-source.el (auth-source-save-behavior): New variable to replace `auth-source-never-create'. (auth-source-netrc-create): Use it. (auth-source-never-save): Remove. nnimap.el (nnimap-stream): Doc fix. (nnimap-open-connection-1): Reverse the order of the ports to that the prompted-for port is first. gnus-start.el (gnus-get-unread-articles): Don't clobber the async retrieval by the no-group selection. gnus-demon.el (gnus-demon-init): run-with-timer should be called with numerical parameters. auth-source.el (auth-source-creation-prompts): New variable to manage creation-time prompts. (auth-source-search): Document it. (auth-source-format-prompt): Add utility function. (auth-source-netrc-create): Don't default the user name to user-login-name. Use `auth-source-creation-prompts' and some default prompts for user, host, port, and password (the default generic prompt remains ugly). (auth-source-never-save): Add customizable option to never save info. (auth-source-netrc-create): Use it and improve save prompts. Fix help mode excursion. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-24 06:32:33 +0000 +++ lisp/gnus/ChangeLog 2011-02-25 12:53:00 +0000 @@ -1,3 +1,36 @@ +2011-02-25 Teodor Zlatanov + + * auth-source.el (auth-source-save-behavior): New variable to replace + `auth-source-never-create'. + (auth-source-netrc-create): Use it. + (auth-source-never-save): Remove. + +2011-02-25 Lars Ingebrigtsen + + * nnimap.el (nnimap-stream): Doc fix. + (nnimap-open-connection-1): Reverse the order of the ports to that the + prompted-for port is first. + + * gnus-start.el (gnus-get-unread-articles): Don't clobber the async + retrieval by the no-group selection. + + * gnus-demon.el (gnus-demon-init): run-with-timer should be called with + numerical parameters. + +2011-02-24 Teodor Zlatanov + + * auth-source.el (auth-source-creation-prompts): New variable to manage + creation-time prompts. + (auth-source-search): Document it. + (auth-source-format-prompt): Add utility function. + (auth-source-netrc-create): Don't default the user name to + user-login-name. Use `auth-source-creation-prompts' and some default + prompts for user, host, port, and password (the default generic prompt + remains ugly). + (auth-source-never-save): Add customizable option to never save info. + (auth-source-netrc-create): Use it and improve save prompts. Fix help + mode excursion. + 2011-02-24 Katsumi Yamaoka * auth-source.el (auth-source-netrc-create): Use `read-char' with no === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-24 06:32:33 +0000 +++ lisp/gnus/auth-source.el 2011-02-25 12:53:00 +0000 @@ -137,8 +137,21 @@ (defvar auth-source-creation-defaults nil "Defaults for creating token values. Usually let-bound.") +(defvar auth-source-creation-prompts nil + "Default prompts for token values. Usually let-bound.") + (make-obsolete 'auth-source-hide-passwords nil "Emacs 24.1") +(defcustom auth-source-save-behavior 'ask + "If set, auth-source will respect it for save behavior." + :group 'auth-source + :version "23.2" ;; No Gnus + :type `(choice + :tag "auth-source new token save behavior" + (const :tag "Always save" t) + (const :tag "Never save" nil) + (const :tag "Ask" ask))) + (defvar auth-source-magic "auth-source-magic ") (defcustom auth-source-do-cache t @@ -435,12 +448,18 @@ token. The value for that parameter will be obtained from the search parameters or from user input. If any queries are needed, the alist `auth-source-creation-defaults' will be checked for the -default prompt. +default value. If the user, host, or port are missing, the alist +`auth-source-creation-prompts' will be used to look up the +prompts IN THAT ORDER (so the 'user prompt will be queried first, +then 'host, then 'port, and finally 'secret). Each prompt string +can use %u, %h, and %p to show the user, host, and port. Here's an example: \(let ((auth-source-creation-defaults '((user . \"defaultUser\") - (A . \"default A\")))) + (A . \"default A\"))) + (auth-source-creation-prompts + '((password . \"Enter IMAP password for %h:%p: \")))) (auth-source-search :host '(\"nonesuch\" \"twosuch\") :type 'netrc :max 1 :P \"pppp\" :Q \"qqqq\" :create '(A B Q))) @@ -452,12 +471,11 @@ Create a new entry if you found none. The netrc backend will automatically require host, user, and port. The host will be - 'nonesuch' and Q will be 'qqqq'. We prompt for A with default - 'default A', for B and port with default nil, and for the - user with default 'defaultUser'. We will not prompt for Q. The - resulting token will have keys user, host, port, A, B, and Q. - It will not have P with any value, even though P is used in the - search to find only entries that have P set to 'pppp'.\" + 'nonesuch' and Q will be 'qqqq'. We prompt for the password + with the shown prompt. We will not prompt for Q. The resulting + token will have keys user, host, port, A, B, and Q. It will not + have P with any value, even though P is used in the search to + find only entries that have P set to 'pppp'.\" When multiple values are specified in the search parameter, the user is prompted for which one. So :host (X Y Z) would ask the @@ -903,6 +921,17 @@ (nth 0 v) v)) +;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host"))) + +(defun auth-source-format-prompt (prompt alist) + "Format PROMPT using %x (for any character x) specifiers in ALIST." + (dolist (cell alist) + (let ((c (nth 0 cell)) + (v (nth 1 cell))) + (when (and c v) + (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt))))) + prompt) + ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) @@ -954,31 +983,50 @@ ;; the default supplementals are simple: for the user, ;; try (user-login-name), otherwise take given-default (default (cond - ((and (not given-default) (eq r 'user)) - (user-login-name)) - (t given-default)))) + ;; don't default the user name + ;; ((and (not given-default) (eq r 'user)) + ;; (user-login-name)) + (t given-default))) + (printable-defaults (list + (cons 'user + (or + (auth-source-netrc-element-or-first + (aget valist 'user)) + (plist-get artificial :user) + "[any user]")) + (cons 'host + (or + (auth-source-netrc-element-or-first + (aget valist 'host)) + (plist-get artificial :host) + "[any host]")) + (cons 'port + (or + (auth-source-netrc-element-or-first + (aget valist 'port)) + (plist-get artificial :port) + "[any port]")))) + (prompt (or (aget auth-source-creation-prompts r) + (case r + ('secret "%p password for user %u, host %h: ") + ('user "%p user name: ") + ('host "%p host name for user %u: ") + ('port "%p port for user %u and host %h: ")) + (format "Enter %s (%%u@%%h:%%p): " r))) + (prompt (auth-source-format-prompt + prompt + `((?u ,(aget printable-defaults 'user)) + (?h ,(aget printable-defaults 'host)) + (?p ,(aget printable-defaults 'port)))))) ;; store the data, prompting for the password if needed (setq data (cond ((and (null data) (eq r 'secret)) ;; special case prompt for passwords - (read-passwd (format "Password for %s@%s:%s: " - (or - (auth-source-netrc-element-or-first - (aget valist 'user)) - (plist-get artificial :user) - "[any user]") - (or - (auth-source-netrc-element-or-first - (aget valist 'host)) - (plist-get artificial :host) - "[any host]") - (or - (auth-source-netrc-element-or-first - (aget valist 'port)) - (plist-get artificial :port) - "[any port]")))) + (read-passwd prompt)) + ((null data) + (read-string prompt default)) (t (or data default)))) (when data @@ -1026,22 +1074,42 @@ (goto-char (point-max)) ;; ask AFTER we've successfully opened the file - (let ((prompt (format "Add to file %s? %s: " + (let ((prompt (format "Save auth info to file %s? %s: " file - "(y)es/(n)o but use it/(e)dit line/(s)kip file")) - done k) + "y/n/N/e/?")) + (done (not (eq auth-source-save-behavior 'ask))) + (bufname "*auth-source Help*") + k) (while (not done) - (message "%s" prompt) + (message "%s" prompt) (setq k (read-char)) (case k (?y (setq done t)) + (?? (save-excursion + (with-output-to-temp-buffer bufname + (princ + (concat "(y)es, save\n" + "(n)o but use the info\n" + "(N)o and don't ask to save again\n" + "(e)dit the line\n" + "(?) for help as you can see.\n")) + (set-buffer standard-output) + (help-mode)))) (?n (setq add "" done t)) - (?s (setq add "" - done 'skip)) + (?N (setq add "" + done t + auth-source-save-behavior nil)) (?e (setq add (read-string "Line to add: " add))) (t nil))) + (when (get-buffer-window bufname) + (delete-window (get-buffer-window bufname))) + + ;; make sure the info is not saved + (when (null auth-source-save-behavior) + (setq add "")) + (when (< 0 (length add)) (progn (unless (bolp) === modified file 'lisp/gnus/gnus-demon.el' --- lisp/gnus/gnus-demon.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/gnus-demon.el 2011-02-25 12:53:00 +0000 @@ -140,7 +140,7 @@ ;; (func number nil) ;; Call every `time' ((and (numberp time) (null idle)) - (run-with-timer t time 'gnus-demon-run-callback func))))) + (run-with-timer time time 'gnus-demon-run-callback func))))) (when timer (add-to-list 'gnus-demon-timers timer))))) === modified file 'lisp/gnus/gnus-start.el' --- lisp/gnus/gnus-start.el 2011-02-23 13:35:35 +0000 +++ lisp/gnus/gnus-start.el 2011-02-25 12:53:00 +0000 @@ -1690,6 +1690,16 @@ method)) (setcar elem method)) (push (list method 'ok) methods))))) + + ;; If we have primary/secondary select methods, but no groups from + ;; them, we still want to issue a retrieval request from them. + (dolist (method (cons gnus-select-method + gnus-secondary-select-methods)) + (when (and (not (assoc method type-cache)) + (gnus-check-backend-function 'request-list (car method))) + (with-current-buffer nntp-server-buffer + (gnus-read-active-file-1 method nil)))) + ;; Start early async retrieval of data. (dolist (elem type-cache) (destructuring-bind (method method-type infos dummy) elem @@ -1712,15 +1722,6 @@ (setcar (nthcdr 3 elem) (gnus-retrieve-group-data-early method infos))))))) - ;; If we have primary/secondary select methods, but no groups from - ;; them, we still want to issue a retrieval request from them. - (dolist (method (cons gnus-select-method - gnus-secondary-select-methods)) - (when (and (not (assoc method type-cache)) - (gnus-check-backend-function 'request-list (car method))) - (with-current-buffer nntp-server-buffer - (gnus-read-active-file-1 method nil)))) - ;; Do the rest of the retrieval. (dolist (elem type-cache) (destructuring-bind (method method-type infos early-data) elem === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2011-02-23 13:35:35 +0000 +++ lisp/gnus/nnimap.el 2011-02-25 12:53:00 +0000 @@ -62,8 +62,9 @@ (defvoo nnimap-stream 'undecided "How nnimap will talk to the IMAP server. -Values are `ssl', `network', `starttls' or `shell'. -The default is to try `ssl' first, and then `network'.") +Values are `ssl', `network', `network-only, `starttls' or +`shell'. The default is to try `ssl' first, and then +`network'.") (defvoo nnimap-shell-program (if (boundp 'imap-shell-program) (if (listp imap-shell-program) @@ -337,7 +338,7 @@ (eq nnimap-stream 'starttls)) (nnheader-message 7 "Opening connection to %s..." nnimap-address) - '("143" "imap")) + '("imap" "143")) ((eq nnimap-stream 'shell) (nnheader-message 7 "Opening connection to %s via shell..." nnimap-address) @@ -345,16 +346,16 @@ ((memq nnimap-stream '(ssl tls)) (nnheader-message 7 "Opening connection to %s via tls..." nnimap-address) - '("143" "993" "imap" "imaps")) + '("imaps" "imap" "993" "143")) (t (error "Unknown stream type: %s" nnimap-stream)))) (proto-stream-always-use-starttls t) login-result credentials) (when nnimap-server-port - (setq ports (append ports (list nnimap-server-port)))) + (push nnimap-server-port ports)) (destructuring-bind (stream greeting capabilities stream-type) (open-protocol-stream - "*nnimap*" (current-buffer) nnimap-address (car (last ports)) + "*nnimap*" (current-buffer) nnimap-address (car ports) :type nnimap-stream :shell-command nnimap-shell-program :capability-command "1 CAPABILITY\r\n" ------------------------------------------------------------ revno: 103419 committer: Paul Eggert branch nick: trunk timestamp: Fri 2011-02-25 02:03:28 -0800 message: Elaborate my most-recent ChangeLog entry. diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-25 07:23:41 +0000 +++ ChangeLog 2011-02-25 10:03:28 +0000 @@ -1,7 +1,8 @@ 2011-02-25 Paul Eggert * configure, lib/Makefile.in, lib/getopt_int.h, lib/gnulib.mk: - * lib/stdlib.in.h, m4/stdlib_h.m4: Regenerate. + * lib/stdlib.in.h, m4/stdlib_h.m4: Regenerate to incorporate + recent changes to configure.in and to gnulib. 2011-02-24 Glenn Morris ------------------------------------------------------------ revno: 103418 committer: Paul Eggert branch nick: trunk timestamp: Thu 2011-02-24 23:23:41 -0800 message: Regenerate. diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-24 04:28:17 +0000 +++ ChangeLog 2011-02-25 07:23:41 +0000 @@ -1,3 +1,8 @@ +2011-02-25 Paul Eggert + + * configure, lib/Makefile.in, lib/getopt_int.h, lib/gnulib.mk: + * lib/stdlib.in.h, m4/stdlib_h.m4: Regenerate. + 2011-02-24 Glenn Morris * configure.in: Replace obsolete AC_OUTPUT() with AC_CONFIG_FILES(), === modified file 'configure' --- configure 2011-02-22 01:55:20 +0000 +++ configure 2011-02-25 07:23:41 +0000 @@ -874,6 +874,7 @@ GNULIB_CLOSE GNULIB_CHOWN GETLOADAVG_LIBS +REPLACE_WCTOMB REPLACE_UNSETENV REPLACE_STRTOD REPLACE_SETENV @@ -881,6 +882,7 @@ REPLACE_REALLOC REPLACE_PUTENV REPLACE_MKSTEMP +REPLACE_MBTOWC REPLACE_MALLOC REPLACE_CANONICALIZE_FILE_NAME REPLACE_CALLOC @@ -909,6 +911,7 @@ HAVE_CANONICALIZE_FILE_NAME HAVE_ATOLL HAVE__EXIT +GNULIB_WCTOMB GNULIB_UNSETENV GNULIB_UNLOCKPT GNULIB_SYSTEM_POSIX @@ -927,6 +930,7 @@ GNULIB_MKOSTEMPS GNULIB_MKOSTEMP GNULIB_MKDTEMP +GNULIB_MBTOWC GNULIB_MALLOC_POSIX GNULIB_GRANTPT GNULIB_GETSUBOPT @@ -13780,6 +13784,7 @@ GNULIB_GETSUBOPT=0; GNULIB_GRANTPT=0; GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; GNULIB_MKDTEMP=0; GNULIB_MKOSTEMP=0; GNULIB_MKOSTEMPS=0; @@ -13798,6 +13803,7 @@ GNULIB_SYSTEM_POSIX=0; GNULIB_UNLOCKPT=0; GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; HAVE__EXIT=1; HAVE_ATOLL=1; HAVE_CANONICALIZE_FILE_NAME=1; @@ -13826,6 +13832,7 @@ REPLACE_CALLOC=0; REPLACE_CANONICALIZE_FILE_NAME=0; REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; REPLACE_MKSTEMP=0; REPLACE_PUTENV=0; REPLACE_REALLOC=0; @@ -13833,6 +13840,7 @@ REPLACE_SETENV=0; REPLACE_STRTOD=0; REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; GNULIB_CHOWN=0; @@ -19249,7 +19257,15 @@ ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile" -ac_config_commands="$ac_config_commands default" + +ac_config_commands="$ac_config_commands mkdirs" + + +ac_config_commands="$ac_config_commands epaths" + + +ac_config_commands="$ac_config_commands gdbinit" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20034,7 +20050,9 @@ "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;; + "epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;; + "gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -20764,21 +20782,20 @@ done } ;; - "default":C) - -### Make the necessary directories, if they don't exist. + "mkdirs":C) for dir in etc lisp ; do test -d ${dir} || mkdir ${dir} done - + ;; + "epaths":C) echo creating src/epaths.h ${MAKE-make} epaths-force - + ;; + "gdbinit":C) if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then echo creating src/.gdbinit echo source $srcdir/src/.gdbinit > src/.gdbinit fi - ;; esac @@ -20818,3 +20835,4 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + === modified file 'lib/Makefile.in' --- lib/Makefile.in 2011-02-22 01:55:20 +0000 +++ lib/Makefile.in 2011-02-25 07:23:41 +0000 @@ -179,6 +179,7 @@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ @@ -225,6 +226,7 @@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ +GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@ @@ -452,6 +454,7 @@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC = @REPLACE_MALLOC@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKNOD = @REPLACE_MKNOD@ @@ -478,6 +481,7 @@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WRITE = @REPLACE_WRITE@ RSVG_CFLAGS = @RSVG_CFLAGS@ RSVG_LIBS = @RSVG_LIBS@ @@ -1001,6 +1005,7 @@ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ + -e 's|@''GNULIB_MBTOWC''@|$(GNULIB_MBTOWC)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \ -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \ @@ -1019,6 +1024,7 @@ -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \ -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''GNULIB_WCTOMB''@|$(GNULIB_WCTOMB)|g' \ < $(srcdir)/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ @@ -1047,6 +1053,7 @@ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ @@ -1054,6 +1061,7 @@ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ === modified file 'lib/getopt_int.h' --- lib/getopt_int.h 2011-01-09 07:33:50 +0000 +++ lib/getopt_int.h 2011-02-25 07:23:41 +0000 @@ -108,7 +108,7 @@ #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; -# endif +#endif }; /* The initializer is necessary to set OPTIND and OPTERR to their === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-02-22 01:55:20 +0000 +++ lib/gnulib.mk 2011-02-25 07:23:41 +0000 @@ -267,6 +267,7 @@ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ + -e 's|@''GNULIB_MBTOWC''@|$(GNULIB_MBTOWC)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \ -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \ @@ -285,6 +286,7 @@ -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \ -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''GNULIB_WCTOMB''@|$(GNULIB_WCTOMB)|g' \ < $(srcdir)/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ @@ -313,6 +315,7 @@ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ @@ -320,6 +323,7 @@ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ === modified file 'lib/stdlib.in.h' --- lib/stdlib.in.h 2011-02-16 00:33:44 +0000 +++ lib/stdlib.in.h 2011-02-25 07:23:41 +0000 @@ -274,6 +274,21 @@ "use gnulib module malloc-posix for portability"); #endif +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBTOWC@ +# if @REPLACE_MBTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbtowc +# define mbtowc rpl_mbtowc +# endif +_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# else +_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); +# endif +_GL_CXXALIASWARN (mbtowc); +#endif + #if @GNULIB_MKDTEMP@ /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; @@ -723,6 +738,21 @@ # endif #endif +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCTOMB@ +# if @REPLACE_WCTOMB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wctomb +# define wctomb rpl_wctomb +# endif +_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); +_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); +# else +_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); +# endif +_GL_CXXALIASWARN (wctomb); +#endif + #endif /* _GL_STDLIB_H */ #endif /* _GL_STDLIB_H */ === modified file 'm4/stdlib_h.m4' --- m4/stdlib_h.m4 2011-02-16 00:33:44 +0000 +++ m4/stdlib_h.m4 2011-02-25 07:23:41 +0000 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 36 +# stdlib_h.m4 serial 37 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -44,6 +44,7 @@ GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) @@ -62,6 +63,7 @@ GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) + GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) @@ -91,6 +93,7 @@ REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) @@ -98,4 +101,5 @@ REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) + REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) ]) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.