------------------------------------------------------------ revno: 117126 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-05-19 11:54:39 +0400 message: * font.c (font_matching_entity): Extract font-entity object from the vector of matching entities (Bug#17486). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-19 07:49:09 +0000 +++ src/ChangeLog 2014-05-19 07:54:39 +0000 @@ -7,6 +7,9 @@ (syms_of_data): DEFSYM it. * dbusbind.c (xd_signature): Use CHECK_BOOLEAN. + * font.c (font_matching_entity): Extract font-entity object + from the vector of matching entities (Bug#17486). + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === modified file 'src/font.c' --- src/font.c 2014-04-05 19:30:36 +0000 +++ src/font.c 2014-05-19 07:54:39 +0000 @@ -2803,7 +2803,7 @@ ASET (work, FONT_TYPE_INDEX, driver_list->driver->type); entity = assoc_no_quit (work, XCDR (cache)); if (CONSP (entity)) - entity = XCDR (entity); + entity = AREF (XCDR (entity), 0); else { entity = driver_list->driver->match (f, work); ------------------------------------------------------------ revno: 117125 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-05-19 11:49:09 +0400 message: * src/lisp.h (CHECK_BOOLEAN): New function. * src/alloc.c (Fbool_vector): New function. (syms_of_alloc): Defsubr it. * src/data.c (Qbooleanp): New symbol. (syms_of_data): DEFSYM it. * src/dbusbind.c (xd_signature): Use CHECK_BOOLEAN. * doc/lispref/sequences.texi (Bool-vectors): Mention bool-vector. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-05-17 08:11:31 +0000 +++ doc/lispref/ChangeLog 2014-05-19 07:49:09 +0000 @@ -1,3 +1,7 @@ +2014-05-19 Dmitry Antipov + + * sequences.texi (Bool-vectors): Mention bool-vector. + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === modified file 'doc/lispref/sequences.texi' --- doc/lispref/sequences.texi 2014-05-15 14:59:02 +0000 +++ doc/lispref/sequences.texi 2014-05-19 07:49:09 +0000 @@ -811,7 +811,7 @@ and the length cannot be changed once the bool-vector is created. Bool-vectors are constants when evaluated. - There are two special functions for working with bool-vectors; aside + There are three special functions for working with bool-vectors; aside from that, you manipulate them with same functions used for other kinds of arrays. @@ -820,6 +820,32 @@ each one initialized to @var{initial}. @end defun +@defun bool-vector &rest objects +This function creates and returns a bool-vector whose elements are the +arguments, @var{objects}, each of them should be either @code{t} or @code{nil}. +Note that the printed form represents up to 8 boolean values as a single +character: + +@example +@group +(bool-vector t nil t nil) + @result{} #&4"^E" +(bool-vector) + @result{} #&0"" +@end group +@end example + +If you want to print a bool-vector in a way similar to other vectors, +you can use @code{vconcat} function: + +@example +@group +(vconcat (bool-vector nil t nil t)) + @result{} [nil t nil t] +@end group +@end example +@end defun + @defun bool-vector-p object This returns @code{t} if @var{object} is a bool-vector, and @code{nil} otherwise. @@ -873,9 +899,8 @@ Return the number of elements that are @code{t} in bool vector @var{a}. @end defun - Here is an example of creating, examining, and updating a -bool-vector. Note that the printed form represents up to 8 boolean -values as a single character. + Here is another example of creating, examining, and updating a +bool-vector: @example (setq bv (make-bool-vector 5 t)) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-17 08:11:31 +0000 +++ src/ChangeLog 2014-05-19 07:49:09 +0000 @@ -1,3 +1,12 @@ +2014-05-19 Dmitry Antipov + + * lisp.h (CHECK_BOOLEAN): New function. + * alloc.c (Fbool_vector): New function. + (syms_of_alloc): Defsubr it. + * data.c (Qbooleanp): New symbol. + (syms_of_data): DEFSYM it. + * dbusbind.c (xd_signature): Use CHECK_BOOLEAN. + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === modified file 'src/alloc.c' --- src/alloc.c 2014-04-28 16:59:41 +0000 +++ src/alloc.c 2014-05-19 07:49:09 +0000 @@ -2174,6 +2174,25 @@ return bool_vector_fill (val, init); } +DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0, + doc: /* Return a new bool-vector with specified arguments as elements. +Any number of arguments, even zero arguments, are allowed. +Each argument should be either t or nil. +usage: (bool-vector &rest OBJECTS) */) + (ptrdiff_t nargs, Lisp_Object *args) +{ + ptrdiff_t i; + Lisp_Object vector; + + for (i = 0; i < nargs; i++) + CHECK_BOOLEAN (args[i]); + + vector = make_uninit_bool_vector (nargs); + for (i = 0; i < nargs; i++) + bool_vector_set (vector, i, !NILP (args[i])); + + return vector; +} /* Make a string from NBYTES bytes at CONTENTS, and compute the number of characters from the contents. This string may be unibyte or @@ -7102,6 +7121,7 @@ defsubr (&Scons); defsubr (&Slist); defsubr (&Svector); + defsubr (&Sbool_vector); defsubr (&Smake_byte_code); defsubr (&Smake_list); defsubr (&Smake_vector); === modified file 'src/data.c' --- src/data.c 2014-04-28 01:29:44 +0000 +++ src/data.c 2014-05-19 07:49:09 +0000 @@ -54,7 +54,7 @@ Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; Lisp_Object Qtext_read_only; -Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp; +Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp, Qbooleanp; static Lisp_Object Qnatnump; Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; @@ -3442,6 +3442,7 @@ DEFSYM (Qlistp, "listp"); DEFSYM (Qconsp, "consp"); + DEFSYM (Qbooleanp, "booleanp"); DEFSYM (Qsymbolp, "symbolp"); DEFSYM (Qkeywordp, "keywordp"); DEFSYM (Qintegerp, "integerp"); === modified file 'src/dbusbind.c' --- src/dbusbind.c 2014-05-17 08:11:31 +0000 +++ src/dbusbind.c 2014-05-19 07:49:09 +0000 @@ -387,8 +387,7 @@ break; case DBUS_TYPE_BOOLEAN: - if (!EQ (object, Qt) && !EQ (object, Qnil)) - wrong_type_argument (intern ("booleanp"), object); + CHECK_BOOLEAN (object); sprintf (signature, "%c", dtype); break; === modified file 'src/lisp.h' --- src/lisp.h 2014-05-17 08:11:31 +0000 +++ src/lisp.h 2014-05-19 07:49:09 +0000 @@ -796,7 +796,7 @@ /* Defined in data.c. */ extern Lisp_Object Qarrayp, Qbufferp, Qbuffer_or_string_p, Qchar_table_p; extern Lisp_Object Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp, Qnil; -extern Lisp_Object Qnumberp, Qstringp, Qsymbolp, Qt, Qvectorp; +extern Lisp_Object Qnumberp, Qstringp, Qsymbolp, Qt, Qvectorp, Qbooleanp; extern Lisp_Object Qbool_vector_p; extern Lisp_Object Qvector_or_char_table_p, Qwholenump; extern Lisp_Object Qwindow; @@ -2510,6 +2510,11 @@ CHECK_TYPE (CONSP (x), Qconsp, x); } INLINE void +CHECK_BOOLEAN (Lisp_Object x) +{ + CHECK_TYPE (EQ (x, Qt) || EQ (x, Qnil), Qbooleanp, x); +} +INLINE void CHECK_VECTOR (Lisp_Object x) { CHECK_TYPE (VECTORP (x), Qvectorp, x); ------------------------------------------------------------ revno: 117124 committer: Paul Eggert branch nick: trunk timestamp: Sun 2014-05-18 21:56:03 -0700 message: Remove dependencies on getdelim and getline. Also, remove update-game-scores's limits on game scores and simplify its file-locking code. * configure.ac (getdelim, getline): Remove. * lib-src/update-game-score.c (struct score_entry): Unify the username and data members to a single user_data member, since they don't need to be changed independently and getdelim and getline aren't helpful. Make the score member char *, not intmax_t, so that scores are not limited to intmax_t. All uses changed. (lose_syserr): A zero errno stands for invalid data in score file. (normalize_integer): New function. (main): Use it. Check for invalid scores. Omit redundant stat check. (read_score): First arg is now a string, not a FILE *. All uses changed. Do not use getdelim or getline; that's way simpler. (read_scores): Read the whole file, and let read_score handle each line. (score_compare): Compare strings representing integers, not integers. (write_scores) [DOS_NT]: Eliminate unnecessary chmod. (lock_file): Simplify locking code, eliminating goto. Check for unlink failure. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-18 23:02:29 +0000 +++ ChangeLog 2014-05-19 04:56:03 +0000 @@ -1,3 +1,8 @@ +2014-05-19 Paul Eggert + + Remove dependencies on getdelim and getline. + * configure.ac (getdelim, getline): Remove. + 2014-05-18 Glenn Morris * configure.ac: Do not bother testing for png in non-graphical builds. === modified file 'configure.ac' --- configure.ac 2014-05-18 23:02:29 +0000 +++ configure.ac 2014-05-19 04:56:03 +0000 @@ -3466,7 +3466,7 @@ getrlimit setrlimit shutdown getaddrinfo \ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ -gai_strerror getline getdelim sync \ +gai_strerror sync \ getpwent endpwent getgrent endgrent \ cfmakeraw cfsetspeed copysign __executable_start log2) LIBS=$OLD_LIBS === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-05-18 18:57:04 +0000 +++ lib-src/ChangeLog 2014-05-19 04:56:03 +0000 @@ -1,3 +1,25 @@ +2014-05-19 Paul Eggert + + Remove dependencies on getline and getdelim. + Also, remove update-game-scores's limits on game scores and + simplify its file-locking code. + * update-game-score.c (struct score_entry): Unify the username and + data members to a single user_data member, since they don't need to be + changed independently and getdelim and getline aren't helpful. + Make the score member char *, not intmax_t, so that scores are not + limited to intmax_t. All uses changed. + (lose_syserr): A zero errno stands for invalid data in score file. + (normalize_integer): New function. + (main): Use it. Check for invalid scores. Omit redundant stat check. + (read_score): First arg is now a string, not a FILE *. All uses + changed. Do not use getdelim or getline; that's way simpler. + (read_scores): Read the whole file, and let read_score handle each + line. + (score_compare): Compare strings representing integers, not integers. + (write_scores) [DOS_NT]: Eliminate unnecessary chmod. + (lock_file): Simplify locking code, eliminating goto. + Check for unlink failure. + 2014-05-18 Paul Eggert Port ctags+etags build to Sun C 5.12. === modified file 'lib-src/update-game-score.c' --- lib-src/update-game-score.c 2014-04-16 13:27:28 +0000 +++ lib-src/update-game-score.c 2014-05-19 04:56:03 +0000 @@ -76,9 +76,8 @@ struct score_entry { - intmax_t score; - char *username; - char *data; + char *score; + char *user_data; }; #define MAX_SCORES min (PTRDIFF_MAX, SIZE_MAX / sizeof (struct score_entry)) @@ -102,7 +101,8 @@ static _Noreturn void lose_syserr (const char *msg) { - fprintf (stderr, "%s: %s\n", msg, strerror (errno)); + fprintf (stderr, "%s: %s\n", msg, + errno ? strerror (errno) : "Invalid data in score file"); exit (EXIT_FAILURE); } @@ -137,6 +137,38 @@ return user_prefix; } +static char * +normalize_integer (char *num) +{ + bool neg; + char *p; + while (*num != '\n' && isspace (*num)) + num++; + neg = *num == '-'; + num += neg || *num == '-'; + + if (*num == '0') + { + while (*++num == '0') + continue; + neg &= !!*num; + num -= !*num; + } + + for (p = num; '0' <= *p && *p <= '9'; p++) + continue; + + if (*p || p == num) + { + errno = 0; + return 0; + } + + if (neg) + *--num = '-'; + return num; +} + int main (int argc, char **argv) { @@ -144,9 +176,8 @@ bool running_suid; void *lockstate; char *scorefile; - char *nl; + char *end, *nl, *user, *data; const char *prefix, *user_prefix = NULL; - struct stat buf; struct score_entry *scores; struct score_entry newscore; bool reverse = false; @@ -169,8 +200,8 @@ break; case 'm': { - intmax_t m = strtoimax (optarg, 0, 10); - if (m < 0) + intmax_t m = strtoimax (optarg, &end, 10); + if (optarg == end || *end || m < 0) usage (EXIT_FAILURE); max_scores = min (m, MAX_SCORES); } @@ -194,21 +225,26 @@ strcat (scorefile, "/"); strcat (scorefile, argv[optind]); - newscore.score = strtoimax (argv[optind + 1], 0, 10); + newscore.score = normalize_integer (argv[optind + 1]); + if (! newscore.score) + { + fprintf (stderr, "%s: Invalid score\n", argv[optind + 1]); + return EXIT_FAILURE; + } - newscore.data = argv[optind + 2]; - if (strlen (newscore.data) > MAX_DATA_LEN) - newscore.data[MAX_DATA_LEN] = '\0'; - nl = strchr (newscore.data, '\n'); + user = get_user_id (); + if (! user) + lose_syserr ("Couldn't determine user id"); + data = argv[optind + 2]; + if (strlen (data) > MAX_DATA_LEN) + data[MAX_DATA_LEN] = '\0'; + nl = strchr (data, '\n'); if (nl) *nl = '\0'; - - newscore.username = get_user_id (); - if (! newscore.username) - lose_syserr ("Couldn't determine user id"); - - if (stat (scorefile, &buf) < 0) - lose_syserr ("Failed to access scores file"); + newscore.user_data = malloc (strlen (user) + 1 + strlen (data) + 1); + if (! newscore.user_data + || sprintf (newscore.user_data, "%s %s", user, data) < 0) + lose_syserr ("Memory exhausted"); if (lock_file (scorefile, &lockstate) < 0) lose_syserr ("Failed to lock scores file"); @@ -244,137 +280,75 @@ exit (EXIT_SUCCESS); } -static int -read_score (FILE *f, struct score_entry *score) +static char * +read_score (char *p, struct score_entry *score) { - int c; - if ((c = getc (f)) != EOF) - ungetc (c, f); - if (feof (f)) - return 1; - for (score->score = 0; (c = getc (f)) != EOF && isdigit (c); ) - { - if (INTMAX_MAX / 10 < score->score) - return -1; - score->score *= 10; - if (INTMAX_MAX - (c - '0') < score->score) - return -1; - score->score += c - '0'; - } - while ((c = getc (f)) != EOF - && isspace (c)) - ; - if (c == EOF) - return -1; - ungetc (c, f); -#ifdef HAVE_GETDELIM - { - size_t count = 0; - score->username = 0; - if (getdelim (&score->username, &count, ' ', f) < 1 - || score->username == NULL) - return -1; - /* Trim the space */ - score->username[strlen (score->username)-1] = '\0'; - } -#else - { - ptrdiff_t unameread = 0; - ptrdiff_t unamelen = 30; - char *username = malloc (unamelen); - if (!username) - return -1; - - while ((c = getc (f)) != EOF && c != ' ') - { - if (unameread >= unamelen - 1) - { - ptrdiff_t unamelen_max = min (PTRDIFF_MAX, SIZE_MAX); - if (unamelen <= unamelen_max / 2) - unamelen *= 2; - else if (unamelen < unamelen_max) - unamelen = unamelen_max; - else - { - errno = ENOMEM; - return -1; - } - username = realloc (username, unamelen); - if (!username) - return -1; - } - username[unameread] = c; - unameread++; - } - if (c == EOF) - return -1; - username[unameread] = '\0'; - score->username = username; - } -#endif -#ifdef HAVE_GETLINE - score->data = NULL; - errno = 0; - { - size_t len; - if (getline (&score->data, &len, f) < 0) - return -1; - score->data[strlen (score->data)-1] = '\0'; - } -#else - { - ptrdiff_t cur = 0; - ptrdiff_t len = 16; - char *buf = malloc (len); - if (!buf) - return -1; - while ((c = getc (f)) != EOF - && c != '\n') - { - if (cur >= len-1) - { - if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < len) - { - errno = ENOMEM; - return -1; - } - if (!(buf = realloc (buf, len *= 2))) - return -1; - } - buf[cur] = c; - cur++; - } - score->data = buf; - score->data[cur] = '\0'; - } -#endif - return 0; + score->score = p; + p = strchr (p, ' '); + if (!p) + return p; + *p++ = 0; + score->user_data = p; + p = strchr (p, '\n'); + if (!p) + return p; + *p++ = 0; + return p; } static int read_scores (const char *filename, struct score_entry **scores, ptrdiff_t *count, ptrdiff_t *alloc) { - int readval = -1; - ptrdiff_t scorecount = 0; - ptrdiff_t cursize = 0; - struct score_entry *ret = 0; - struct score_entry entry; + char *p, *filedata; + ptrdiff_t filesize, nread; + struct stat st; FILE *f = fopen (filename, "r"); - int retval = -1; if (!f) return -1; - while ((readval = read_score (f, &entry)) == 0) - if (push_score (&ret, &scorecount, &cursize, &entry) < 0) - return -1; - if (readval > 0 && fclose (f) == 0) - { - *count = scorecount; - *alloc = cursize; - *scores = ret; - retval = 0; - } - return retval; + if (fstat (fileno (f), &st) != 0) + return -1; + if (! (0 <= st.st_size && st.st_size < min (PTRDIFF_MAX, SIZE_MAX))) + { + errno = EOVERFLOW; + return -1; + } + filesize = st.st_size; + filedata = malloc (filesize + 1); + if (! filedata) + return -1; + nread = fread (filedata, 1, filesize + 1, f); + if (filesize < nread) + { + errno = 0; + return -1; + } + if (nread < filesize) + filesize = nread; + if (ferror (f) || fclose (f) != 0) + return -1; + filedata[filesize] = 0; + if (strlen (filedata) != filesize) + { + errno = 0; + return -1; + } + + *scores = 0; + *count = *alloc = 0; + for (p = filedata; p < filedata + filesize; ) + { + struct score_entry entry; + p = read_score (p, &entry); + if (!p) + { + errno = 0; + return -1; + } + if (push_score (scores, count, alloc, &entry) < 0) + return -1; + } + return 0; } static int @@ -382,7 +356,25 @@ { const struct score_entry *sa = (const struct score_entry *) a; const struct score_entry *sb = (const struct score_entry *) b; - return (sb->score > sa->score) - (sb->score < sa->score); + char *sca = sa->score; + char *scb = sb->score; + size_t lena, lenb; + bool nega = *sca == '-'; + bool negb = *scb == '-'; + int diff = nega - negb; + if (diff) + return diff; + if (nega) + { + char *tmp = sca; + sca = scb + 1; + scb = tmp + 1; + } + lena = strlen (sca); + lenb = strlen (scb); + if (lena != lenb) + return lenb < lena ? -1 : 1; + return strcmp (scb, sca); } static int @@ -451,18 +443,12 @@ if (! f) return -1; for (i = 0; i < count; i++) - if (fprintf (f, "%"PRIdMAX" %s %s\n", - scores[i].score, scores[i].username, scores[i].data) - < 0) + if (fprintf (f, "%s %s\n", scores[i].score, scores[i].user_data) < 0) return -1; if (fclose (f) != 0) return -1; if (rename (tempfile, filename) != 0) return -1; -#ifdef DOS_NT - if (chmod (filename, 0644) < 0) - return -1; -#endif return 0; } @@ -479,30 +465,27 @@ strcpy (lockpath, filename); strcat (lockpath, lockext); *state = lockpath; - trylock: - attempts++; - /* If the lock is over an hour old, delete it. */ - if (stat (lockpath, &buf) == 0 - && 60 * 60 < time (0) - buf.st_ctime) - unlink (lockpath); - fd = open (lockpath, O_CREAT | O_EXCL, 0600); - if (fd < 0) + + while ((fd = open (lockpath, O_CREAT | O_EXCL, 0600)) < 0) { - if (errno == EEXIST) + if (errno != EEXIST) + return -1; + attempts++; + + /* Break the lock if it is over an hour old, or if we've tried + more than MAX_ATTEMPTS times. We won't corrupt the file, but + we might lose some scores. */ + if (MAX_ATTEMPTS < attempts + || (stat (lockpath, &buf) == 0 && 60 * 60 < time (0) - buf.st_ctime)) { - /* Break the lock; we won't corrupt the file, but we might - lose some scores. */ - if (attempts > MAX_ATTEMPTS) - { - unlink (lockpath); - attempts = 0; - } - sleep ((rand () % 2)+1); - goto trylock; + if (unlink (lockpath) != 0 && errno != ENOENT) + return -1; + attempts = 0; } - else - return -1; + + sleep ((rand () & 1) + 1); } + close (fd); return 0; } ------------------------------------------------------------ revno: 117123 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-05-18 16:02:29 -0700 message: * configure.ac: Do not bother testing for png in non-graphical builds. This seems to have been lost in the changes from the current emacs-24 branch version. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-18 18:57:04 +0000 +++ ChangeLog 2014-05-18 23:02:29 +0000 @@ -1,3 +1,7 @@ +2014-05-18 Glenn Morris + + * configure.ac: Do not bother testing for png in non-graphical builds. + 2014-05-18 Paul Eggert Port ctags+etags build to Sun C 5.12. === modified file 'configure.ac' --- configure.ac 2014-05-18 05:50:17 +0000 +++ configure.ac 2014-05-18 23:02:29 +0000 @@ -3064,7 +3064,7 @@ # mingw32 loads the library dynamically. if test "$opsys" = mingw32; then AC_CHECK_HEADER([png.h], [HAVE_PNG=yes]) - else + elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then AC_MSG_CHECKING([for png]) png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` && png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD` || { ------------------------------------------------------------ revno: 117122 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-05-18 15:57:37 -0700 message: Trivial simplifications due to track-mouse always being defined * lisp/loadup.el: * lisp/play/gametree.el: `track-mouse' is always defined since 2012-11-24. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-14 18:17:05 +0000 +++ lisp/ChangeLog 2014-05-18 22:57:37 +0000 @@ -1,3 +1,8 @@ +2014-05-18 Glenn Morris + + * loadup.el: + * play/gametree.el: `track-mouse' is always defined since 2012-11-24. + 2014-05-14 Sam Steingold * progmodes/python.el (python-shell-get-or-create-process): === modified file 'lisp/loadup.el' --- lisp/loadup.el 2014-02-10 01:34:22 +0000 +++ lisp/loadup.el 2014-05-18 22:57:37 +0000 @@ -198,12 +198,10 @@ (load "font-lock") (load "jit-lock") -(if (fboundp 'track-mouse) - (progn - (load "mouse") - (and (boundp 'x-toolkit-scroll-bars) - (load "scroll-bar")) - (load "select"))) +(load "mouse") +(if (boundp 'x-toolkit-scroll-bars) + (load "scroll-bar")) +(load "select") (load "emacs-lisp/timer") (load "isearch") (load "rfn-eshadow") === modified file 'lisp/play/gametree.el' --- lisp/play/gametree.el 2014-02-03 00:40:49 +0000 +++ lisp/play/gametree.el 2014-05-18 22:57:37 +0000 @@ -590,31 +590,30 @@ (add-hook 'write-contents-hooks 'gametree-save-and-hack-layout)) ;;;; Goodies for mousing users -(and (fboundp 'track-mouse) - (defun gametree-mouse-break-line-here (event) - (interactive "e") - (mouse-set-point event) - (gametree-break-line-here)) - (defun gametree-mouse-show-children-and-entry (event) - (interactive "e") - (mouse-set-point event) - (gametree-show-children-and-entry)) - (defun gametree-mouse-show-subtree (event) - (interactive "e") - (mouse-set-point event) - (show-subtree)) - (defun gametree-mouse-hide-subtree (event) - (interactive "e") - (mouse-set-point event) - (hide-subtree)) - (define-key gametree-mode-map [M-down-mouse-2 M-mouse-2] - 'gametree-mouse-break-line-here) - (define-key gametree-mode-map [S-down-mouse-1 S-mouse-1] - 'gametree-mouse-show-children-and-entry) - (define-key gametree-mode-map [S-down-mouse-2 S-mouse-2] - 'gametree-mouse-show-subtree) - (define-key gametree-mode-map [S-down-mouse-3 S-mouse-3] - 'gametree-mouse-hide-subtree)) +(defun gametree-mouse-break-line-here (event) + (interactive "e") + (mouse-set-point event) + (gametree-break-line-here)) +(defun gametree-mouse-show-children-and-entry (event) + (interactive "e") + (mouse-set-point event) + (gametree-show-children-and-entry)) +(defun gametree-mouse-show-subtree (event) + (interactive "e") + (mouse-set-point event) + (show-subtree)) +(defun gametree-mouse-hide-subtree (event) + (interactive "e") + (mouse-set-point event) + (hide-subtree)) +(define-key gametree-mode-map [M-down-mouse-2 M-mouse-2] + 'gametree-mouse-break-line-here) +(define-key gametree-mode-map [S-down-mouse-1 S-mouse-1] + 'gametree-mouse-show-children-and-entry) +(define-key gametree-mode-map [S-down-mouse-2 S-mouse-2] + 'gametree-mouse-show-subtree) +(define-key gametree-mode-map [S-down-mouse-3 S-mouse-3] + 'gametree-mouse-hide-subtree) (provide 'gametree) ------------------------------------------------------------ revno: 117121 committer: Paul Eggert branch nick: trunk timestamp: Sun 2014-05-18 11:57:04 -0700 message: Port ctags+etags build to Sun C 5.12. * .bzrignore: Remove lib-src/ctags.c. * lib-src/Makefile.in (etags_args): Remove, replacing with ... (etags_cflags, etags_libs): New macros. All uses changed. (ctags${EXEEXT}): Don't compile etags.c, as compiling etags.c in parallel (once for ctags, once for etags) breaks parallel makes with compilers that use the source file name to name temporaries, such as Sun C 5.12. Instead, compile ctags.c. * lib-src/ctags.c: New file. diff: === modified file '.bzrignore' --- .bzrignore 2014-05-02 17:49:17 +0000 +++ .bzrignore 2014-05-18 18:57:04 +0000 @@ -134,7 +134,6 @@ lib/cxxdefs.h lib-src/blessmail lib-src/ctags -lib-src/ctags.c lib-src/ebrowse lib-src/emacsclient lib-src/etags === modified file 'ChangeLog' --- ChangeLog 2014-05-18 05:50:17 +0000 +++ ChangeLog 2014-05-18 18:57:04 +0000 @@ -1,5 +1,8 @@ 2014-05-18 Paul Eggert + Port ctags+etags build to Sun C 5.12. + * .bzrignore: Remove lib-src/ctags.c. + Port recent libpng changes to hosts with missing png.h. * configure.ac (HAVE_PNG): Port to platforms where libpng-config succeeds but png.h is absent, by testing libpng-config's output === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-05-08 03:41:21 +0000 +++ lib-src/ChangeLog 2014-05-18 18:57:04 +0000 @@ -1,3 +1,14 @@ +2014-05-18 Paul Eggert + + Port ctags+etags build to Sun C 5.12. + * Makefile.in (etags_args): Remove, replacing with ... + (etags_cflags, etags_libs): New macros. All uses changed. + (ctags${EXEEXT}): Don't compile etags.c, as compiling etags.c in + parallel (once for ctags, once for etags) breaks parallel makes + with compilers that use the source file name to name temporaries, + such as Sun C 5.12. Instead, compile ctags.c. + * ctags.c: New file. + 2014-05-04 Paul Eggert Handle systems without WCONTINUED consistently. (Bug#15110, 17339) === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2014-04-30 19:54:52 +0000 +++ lib-src/Makefile.in 2014-05-18 18:57:04 +0000 @@ -311,18 +311,18 @@ etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) -etags_args = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" \ - ${srcdir}/etags.c regex.o $(LOADLIBES) $(NTLIB) -o $@ +etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@ +etags_libs = regex.o $(LOADLIBES) $(NTLIB) etags${EXEEXT}: ${etags_deps} - $(CC) ${ALL_CFLAGS} ${etags_args} + $(CC) ${ALL_CFLAGS} $(etags_cflags) $(srcdir)/etags.c $(etags_libs) +## ctags.c is distinct from etags.c so that parallel makes do not write two +## etags.o files on top of each other. ## FIXME? -## Can't we use a symlink ctags -> etags, and make etags check for argv[0]? -## Or a wrapper script that calls etags --ctags? -ctags${EXEEXT}: ${etags_deps} - $(CC) ${ALL_CFLAGS} -DCTAGS ${etags_args} - +## Can't we use a wrapper that calls 'etags --ctags'? +ctags${EXEEXT}: ctags.c ${etags_deps} + $(CC) ${ALL_CFLAGS} $(etags_cflags) $(srcdir)/ctags.c $(etags_libs) ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ $(config_h) === added file 'lib-src/ctags.c' --- lib-src/ctags.c 1970-01-01 00:00:00 +0000 +++ lib-src/ctags.c 2014-05-18 18:57:04 +0000 @@ -0,0 +1,2 @@ +#define CTAGS 1 +#include "etags.c" ------------------------------------------------------------ revno: 117120 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-05-17 22:50:17 -0700 message: Port recent libpng changes to hosts with missing png.h. * configure.ac (HAVE_PNG): Port to platforms where libpng-config succeeds but png.h is absent, by testing libpng-config's output rather than trusting it. I ran into this problem when building Emacs trunk on a Solaris 10 host. diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-17 08:11:31 +0000 +++ ChangeLog 2014-05-18 05:50:17 +0000 @@ -1,3 +1,11 @@ +2014-05-18 Paul Eggert + + Port recent libpng changes to hosts with missing png.h. + * configure.ac (HAVE_PNG): Port to platforms where libpng-config + succeeds but png.h is absent, by testing libpng-config's output + rather than trusting it. I ran into this problem when building + Emacs trunk on a Solaris 10 host. + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === modified file 'configure.ac' --- configure.ac 2014-05-17 08:11:31 +0000 +++ configure.ac 2014-05-18 05:50:17 +0000 @@ -3064,31 +3064,40 @@ # mingw32 loads the library dynamically. if test "$opsys" = mingw32; then AC_CHECK_HEADER([png.h], [HAVE_PNG=yes]) - elif png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` && - png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD` - then - HAVE_PNG=yes - PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"` - LIBPNG=$png_libs else - # libpng-config does not work; configure by hand. - # Debian unstable as of July 2003 has multiple libpngs, and puts png.h - # in /usr/include/libpng. - AC_CHECK_HEADERS([png.h libpng/png.h], - [AC_CHECK_LIB([png], [png_get_channels], - [HAVE_PNG=yes - LIBPNG='-lpng' - if test "$ac_cv_header_png_h" != yes; then - PNG_CFLAGS=-I/usr/include/libpng - fi - break], - [], [-lz -lm])]) - fi - # $LIBPNG requires explicit -lz in some cases. - # We don't know what those cases are, exactly, so play it safe and - # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ. - if test -n "$LIBPNG" && test -z "$LIBZ"; then - LIBPNG="$LIBPNG -lz" + AC_MSG_CHECKING([for png]) + png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` && + png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD` || { + # libpng-config does not work; configure by hand. + # Debian unstable as of July 2003 has multiple libpngs, and puts png.h + # in /usr/include/libpng. + if test -r /usr/include/libpng/png.h && + test ! -r /usr/include/png.h; then + png_cflags=-I/usr/include/libpng + else + png_cflags= + fi + png_libs='-lpng' + } + SAVE_CFLAGS=$CFLAGS + SAVE_LIBS=$LIBS + CFLAGS="$CFLAGS $png_cflags" + LIBS="$png_libs -lz -lm $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[return !png_get_channels (0, 0);]])], + [HAVE_PNG=yes + PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"` + LIBPNG=$png_libs + # $LIBPNG requires explicit -lz in some cases. + # We don't know what those cases are, exactly, so play it safe and + # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ. + if test -n "$LIBPNG" && test -z "$LIBZ"; then + LIBPNG="$LIBPNG -lz" + fi]) + CFLAGS=$SAVE_CFLAGS + LIBS=$SAVE_LIBS + AC_MSG_RESULT([$HAVE_PNG]) fi fi if test $HAVE_PNG = yes; then