Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104272. ------------------------------------------------------------ revno: 104272 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2011-05-18 01:21:07 -0400 message: Fix last commit. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-18 05:02:49 +0000 +++ ChangeLog 2011-05-18 05:21:07 +0000 @@ -1,11 +1,11 @@ 2011-05-17 Paul Eggert - lib/gnulib.mk: - lib/intprops.h: - lib/unistd.in.h: - m4/inttypes.m4: - m4/stdint.m4: - m4/unistd_h.m4: Sync from gnulib. + * lib/gnulib.mk: + * lib/intprops.h: + * lib/unistd.in.h: + * m4/inttypes.m4: + * m4/stdint.m4: + * m4/unistd_h.m4: Sync from gnulib. 2011-05-14 Glenn Morris === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-05-18 05:02:49 +0000 +++ doc/misc/ChangeLog 2011-05-18 05:21:07 +0000 @@ -1,6 +1,6 @@ 2011-05-17 Paul Eggert - texinfo.tex: Sync from gnulib, version 2011-05-11.16. + * texinfo.tex: Sync from gnulib, version 2011-05-11.16. 2011-05-17 Glenn Morris ------------------------------------------------------------ revno: 104271 committer: Eli Zaretskii branch nick: quickfixes timestamp: Wed 2011-05-18 08:02:49 +0300 message: ChangeLog changes for revision 104264. ChangeLog: Entry for gnulib sync. doc/misc/ChangeLog: Entry for gnulib sync. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-14 19:52:13 +0000 +++ ChangeLog 2011-05-18 05:02:49 +0000 @@ -1,3 +1,12 @@ +2011-05-17 Paul Eggert + + lib/gnulib.mk: + lib/intprops.h: + lib/unistd.in.h: + m4/inttypes.m4: + m4/stdint.m4: + m4/unistd_h.m4: Sync from gnulib. + 2011-05-14 Glenn Morris * configure.in: Treat failure to find an X toolkit the same way we treat === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-05-17 02:30:53 +0000 +++ doc/misc/ChangeLog 2011-05-18 05:02:49 +0000 @@ -1,3 +1,7 @@ +2011-05-17 Paul Eggert + + texinfo.tex: Sync from gnulib, version 2011-05-11.16. + 2011-05-17 Glenn Morris * gnus.texi (Face): Fix typo. ------------------------------------------------------------ revno: 104270 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-17 20:42:33 -0700 message: * lisp/emacs-lisp/authors.el (authors-fixed-entries): Remove fakemail.c diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-18 03:39:45 +0000 +++ lisp/ChangeLog 2011-05-18 03:42:33 +0000 @@ -1,5 +1,6 @@ 2011-05-18 Glenn Morris + * emacs-lisp/authors.el (authors-fixed-entries): Remove fakemail.c * mail/sendmail.el (sendmail-program): Fall back to just "sendmail". Rationalize calendar handling of day and month abbrev-arrays. === modified file 'lisp/emacs-lisp/authors.el' --- lisp/emacs-lisp/authors.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/authors.el 2011-05-18 03:42:33 +0000 @@ -437,7 +437,7 @@ ;; No longer distributed. ;;; "vmspaths.h" "build.com" "compile.com" "kepteditor.com" "precomp.com" ;;; "vmsproc.el" :wrote "logout.com" "mailemacs.com") - ("Guillermo J. Rozas" :wrote "fakemail.c") +;;; ("Guillermo J. Rozas" :wrote "fakemail.c") ("Wolfgang Rupprecht" :changed "lisp-mode.el" "loadup.el" "sort.el" "alloc.c" "callint.c" ;; config.in renamed from config.h.in; ecrt0.c from crt0.c. ------------------------------------------------------------ revno: 104269 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-17 20:39:45 -0700 message: Remove lib-src/fakemail.c. * lib-src/fakemail.c: Remove file. * lib-src/Makefile.in (UTILITIES): Remove fakemail${EXEEXT}. (fakemail${EXEEXT}): Remove rule. * lib-src/makefile.w32-in ($(BLD)/fakemail.exe, fakemail) ($(BLD)/fakemail.$(O)): Remove. * lisp/mail/sendmail.el (sendmail-program): Fall back to just "sendmail". * lisp/mail/feedmail.el: Update commentary. * doc/emacs/ack.texi (Acknowledgments): Remove fakemail.c. * etc/NEWS: Mention this. * INSTALL: Remove fakemail. diff: === modified file 'INSTALL' --- INSTALL 2011-05-17 02:43:57 +0000 +++ INSTALL 2011-05-18 03:39:45 +0000 @@ -705,8 +705,8 @@ in `./lib-src' to their final destinations, as selected in `./src/epaths.h'. Strictly speaking, not all of the executables in `./lib-src' need be copied. -- The programs `fakemail', `hexl', `movemail', `profile', `rcs2log', - and `vcdiff' are used by Emacs; they do need to be copied. +- The programs `hexl', `movemail', `profile', `rcs2log', and `vcdiff' + are used by Emacs; they do need to be copied. - The programs `etags', `ctags', `emacsclient', and `rcs-checkin' are intended to be run by users; they are handled below. - The programs `make-docfile' and `test-distrib' were === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-05-17 02:26:56 +0000 +++ doc/emacs/ChangeLog 2011-05-18 03:39:45 +0000 @@ -1,3 +1,7 @@ +2011-05-18 Glenn Morris + + * ack.texi (Acknowledgments): Remove fakemail.c. + 2011-05-17 Chong Yidong Fixes for fitting text into 7x9 printed manual. === modified file 'doc/emacs/ack.texi' --- doc/emacs/ack.texi 2011-03-09 16:54:08 +0000 +++ doc/emacs/ack.texi 2011-05-18 03:39:45 +0000 @@ -1016,7 +1016,7 @@ @item Guillermo J.@: Rozas wrote @file{scheme.el}, a mode for editing Scheme and -DSSSL code, and @file{fakemail.c}, an interface to the System V mailer. +DSSSL code. @item Ivar Rummelhoff wrote @file{winner.el}, which records recent window === modified file 'etc/NEWS' --- etc/NEWS 2011-05-18 03:20:13 +0000 +++ etc/NEWS 2011-05-18 03:39:45 +0000 @@ -278,6 +278,10 @@ ** The standalone programs lib-src/digest-doc and sorted-doc have been replaced with Lisp commands `doc-file-to-man' and `doc-file-to-info'. +--- +** The standalone program `fakemail' has been removed. +If you need it, feedmail.el ought to provide a superset of the functionality. + ** The variable `focus-follows-mouse' now always defaults to nil. === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-04-26 12:49:53 +0000 +++ lib-src/ChangeLog 2011-05-18 03:39:45 +0000 @@ -1,3 +1,11 @@ +2011-05-18 Glenn Morris + + * fakemail.c: Remove file. + * makefile.w32-in ($(BLD)/fakemail.exe, fakemail) + ($(BLD)/fakemail.$(O)): Remove. + * Makefile.in (UTILITIES): Remove fakemail${EXEEXT}. + (fakemail${EXEEXT}): Remove rule. + 2011-04-24 Teodor Zlatanov * makefile.w32-in (obj): Add gnutls.o. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2011-03-23 03:09:55 +0000 +++ lib-src/Makefile.in 2011-05-18 03:39:45 +0000 @@ -117,8 +117,8 @@ # Things that Emacs runs internally, or during the build process, # which should not be installed in bindir. -UTILITIES = profile${EXEEXT} movemail${EXEEXT} fakemail${EXEEXT} \ - hexl${EXEEXT} update-game-score${EXEEXT} +UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \ + update-game-score${EXEEXT} DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT} @@ -353,9 +353,6 @@ pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c -fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h - $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail - emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ -DVERSION="\"${version}\"" \ === removed file 'lib-src/fakemail.c' --- lib-src/fakemail.c 2011-04-16 21:13:07 +0000 +++ lib-src/fakemail.c 1970-01-01 00:00:00 +0000 @@ -1,744 +0,0 @@ -/* sendmail-like interface to /bin/mail for system V, - Copyright (C) 1985, 1994, 1999, 2001-2011 Free Software Foundation, Inc. - -Author: Bill Rozas -(according to ack.texi) - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -#define _XOPEN_SOURCE 500 /* for cuserid */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined (BSD_SYSTEM) && !defined (USE_FAKEMAIL) -/* This program isnot used in BSD, so just avoid loader complaints. */ -int -main (void) -{ - return 0; -} -#else /* not BSD 4.2 (or newer) */ -#ifdef MSDOS -int -main () -{ - return 0; -} -#else /* not MSDOS */ -/* This conditional contains all the rest of the file. */ - -/* These are defined in config in some versions. */ - -#ifdef static -#undef static -#endif - -#ifdef WINDOWSNT -#include "ntlib.h" -#endif - -#include -#include -#include -#include -#include -#include - -/* This is to declare cuserid. */ -#include - -/* Type definitions */ - -#define boolean int -#define true 1 -#define false 0 - -#define TM_YEAR_BASE 1900 - -/* Nonzero if TM_YEAR is a struct tm's tm_year value that causes - asctime to have well-defined behavior. */ -#ifndef TM_YEAR_IN_ASCTIME_RANGE -# define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \ - (1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE) -#endif - -/* Various lists */ - -struct line_record -{ - char *string; - struct line_record *continuation; -}; -typedef struct line_record *line_list; - -struct header_record -{ - line_list text; - struct header_record *next; - struct header_record *previous; -}; -typedef struct header_record *header; - -struct stream_record -{ - FILE *handle; - int (*action)(FILE *); - struct stream_record *rest_streams; -}; -typedef struct stream_record *stream_list; - -/* A `struct linebuffer' is a structure which holds a line of text. - * `readline' reads a line from a stream into a linebuffer - * and works regardless of the length of the line. - */ - -struct linebuffer -{ - long size; - char *buffer; -}; - -struct linebuffer lb; - -#define new_list() \ - ((line_list) xmalloc (sizeof (struct line_record))) -#define new_header() \ - ((header) xmalloc (sizeof (struct header_record))) -#define new_stream() \ - ((stream_list) xmalloc (sizeof (struct stream_record))) -#define alloc_string(nchars) \ - ((char *) xmalloc ((nchars) + 1)) - -/* Global declarations */ - -#define BUFLEN 1024 -#define KEYWORD_SIZE 256 -#define FROM_PREFIX "From" -#define MY_NAME "fakemail" -#define NIL ((line_list) NULL) -#define INITIAL_LINE_SIZE 200 - -#ifndef MAIL_PROGRAM_NAME -#define MAIL_PROGRAM_NAME "/bin/mail" -#endif - -static const char *my_name; -static char *the_date; -static char *the_user; -static line_list file_preface; -static stream_list the_streams; -static boolean no_problems = true; - -static void fatal (const char *s1) NO_RETURN; - -#ifdef CURRENT_USER -static struct passwd *my_entry; -#define cuserid(s) \ -(my_entry = getpwuid (((int) geteuid ())), \ - my_entry->pw_name) -#endif - -/* Utilities */ - -/* Print error message. `s1' is printf control string, `s2' is arg for it. */ - -static void -error (const char *s1, const char *s2) -{ - printf ("%s: ", my_name); - printf (s1, s2); - printf ("\n"); - no_problems = false; -} - -/* Print error message and exit. */ - -static void -fatal (const char *s1) -{ - error ("%s", s1); - exit (EXIT_FAILURE); -} - -/* Like malloc but get fatal error if memory is exhausted. */ - -static void * -xmalloc (size_t size) -{ - void *result = malloc (size); - if (! result) - fatal ("virtual memory exhausted"); - return result; -} - -static void * -xrealloc (void *ptr, size_t size) -{ - void *result = realloc (ptr, size); - if (! result) - fatal ("virtual memory exhausted"); - return result; -} - -/* Initialize a linebuffer for use */ - -static void -init_linebuffer (struct linebuffer *linebuffer) -{ - linebuffer->size = INITIAL_LINE_SIZE; - linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE)); -} - -/* Read a line of text from `stream' into `linebuffer'. - Return the length of the line. */ - -static long -readline (struct linebuffer *linebuffer, FILE *stream) -{ - char *buffer = linebuffer->buffer; - char *p = linebuffer->buffer; - char *end = p + linebuffer->size; - - while (true) - { - int c = getc (stream); - if (p == end) - { - linebuffer->size *= 2; - buffer = (char *) xrealloc (buffer, linebuffer->size); - p = buffer + (p - linebuffer->buffer); - end = buffer + linebuffer->size; - linebuffer->buffer = buffer; - } - if (c < 0 || c == '\n') - { - *p = 0; - break; - } - *p++ = c; - } - - return p - buffer; -} - -/* Extract a colon-terminated keyword from the string FIELD. - Return that keyword as a string stored in a static buffer. - Store the address of the rest of the string into *REST. - - If there is no keyword, return NULL and don't alter *REST. */ - -static char * -get_keyword (register char *field, char **rest) -{ - static char keyword[KEYWORD_SIZE]; - register char *ptr; - register int c; - - ptr = &keyword[0]; - c = (unsigned char) *field++; - if (isspace (c) || c == ':') - return ((char *) NULL); - *ptr++ = (islower (c) ? toupper (c) : c); - while (((c = (unsigned char) *field++) != ':') && ! isspace (c)) - *ptr++ = (islower (c) ? toupper (c) : c); - *ptr++ = '\0'; - while (isspace (c)) - c = (unsigned char) *field++; - if (c != ':') - return ((char *) NULL); - *rest = field; - return &keyword[0]; -} - -/* Nonzero if the string FIELD starts with a colon-terminated keyword. */ - -static boolean -has_keyword (char *field) -{ - char *ignored; - return (get_keyword (field, &ignored) != ((char *) NULL)); -} - -/* Store the string FIELD, followed by any lines in THE_LIST, - into the buffer WHERE. - Concatenate lines, putting just a space between them. - Delete everything contained in parentheses. - When a recipient name contains <...>, we discard - everything except what is inside the <...>. - - We don't pay attention to overflowing WHERE; - the caller has to make it big enough. */ - -static char * -add_field (line_list the_list, register char *field, register char *where) -{ - register char c; - while (true) - { - char *this_recipient_where; - int in_quotes = 0; - - *where++ = ' '; - this_recipient_where = where; - - while ((c = *field++) != '\0') - { - if (c == '\\') - *where++ = c; - else if (c == '"') - { - in_quotes = ! in_quotes; - *where++ = c; - } - else if (in_quotes) - *where++ = c; - else if (c == '(') - { - while (*field && *field != ')') ++field; - if (! (*field++)) break; /* no close */ - continue; - } - else if (c == ',') - { - *where++ = ' '; - /* When we get to the end of one recipient, - don't discard it if the next one has <...>. */ - this_recipient_where = where; - } - else if (c == '<') - /* Discard everything we got before the `<'. */ - where = this_recipient_where; - else if (c == '>') - /* Discard the rest of this name that follows the `>'. */ - { - while (*field && *field != ',') ++field; - if (! (*field++)) break; /* no comma */ - continue; - } - else - *where++ = c; - } - if (the_list == NIL) break; - field = the_list->string; - the_list = the_list->continuation; - } - return where; -} - -static line_list -make_file_preface (void) -{ - char *the_string, *temp; - long idiotic_interface; - struct tm *tm; - long prefix_length; - long user_length; - long date_length; - line_list result; - - prefix_length = strlen (FROM_PREFIX); - time (&idiotic_interface); - /* Convert to a string, checking for out-of-range time stamps. - Don't use 'ctime', as that might dump core if the hardware clock - is set to a bizarre value. */ - tm = localtime (&idiotic_interface); - if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) - && (the_date = asctime (tm)))) - fatal ("current time is out of range"); - /* the_date has an unwanted newline at the end */ - date_length = strlen (the_date) - 1; - the_date[date_length] = '\0'; - temp = cuserid ((char *) NULL); - user_length = strlen (temp); - the_user = alloc_string (user_length + 1); - strcpy (the_user, temp); - the_string = alloc_string (3 + prefix_length - + user_length - + date_length); - temp = the_string; - strcpy (temp, FROM_PREFIX); - temp = &temp[prefix_length]; - *temp++ = ' '; - strcpy (temp, the_user); - temp = &temp[user_length]; - *temp++ = ' '; - strcpy (temp, the_date); - result = new_list (); - result->string = the_string; - result->continuation = ((line_list) NULL); - return result; -} - -static void -write_line_list (register line_list the_list, FILE *the_stream) -{ - for ( ; - the_list != ((line_list) NULL) ; - the_list = the_list->continuation) - { - fputs (the_list->string, the_stream); - putc ('\n', the_stream); - } - return; -} - -static int -close_the_streams (void) -{ - register stream_list rem; - for (rem = the_streams; - rem != ((stream_list) NULL); - rem = rem->rest_streams) - if (no_problems && (*rem->action) (rem->handle) != 0) - error ("output error", NULL); - the_streams = ((stream_list) NULL); - return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE); -} - -static void -add_a_stream (FILE *the_stream, int (*closing_action) (FILE *)) -{ - stream_list old = the_streams; - the_streams = new_stream (); - the_streams->handle = the_stream; - the_streams->action = closing_action; - the_streams->rest_streams = old; - return; -} - -static int -my_fclose (FILE *the_file) -{ - putc ('\n', the_file); - fflush (the_file); - if (ferror (the_file)) - return EOF; - return fclose (the_file); -} - -static boolean -open_a_file (char *name) -{ - FILE *the_stream = fopen (name, "a"); - if (the_stream != ((FILE *) NULL)) - { - add_a_stream (the_stream, my_fclose); - if (the_user == ((char *) NULL)) - file_preface = make_file_preface (); - write_line_list (file_preface, the_stream); - return true; - } - return false; -} - -static void -put_string (char *s) -{ - register stream_list rem; - for (rem = the_streams; - rem != ((stream_list) NULL); - rem = rem->rest_streams) - fputs (s, rem->handle); - return; -} - -static void -put_line (const char *string) -{ - register stream_list rem; - for (rem = the_streams; - rem != ((stream_list) NULL); - rem = rem->rest_streams) - { - const char *s = string; - int column = 0; - - /* Divide STRING into lines. */ - while (*s != 0) - { - const char *breakpos; - - /* Find the last char that fits. */ - for (breakpos = s; *breakpos && column < 78; ++breakpos) - { - if (*breakpos == '\t') - column += 8; - else - column++; - } - /* If we didn't reach end of line, break the line. */ - if (*breakpos) - { - /* Back up to just after the last comma that fits. */ - while (breakpos != s && breakpos[-1] != ',') --breakpos; - - if (breakpos == s) - { - /* If no comma fits, move past the first address anyway. */ - while (*breakpos != 0 && *breakpos != ',') ++breakpos; - if (*breakpos != 0) - /* Include the comma after it. */ - ++breakpos; - } - } - /* Output that much, then break the line. */ - fwrite (s, 1, breakpos - s, rem->handle); - column = 8; - - /* Skip whitespace and prepare to print more addresses. */ - s = breakpos; - while (*s == ' ' || *s == '\t') ++s; - if (*s != 0) - fputs ("\n\t", rem->handle); - } - putc ('\n', rem->handle); - } - return; -} - -#define mail_error error - -/* Handle an FCC field. FIELD is the text of the first line (after - the header name), and THE_LIST holds the continuation lines if any. - Call open_a_file for each file. */ - -static void -setup_files (register line_list the_list, register char *field) -{ - register char *start; - register char c; - while (true) - { - while (((c = *field) != '\0') - && (c == ' ' - || c == '\t' - || c == ',')) - field += 1; - if (c != '\0') - { - start = field; - while (((c = *field) != '\0') - && c != ' ' - && c != '\t' - && c != ',') - field += 1; - *field = '\0'; - if (!open_a_file (start)) - mail_error ("Could not open file %s", start); - *field = c; - if (c != '\0') continue; - } - if (the_list == ((line_list) NULL)) - return; - field = the_list->string; - the_list = the_list->continuation; - } -} - -/* Compute the total size of all recipient names stored in THE_HEADER. - The result says how big to make the buffer to pass to parse_header. */ - -static int -args_size (header the_header) -{ - register header old = the_header; - register line_list rem; - register int size = 0; - do - { - char *field; - register char *keyword = get_keyword (the_header->text->string, &field); - if ((strcmp (keyword, "TO") == 0) - || (strcmp (keyword, "CC") == 0) - || (strcmp (keyword, "BCC") == 0)) - { - size += 1 + strlen (field); - for (rem = the_header->text->continuation; - rem != NIL; - rem = rem->continuation) - size += 1 + strlen (rem->string); - } - the_header = the_header->next; - } while (the_header != old); - return size; -} - -/* Scan the header described by the lists THE_HEADER, - and put all recipient names into the buffer WHERE. - Precede each recipient name with a space. - - Also, if the header has any FCC fields, call setup_files for each one. */ - -static void -parse_header (header the_header, register char *where) -{ - register header old = the_header; - do - { - char *field; - register char *keyword = get_keyword (the_header->text->string, &field); - if (strcmp (keyword, "TO") == 0) - where = add_field (the_header->text->continuation, field, where); - else if (strcmp (keyword, "CC") == 0) - where = add_field (the_header->text->continuation, field, where); - else if (strcmp (keyword, "BCC") == 0) - { - where = add_field (the_header->text->continuation, field, where); - the_header->previous->next = the_header->next; - the_header->next->previous = the_header->previous; - } - else if (strcmp (keyword, "FCC") == 0) - setup_files (the_header->text->continuation, field); - the_header = the_header->next; - } while (the_header != old); - *where = '\0'; - return; -} - -/* Read lines from the input until we get a blank line. - Create a list of `header' objects, one for each header field, - each of which points to a list of `line_list' objects, - one for each line in that field. - Continuation lines are grouped in the headers they continue. */ - -static header -read_header (void) -{ - register header the_header = ((header) NULL); - register line_list *next_line = ((line_list *) NULL); - - init_linebuffer (&lb); - - do - { - long length; - register char *line; - - readline (&lb, stdin); - line = lb.buffer; - length = strlen (line); - if (length == 0) break; - - if (has_keyword (line)) - { - register header old = the_header; - the_header = new_header (); - if (old == ((header) NULL)) - { - the_header->next = the_header; - the_header->previous = the_header; - } - else - { - the_header->previous = old; - the_header->next = old->next; - old->next = the_header; - } - next_line = &(the_header->text); - } - - if (next_line == ((line_list *) NULL)) - { - /* Not a valid header */ - exit (EXIT_FAILURE); - } - *next_line = new_list (); - (*next_line)->string = alloc_string (length); - strcpy (((*next_line)->string), line); - next_line = &((*next_line)->continuation); - *next_line = NIL; - - } while (true); - - if (! the_header) - fatal ("input message has no header"); - return the_header->next; -} - -static void -write_header (header the_header) -{ - register header old = the_header; - do - { - register line_list the_list; - for (the_list = the_header->text; - the_list != NIL; - the_list = the_list->continuation) - put_line (the_list->string); - the_header = the_header->next; - } while (the_header != old); - put_line (""); - return; -} - -int -main (int argc, char **argv) -{ - char *command_line; - header the_header; - long name_length; - const char *mail_program_name; - char buf[BUFLEN + 1]; - register int size; - FILE *the_pipe; - - mail_program_name = getenv ("FAKEMAILER"); - if (!(mail_program_name && *mail_program_name)) - mail_program_name = MAIL_PROGRAM_NAME; - name_length = strlen (mail_program_name); - - my_name = MY_NAME; - the_streams = ((stream_list) NULL); - the_date = ((char *) NULL); - the_user = ((char *) NULL); - - the_header = read_header (); - command_line = alloc_string (name_length + args_size (the_header)); - strcpy (command_line, mail_program_name); - parse_header (the_header, &command_line[name_length]); - - the_pipe = popen (command_line, "w"); - if (the_pipe == ((FILE *) NULL)) - fatal ("cannot open pipe to real mailer"); - - add_a_stream (the_pipe, pclose); - - write_header (the_header); - - /* Dump the message itself */ - - while (!feof (stdin)) - { - size = fread (buf, 1, BUFLEN, stdin); - buf[size] = '\0'; - put_string (buf); - } - - if (no_problems && (ferror (stdin) || fclose (stdin) != 0)) - error ("input error", NULL); - - exit (close_the_streams ()); -} - -#endif /* not MSDOS */ -#endif /* not BSD 4.2 (or newer) */ - - -/* fakemail.c ends here */ === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2011-04-25 01:28:55 +0000 +++ lib-src/makefile.w32-in 2011-05-18 03:39:45 +0000 @@ -31,8 +31,6 @@ $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS) $(BLD)/hexl.exe: $(BLD)/hexl.$(O) $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS) -$(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) - $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS) $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O) $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS) @@ -42,7 +40,6 @@ ebrowse: stamp_BLD $(BLD)/ebrowse.exe hexl: stamp_BLD $(BLD)/hexl.exe movemail: stamp_BLD $(BLD)/movemail.exe -fakemail: stamp_BLD $(BLD)/fakemail.exe emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe test-distrib: stamp_BLD $(BLD)/test-distrib.exe @@ -406,14 +403,6 @@ $(SRC)/ntlib.h \ $(EMACS_ROOT)/lib/getopt.h -$(BLD)/fakemail.$(O) : \ - $(SRC)/fakemail.c \ - $(SRC)/ntlib.h \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/lib-src/../src/config.h \ - $(EMACS_ROOT)/nt/inc/pwd.h - $(BLD)/getdate.$(O) : \ $(SRC)/getdate.c \ $(EMACS_ROOT)/src/s/ms-w32.h \ @@ -483,7 +472,7 @@ # The following dependencies are for supporting parallel builds, where # we must make sure $(BLD) exists before any compilation starts. # -$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD +$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O): stamp_BLD $(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-18 03:20:13 +0000 +++ lisp/ChangeLog 2011-05-18 03:39:45 +0000 @@ -1,5 +1,7 @@ 2011-05-18 Glenn Morris + * mail/sendmail.el (sendmail-program): Fall back to just "sendmail". + Rationalize calendar handling of day and month abbrev-arrays. * calendar/calendar.el (calendar-customized-p): New function. (calendar-abbrev-construct, calendar-make-alist): Change what it does. === modified file 'lisp/mail/feedmail.el' --- lisp/mail/feedmail.el 2011-05-14 18:47:29 +0000 +++ lisp/mail/feedmail.el 2011-05-18 03:39:45 +0000 @@ -13,9 +13,8 @@ ;; A replacement for parts of Emacs' sendmail.el (specifically, ;; it's what handles your outgoing mail after you hit C-c C-c in mail ;; mode). See below for a list of additional features, including the -;; ability to queue messages for later sending. If you are using -;; fakemail as a subprocess, you can switch to feedmail and eliminate -;; the use of fakemail. +;; ability to queue messages for later sending. This replaces +;; the standalone fakemail program that used to be distributed with Emacs. ;; feedmail works with recent versions of Emacs (20.x series) and ;; XEmacs (tested with 20.4 and later betas). It probably no longer @@ -90,12 +89,11 @@ ;; This code does in elisp a superset of the stuff that used to be done ;; by the separate program "fakemail" for processing outbound email. ;; In other words, it takes over after you hit "C-c C-c" in mail mode. -;; By appropriate setting of options, you can still use "fakemail", -;; or you can even revert to sendmail (which is not too popular -;; locally). See the variables at the top of the elisp for how to -;; achieve these effects (there are more features than in this bullet -;; list, so trolling through the variable and function doc strings may -;; be worth your while): +;; By appropriate setting of options, you can even revert to sendmail +;; (which is not too popular locally). See the variables at the top +;; of the elisp for how to achieve these effects (there are more +;; features than in this bullet list, so trolling through the variable +;; and function doc strings may be worth your while): ;; ;; --- you can park outgoing messages into a disk-based queue and ;; stimulate sending them all later (handy for laptop users); === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2011-05-13 01:42:24 +0000 +++ lisp/mail/sendmail.el 2011-05-18 03:39:45 +0000 @@ -48,9 +48,9 @@ ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail") ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail") ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail") - (t "fakemail"))) ; in lib-src, to interface to /bin/mail + (t "sendmail"))) "Program used to send messages." - :version "24.1" ; added executable-find + :version "24.1" ; add executable-find, remove fakemail :group 'mail :type 'file) ------------------------------------------------------------ revno: 104268 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-17 20:20:13 -0700 message: Rationalize calendar handling of day and month abbrev-arrays. * lisp/calendar/calendar.el (calendar-customized-p): New function. (calendar-abbrev-construct, calendar-make-alist): Change what it does. (calendar-day-name-array, calendar-month-name-array): Doc fix. Add :set function. (calendar-abbrev-length, calendar-day-abbrev-array) (calendar-month-abbrev-array): Make defcustoms, with appropriate :set. (calendar-day-abbrev-array, calendar-month-abbrev-array): Elements may no longer be nil. (calendar-day-name, calendar-month-name): Update for changed nature of abbrev arrays. * calendar/diary-lib.el (diary-name-pattern): Update for changed nature of abbrev arrays. (diary-mark-entries-1): Update calendar-make-alist calls. (diary-font-lock-date-forms): Doc fix for changed abbrev arrays. * calendar/cal-html.el (cal-html-day-abbrev-array): Simply inherit from calendar-day-abbrev-array. * etc/NEWS: Mention this. diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-05-16 11:27:34 +0000 +++ etc/NEWS 2011-05-18 03:20:13 +0000 @@ -473,6 +473,10 @@ *** New function `diary-hebrew-birthday'. --- +*** Elements of `calendar-day-abbrev-array' and `calendar-month-abbrev-array' +may no longer be nil, but must all be strings. + +--- *** The obsolete (since Emacs 22.1) method of enabling the appt package by adding appt-make-list to diary-hook has been removed. Use appt-activate. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-18 00:39:40 +0000 +++ lisp/ChangeLog 2011-05-18 03:20:13 +0000 @@ -1,3 +1,23 @@ +2011-05-18 Glenn Morris + + Rationalize calendar handling of day and month abbrev-arrays. + * calendar/calendar.el (calendar-customized-p): New function. + (calendar-abbrev-construct, calendar-make-alist): Change what it does. + (calendar-day-name-array, calendar-month-name-array): Doc fix. + Add :set function. + (calendar-abbrev-length, calendar-day-abbrev-array) + (calendar-month-abbrev-array): Make defcustoms, with appropriate :set. + (calendar-day-abbrev-array, calendar-month-abbrev-array): + Elements may no longer be nil. + (calendar-day-name, calendar-month-name): + Update for changed nature of abbrev arrays. + * calendar/diary-lib.el (diary-name-pattern): + Update for changed nature of abbrev arrays. + (diary-mark-entries-1): Update calendar-make-alist calls. + (diary-font-lock-date-forms): Doc fix for changed abbrev arrays. + * calendar/cal-html.el (cal-html-day-abbrev-array): + Simply inherit from calendar-day-abbrev-array. + 2011-05-17 Stefan Monnier * progmodes/grep.el (grep-mode): Disable default === modified file 'lisp/calendar/cal-html.el' --- lisp/calendar/cal-html.el 2011-04-19 04:11:01 +0000 +++ lisp/calendar/cal-html.el 2011-05-18 03:20:13 +0000 @@ -54,11 +54,16 @@ :type 'integer :group 'calendar-html) -(defcustom cal-html-day-abbrev-array - (calendar-abbrev-construct calendar-day-abbrev-array - calendar-day-name-array) +(defcustom cal-html-day-abbrev-array calendar-day-abbrev-array "Array of seven strings for abbreviated day names (starting with Sunday)." - :type '(vector string string string string string string string) + :set-after '(calendar-day-abbrev-array) + :type '(vector (string :tag "Sun") + (string :tag "Mon") + (string :tag "Tue") + (string :tag "Wed") + (string :tag "Thu") + (string :tag "Fri") + (string :tag "Sat")) :group 'calendar-html) (defcustom cal-html-css-default === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2011-04-19 04:11:01 +0000 +++ lisp/calendar/calendar.el 2011-05-18 03:20:13 +0000 @@ -2034,18 +2034,40 @@ value)) -(defvar calendar-abbrev-length 3 - "*Length of abbreviations to be used for day and month names. -See also `calendar-day-abbrev-array' and `calendar-month-abbrev-array'.") - -;; FIXME does it have to start from Sunday? +(defun calendar-customized-p (symbol) + "Return non-nil if SYMBOL has been customized." + (and (default-boundp symbol) + (let ((standard (get symbol 'standard-value))) + (and standard + (not (equal (eval (car standard)) (default-value symbol))))))) + +(defun calendar-abbrev-construct (full) + "From sequence FULL, return a vector of abbreviations. +Each abbreviation is no longer than `calendar-abbrev-length' characters." + (apply 'vector (mapcar + (lambda (f) + (substring f 0 (min calendar-abbrev-length (length f)))) + full))) + (defcustom calendar-day-name-array ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] - "Array of capitalized strings giving, in order, the day names. + "Array of capitalized strings giving, in order from Sunday, the day names. The first two characters of each string will be used to head the -day columns in the calendar. See also the variable -`calendar-day-abbrev-array'." +day columns in the calendar. +If you change this without using customize after the calendar has loaded, +then you may also want to change `calendar-day-abbrev-array'." :group 'calendar + :initialize 'custom-initialize-default + :set (lambda (symbol value) + (let ((dcustomized (calendar-customized-p 'calendar-day-abbrev-array)) + (hcustomized (calendar-customized-p 'cal-html-day-abbrev-array))) + (set symbol value) + (or dcustomized + (setq calendar-day-abbrev-array + (calendar-abbrev-construct calendar-day-name-array))) + (and (not hcustomized) + (boundp 'cal-html-day-abbrev-array) + (setq cal-html-day-abbrev-array calendar-day-abbrev-array)))) :type '(vector (string :tag "Sunday") (string :tag "Monday") (string :tag "Tuesday") @@ -2054,23 +2076,74 @@ (string :tag "Friday") (string :tag "Saturday"))) -(defvar calendar-day-abbrev-array - [nil nil nil nil nil nil nil] - "*Array of capitalized strings giving the abbreviated day names. +(defcustom calendar-abbrev-length 3 + "Default length of abbreviations to use for day and month names. +If you change this without using customize after the calendar has loaded, +then you may also want to change `calendar-day-abbrev-array' and +`calendar-month-abbrev-array'." + :group 'calendar + :initialize 'custom-initialize-default + :set (lambda (symbol value) + (let ((dcustomized (calendar-customized-p 'calendar-day-abbrev-array)) + (mcustomized (calendar-customized-p + 'calendar-month-abbrev-array)) + (hcustomized (calendar-customized-p 'cal-html-day-abbrev-array))) + (set symbol value) + (or dcustomized + (setq calendar-day-abbrev-array + (calendar-abbrev-construct calendar-day-name-array))) + (or mcustomized + (setq calendar-month-abbrev-array + (calendar-abbrev-construct calendar-month-name-array))) + (and (not hcustomized) + (boundp 'cal-html-day-abbrev-array) + (setq cal-html-day-abbrev-array calendar-day-abbrev-array)))) + :type 'integer) + +(defcustom calendar-day-abbrev-array + (calendar-abbrev-construct calendar-day-name-array) + "Array of capitalized strings giving the abbreviated day names. The order should be the same as that of the full names specified in `calendar-day-name-array'. These abbreviations may be used instead of the full names in the diary file. Do not include a trailing `.' in the strings specified in this variable, though -you may use such in the diary file. If any element of this array -is nil, then the abbreviation will be constructed as the first -`calendar-abbrev-length' characters of the corresponding full name.") +you may use such in the diary file. By default, each string is +the first `calendar-abbrev-length' characters of the corresponding +full name." + :group 'calendar + :initialize 'custom-initialize-default + :set-after '(calendar-abbrev-length calendar-day-name-array) + :set (lambda (symbol value) + (let ((hcustomized (calendar-customized-p 'cal-html-day-abbrev-array))) + (set symbol value) + (and (not hcustomized) + (boundp 'cal-html-day-abbrev-array) + (setq cal-html-day-abbrev-array calendar-day-abbrev-array)))) + :type '(vector (string :tag "Sun") + (string :tag "Mon") + (string :tag "Tue") + (string :tag "Wed") + (string :tag "Thu") + (string :tag "Fri") + (string :tag "Sat")) + ;; Made defcustom, changed defaults from nil nil... + :version "24.1") (defcustom calendar-month-name-array ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] "Array of capitalized strings giving, in order, the month names. -See also the variable `calendar-month-abbrev-array'." +If you change this without using customize after the calendar has loaded, +then you may also want to change `calendar-month-abbrev-array'." :group 'calendar + :initialize 'custom-initialize-default + :set (lambda (symbol value) + (let ((mcustomized (calendar-customized-p + 'calendar-month-abbrev-array))) + (set symbol value) + (or mcustomized + (setq calendar-month-abbrev-array + (calendar-abbrev-construct calendar-month-name-array))))) :type '(vector (string :tag "January") (string :tag "February") (string :tag "March") @@ -2084,46 +2157,54 @@ (string :tag "November") (string :tag "December"))) -(defvar calendar-month-abbrev-array - [nil nil nil nil nil nil nil nil nil nil nil nil] - "*Array of capitalized strings giving the abbreviated month names. +(defcustom calendar-month-abbrev-array + (calendar-abbrev-construct calendar-month-name-array) + "Array of capitalized strings giving the abbreviated month names. The order should be the same as that of the full names specified in `calendar-month-name-array'. These abbreviations are used in the calendar menu entries, and can also be used in the diary file. Do not include a trailing `.' in the strings specified in -this variable, though you may use such in the diary file. If any -element of this array is nil, then the abbreviation will be -constructed as the first `calendar-abbrev-length' characters of the -corresponding full name.") +this variable, though you may use such in the diary file. By +default, each string is the first ``calendar-abbrev-length' +characters of the corresponding full name." + :group 'calendar + :set-after '(calendar-abbrev-length calendar-month-name-array) + :type '(vector (string :tag "Jan") + (string :tag "Feb") + (string :tag "Mar") + (string :tag "Apr") + (string :tag "May") + (string :tag "Jun") + (string :tag "Jul") + (string :tag "Aug") + (string :tag "Sep") + (string :tag "Oct") + (string :tag "Nov") + (string :tag "Dec")) + ;; Made defcustom, changed defaults from nil nil... + :version "24.1") -(defun calendar-make-alist (sequence &optional start-index filter abbrevs) - "Make an assoc list corresponding to SEQUENCE. -Each element of sequence will be associated with an integer, starting -from 1, or from START-INDEX if that is non-nil. If a sequence ABBREVS -is supplied, the function `calendar-abbrev-construct' is used to -construct abbreviations corresponding to the elements in SEQUENCE. -Each abbreviation is entered into the alist with the same -association index as the full name it represents. -If FILTER is provided, apply it to each key in the alist." - (let ((index 0) - (offset (or start-index 1)) - (aseq (if abbrevs (calendar-abbrev-construct abbrevs sequence))) - (aseqp (if abbrevs (calendar-abbrev-construct abbrevs sequence - 'period))) - alist elem) - (dotimes (i (length sequence) (reverse alist)) - (setq index (+ i offset) - elem (elt sequence i) - alist - (cons (cons (if filter (funcall filter elem) elem) index) alist)) - (if aseq - (setq elem (elt aseq i) - alist (cons (cons (if filter (funcall filter elem) elem) - index) alist))) - (if aseqp - (setq elem (elt aseqp i) - alist (cons (cons (if filter (funcall filter elem) elem) - index) alist)))))) +(defun calendar-make-alist (sequence &optional start-index filter + &rest sequences) + "Return an association list corresponding to SEQUENCE. +Associates each element of SEQUENCE with an incremented integer, +starting from START-INDEX (default 1). Applies the function FILTER, +if provided, to each key in the alist. Repeats the process, with +indices starting from START-INDEX each time, for any remaining +arguments SEQUENCES." + (or start-index (setq start-index 1)) + (let (index alist) + (mapc (lambda (seq) + (setq index start-index) + (mapc (lambda (elem) + (setq alist (cons + (cons (if filter (funcall filter elem) elem) + index) + alist) + index (1+ index))) + seq)) + (append (list sequence) sequences)) + (reverse alist))) (defun calendar-read-date (&optional noday) "Prompt for Gregorian date. Return a list (month day year). @@ -2162,23 +2243,6 @@ (+ (* 12 (- yr2 yr1)) (- mon2 mon1))) -(defun calendar-abbrev-construct (abbrev full &optional period) - "Internal calendar function to return a complete abbreviation array. -ABBREV is an array of abbreviations, FULL the corresponding array -of full names. The return value is the ABBREV array, with any nil -elements replaced by the first three characters taken from the -corresponding element of FULL. If optional argument PERIOD is non-nil, -each element returned has a final `.' character." - (let (elem array name) - (dotimes (i (length full)) - (setq name (aref full i) - elem (or (aref abbrev i) - (substring name 0 - (min calendar-abbrev-length (length name)))) - elem (format "%s%s" elem (if period "." "")) - array (append array (list elem)))) - (vconcat array))) - (defvar calendar-font-lock-keywords `((,(concat (regexp-opt (mapcar 'identity calendar-month-name-array) t) " -?[0-9]+") @@ -2204,10 +2268,7 @@ week. Day names are taken from the variable `calendar-day-name-array', unless the optional argument ABBREV is non-nil, in which case the variable `calendar-day-abbrev-array' is used." - (aref (if abbrev - (calendar-abbrev-construct calendar-day-abbrev-array - calendar-day-name-array) - calendar-day-name-array) + (aref (if abbrev calendar-day-abbrev-array calendar-day-name-array) (if absolute date (calendar-day-of-week date)))) (defun calendar-month-name (month &optional abbrev) @@ -2216,10 +2277,7 @@ variable `calendar-month-name-array', unless the optional argument ABBREV is non-nil, in which case `calendar-month-abbrev-array' is used." - (aref (if abbrev - (calendar-abbrev-construct calendar-month-abbrev-array - calendar-month-name-array) - calendar-month-name-array) + (aref (if abbrev calendar-month-abbrev-array calendar-month-name-array) (1- month))) (defun calendar-day-of-week (date) === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-05-10 02:22:55 +0000 +++ lisp/calendar/diary-lib.el 2011-05-18 03:20:13 +0000 @@ -1250,19 +1250,15 @@ (defun diary-name-pattern (string-array &optional abbrev-array paren) "Return a regexp matching the strings in the array STRING-ARRAY. -If the optional argument ABBREV-ARRAY is present, then the function -`calendar-abbrev-construct' is used to construct abbreviations from the -two supplied arrays. The returned regexp will then also match these -abbreviations, with or without final `.' characters. If the optional -argument PAREN is non-nil, the regexp is surrounded by parentheses." +If the optional argument ABBREV-ARRAY is present, the regexp +also matches the supplied abbreviations, with or without final `.' +characters. If the optional argument PAREN is non-nil, surrounds +the regexp with parentheses." (regexp-opt (append string-array - (if abbrev-array - (calendar-abbrev-construct abbrev-array - string-array)) - (if abbrev-array - (calendar-abbrev-construct abbrev-array - string-array - 'period)) + abbrev-array + (if abbrev-array + (mapcar (lambda (e) (format "%s." e)) + abbrev-array)) nil) paren)) @@ -1363,7 +1359,11 @@ (cdr (assoc-string dd-name (calendar-make-alist calendar-day-name-array - 0 nil calendar-day-abbrev-array) t)) marks) + 0 nil calendar-day-abbrev-array + (mapcar (lambda (e) + (format "%s." e)) + calendar-day-abbrev-array)) + t)) marks) (if mm-name (setq mm (if (string-equal mm-name "*") 0 @@ -1372,7 +1372,11 @@ (if months (calendar-make-alist months) (calendar-make-alist calendar-month-name-array - 1 nil calendar-month-abbrev-array)) t))))) + 1 nil calendar-month-abbrev-array + (mapcar (lambda (e) + (format "%s." e)) + calendar-month-abbrev-array))) + t))))) (funcall markfunc mm dd yy marks)))))))) ;;;###cal-autoload @@ -2307,11 +2311,10 @@ (defun diary-font-lock-date-forms (month-array &optional symbol abbrev-array) "Create font-lock patterns for `diary-date-forms' using MONTH-ARRAY. -If given, optional SYMBOL must be a prefix to entries. -If optional ABBREV-ARRAY is present, the abbreviations constructed -from this array by the function `calendar-abbrev-construct' are -matched (with or without a final `.'), in addition to the full month -names." +If given, optional SYMBOL must be a prefix to entries. If +optional ABBREV-ARRAY is present, also matches the abbreviations +from this array (with or without a final `.'), in addition to the +full month names." (let ((dayname (diary-name-pattern calendar-day-name-array calendar-day-abbrev-array t)) (monthname (format "\\(%s\\|\\*\\)" ------------------------------------------------------------ revno: 104267 committer: Christoph Scholtes branch nick: trunk timestamp: Tue 2011-05-17 21:03:15 -0600 message: Last commit was missing updated source file. diff: === modified file 'src/menu.c' --- src/menu.c 2011-05-12 20:23:33 +0000 +++ src/menu.c 2011-05-18 03:03:15 +0000 @@ -21,6 +21,7 @@ #include #include #include +#include /* for INT_MAX */ #include "lisp.h" #include "keyboard.h" ------------------------------------------------------------ revno: 104266 committer: Christoph Scholtes branch nick: trunk timestamp: Tue 2011-05-17 21:00:08 -0600 message: * menu.c: Include limits.h (fixes the MS-Windows build broken by revision 104265). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-18 00:47:42 +0000 +++ src/ChangeLog 2011-05-18 03:00:08 +0000 @@ -1,3 +1,8 @@ +2011-05-18 Christoph Scholtes + + * menu.c: Include limits.h (fixes the MS-Windows build broken by + revision 104625). + 2011-05-18 Paul Eggert Fix some integer overflow issues, such as string length overflow. ------------------------------------------------------------ revno: 104265 [merge] fixes bug(s): http://debbugs.gnu.org/8675 http://debbugs.gnu.org/8664 committer: Paul Eggert branch nick: trunk timestamp: Tue 2011-05-17 17:52:24 -0700 message: Int overflow fixes, e.g., string length overflow. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-18 00:26:48 +0000 +++ src/ChangeLog 2011-05-18 00:47:42 +0000 @@ -1,3 +1,98 @@ +2011-05-18 Paul Eggert + + Fix some integer overflow issues, such as string length overflow. + + * insdel.c (count_size_as_multibyte): Check for string overflow. + + * character.c (lisp_string_width): Check for string overflow. + Use EMACS_INT, not int, for string indexes and lengths; in + particular, 2nd arg is now EMACS_INT, not int. Do not crash if + the resulting string length overflows an EMACS_INT; instead, + report a string overflow if no precision given. When checking for + precision exhaustion, use a check that cannot possibly have + integer overflow. (Bug#8675) + * character.h (lisp_string_width): Adjust to new signature. + + * alloc.c (string_overflow): New function. + (Fmake_string): Use it. This doesn't change behavior, but saves + a few bytes and will simplify future changes. + * character.c (string_escape_byte8): Likewise. + * lisp.h (string_overflow): New decl. + + Fixups, following up to the user-interface timestamp change. + * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time + for UI timestamps, instead of unsigned long. + * msdos.c (mouse_get_pos): Likewise. + * w32inevt.c (movement_time, w32_console_mouse_position): Likewise. + * w32gui.h (Time): Define by including "systime.h" rather than by + declaring it ourselves. (Bug#8664) + + * dispextern.h (struct image): Don't assume time_t <= unsigned long. + * image.c (clear_image_cache): Likewise. + + * term.c (term_mouse_position): Don't assume time_t wraparound. + + Be more systematic about user-interface timestamps. + Before, the code sometimes used 'Time', sometimes 'unsigned long', + and sometimes 'EMACS_UINT', to represent these timestamps. This + change causes it to use 'Time' uniformly, as that's what X uses. + This makes the code easier to follow, and makes it easier to catch + integer overflow bugs such as Bug#8664. + * frame.c (Fmouse_position, Fmouse_pixel_position): + Use Time, not unsigned long, for user-interface timestamps. + * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise. + (button_down_time, make_lispy_position, make_lispy_movement): Likewise. + * keyboard.h (last_event_timestamp): Likewise. + * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise. + * menu.h (xmenu_show): Likewise. + * term.c (term_mouse_position): Likewise. + * termhooks.h (struct input_event.timestamp): Likewise. + (struct terminal.mouse_position_hook): Likewise. + * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise. + * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise. + * systime.h (Time): New decl. Pull it in from if + HAVE_X_WINDOWS, otherwise define it as unsigned long, which is + what it was before. + * menu.h, termhooks.h: Include "systime.h", for Time. + + * keyboard.c (make_lispy_event): Fix problem in integer overflow. + Don't assume that the difference between two unsigned long values + can fit into an integer. At this point, we know button_down_time + <= event->timestamp, so the difference must be nonnegative, so + there's no need to cast the result if double-click-time is + nonnegative, as it should be; check that it's nonnegative, just in + case. This bug is triggered when events are more than 2**31 ms + apart (about 25 days). (Bug#8664) + + * xselect.c (last_event_timestamp): Remove duplicate decl. + (x_own_selection): Remove needless cast to unsigned long. + + * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes + that always fit in int. Use a sentinel instead of a counter, to + avoid a temp and to allay GCC's concerns about possible int overflow. + * frame.h (struct frame): Use int for menu_bar_items_used + instead of EMACS_INT, since it always fits in int. + + * menu.c (grow_menu_items): Check for int overflow. + + * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils. + + * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers. + Before, the code was not consistent. These values cannot exceed + 2**31 - 1 so there's no need to make them unsigned. + (x_x_to_emacs_modifiers): Accept int and return EMACS_INT. + (x_emacs_to_x_modifiers): Accept EMACS_INT and return int. + (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers + as modifiers. + * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change. + + * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT. + (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT. + Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)), + presumably because the widths might not match. + + * window.c (size_window): Avoid needless test at loop start. + 2011-05-18 Courtney Bane (tiny change) * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687). === modified file 'src/alloc.c' --- src/alloc.c 2011-05-12 07:07:06 +0000 +++ src/alloc.c 2011-05-16 01:11:54 +0000 @@ -2174,6 +2174,11 @@ current_sblock = tb; } +void +string_overflow (void) +{ + error ("Maximum string size exceeded"); +} DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, doc: /* Return a newly created string of length LENGTH, with INIT in each element. @@ -2206,7 +2211,7 @@ EMACS_INT string_len = XINT (length); if (string_len > MOST_POSITIVE_FIXNUM / len) - error ("Maximum string size exceeded"); + string_overflow (); nbytes = len * string_len; val = make_uninit_multibyte_string (string_len, nbytes); p = SDATA (val); === modified file 'src/character.c' --- src/character.c 2011-05-12 07:07:06 +0000 +++ src/character.c 2011-05-16 05:18:38 +0000 @@ -35,6 +35,7 @@ #include #include +#include #include "lisp.h" #include "character.h" #include "buffer.h" @@ -404,7 +405,7 @@ in *NCHARS and *NBYTES respectively. */ EMACS_INT -lisp_string_width (Lisp_Object string, int precision, +lisp_string_width (Lisp_Object string, EMACS_INT precision, EMACS_INT *nchars, EMACS_INT *nbytes) { EMACS_INT len = SCHARS (string); @@ -419,7 +420,7 @@ while (i < len) { - int chars, bytes, thiswidth; + EMACS_INT chars, bytes, thiswidth; Lisp_Object val; int cmp_id; EMACS_INT ignore, end; @@ -437,7 +438,11 @@ int c; if (multibyte) - c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes); + { + int cbytes; + c = STRING_CHAR_AND_LENGTH (str + i_byte, cbytes); + bytes = cbytes; + } else c = str[i_byte], bytes = 1; chars = 1; @@ -455,8 +460,14 @@ } } - if (precision > 0 - && (width + thiswidth > precision)) + if (precision <= 0) + { +#ifdef emacs + if (INT_ADD_OVERFLOW (width, thiswidth)) + string_overflow (); +#endif + } + else if (precision - width < thiswidth) { *nchars = i; *nbytes = i_byte; @@ -465,7 +476,7 @@ i += chars; i_byte += bytes; width += thiswidth; - } + } if (precision > 0) { @@ -672,7 +683,7 @@ } -/* Convert unibyte text at STR of NBYTES bytes to a multibyte text +/* Convert unibyte text at STR of BYTES bytes to a multibyte text that contains the same single-byte characters. It actually converts all 8-bit characters to multibyte forms. It is assured that we can use LEN bytes at STR as a work area and that is @@ -823,7 +834,7 @@ { if ((MOST_POSITIVE_FIXNUM - nchars) / 3 < byte8_count || (MOST_POSITIVE_FIXNUM - nbytes) / 2 < byte8_count) - error ("Maximum string size exceeded"); + string_overflow (); /* Convert 2-byte sequence of byte8 chars to 4-byte octal. */ val = make_uninit_multibyte_string (nchars + byte8_count * 3, @@ -832,7 +843,8 @@ else { if ((MOST_POSITIVE_FIXNUM - nchars) / 3 < byte8_count) - error ("Maximum string size exceeded"); + string_overflow (); + /* Convert 1-byte sequence of byte8 chars to 4-byte octal. */ val = make_uninit_string (nbytes + byte8_count * 3); } === modified file 'src/character.h' --- src/character.h 2011-04-11 03:39:45 +0000 +++ src/character.h 2011-05-16 05:08:59 +0000 @@ -612,7 +612,7 @@ extern EMACS_INT strwidth (const char *, EMACS_INT); extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, EMACS_INT *, EMACS_INT *); -extern EMACS_INT lisp_string_width (Lisp_Object, int, +extern EMACS_INT lisp_string_width (Lisp_Object, EMACS_INT, EMACS_INT *, EMACS_INT *); extern Lisp_Object Qcharacterp; === modified file 'src/dispextern.h' --- src/dispextern.h 2011-04-23 03:07:16 +0000 +++ src/dispextern.h 2011-05-13 01:10:46 +0000 @@ -2709,7 +2709,7 @@ { /* The time in seconds at which the image was last displayed. Set in prepare_image_for_display. */ - unsigned long timestamp; + time_t timestamp; /* Pixmaps of the image. */ Pixmap pixmap, mask; === modified file 'src/fns.c' --- src/fns.c 2011-05-12 07:07:06 +0000 +++ src/fns.c 2011-05-15 17:17:44 +0000 @@ -457,10 +457,10 @@ Lisp_Object prev; int some_multibyte; /* When we make a multibyte string, we can't copy text properties - while concatinating each string because the length of resulting - string can't be decided until we finish the whole concatination. + while concatenating each string because the length of resulting + string can't be decided until we finish the whole concatenation. So, we record strings that have text properties to be copied - here, and copy the text properties after the concatination. */ + here, and copy the text properties after the concatenation. */ struct textprop_rec *textprops = NULL; /* Number of elements in textprops. */ int num_textprops = 0; @@ -704,7 +704,7 @@ make_number (0), make_number (SCHARS (this)), Qnil); - /* If successive arguments have properites, be sure that the + /* If successive arguments have properties, be sure that the value of `composition' property be the copy. */ if (last_to_end == textprops[argnum].to) make_composition_value_copy (props); @@ -2076,7 +2076,7 @@ return compare_window_configurations (o1, o2, 0); /* Aside from them, only true vectors, char-tables, compiled - functions, and fonts (font-spec, font-entity, font-ojbect) + functions, and fonts (font-spec, font-entity, font-object) are sensible to compare, so eliminate the others now. */ if (size & PSEUDOVECTOR_FLAG) { @@ -2782,7 +2782,7 @@ `months', returning a 12-element vector of month names (locale items MON_n); `paper', returning a list (WIDTH HEIGHT) for the default paper size, - both measured in milimeters (locale items PAPER_WIDTH, PAPER_HEIGHT). + both measured in millimeters (locale items PAPER_WIDTH, PAPER_HEIGHT). If the system can't provide such information through a call to `nl_langinfo', or if ITEM isn't from the list above, return nil. === modified file 'src/frame.c' --- src/frame.c 2011-04-19 01:15:59 +0000 +++ src/frame.c 2011-05-12 20:23:33 +0000 @@ -1631,7 +1631,7 @@ enum scroll_bar_part party_dummy; Lisp_Object x, y, retval; int col, row; - unsigned long long_dummy; + Time long_dummy; struct gcpro gcpro1; f = SELECTED_FRAME (); @@ -1676,7 +1676,7 @@ Lisp_Object lispy_dummy; enum scroll_bar_part party_dummy; Lisp_Object x, y; - unsigned long long_dummy; + Time long_dummy; f = SELECTED_FRAME (); x = y = Qnil; === modified file 'src/frame.h' --- src/frame.h 2011-05-12 07:07:06 +0000 +++ src/frame.h 2011-05-15 17:17:44 +0000 @@ -192,7 +192,7 @@ struct face_cache *face_cache; /* Number of elements in `menu_bar_vector' that have meaningful data. */ - EMACS_INT menu_bar_items_used; + int menu_bar_items_used; /* A buffer to hold the frame's name. We can't use the Lisp string's pointer (`name', above) because it might get relocated. */ === modified file 'src/image.c' --- src/image.c 2011-05-12 07:07:06 +0000 +++ src/image.c 2011-05-15 17:17:44 +0000 @@ -1523,7 +1523,7 @@ { /* Free cache based on timestamp. */ EMACS_TIME t; - unsigned long old; + time_t old; int delay, nimages = 0; for (i = 0; i < c->used; ++i) === modified file 'src/insdel.c' --- src/insdel.c 2011-04-19 10:48:30 +0000 +++ src/insdel.c 2011-05-16 05:15:51 +0000 @@ -20,6 +20,9 @@ #include #include + +#include + #include "lisp.h" #include "intervals.h" #include "buffer.h" @@ -581,14 +584,19 @@ for (i = 0; i < nbytes; i++) { unsigned int c = *ptr++; + int n; if (ASCII_CHAR_P (c)) - outgoing_nbytes++; + n = 1; else { c = BYTE8_TO_CHAR (c); - outgoing_nbytes += CHAR_BYTES (c); + n = CHAR_BYTES (c); } + + if (INT_ADD_OVERFLOW (outgoing_nbytes, n)) + string_overflow (); + outgoing_nbytes += n; } return outgoing_nbytes; === modified file 'src/keyboard.c' --- src/keyboard.c 2011-05-12 07:07:06 +0000 +++ src/keyboard.c 2011-05-15 17:17:44 +0000 @@ -238,7 +238,7 @@ /* The timestamp of the last input event we received from the X server. X Windows wants this for selection ownership. */ -unsigned long last_event_timestamp; +Time last_event_timestamp; static Lisp_Object Qx_set_selection, Qhandle_switch_frame; Lisp_Object QPRIMARY; @@ -4085,7 +4085,7 @@ Lisp_Object bar_window; enum scroll_bar_part part; Lisp_Object x, y; - unsigned long t; + Time t; *kbp = current_kboard; /* Note that this uses F to determine which terminal to look at. @@ -5088,7 +5088,7 @@ static int last_mouse_button; static int last_mouse_x; static int last_mouse_y; -static unsigned long button_down_time; +static Time button_down_time; /* The number of clicks in this multiple-click. */ @@ -5099,7 +5099,7 @@ static Lisp_Object make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, - unsigned long t) + Time t) { enum window_part part; Lisp_Object posn = Qnil; @@ -5556,9 +5556,9 @@ && (eabs (XINT (event->y) - last_mouse_y) <= fuzz) && button_down_time != 0 && (EQ (Vdouble_click_time, Qt) - || (INTEGERP (Vdouble_click_time) - && ((int)(event->timestamp - button_down_time) - < XINT (Vdouble_click_time))))); + || (NATNUMP (Vdouble_click_time) + && (event->timestamp - button_down_time + < XFASTINT (Vdouble_click_time))))); } last_mouse_button = button; @@ -5742,9 +5742,9 @@ && (eabs (XINT (event->y) - last_mouse_y) <= fuzz) && button_down_time != 0 && (EQ (Vdouble_click_time, Qt) - || (INTEGERP (Vdouble_click_time) - && ((int)(event->timestamp - button_down_time) - < XINT (Vdouble_click_time))))); + || (NATNUMP (Vdouble_click_time) + && (event->timestamp - button_down_time + < XFASTINT (Vdouble_click_time))))); if (is_double) { double_click_count++; @@ -5987,7 +5987,7 @@ static Lisp_Object make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part, - Lisp_Object x, Lisp_Object y, unsigned long t) + Lisp_Object x, Lisp_Object y, Time t) { /* Is it a scroll bar movement? */ if (frame && ! NILP (bar_window)) === modified file 'src/keyboard.h' --- src/keyboard.h 2011-04-14 01:36:53 +0000 +++ src/keyboard.h 2011-05-12 20:23:33 +0000 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -#include "systime.h" /* for EMACS_TIME */ +#include "systime.h" /* for EMACS_TIME, Time */ #include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ /* Lisp fields in struct keyboard are hidden from most code and accessed @@ -459,7 +459,7 @@ /* The timestamp of the last input event we received from the X server. X Windows wants this for selection ownership. */ -extern unsigned long last_event_timestamp; +extern Time last_event_timestamp; extern int quit_char; === modified file 'src/lisp.h' --- src/lisp.h 2011-05-12 07:07:06 +0000 +++ src/lisp.h 2011-05-16 01:11:54 +0000 @@ -470,8 +470,8 @@ #define XHASH(a) ((a).i) #define XTYPE(a) ((enum Lisp_Type) (a).u.type) -#define XINT(a) ((a).s.val) -#define XUINT(a) ((a).u.val) +#define XINT(a) ((EMACS_INT) (a).s.val) +#define XUINT(a) ((EMACS_UINT) (a).u.val) #ifdef USE_LSB_TAG @@ -2710,6 +2710,7 @@ EXFUN (Fvector, MANY); EXFUN (Fmake_symbol, 1); EXFUN (Fmake_marker, 0); +extern void string_overflow (void) NO_RETURN; EXFUN (Fmake_string, 2); extern Lisp_Object build_string (const char *); extern Lisp_Object make_string (const char *, EMACS_INT); === modified file 'src/menu.c' --- src/menu.c 2011-04-29 17:56:27 +0000 +++ src/menu.c 2011-05-12 20:23:33 +0000 @@ -176,6 +176,8 @@ static void grow_menu_items (void) { + if ((INT_MAX - MENU_ITEMS_PANE_LENGTH) / 2 < menu_items_allocated) + memory_full (); menu_items_allocated *= 2; menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); } @@ -1145,13 +1147,13 @@ #else /* not HAVE_X_WINDOWS */ Lisp_Object bar_window; enum scroll_bar_part part; - unsigned long time; + Time time; void (*mouse_position_hook) (struct frame **, int, Lisp_Object *, enum scroll_bar_part *, Lisp_Object *, Lisp_Object *, - unsigned long *) = + Time *) = FRAME_TERMINAL (new_f)->mouse_position_hook; if (mouse_position_hook) === modified file 'src/menu.h' --- src/menu.h 2011-01-25 04:08:28 +0000 +++ src/menu.h 2011-05-12 20:23:33 +0000 @@ -19,6 +19,8 @@ #ifndef MENU_H #define MENU_H +#include "systime.h" /* for Time */ + extern void x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval); @@ -48,6 +50,5 @@ extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int, Lisp_Object, const char **); extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int, - Lisp_Object, const char **, EMACS_UINT); + Lisp_Object, const char **, Time); #endif /* MENU_H */ - === modified file 'src/msdos.c' --- src/msdos.c 2011-04-24 12:48:30 +0000 +++ src/msdos.c 2011-05-14 19:06:08 +0000 @@ -287,7 +287,7 @@ void mouse_get_pos (FRAME_PTR *f, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - unsigned long *time) + Time *time) { int ix, iy; Lisp_Object frame, tail; === modified file 'src/nsterm.m' --- src/nsterm.m 2011-04-03 08:30:57 +0000 +++ src/nsterm.m 2011-05-14 09:03:53 +0000 @@ -158,7 +158,7 @@ /* display update */ NSPoint last_mouse_motion_position; static NSRect last_mouse_glyph; -static unsigned long last_mouse_movement_time = 0; +static Time last_mouse_movement_time = 0; static Lisp_Object last_mouse_motion_frame; static EmacsScroller *last_mouse_scroll_bar = nil; static struct frame *ns_updating_frame; @@ -1789,7 +1789,7 @@ static void ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - unsigned long *time) + Time *time) /* -------------------------------------------------------------------------- External (hook): inform emacs about mouse position and hit parts. If a scrollbar is being dragged, set bar_window, part, x, y, time. @@ -6531,5 +6531,3 @@ /* Tell emacs about this window system. */ Fprovide (intern ("ns"), Qnil); } - - === modified file 'src/systime.h' --- src/systime.h 2011-03-11 20:24:09 +0000 +++ src/systime.h 2011-05-12 20:23:33 +0000 @@ -30,6 +30,12 @@ #endif #endif +#ifdef HAVE_X_WINDOWS +# include +#else +typedef unsigned long Time; +#endif + #ifdef HAVE_TZNAME #ifndef tzname /* For SGI. */ extern char *tzname[]; /* RS6000 and others want it this way. */ === modified file 'src/term.c' --- src/term.c 2011-05-18 00:26:48 +0000 +++ src/term.c 2011-05-18 00:39:40 +0000 @@ -2699,9 +2699,10 @@ static void term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, - Lisp_Object *y, unsigned long *timeptr) + Lisp_Object *y, Time *timeptr) { struct timeval now; + Time sec, usec; *fp = SELECTED_FRAME (); (*fp)->mouse_moved = 0; @@ -2712,7 +2713,9 @@ XSETINT (*x, last_mouse_x); XSETINT (*y, last_mouse_y); gettimeofday(&now, 0); - *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000); + sec = now.tv_sec; + usec = now.tv_usec; + *timeptr = (sec * 1000) + (usec / 1000); } /* Prepare a mouse-event in *RESULT for placement in the input queue. === modified file 'src/termhooks.h' --- src/termhooks.h 2011-05-12 07:07:06 +0000 +++ src/termhooks.h 2011-05-15 17:17:44 +0000 @@ -20,6 +20,8 @@ /* Miscellanea. */ +#include "systime.h" /* for Time */ + struct glyph; struct frame; @@ -233,7 +235,7 @@ int modifiers; /* See enum below for interpretation. */ Lisp_Object x, y; - unsigned long timestamp; + Time timestamp; /* This is padding just to put the frame_or_window field past the size of struct selection_input_event. */ @@ -463,7 +465,7 @@ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - unsigned long *); + Time *); /* The window system handling code should set this if the mouse has moved since the last call to the mouse_position_hook. Calling that === modified file 'src/w32gui.h' --- src/w32gui.h 2011-01-25 04:08:28 +0000 +++ src/w32gui.h 2011-05-14 09:03:53 +0000 @@ -20,6 +20,8 @@ #define EMACS_W32GUI_H #include +#include "systime.h" /* for Time */ + /* Local memory management for menus. */ #define local_heap (GetProcessHeap ()) #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) @@ -47,7 +49,6 @@ typedef XGCValues * GC; typedef COLORREF Color; -typedef DWORD Time; typedef HWND Window; typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */ typedef HCURSOR Cursor; @@ -147,4 +148,3 @@ #endif /* EMACS_W32GUI_H */ - === modified file 'src/w32inevt.c' --- src/w32inevt.c 2011-03-25 15:39:59 +0000 +++ src/w32inevt.c 2011-05-14 19:06:08 +0000 @@ -45,7 +45,7 @@ /* Info for last mouse motion */ static COORD movement_pos; -static DWORD movement_time; +static Time movement_time; /* from w32fns.c */ extern unsigned int map_keypad_keys (unsigned int, unsigned int); @@ -544,7 +544,7 @@ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - unsigned long *time) + Time *time) { BLOCK_INPUT; @@ -756,4 +756,3 @@ UNBLOCK_INPUT; return ret; } - === modified file 'src/w32menu.c' --- src/w32menu.c 2011-05-12 07:07:06 +0000 +++ src/w32menu.c 2011-05-16 05:17:23 +0000 @@ -146,7 +146,7 @@ FRAME_PTR new_f = SELECTED_FRAME (); Lisp_Object bar_window; enum scroll_bar_part part; - unsigned long time; + Time time; Lisp_Object x, y; (*mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time); === modified file 'src/window.c' --- src/window.c 2011-05-12 07:07:06 +0000 +++ src/window.c 2011-05-15 17:17:44 +0000 @@ -3094,11 +3094,14 @@ Lisp_Object last_child; int child_size; - for (child = *forward; !NILP (child); child = c->next) + child = *forward; + do { c = XWINDOW (child); last_child = child; + child = c->next; } + while (!NILP (child)); child_size = WINDOW_TOTAL_SIZE (c, width_p); size_window (last_child, size - old_size + child_size, === modified file 'src/xmenu.c' --- src/xmenu.c 2011-05-12 07:07:06 +0000 +++ src/xmenu.c 2011-05-15 17:17:44 +0000 @@ -240,7 +240,7 @@ FRAME_PTR new_f = SELECTED_FRAME (); Lisp_Object bar_window; enum scroll_bar_part part; - unsigned long time; + Time time; Lisp_Object x, y; (*mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time); @@ -922,7 +922,7 @@ #endif Lisp_Object items; widget_value *wv, *first_wv, *prev_wv = 0; - EMACS_UINT i, last_i = 0; + int i; int *submenu_start, *submenu_end; int *submenu_top_level_items, *submenu_n_panes; @@ -966,7 +966,7 @@ Lisp_Object *previous_items = (Lisp_Object *) alloca (previous_menu_items_used * sizeof (Lisp_Object)); - EMACS_UINT subitems; + int subitems; /* If we are making a new widget, its contents are empty, do always reinitialize them. */ @@ -1012,7 +1012,7 @@ menu_items = f->menu_bar_vector; menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; subitems = ASIZE (items) / 4; - submenu_start = (int *) alloca (subitems * sizeof (int)); + submenu_start = (int *) alloca ((subitems + 1) * sizeof (int)); submenu_end = (int *) alloca (subitems * sizeof (int)); submenu_n_panes = (int *) alloca (subitems * sizeof (int)); submenu_top_level_items = (int *) alloca (subitems * sizeof (int)); @@ -1021,8 +1021,6 @@ { Lisp_Object key, string, maps; - last_i = i; - key = XVECTOR (items)->contents[4 * i]; string = XVECTOR (items)->contents[4 * i + 1]; maps = XVECTOR (items)->contents[4 * i + 2]; @@ -1039,6 +1037,7 @@ submenu_end[i] = menu_items_used; } + submenu_start[i] = -1; finish_menu_items (); /* Convert menu_items into widget_value trees @@ -1052,7 +1051,7 @@ wv->help = Qnil; first_wv = wv; - for (i = 0; i < last_i; i++) + for (i = 0; 0 <= submenu_start[i]; i++) { menu_items_n_panes = submenu_n_panes[i]; wv = digest_single_submenu (submenu_start[i], submenu_end[i], @@ -1421,7 +1420,8 @@ menu pops down. menu_item_selection will be set to the selection. */ static void -create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, int for_click, EMACS_UINT timestamp) +create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, + int for_click, Time timestamp) { int i; GtkWidget *menu; @@ -1465,7 +1465,7 @@ gtk_widget_show_all (menu); gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, - timestamp > 0 ? timestamp : gtk_get_current_event_time()); + timestamp ? timestamp : gtk_get_current_event_time ()); record_unwind_protect (pop_down_menu, make_save_value (menu, 0)); @@ -1525,7 +1525,7 @@ menu_item_selection will be set to the selection. */ static void create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, - int x, int y, int for_click, EMACS_UINT timestamp) + int x, int y, int for_click, Time timestamp) { int i; Arg av[2]; @@ -1599,7 +1599,7 @@ Lisp_Object xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, - Lisp_Object title, const char **error_name, EMACS_UINT timestamp) + Lisp_Object title, const char **error_name, Time timestamp) { int i; widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; @@ -2242,7 +2242,7 @@ Lisp_Object xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, - Lisp_Object title, const char **error_name, EMACS_UINT timestamp) + Lisp_Object title, const char **error_name, Time timestamp) { Window root; XMenu *menu; === modified file 'src/xselect.c' --- src/xselect.c 2011-05-12 07:07:06 +0000 +++ src/xselect.c 2011-05-15 17:17:44 +0000 @@ -121,10 +121,6 @@ #define SELECTION_QUANTUM(dpy) ((XMaxRequestSize(dpy) << 2) - 100) -/* The timestamp of the last input event Emacs received from the X server. */ -/* Defined in keyboard.c. */ -extern unsigned long last_event_timestamp; - /* This is an association list whose elements are of the form ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME) SELECTION-NAME is a lisp symbol, whose name is the name of an X Atom. @@ -356,7 +352,7 @@ Lisp_Object selection_data; Lisp_Object prev_value; - selection_time = long_to_cons ((unsigned long) timestamp); + selection_time = long_to_cons (timestamp); selection_data = list4 (selection_name, selection_value, selection_time, selected_frame); prev_value = assq_no_quit (selection_name, Vselection_alist); === modified file 'src/xterm.c' --- src/xterm.c 2011-05-12 07:07:06 +0000 +++ src/xterm.c 2011-05-15 17:17:44 +0000 @@ -342,7 +342,7 @@ static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, enum scroll_bar_part *, Lisp_Object *, Lisp_Object *, - unsigned long *); + Time *); static void x_handle_net_wm_state (struct frame *, XPropertyEvent *); static void x_check_fullscreen (struct frame *); static void x_check_expected_move (struct frame *, int, int); @@ -3637,23 +3637,23 @@ /* Convert between the modifier bits X uses and the modifier bits Emacs uses. */ -unsigned int -x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, unsigned int state) +EMACS_INT +x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, int state) { - EMACS_UINT mod_meta = meta_modifier; - EMACS_UINT mod_alt = alt_modifier; - EMACS_UINT mod_hyper = hyper_modifier; - EMACS_UINT mod_super = super_modifier; + EMACS_INT mod_meta = meta_modifier; + EMACS_INT mod_alt = alt_modifier; + EMACS_INT mod_hyper = hyper_modifier; + EMACS_INT mod_super = super_modifier; Lisp_Object tem; tem = Fget (Vx_alt_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_alt = XUINT (tem); + if (INTEGERP (tem)) mod_alt = XINT (tem); tem = Fget (Vx_meta_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_meta = XUINT (tem); + if (INTEGERP (tem)) mod_meta = XINT (tem); tem = Fget (Vx_hyper_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem); + if (INTEGERP (tem)) mod_hyper = XINT (tem); tem = Fget (Vx_super_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_super = XUINT (tem); + if (INTEGERP (tem)) mod_super = XINT (tem); return ( ((state & (ShiftMask | dpyinfo->shift_lock_mask)) ? shift_modifier : 0) @@ -3664,24 +3664,24 @@ | ((state & dpyinfo->hyper_mod_mask) ? mod_hyper : 0)); } -static unsigned int -x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, unsigned int state) +static int +x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, EMACS_INT state) { - EMACS_UINT mod_meta = meta_modifier; - EMACS_UINT mod_alt = alt_modifier; - EMACS_UINT mod_hyper = hyper_modifier; - EMACS_UINT mod_super = super_modifier; + int mod_meta = meta_modifier; + int mod_alt = alt_modifier; + int mod_hyper = hyper_modifier; + int mod_super = super_modifier; Lisp_Object tem; tem = Fget (Vx_alt_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_alt = XUINT (tem); + if (INTEGERP (tem)) mod_alt = XINT (tem); tem = Fget (Vx_meta_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_meta = XUINT (tem); + if (INTEGERP (tem)) mod_meta = XINT (tem); tem = Fget (Vx_hyper_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_hyper = XUINT (tem); + if (INTEGERP (tem)) mod_hyper = XINT (tem); tem = Fget (Vx_super_keysym, Qmodifier_value); - if (! EQ (tem, Qnil)) mod_super = XUINT (tem); + if (INTEGERP (tem)) mod_super = XINT (tem); return ( ((state & mod_alt) ? dpyinfo->alt_mod_mask : 0) @@ -3827,7 +3827,7 @@ static void XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - long unsigned int *timestamp) + Time *timestamp) { FRAME_PTR f1; @@ -5562,7 +5562,7 @@ static void x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, - Lisp_Object *y, long unsigned int *timestamp) + Lisp_Object *y, Time *timestamp) { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); Window w = bar->x_window; === modified file 'src/xterm.h' --- src/xterm.h 2011-04-16 16:44:58 +0000 +++ src/xterm.h 2011-05-11 23:16:52 +0000 @@ -989,8 +989,7 @@ #ifdef USE_X_TOOLKIT extern int x_dispatch_event (XEvent *, Display *); #endif -extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *, - unsigned); +extern EMACS_INT x_x_to_emacs_modifiers (struct x_display_info *, int); extern int x_display_pixel_height (struct x_display_info *); extern int x_display_pixel_width (struct x_display_info *); ------------------------------------------------------------ revno: 104264 [merge] committer: Paul Eggert branch nick: trunk timestamp: Tue 2011-05-17 17:35:01 -0700 message: Merge from gnulib. diff: === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2011-04-06 05:07:27 +0000 +++ doc/misc/texinfo.tex 2011-05-18 00:32:16 +0000 @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2011-03-25.11} +\def\texinfoversion{2011-05-11.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -8424,7 +8424,7 @@ % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdef^^a0{~} + \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} @@ -8546,7 +8546,7 @@ % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% - \gdef^^a0{~} + \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} @@ -9395,6 +9395,8 @@ \message{and turning on texinfo input format.} +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-05-04 07:19:21 +0000 +++ lib/gnulib.mk 2011-05-18 00:32:16 +0000 @@ -167,7 +167,8 @@ ## begin gnulib module ignore-value -libgnu_a_SOURCES += ignore-value.h + +EXTRA_DIST += ignore-value.h ## end gnulib module ignore-value @@ -779,6 +780,7 @@ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ + -e 's|@''GNULIB_GROUP_MEMBER''@|$(GNULIB_GROUP_MEMBER)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \ @@ -817,6 +819,7 @@ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ @@ -883,9 +886,10 @@ ## begin gnulib module verify if gl_GNULIB_ENABLED_verify -libgnu_a_SOURCES += verify.h endif +EXTRA_DIST += verify.h + ## end gnulib module verify ## begin gnulib module warn-on-use === modified file 'lib/intprops.h' --- lib/intprops.h 2011-01-30 19:22:02 +0000 +++ lib/intprops.h 2011-05-18 00:32:16 +0000 @@ -17,70 +17,298 @@ /* Written by Paul Eggert. */ -#ifndef GL_INTPROPS_H -# define GL_INTPROPS_H - -# include +#ifndef _GL_INTPROPS_H +#define _GL_INTPROPS_H + +#include + +/* Return a integer value, converted to the same type as the integer + expression E after integer type promotion. V is the unconverted value. + E should not have side effects. */ +#define _GL_INT_CONVERT(e, v) ((e) - (e) + (v)) /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if the arithmetic type T is an integer type. bool counts as an integer. */ -# define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ -# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) -# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) -# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) + +/* True if the signed integer expression E uses two's complement. */ +#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1) /* True if the arithmetic type T is signed. */ -# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) - -/* The maximum and minimum values for the integer type T. These +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Return 1 if the integer expression E, after integer promotion, has + a signed type. E should not have side effects. */ +#define _GL_INT_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0) + + +/* Minimum and maximum values for integer types and expressions. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ -# define TYPE_MINIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) 0 \ - : TYPE_SIGNED_MAGNITUDE (t) \ - ? ~ (t) 0 \ + +/* The maximum and minimum values for the integer type T. */ +#define TYPE_MINIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) 0 \ + : TYPE_SIGNED_MAGNITUDE (t) \ + ? ~ (t) 0 \ : ~ TYPE_MAXIMUM (t))) -# define TYPE_MAXIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) -1 \ +#define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) -/* Return zero if T can be determined to be an unsigned type. - Otherwise, return 1. - When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a - tighter bound. Otherwise, it overestimates the true bound by one byte - when applied to unsigned types of size 2, 4, 16, ... bytes. - The symbol signed_type_or_expr__ is private to this header file. */ -# if __GNUC__ >= 2 -# define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t)) -# else -# define signed_type_or_expr__(t) 1 -# endif +/* The maximum and minimum values for the type of the expression E, + after integer promotion. E should not have side effects. */ +#define _GL_INT_MINIMUM(e) \ + (_GL_INT_SIGNED (e) \ + ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_CONVERT (e, 0)) +#define _GL_INT_MAXIMUM(e) \ + (_GL_INT_SIGNED (e) \ + ? _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_CONVERT (e, -1)) +#define _GL_SIGNED_INT_MAXIMUM(e) \ + (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) + + +/* Return 1 if the __typeof__ keyword works. This could be done by + 'configure', but for now it's easier to do it by hand. */ +#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C +# define _GL_HAVE___TYPEOF__ 1 +#else +# define _GL_HAVE___TYPEOF__ 0 +#endif + +/* Return 1 if the integer type or expression T might be signed. Return 0 + if it is definitely unsigned. This macro does not evaluate its argument, + and expands to an integer constant expression. */ +#if _GL_HAVE___TYPEOF__ +# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) +#else +# define _GL_SIGNED_TYPE_OR_EXPR(t) 1 +#endif /* Bound on length of the string representing an unsigned integer value representable in B bits. log10 (2.0) < 146/485. The smallest value of B where this bound is not tight is 2621. */ -# define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) +#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) /* Bound on length of the string representing an integer type or expression T. Subtract 1 for the sign bit if T is signed, and then add 1 more for - a minus sign if needed. */ -# define INT_STRLEN_BOUND(t) \ - (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) \ - + signed_type_or_expr__ (t)) + a minus sign if needed. + + Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is + signed, this macro may overestimate the true bound by one byte when + applied to unsigned types of size 2, 4, 16, ... bytes. */ +#define INT_STRLEN_BOUND(t) \ + (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ + - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + + _GL_SIGNED_TYPE_OR_EXPR (t)) /* Bound on buffer size needed to represent an integer type or expression T, including the terminating null. */ -# define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) - -#endif /* GL_INTPROPS_H */ +#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) + + +/* Range overflow checks. + + The INT__RANGE_OVERFLOW macros return 1 if the corresponding C + operators might not yield numerically correct answers due to + arithmetic overflow. They do not rely on undefined or + implementation-defined behavior. Their implementations are simple + and straightforward, but they are a bit harder to use than the + INT__OVERFLOW macros described below. + + Example usage: + + long int i = ...; + long int j = ...; + if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX)) + printf ("multiply would overflow"); + else + printf ("product is %ld", i * j); + + Restrictions on *_RANGE_OVERFLOW macros: + + These macros do not check for all possible numerical problems or + undefined or unspecified behavior: they do not check for division + by zero, for bad shift counts, or for shifting negative numbers. + + These macros may evaluate their arguments zero or multiple times, + so the arguments should not have side effects. The arithmetic + arguments (including the MIN and MAX arguments) must be of the same + integer type after the usual arithmetic conversions, and the type + must have minimum value MIN and maximum MAX. Unsigned types should + use a zero MIN of the proper type. + + These macros are tuned for constant MIN and MAX. For commutative + operations such as A + B, they are also tuned for constant B. */ + +/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? (a) < (min) - (b) \ + : (max) - (b) < (a)) + +/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? (max) + (b) < (a) \ + : (a) < (min) + (b)) + +/* Return 1 if - A would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \ + ((min) < 0 \ + ? (a) < - (max) \ + : 0 < (a)) + +/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. */ +#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ + ((b) < 0 \ + ? ((a) < 0 \ + ? (a) < (max) / (b) \ + : (b) < -1 && (min) / (b) < (a)) \ + : (0 < (b) \ + && ((a) < 0 \ + ? (a) < (min) / (b) \ + : (max) / (b) < (a)))) + +/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Do not check for division by zero. */ +#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \ + ((min) < 0 && (b) == -1 && (a) < - (max)) + +/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Do not check for division by zero. + Mathematically, % should never overflow, but on x86-like hosts + INT_MIN % -1 traps, and the C standard permits this, so treat this + as an overflow too. */ +#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \ + INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max) + +/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic. + See above for restrictions. Here, MIN and MAX are for A only, and B need + not be of the same type as the other arguments. The C standard says that + behavior is undefined for shifts unless 0 <= B < wordwidth, and that when + A is negative then A << B has undefined behavior and A >> B has + implementation-defined behavior, but do not check these other + restrictions. */ +#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \ + ((a) < 0 \ + ? (a) < (min) >> (b) \ + : (max) >> (b) < (a)) + + +/* The _GL*_OVERFLOW macros have the same restrictions as the + *_RANGE_OVERFLOW macros, except that they do not assume that operands + (e.g., A and B) have the same type as MIN and MAX. Instead, they assume + that the result (e.g., A + B) has that type. */ +#define _GL_ADD_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? (b) <= (a) + (b) \ + : (b) < 0 ? (a) <= (a) + (b) \ + : (a) + (b) < (b)) +#define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \ + : (a) < 0 ? 1 \ + : (b) < 0 ? (a) - (b) <= (a) \ + : (a) < (b)) +#define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ + || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) +#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + : (a) < 0 ? (b) <= (a) + (b) - 1 \ + : (b) < 0 && (a) + (b) <= (a)) +#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \ + : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max)) + +/* Return a nonzero value if A is a mathematical multiple of B, where + A is unsigned, B is negative, and MAX is the maximum value of A's + type. A's type must be the same as (A % B)'s type. Normally (A % + -B == 0) suffices, but things get tricky if -B would overflow. */ +#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \ + (((b) < -_GL_SIGNED_INT_MAXIMUM (b) \ + ? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \ + ? (a) \ + : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \ + : (a) % - (b)) \ + == 0) + + +/* Integer overflow checks. + + The INT__OVERFLOW macros return 1 if the corresponding C operators + might not yield numerically correct answers due to arithmetic overflow. + They work correctly on all known practical hosts, and do not rely + on undefined behavior due to signed arithmetic overflow. + + Example usage: + + long int i = ...; + long int j = ...; + if (INT_MULTIPLY_OVERFLOW (i, j)) + printf ("multiply would overflow"); + else + printf ("product is %ld", i * j); + + These macros do not check for all possible numerical problems or + undefined or unspecified behavior: they do not check for division + by zero, for bad shift counts, or for shifting negative numbers. + + These macros may evaluate their arguments zero or multiple times, so the + arguments should not have side effects. + + These macros are tuned for their last argument being a constant. + + Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B, + A % B, and A << B would overflow, respectively. */ + +#define INT_ADD_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) +#define INT_SUBTRACT_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) +#define INT_NEGATE_OVERFLOW(a) \ + INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#define INT_MULTIPLY_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW) +#define INT_DIVIDE_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW) +#define INT_REMAINDER_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW) +#define INT_LEFT_SHIFT_OVERFLOW(a, b) \ + INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \ + _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) + +/* Return 1 if the expression A B would overflow, + where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test, + assuming MIN and MAX are the minimum and maximum for the result type. + + This macro assumes that A | B is a valid integer if both A and B are, + which is true of all known practical hosts. If this is a problem + for you, please let us know how to fix it for your host. */ +#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ + op_result_overflow (a, b, \ + _GL_INT_MINIMUM ((a) | (b)), \ + _GL_INT_MAXIMUM ((a) | (b))) + +#endif /* _GL_INTPROPS_H */ === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2011-04-18 04:03:18 +0000 +++ lib/unistd.in.h 2011-05-18 00:32:16 +0000 @@ -871,6 +871,22 @@ #endif +#if @GNULIB_GROUP_MEMBER@ +/* Determine whether group id is in calling user's group list. */ +# if !@HAVE_GROUP_MEMBER@ +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +# endif +_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); +_GL_CXXALIASWARN (group_member); +#elif defined GNULIB_POSIXCHECK +# undef group_member +# if HAVE_RAW_DECL_GROUP_MEMBER +_GL_WARN_ON_USE (group_member, "group_member is unportable - " + "use gnulib module group-member for portability"); +# endif +#endif + + #if @GNULIB_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Do not follow symbolic links. === modified file 'm4/inttypes.m4' --- m4/inttypes.m4 2011-04-26 19:29:47 +0000 +++ m4/inttypes.m4 2011-05-18 00:32:16 +0000 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 23 +# inttypes.m4 serial 24 dnl Copyright (C) 2006-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, @@ -13,7 +13,7 @@ gl_INTTYPES_PRI_SCN ]) -AC_DEFUN([gl_INTTYPES_INCOMPLETE], +AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], [ AC_REQUIRE([gl_STDINT_H]) AC_CHECK_HEADERS_ONCE([inttypes.h]) === modified file 'm4/stdint.m4' --- m4/stdint.m4 2011-04-06 07:04:00 +0000 +++ m4/stdint.m4 2011-05-18 00:32:16 +0000 @@ -1,4 +1,4 @@ -# stdint.m4 serial 40 +# stdint.m4 serial 41 dnl Copyright (C) 2001-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, @@ -7,7 +7,7 @@ dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. -AC_DEFUN([gl_STDINT_H], +AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl === modified file 'm4/unistd_h.m4' --- m4/unistd_h.m4 2011-04-18 04:03:18 +0000 +++ m4/unistd_h.m4 2011-05-18 00:32:16 +0000 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 55 +# unistd_h.m4 serial 56 dnl Copyright (C) 2006-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, @@ -36,8 +36,8 @@ ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell - endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink - readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat + endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep]) ]) @@ -72,6 +72,7 @@ GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) @@ -110,6 +111,7 @@ HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) ------------------------------------------------------------ revno: 104263 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8687 author: Courtney Bane committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-17 21:26:48 -0300 message: * src/term.c (Fresume_tty): Restore hooks before reinitializing. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-12 16:30:17 +0000 +++ src/ChangeLog 2011-05-18 00:26:48 +0000 @@ -1,3 +1,7 @@ +2011-05-18 Courtney Bane (tiny change) + + * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687). + 2011-05-12 Drew Adams * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655). @@ -8,8 +12,8 @@ `width' to `bar_area_x' and `bar_area_width', respectively. (x_scroll_run): Take account of fringe background extension. - * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename - local vars `left' and `width' to `bar_area_x' and + * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: + Rename local vars `left' and `width' to `bar_area_x' and `bar_area_width', respectively. (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe background extension. @@ -126,8 +130,8 @@ * dbusbind.c: Do not use XPNTR on a value that may be an integer. Reported by Stefan Monnier in . - (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use - SYMBOLP-guarded XSYMBOL, not XPNTR. + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): + Use SYMBOLP-guarded XSYMBOL, not XPNTR. * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t. (EMACS_UINTPTR): Likewise, with uintptr_t. @@ -313,8 +317,8 @@ * callproc.c: Indentation fixup. * sysdep.c (wait_for_termination_1): Make static. - (wait_for_termination, interruptible_wait_for_termination): Move - after wait_for_termination_1. + (wait_for_termination, interruptible_wait_for_termination): + Move after wait_for_termination_1. 2011-05-01 Lars Magne Ingebrigtsen @@ -430,8 +434,8 @@ (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0. * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546) - GCC 4.6.0 optimizes based on type-based alias analysis. For - example, if b is of type struct buffer * and v of type struct + GCC 4.6.0 optimizes based on type-based alias analysis. + For example, if b is of type struct buffer * and v of type struct Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size != &v->size, and therefore "v->size = 1; b->size = 2; return v->size;" must therefore return 1. This assumption is incorrect @@ -451,8 +455,8 @@ (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR. (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE, since Lisp_Subr is a special case (no "next" field). - (ASIZE): Now uses header.size rather than size. All - previous uses of XVECTOR (foo)->size replaced to use this macro, + (ASIZE): Now uses header.size rather than size. + All previous uses of XVECTOR (foo)->size replaced to use this macro, to avoid the hassle of writing XVECTOR (foo)->header.size. (struct vectorlike_header): New type. (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the @@ -501,7 +505,7 @@ Break out the floating-point parsing into a new function string_to_number, so that Fstring_to_number parses floating point numbers consistently with the Lisp reader. - (digit_to_number): Moved here from data.c. Make it static inline. + (digit_to_number): Move here from data.c. Make it static inline. (E_CHAR, EXP_INT): Remove, replacing with ... (E_EXP): New macro, to solve the "1.0e+" problem mentioned below. (string_to_number): New function, replacing isfloat_string. @@ -738,8 +742,8 @@ Fix doprnt so it could be used again safely in `verror'. (Bug#8435) * doprnt.c: Include limits.h. (SIZE_MAX): New macro. - (doprnt): Return a size_t value. 2nd arg is now size_t. Many - local variables are now size_t instead of int or unsigned. + (doprnt): Return a size_t value. 2nd arg is now size_t. + Many local variables are now size_t instead of int or unsigned. Improve overflow protection. Support `l' modifier for integer conversions. Support %l conversion. Don't assume an EMACS_INT argument for integer conversions and for %c. @@ -940,8 +944,8 @@ * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT. - * textprop.c (verify_interval_modification, interval_of): Declare - arguments EMACS_INT. + * textprop.c (verify_interval_modification, interval_of): + Declare arguments EMACS_INT. * intervals.c (adjust_intervals_for_insertion): Declare arguments EMACS_INT. @@ -1192,8 +1196,8 @@ (free_realized_fontset) #if-0 the body, which does nothing. (face_suitable_for_char_p): #if-0, as it's never called. * fontset.h (face_suitable_for_char_p): Remove decl. - * xfaces.c (face_at_string_position): Use - FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P, + * xfaces.c (face_at_string_position): + Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P, since 0 is always ASCII. * fns.c (weak_hash_tables): Now static. @@ -1302,8 +1306,8 @@ (last_point_position_window): Remove decls. * keyboard.c: Make these variables static. - * coding.h (coding, code_convert_region, encode_coding_gap): Remove - decls. + * coding.h (coding, code_convert_region, encode_coding_gap): + Remove decls. * coding.c (Vsjis_coding_system, Vbig5_coding_system): (iso_code_class, detect_coding, code_convert_region): Now static. (encode_coding_gap): Remove; unused. @@ -1334,7 +1338,7 @@ exported only to the debugger. * atimer.c (alarm_signal_handler, run_all_atimers): Now static. - * atimer.h (run_all_atimers): Removed; not exported. + * atimer.h (run_all_atimers): Remove; not exported. font.c: Make copy_font_spec and merge_font_spec ordinary C functions. * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it @@ -1589,8 +1593,8 @@ 2011-04-09 Chong Yidong - * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use - unsigned char, to match FcChar8 type definition. + * ftfont.c (get_adstyle_property, ftfont_pattern_entity): + Use unsigned char, to match FcChar8 type definition. * xterm.c (handle_one_xevent): * xmenu.c (create_and_show_popup_menu): @@ -1663,8 +1667,8 @@ 2011-04-06 Chong Yidong - * process.c (Flist_processes): Removed to Lisp. - (list_processes_1): Deleted. + * process.c (Flist_processes): Remove to Lisp. + (list_processes_1): Delete. 2011-04-06 Eli Zaretskii @@ -1922,8 +1926,8 @@ * callint.c (Fcall_interactively): Preserve lexical-binding mode for interactive spec. - * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New - byte-codes. + * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): + New byte-codes. (exec_byte_code): New function extracted from Fbyte_code to handle new calling convention for byte-code-functions. Add new byte-codes. @@ -1938,8 +1942,8 @@ 2011-03-31 Eli Zaretskii * xdisp.c (SCROLL_LIMIT): New macro. - (try_scrolling): Use it when setting scroll_limit. Limit - scrolling to 100 screen lines. + (try_scrolling): Use it when setting scroll_limit. + Limit scrolling to 100 screen lines. (redisplay_window): Even when falling back on "recentering", position point in the window according to scroll-conservatively, scroll-margin, and scroll-*-aggressively variables. (Bug#6671) === modified file 'src/term.c' --- src/term.c 2011-05-04 07:20:46 +0000 +++ src/term.c 2011-05-18 00:26:48 +0000 @@ -2595,6 +2595,7 @@ FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); } + set_tty_hooks (t); init_sys_modes (t->display_info.tty); { ------------------------------------------------------------ revno: 104262 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2011-05-17 21:17:45 +0300 message: nt/README.W32: Add information about GnuTLS libraries. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-05-09 13:35:56 +0000 +++ nt/ChangeLog 2011-05-17 18:17:45 +0000 @@ -1,3 +1,7 @@ +2011-05-17 Eli Zaretskii + + * README.W32: Add information about GnuTLS libraries. + 2011-05-09 Eli Zaretskii * config.nt [_MSC_VER] (va_copy): Replacement for the MS compiler. === modified file 'nt/README.W32' --- nt/README.W32 2011-01-25 04:08:28 +0000 +++ nt/README.W32 2011-05-17 18:17:45 +0000 @@ -147,6 +147,15 @@ unreliable under Windows. See nt/INSTALL in the src distribution if you wish to compile Emacs with SVG support. +* GnuTLS support + + In order to support GnuTLS at runtime, Emacs must be able to find + the relevant DLLs during startup; failure to do so is not an error, + but GnuTLS won't be available to the running session. + + You can get pre-built binaries (including any required DLL and the + gnutls.h file) and an installer at http://josefsson.org/gnutls4win/. + * Uninstalling Emacs If you should need to uninstall Emacs, simply delete all the files ------------------------------------------------------------ revno: 104261 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8684 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-17 15:14:30 -0300 message: * lisp/progmodes/grep.el (grep-mode): Disable default compilation-directory-matcher setting. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-17 12:47:55 +0000 +++ lisp/ChangeLog 2011-05-17 18:14:30 +0000 @@ -1,3 +1,8 @@ +2011-05-17 Stefan Monnier + + * progmodes/grep.el (grep-mode): Disable default + compilation-directory-matcher setting (bug#8684). + 2011-05-17 Michael Albinus * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2011-05-12 15:10:17 +0000 +++ lisp/progmodes/grep.el 2011-05-17 18:14:30 +0000 @@ -698,6 +698,7 @@ grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist) grep-regexp-alist) + (set (make-local-variable 'compilation-directory-matcher) nil) (set (make-local-variable 'compilation-process-setup-function) 'grep-process-setup) (set (make-local-variable 'compilation-disable-input) t) ------------------------------------------------------------ revno: 104260 committer: Michael Albinus branch nick: trunk timestamp: Tue 2011-05-17 14:47:55 +0200 message: * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" instead of "head" and "tail". There were problems with SunOS 5.9, and it performs better. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-17 02:40:34 +0000 +++ lisp/ChangeLog 2011-05-17 12:47:55 +0000 @@ -1,3 +1,9 @@ +2011-05-17 Michael Albinus + + * net/tramp.el (tramp-handle-insert-file-contents): Use "dd" + instead of "head" and "tail". There were problems with SunOS 5.9, + and it performs better. + 2011-05-17 Glenn Morris * mail/mail-utils.el (mail-dont-reply-to): Silence compiler. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2011-05-05 04:00:38 +0000 +++ lisp/net/tramp.el 2011-05-17 12:47:55 +0000 @@ -2838,16 +2838,16 @@ v (cond ((and beg end) - (format "tail -c +%d %s | head -c +%d >%s" - (1+ beg) (tramp-shell-quote-argument localname) + (format "dd bs=1 skip=%d if=%s count=%d of=%s" + beg (tramp-shell-quote-argument localname) (- end beg) remote-copy)) (beg - (format "tail -c +%d %s >%s" - (1+ beg) (tramp-shell-quote-argument localname) + (format "dd bs=1 skip=%d if=%s of=%s" + beg (tramp-shell-quote-argument localname) remote-copy)) (end - (format "head -c +%d %s >%s" - (1+ end) (tramp-shell-quote-argument localname) + (format "dd bs=1 count=%d if=%s of=%s" + end (tramp-shell-quote-argument localname) remote-copy))))) ;; `insert-file-contents-literally' takes care to avoid ------------------------------------------------------------ revno: 104259 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-16 21:05:39 -0700 message: * lisp/calendar/appt.el: Fix doc typo in previous. diff: === modified file 'lisp/calendar/appt.el' --- lisp/calendar/appt.el 2011-05-17 02:36:51 +0000 +++ lisp/calendar/appt.el 2011-05-17 04:05:39 +0000 @@ -119,7 +119,7 @@ (defcustom appt-display-mode-line t "Non-nil means display minutes to appointment and time on the mode line. This is in addition to any other display of appointment messages. -The mode line updates every minute, indepedent of the value of +The mode line updates every minute, independent of the value of `appt-display-interval'." :type 'boolean :group 'appt) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.