Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104363. ------------------------------------------------------------ revno: 104363 [merge] committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 20:45:04 -0700 message: Merge from emacs-23; up to r100587. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-24 08:22:58 +0000 +++ src/ChangeLog 2011-05-25 03:45:04 +0000 @@ -1,3 +1,25 @@ +2011-05-25 YAMAMOTO Mitsuharu + + * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p. + + * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row + for fringe update if it has periodic bitmap. + (row_equal_p): Also compare left_fringe_offset, right_fringe_offset, + and fringe_bitmap_periodic_p. + + * fringe.c (get_fringe_bitmap_data): New function. + (draw_fringe_bitmap_1, update_window_fringes): Use it. + (update_window_fringes): Record periodicity of fringe bitmap in glyph + row. Mark glyph row for fringe update if periodicity changed. + + * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row + for fringe update unless it has periodic bitmap. + +2011-05-25 Kenichi Handa + + * xdisp.c (get_next_display_element): Set correct it->face_id for + a static composition. + 2011-05-24 Leo Liu * deps.mk (fns.o): === modified file 'src/dispextern.h' --- src/dispextern.h 2011-05-13 01:10:46 +0000 +++ src/dispextern.h 2011-05-25 03:45:04 +0000 @@ -845,6 +845,10 @@ /* Vertical offset of the right fringe bitmap. */ signed right_fringe_offset : FRINGE_HEIGHT_BITS; + /* 1 means that at least one of the left and right fringe bitmaps is + periodic and thus depends on the y-position of the row. */ + unsigned fringe_bitmap_periodic_p : 1; + /* 1 means that we must draw the bitmaps of this row. */ unsigned redraw_fringe_bitmaps_p : 1; === modified file 'src/dispnew.c' --- src/dispnew.c 2011-05-21 02:15:34 +0000 +++ src/dispnew.c 2011-05-25 03:45:04 +0000 @@ -861,6 +861,8 @@ row->visible_height -= min_y - row->y; if (row->y + row->height > max_y) row->visible_height -= row->y + row->height - max_y; + if (row->fringe_bitmap_periodic_p) + row->redraw_fringe_bitmaps_p = 1; } } @@ -1339,8 +1341,11 @@ || a->cursor_in_fringe_p != b->cursor_in_fringe_p || a->left_fringe_bitmap != b->left_fringe_bitmap || a->left_fringe_face_id != b->left_fringe_face_id + || a->left_fringe_offset != b->left_fringe_offset || a->right_fringe_bitmap != b->right_fringe_bitmap || a->right_fringe_face_id != b->right_fringe_face_id + || a->right_fringe_offset != b->right_fringe_offset + || a->fringe_bitmap_periodic_p != b->fringe_bitmap_periodic_p || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap || a->exact_window_width_line_p != b->exact_window_width_line_p || a->overlapped_p != b->overlapped_p @@ -4565,13 +4570,7 @@ to = MATRIX_ROW (current_matrix, r->desired_vpos + j); from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); to_overlapped_p = to->overlapped_p; - if (!from->mode_line_p && !w->pseudo_window_p - && (to->left_fringe_bitmap != from->left_fringe_bitmap - || to->right_fringe_bitmap != from->right_fringe_bitmap - || to->left_fringe_face_id != from->left_fringe_face_id - || to->right_fringe_face_id != from->right_fringe_face_id - || to->overlay_arrow_bitmap != from->overlay_arrow_bitmap)) - from->redraw_fringe_bitmaps_p = 1; + from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p; assign_row (to, from); to->enabled_p = 1, from->enabled_p = 0; to->overlapped_p = to_overlapped_p; === modified file 'src/fringe.c' --- src/fringe.c 2011-05-12 07:07:06 +0000 +++ src/fringe.c 2011-05-25 03:45:04 +0000 @@ -521,6 +521,20 @@ return num; } +/* Get fringe bitmap data for bitmap number BN. */ + +static struct fringe_bitmap * +get_fringe_bitmap_data (int bn) +{ + struct fringe_bitmap *fb; + + fb = fringe_bitmaps[bn]; + if (fb == NULL) + fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS + ? bn : UNDEF_FRINGE_BITMAP]; + + return fb; +} /* Draw the bitmap WHICH in one of the left or right fringes of window W. ROW is the glyph row for which to display the bitmap; it @@ -568,10 +582,7 @@ face_id = FRINGE_FACE_ID; } - fb = fringe_bitmaps[which]; - if (fb == NULL) - fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS - ? which : UNDEF_FRINGE_BITMAP]; + fb = get_fringe_bitmap_data (which); period = fb->period; @@ -1041,12 +1052,8 @@ if (bn != NO_FRINGE_BITMAP) { - struct fringe_bitmap *fb; + struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); - fb = fringe_bitmaps[bn]; - if (fb == NULL) - fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS - ? bn : UNDEF_FRINGE_BITMAP]; if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) { struct glyph_row *row1; @@ -1100,12 +1107,8 @@ if (bn != NO_FRINGE_BITMAP) { - struct fringe_bitmap *fb; + struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); - fb = fringe_bitmaps[bn]; - if (fb == NULL) - fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS - ? bn : UNDEF_FRINGE_BITMAP]; if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) { struct glyph_row *row1; @@ -1141,6 +1144,7 @@ int left, right; unsigned left_face_id, right_face_id; int left_offset, right_offset; + int periodic_p; row = w->desired_matrix->rows + rn; cur = w->current_matrix->rows + rn; @@ -1149,6 +1153,7 @@ left_face_id = right_face_id = DEFAULT_FACE_ID; left_offset = right_offset = 0; + periodic_p = 0; /* Decide which bitmap to draw in the left fringe. */ if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) @@ -1240,6 +1245,9 @@ else right = NO_FRINGE_BITMAP; + periodic_p = (get_fringe_bitmap_data (left)->period != 0 + || get_fringe_bitmap_data (right)->period != 0); + if (row->y != cur->y || row->visible_height != cur->visible_height || row->ends_at_zv_p != cur->ends_at_zv_p @@ -1249,6 +1257,7 @@ || right_face_id != cur->right_fringe_face_id || left_offset != cur->left_fringe_offset || right_offset != cur->right_fringe_offset + || periodic_p != cur->fringe_bitmap_periodic_p || cur->redraw_fringe_bitmaps_p) { redraw_p = row->redraw_fringe_bitmaps_p = 1; @@ -1261,6 +1270,7 @@ cur->right_fringe_face_id = right_face_id; cur->left_fringe_offset = left_offset; cur->right_fringe_offset = right_offset; + cur->fringe_bitmap_periodic_p = periodic_p; } } @@ -1279,6 +1289,7 @@ row->right_fringe_face_id = right_face_id; row->left_fringe_offset = left_offset; row->right_fringe_offset = right_offset; + row->fringe_bitmap_periodic_p = periodic_p; } return redraw_p && !keep_current_p; === modified file 'src/xdisp.c' --- src/xdisp.c 2011-05-12 07:07:06 +0000 +++ src/xdisp.c 2011-05-25 03:45:04 +0000 @@ -5890,11 +5890,23 @@ else { EMACS_INT pos = (it->s ? -1 - : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) - : IT_CHARPOS (*it)); - - it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos, - it->string); + : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) + : IT_CHARPOS (*it)); + int c; + + if (it->what == IT_CHARACTER) + c = it->char_to_display; + else + { + struct composition *cmp = composition_table[it->cmp_it.id]; + int i; + + c = ' '; + for (i = 0; i < cmp->glyph_len; i++) + if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') + break; + } + it->face_id = FACE_FOR_CHAR (it->f, face, c, pos, it->string); } } @@ -14817,7 +14829,8 @@ row->visible_height -= min_y - row->y; if (row->y + row->height > max_y) row->visible_height -= row->y + row->height - max_y; - row->redraw_fringe_bitmaps_p = 1; + if (row->fringe_bitmap_periodic_p) + row->redraw_fringe_bitmaps_p = 1; it.current_y += row->height; @@ -14979,7 +14992,8 @@ row->visible_height -= min_y - row->y; if (row->y + row->height > max_y) row->visible_height -= row->y + row->height - max_y; - row->redraw_fringe_bitmaps_p = 1; + if (row->fringe_bitmap_periodic_p) + row->redraw_fringe_bitmaps_p = 1; } /* Scroll the current matrix. */ ------------------------------------------------------------ revno: 104362 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 19:33:35 -0700 message: Small further clean-up in lib-src/Makefile.in * lib-src/Makefile.in (.c.o): Remove (every .o file has an explicit rule). (insrcdir): New. (stamp-rcs2log, stamp-rcs-checkin, stamp-grep-changelog, stamp-vcdiff): Use $insrcdir to suppress unaesthetic ignored errors. (clean): Simplify list of things to delete. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-05-25 01:32:34 +0000 +++ lib-src/ChangeLog 2011-05-25 02:33:35 +0000 @@ -1,5 +1,11 @@ 2011-05-25 Glenn Morris + * Makefile.in (.c.o): Remove (every .o file has an explicit rule). + (insrcdir): New. + (stamp-rcs2log, stamp-rcs-checkin, stamp-grep-changelog, stamp-vcdiff): + Use $insrcdir to suppress unaesthetic ignored errors. + (clean): Simplify list of things to delete. + * Makefile.in (movemail${EXEEXT}): Build in one step, not via .o file. * Makefile.in (REGEXPOBJ, REGEXPDEPS): Remove. Replace by expansion. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2011-05-25 01:32:34 +0000 +++ lib-src/Makefile.in 2011-05-25 02:33:35 +0000 @@ -178,33 +178,27 @@ LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) $(EXE_FILES): ../lib/libgnu.a -## This is the default compilation command. -## But we should never rely on it, because some make version failed to -## find it for getopt.o. -## Using an explicit command made it work. -.c.o: - ${CC} -c ${CPP_CFLAGS} $< - all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS} ## These targets copy the scripts into the build directory so that ## they can be run from there in an uninstalled Emacs. -## The "-" is prepended because some versions of cp barf when srcdir -## is the current directory, and thus the file will be copied into itself. +## Nothing to do if pwd = srcdir. +insrcdir=[ "`/bin/pwd`" = "`(cd $(srcdir) && /bin/pwd)`" ] + stamp-rcs2log: $(srcdir)/rcs2log - -cp -p $(srcdir)/rcs2log rcs2log + $(insrcdir) || cp -p $(srcdir)/rcs2log rcs2log touch $@ stamp-rcs-checkin: $(srcdir)/rcs-checkin - -cp -p $(srcdir)/rcs-checkin rcs-checkin + $(insrcdir) || cp -p $(srcdir)/rcs-checkin rcs-checkin touch $@ stamp-grep-changelog: $(srcdir)/grep-changelog - -cp -p $(srcdir)/grep-changelog grep-changelog + $(insrcdir) || cp -p $(srcdir)/grep-changelog grep-changelog touch $@ stamp-vcdiff: $(srcdir)/vcdiff - -cp -p $(srcdir)/vcdiff vcdiff + $(insrcdir) || cp -p $(srcdir)/vcdiff vcdiff touch $@ ## Only used if we need blessmail, but no harm in always defining. @@ -282,7 +276,7 @@ clean: mostlyclean -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL} - -rm -f fns*.el *.tab.c *.tab.h stamp-* + -rm -f ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS} distclean: clean -rm -f TAGS ------------------------------------------------------------ revno: 104361 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 21:32:34 -0400 message: * lib-src/Makefile.in (movemail${EXEEXT}): Build in one step, not via .o file. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-05-25 01:23:14 +0000 +++ lib-src/ChangeLog 2011-05-25 01:32:34 +0000 @@ -1,5 +1,7 @@ 2011-05-25 Glenn Morris + * Makefile.in (movemail${EXEEXT}): Build in one step, not via .o file. + * Makefile.in (REGEXPOBJ, REGEXPDEPS): Remove. Replace by expansion. (etags${EXEEXT}): Just depend on regex.o, not regex.h as well. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2011-05-25 01:23:14 +0000 +++ lib-src/Makefile.in 2011-05-25 01:32:34 +0000 @@ -340,13 +340,10 @@ $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ -o make-docfile -movemail${EXEEXT}: movemail.o pop.o - $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \ +movemail${EXEEXT}: ${srcdir}/movemail.c pop.o ../src/config.h + $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ $(LOADLIBES) $(LIBS_MOVE) -o movemail -movemail.o: ${srcdir}/movemail.c ../src/config.h - $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c - pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c ------------------------------------------------------------ revno: 104360 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 21:23:14 -0400 message: Tiny simplifications in lib-src/Makfile.in * lib-src/Makfile.in (REGEXPOBJ, REGEXPDEPS): Remove. Replace by expansion. (etags${EXEEXT}): Just depend on regex.o, not regex.h as well. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-05-24 03:43:17 +0000 +++ lib-src/ChangeLog 2011-05-25 01:23:14 +0000 @@ -1,3 +1,8 @@ +2011-05-25 Glenn Morris + + * Makefile.in (REGEXPOBJ, REGEXPDEPS): Remove. Replace by expansion. + (etags${EXEEXT}): Just depend on regex.o, not regex.h as well. + 2011-05-24 Glenn Morris * Makefile.in (update-game-score${EXEEXT}): Use a single rule. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2011-05-24 03:43:17 +0000 +++ lib-src/Makefile.in 2011-05-25 01:23:14 +0000 @@ -313,17 +313,14 @@ ../lib/libgnu.a: ../src/config.h cd ../lib && $(MAKE) libgnu.a -REGEXPOBJ = regex.o -REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h - regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ ${srcdir}/../src/regex.c -etags${EXEEXT}: ${srcdir}/etags.c $(REGEXPDEPS) ../src/config.h +etags${EXEEXT}: ${srcdir}/etags.c regex.o ../src/config.h $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - $(REGEXPOBJ) $(LOADLIBES) -o etags + regex.o $(LOADLIBES) -o etags ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h ../src/config.h $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ @@ -334,7 +331,7 @@ ctags${EXEEXT}: etags${EXEEXT} $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - $(REGEXPOBJ) $(LOADLIBES) -o ctags + regex.o $(LOADLIBES) -o ctags profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile ------------------------------------------------------------ revno: 104359 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 16:09:08 -0400 message: * Makefile.in (check): Just give a message if no test/ directory. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 19:12:58 +0000 +++ ChangeLog 2011-05-24 20:09:08 +0000 @@ -1,5 +1,7 @@ 2011-05-24 Glenn Morris + * Makefile.in (check): Just give a message if no test/ directory. + * configure.in: Avoid using variables inside AC_CONFIG_FILES. * configure.in (OPT_MAKEFILES_IN): Remove. === modified file 'Makefile.in' --- Makefile.in 2011-05-24 17:23:15 +0000 +++ Makefile.in 2011-05-24 20:09:08 +0000 @@ -859,9 +859,11 @@ check: @if test ! -d test/automated; then \ - echo "You do not seem to have the test/ directory."; exit 1; \ - else true; fi - cd test/automated && $(MAKE) $(MFLAGS) check + echo "You do not seem to have the test/ directory."; \ + echo "Maybe you are using a release tarfile, rather than a repository checkout."; \ + else \ + cd test/automated && $(MAKE) $(MFLAGS) check; \ + fi dist: cd ${srcdir}; ./make-dist ------------------------------------------------------------ revno: 104358 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 15:12:58 -0400 message: * configure.in: Avoid using variables inside AC_CONFIG_FILES. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 17:23:15 +0000 +++ ChangeLog 2011-05-24 19:12:58 +0000 @@ -1,5 +1,7 @@ 2011-05-24 Glenn Morris + * configure.in: Avoid using variables inside AC_CONFIG_FILES. + * configure.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. (SUBDIR_MAKEFILES_IN): New output variable. === modified file 'configure.in' --- configure.in 2011-05-24 17:23:15 +0000 +++ configure.in 2011-05-24 19:12:58 +0000 @@ -3701,20 +3701,34 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] -SUBDIR_MAKEFILES="lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES. +dnl You _can_ use that variable here, so long as any directory using +dnl automake (ie lib/) is explicitly listed and not "hidden" in a variable +dnl (else you get "no `Makefile.am' found for any configure output"). +dnl This will work, but you get a config.status that is not quite right +dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html). +dnl That doesn't have any obvious consequences for Emacs, but on the whole +dnl it seems better to just live with the duplication. +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + +AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ + doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ + doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \ + leim/Makefile]) dnl test/ is not present in release tarfiles. opt_makefile=test/automated/Makefile -test -f $srcdir/${opt_makefile}.in && \ +if test -f $srcdir/${opt_makefile}.in; then SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" + dnl Again, it's best not to use a variable. Though you can add + dnl ", [], [opt_makefile='$opt_makefile']" and it should work. + AC_CONFIG_FILES([test/automated/Makefile]) +fi -SUBDIR_MAKEFILES_IN=`echo " lib/Makefile ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` +SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` AC_SUBST(SUBDIR_MAKEFILES_IN) -dnl Any directory using automake (ie lib/) has to be explicitly listed, -dnl else automake fails with "no `Makefile.am' found for any configure output". -AC_CONFIG_FILES([Makefile lib/Makefile ${SUBDIR_MAKEFILES}]) dnl Make the necessary directories, if they don't exist. AC_CONFIG_COMMANDS([mkdirs], [ ------------------------------------------------------------ revno: 104357 author: Vincent Belaïche committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-24 15:22:09 -0300 message: * lisp/play/5x5.el (5x5-new-game, 5x5-randomize): Reset 5x5-solver-output to nil when a new grid is cast. (5x5-log-init, 5x5-log): Use defsubst instead of defmacro to shunt these debugging traces, as defmacro breaks the compiled code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 18:15:07 +0000 +++ lisp/ChangeLog 2011-05-24 18:22:09 +0000 @@ -1,3 +1,10 @@ +2011-05-24 Vincent Belaïche + + * play/5x5.el (5x5-new-game, 5x5-randomize): + Reset 5x5-solver-output to nil when a new grid is cast. + (5x5-log-init, 5x5-log): Use defsubst instead of defmacro to shunt + these debugging traces, as defmacro breaks the compiled code. + 2011-05-24 Dmitry Kurochkin (tiny change) * isearch.el (isearch-range-invisible): Use invisible-p (bug#8721). === modified file 'lisp/play/5x5.el' --- lisp/play/5x5.el 2011-05-24 03:36:06 +0000 +++ lisp/play/5x5.el 2011-05-24 18:22:09 +0000 @@ -239,7 +239,8 @@ (setq 5x5-x-pos (/ 5x5-grid-size 2) 5x5-y-pos (/ 5x5-grid-size 2) 5x5-moves 0 - 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos)) + 5x5-grid (5x5-make-move (5x5-make-new-grid) 5x5-y-pos 5x5-x-pos) + 5x5-solver-output nil) (5x5-draw-grid (list 5x5-grid)) (5x5-position-cursor))) @@ -492,6 +493,9 @@ (eval-and-compile (if nil; set to t to enable solver logging + ;; Note these logging facilities were not cleaned out as the arithmetic + ;; solver is not yet complete --- it works only for grid size = 5. + ;; So they may be useful again to design a more generic solution. (progn (defvar 5x5-log-buffer nil) (defun 5x5-log-init () @@ -516,8 +520,8 @@ (with-current-buffer 5x5-log-buffer (insert name ?= value-to-log ?\n)))) value)) - (defmacro 5x5-log-init ()) - (defmacro 5x5-log (name value) value))) + (defsubst 5x5-log-init ()) + (defsubst 5x5-log (name value) value))) (declare-function math-map-vec "calc-vec" (f a)) (declare-function math-sub "calc" (a b)) @@ -861,7 +865,8 @@ (setq 5x5-x-pos (/ 5x5-grid-size 2) 5x5-y-pos (/ 5x5-grid-size 2) 5x5-moves 0 - 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move))) + 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move)) + 5x5-solver-output nil) (unless 5x5-cracking (5x5-draw-grid (list 5x5-grid))) (5x5-position-cursor))) ------------------------------------------------------------ revno: 104356 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8721 author: Dmitry Kurochkin committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-05-24 15:15:07 -0300 message: * lisp/isearch.el (isearch-range-invisible): Use invisible-p. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 08:22:58 +0000 +++ lisp/ChangeLog 2011-05-24 18:15:07 +0000 @@ -1,3 +1,7 @@ +2011-05-24 Dmitry Kurochkin (tiny change) + + * isearch.el (isearch-range-invisible): Use invisible-p (bug#8721). + 2011-05-24 Leo Liu * vc/vc-bzr.el (vc-bzr-sha1-program): Rename from sha1-program. @@ -13,15 +17,15 @@ (mail-insert-from-field): Do not perform RFC2047 encoding. (mail-encode-header): New function. (sendmail-send-it): Set buffer-file-coding-system of the work - buffer to the return value of select-message-coding-system. Call - mail-encode-header. + buffer to the return value of select-message-coding-system. + Call mail-encode-header. * mail/smtpmail.el (smtpmail-send-it): Call mail-encode-header. 2011-05-24 Sean Neakums (tiny change) - * mail/supercite.el (sc-default-cite-frame): Handle - sc-nested-citation-p when sc-cite-blank-lines-p is non-nil. + * mail/supercite.el (sc-default-cite-frame): + Handle sc-nested-citation-p when sc-cite-blank-lines-p is non-nil. 2011-05-24 Glenn Morris === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-05-03 03:34:26 +0000 +++ lisp/isearch.el 2011-05-24 18:15:07 +0000 @@ -2434,13 +2434,7 @@ ;; If the following character is currently invisible, ;; skip all characters with that same `invisible' property value. ;; Do that over and over. - (while (and (< (point) end) - (let ((prop - (get-char-property (point) 'invisible))) - (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec))))) + (while (and (< (point) end) (invisible-p (point))) (if (get-text-property (point) 'invisible) (progn (goto-char (next-single-property-change (point) 'invisible @@ -2456,10 +2450,7 @@ (while overlays (setq o (car overlays) invis-prop (overlay-get o 'invisible)) - (if (if (eq buffer-invisibility-spec t) - invis-prop - (or (memq invis-prop buffer-invisibility-spec) - (assq invis-prop buffer-invisibility-spec))) + (if (invisible-p invis-prop) (if (overlay-get o 'isearch-open-invisible) (setq ov-list (cons o ov-list)) ;; We found one overlay that cannot be ------------------------------------------------------------ revno: 104355 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 13:24:15 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2011-05-24 16:31:25 +0000 +++ autogen/Makefile.in 2011-05-24 17:24:15 +0000 @@ -508,7 +508,6 @@ OLDXMENU = @OLDXMENU@ OLDXMENU_DEPS = @OLDXMENU_DEPS@ OLDXMENU_TARGET = @OLDXMENU_TARGET@ -OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ OTHER_FILES = @OTHER_FILES@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -625,6 +624,7 @@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ S_FILE = @S_FILE@ TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@ === modified file 'autogen/configure' --- autogen/configure 2011-05-24 16:31:25 +0000 +++ autogen/configure 2011-05-24 17:24:15 +0000 @@ -603,7 +603,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -OPT_MAKEFILES_IN +SUBDIR_MAKEFILES_IN LIB_GCC LD_FIRSTFLAG LD_SWITCH_SYSTEM_TEMACS @@ -20909,16 +20909,17 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` -ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" - - -if test -f $srcdir/test/automated/Makefile.in; then - OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" - ac_config_files="$ac_config_files test/automated/Makefile" - -else - OPT_MAKEFILES_IN= -fi +SUBDIR_MAKEFILES="lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + +opt_makefile=test/automated/Makefile + +test -f $srcdir/${opt_makefile}.in && \ + SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" + +SUBDIR_MAKEFILES_IN=`echo " lib/Makefile ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` + + +ac_config_files="$ac_config_files Makefile lib/Makefile ${SUBDIR_MAKEFILES}" ac_config_commands="$ac_config_commands mkdirs" @@ -21719,17 +21720,7 @@ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;; - "oldXMenu/Makefile") CONFIG_FILES="$CONFIG_FILES oldXMenu/Makefile" ;; - "doc/emacs/Makefile") CONFIG_FILES="$CONFIG_FILES doc/emacs/Makefile" ;; - "doc/misc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/misc/Makefile" ;; - "doc/lispintro/Makefile") CONFIG_FILES="$CONFIG_FILES doc/lispintro/Makefile" ;; - "doc/lispref/Makefile") CONFIG_FILES="$CONFIG_FILES doc/lispref/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;; - "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; - "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; - "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;; + "${SUBDIR_MAKEFILES}") CONFIG_FILES="$CONFIG_FILES ${SUBDIR_MAKEFILES}" ;; "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;; "epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;; "gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;; ------------------------------------------------------------ revno: 104354 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 13:23:15 -0400 message: Reimplement trunk r104345 in a way visible to automake. * configure.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. (SUBDIR_MAKEFILES_IN): New output variable. * Makefile.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES_IN): Let configure set it. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 16:30:13 +0000 +++ ChangeLog 2011-05-24 17:23:15 +0000 @@ -1,3 +1,11 @@ +2011-05-24 Glenn Morris + + * configure.in (OPT_MAKEFILES_IN): Remove. + (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. + (SUBDIR_MAKEFILES_IN): New output variable. + * Makefile.in (OPT_MAKEFILES_IN): Remove. + (SUBDIR_MAKEFILES_IN): Let configure set it. + 2011-05-24 Leo Liu * m4/sha1.m4: === modified file 'Makefile.in' --- Makefile.in 2011-05-24 16:30:13 +0000 +++ Makefile.in 2011-05-24 17:23:15 +0000 @@ -264,22 +264,8 @@ # checked out from a VCS. SUBDIR = lib lib-src src lisp -# test/automated/Makefile.in, if you have it (test/ is not in the release). -OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ - # The subdir makefiles created by config.status. -SUBDIR_MAKEFILES_IN = $(srcdir)/lib/Makefile.in \ - $(srcdir)/lib-src/Makefile.in \ - $(srcdir)/doc/emacs/Makefile.in \ - $(srcdir)/doc/misc/Makefile.in \ - $(srcdir)/doc/lispref/Makefile.in \ - $(srcdir)/doc/lispintro/Makefile.in \ - $(srcdir)/src/Makefile.in \ - $(srcdir)/oldXMenu/Makefile.in \ - $(srcdir)/lwlib/Makefile.in \ - $(srcdir)/leim/Makefile.in \ - $(srcdir)/lisp/Makefile.in $(OPT_MAKEFILES_IN) - +SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` # Subdirectories to install, and where they'll go. === modified file 'configure.in' --- configure.in 2011-05-24 16:30:13 +0000 +++ configure.in 2011-05-24 17:23:15 +0000 @@ -3701,19 +3701,20 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] -AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ - doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ - doc/lispref/Makefile src/Makefile \ - lwlib/Makefile lisp/Makefile leim/Makefile]) +SUBDIR_MAKEFILES="lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" dnl test/ is not present in release tarfiles. -if test -f $srcdir/test/automated/Makefile.in; then - OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" - AC_CONFIG_FILES([test/automated/Makefile]) -else - OPT_MAKEFILES_IN= -fi -AC_SUBST(OPT_MAKEFILES_IN) +opt_makefile=test/automated/Makefile + +test -f $srcdir/${opt_makefile}.in && \ + SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" + +SUBDIR_MAKEFILES_IN=`echo " lib/Makefile ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` + +AC_SUBST(SUBDIR_MAKEFILES_IN) +dnl Any directory using automake (ie lib/) has to be explicitly listed, +dnl else automake fails with "no `Makefile.am' found for any configure output". +AC_CONFIG_FILES([Makefile lib/Makefile ${SUBDIR_MAKEFILES}]) dnl Make the necessary directories, if they don't exist. AC_CONFIG_COMMANDS([mkdirs], [ ------------------------------------------------------------ revno: 104353 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 12:31:25 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2011-05-24 04:03:44 +0000 +++ autogen/Makefile.in 2011-05-24 16:31:25 +0000 @@ -24,7 +24,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 crypto/sha1 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -59,17 +59,17 @@ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/ssize_t.m4 \ - $(top_srcdir)/m4/st_dm_mode.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ - $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strtoull.m4 \ - $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/symlink.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/time_h.m4 \ - $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/m4/sha1.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ + $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdarg.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ + $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ + $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -733,15 +733,15 @@ $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ stdlib.h sys/stat.h time.h unistd.h warn-on-use.h EXTRA_DIST = allocator.h $(top_srcdir)/./arg-nonnull.h \ - $(top_srcdir)/./c++defs.h careadlinkat.h md5.c md5.h dosname.h \ - ftoastr.c ftoastr.h filemode.c filemode.h getloadavg.c \ - getopt.c getopt.in.h getopt1.c getopt_int.h ignore-value.h \ - intprops.h inttypes.in.h lstat.c mktime-internal.h mktime.c \ - readlink.c stat.c stdarg.in.h stdbool.in.h stddef.in.h \ - stdint.in.h stdio.in.h stdlib.in.h strftime.c strftime.h \ - strtol.c strtoul.c strtoull.c strtoimax.c strtoumax.c \ - symlink.c sys_stat.in.h time.in.h time_r.c unistd.in.h \ - verify.h $(top_srcdir)/./warn-on-use.h + $(top_srcdir)/./c++defs.h careadlinkat.h md5.c md5.h sha1.c \ + sha1.h dosname.h ftoastr.c ftoastr.h filemode.c filemode.h \ + getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \ + ignore-value.h intprops.h inttypes.in.h lstat.c \ + mktime-internal.h mktime.c readlink.c stat.c stdarg.in.h \ + stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \ + strftime.c strftime.h strtol.c strtoul.c strtoull.c \ + strtoimax.c strtoumax.c symlink.c sys_stat.in.h time.in.h \ + time_r.c unistd.in.h verify.h $(top_srcdir)/./warn-on-use.h MOSTLYCLEANDIRS = sys MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ c++defs.h c++defs.h-t getopt.h getopt.h-t inttypes.h \ @@ -755,9 +755,9 @@ $(am__append_1) libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) -EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \ - getopt.c getopt1.c lstat.c mktime.c readlink.c stat.c \ - strftime.c strtol.c strtoul.c strtoull.c strtoimax.c \ +EXTRA_libgnu_a_SOURCES = md5.c sha1.c ftoastr.c filemode.c \ + getloadavg.c getopt.c getopt1.c lstat.c mktime.c readlink.c \ + stat.c strftime.c strtol.c strtoul.c strtoull.c strtoimax.c \ strtoumax.c symlink.c time_r.c ARG_NONNULL_H = arg-nonnull.h CXXDEFS_H = c++defs.h @@ -823,6 +823,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ === modified file 'autogen/aclocal.m4' --- autogen/aclocal.m4 2011-05-18 05:58:40 +0000 +++ autogen/aclocal.m4 2011-05-24 16:31:25 +0000 @@ -1000,6 +1000,7 @@ m4_include([m4/mktime.m4]) m4_include([m4/multiarch.m4]) m4_include([m4/readlink.m4]) +m4_include([m4/sha1.m4]) m4_include([m4/socklen.m4]) m4_include([m4/ssize_t.m4]) m4_include([m4/st_dm_mode.m4]) === modified file 'autogen/configure' --- autogen/configure 2011-05-24 07:20:51 +0000 +++ autogen/configure 2011-05-24 16:31:25 +0000 @@ -4216,23 +4216,6 @@ * ) srcdir="`(cd ${srcdir}; pwd)`" ;; esac -#### Check if the source directory already has a configured system in it. -if test `pwd` != `(cd ${srcdir} && pwd)` \ - && test -f "${srcdir}/src/config.h" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The directory tree \`${srcdir}' is being used - as a build directory right now; it has been configured in its own - right. To configure in another directory as well, you MUST - use GNU make. If you do not have GNU make, then you must - now do \`make distclean' in ${srcdir}, - and then run $0 again." >&5 -$as_echo "$as_me: WARNING: The directory tree \`${srcdir}' is being used - as a build directory right now; it has been configured in its own - right. To configure in another directory as well, you MUST - use GNU make. If you do not have GNU make, then you must - now do \`make distclean' in ${srcdir}, - and then run $0 again." >&2;} -fi - #### Given the configuration name, set machfile and opsysfile to the #### names of the m/*.h and s/*.h files we should use. @@ -6541,6 +6524,7 @@ # Code from module c++defs: # Code from module careadlinkat: # Code from module crypto/md5: + # Code from module crypto/sha1: # Code from module dosname: # Code from module dtoastr: # Code from module extensions: @@ -16699,6 +16683,22 @@ + gl_LIBOBJS="$gl_LIBOBJS sha1.$ac_objext" + + + + + : + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS filemode.$ac_objext" ------------------------------------------------------------ revno: 104352 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 12:30:13 -0400 message: Revert r104345, for now at least. Some automakes don't seem to like it (?). diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 08:16:58 +0000 +++ ChangeLog 2011-05-24 16:30:13 +0000 @@ -15,12 +15,6 @@ * Makefile.in (TAGS, tags, check): Pass MFLAGS to sub-makes. - * configure.in (OPT_MAKEFILES_IN): Remove. - (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. - (SUBDIR_MAKEFILES_IN): New output variable. - * Makefile.in (OPT_MAKEFILES_IN): Remove. - (SUBDIR_MAKEFILES_IN): Let configure set it. - 2011-05-24 Glenn Morris * make-dist: Don't distribute test/. (Bug#8107) === modified file 'Makefile.in' --- Makefile.in 2011-05-24 08:12:52 +0000 +++ Makefile.in 2011-05-24 16:30:13 +0000 @@ -264,8 +264,22 @@ # checked out from a VCS. SUBDIR = lib lib-src src lisp +# test/automated/Makefile.in, if you have it (test/ is not in the release). +OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ + # The subdir makefiles created by config.status. -SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ +SUBDIR_MAKEFILES_IN = $(srcdir)/lib/Makefile.in \ + $(srcdir)/lib-src/Makefile.in \ + $(srcdir)/doc/emacs/Makefile.in \ + $(srcdir)/doc/misc/Makefile.in \ + $(srcdir)/doc/lispref/Makefile.in \ + $(srcdir)/doc/lispintro/Makefile.in \ + $(srcdir)/src/Makefile.in \ + $(srcdir)/oldXMenu/Makefile.in \ + $(srcdir)/lwlib/Makefile.in \ + $(srcdir)/leim/Makefile.in \ + $(srcdir)/lisp/Makefile.in $(OPT_MAKEFILES_IN) + SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` # Subdirectories to install, and where they'll go. === modified file 'configure.in' --- configure.in 2011-05-24 08:16:58 +0000 +++ configure.in 2011-05-24 16:30:13 +0000 @@ -3701,18 +3701,19 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] -SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ + doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ + doc/lispref/Makefile src/Makefile \ + lwlib/Makefile lisp/Makefile leim/Makefile]) dnl test/ is not present in release tarfiles. -opt_makefile=test/automated/Makefile - -test -f $srcdir/${opt_makefile}.in && \ - SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" - -SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` - -AC_SUBST(SUBDIR_MAKEFILES_IN) -AC_CONFIG_FILES([Makefile ${SUBDIR_MAKEFILES}]) +if test -f $srcdir/test/automated/Makefile.in; then + OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" + AC_CONFIG_FILES([test/automated/Makefile]) +else + OPT_MAKEFILES_IN= +fi +AC_SUBST(OPT_MAKEFILES_IN) dnl Make the necessary directories, if they don't exist. AC_CONFIG_COMMANDS([mkdirs], [ ------------------------------------------------------------ revno: 104351 committer: Leo Liu branch nick: trunk timestamp: Tue 2011-05-24 22:22:44 +0800 message: Mention function `sha1' and the removal of sha1.el in NEWS diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-05-14 18:39:26 +0000 +++ etc/ChangeLog 2011-05-24 14:22:44 +0000 @@ -1,3 +1,7 @@ +2011-05-24 Leo Liu + + * NEWS: Mention the new primitive sha1 and the removal of sha1.el. + 2011-05-14 Ulf Jasper * images/newsticker/README: Added. === modified file 'etc/NEWS' --- etc/NEWS 2011-05-24 02:45:50 +0000 +++ etc/NEWS 2011-05-24 14:22:44 +0000 @@ -290,6 +290,10 @@ ** The variable `focus-follows-mouse' now always defaults to nil. +** Function `sha1' is now implemented in C for speed. +The elisp implementation sha1.el is removed. Feature sha1 is provided +by default. + * Editing Changes in Emacs 24.1 ------------------------------------------------------------ revno: 104350 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-05-24 09:46:18 +0000 message: gnus-art.el (gnus-mime-delete-part): Fix mm-handle-filename usage. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-05-20 01:00:46 +0000 +++ lisp/gnus/ChangeLog 2011-05-24 09:46:18 +0000 @@ -1,3 +1,7 @@ +2011-05-24 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-delete-part): Fix mm-handle-filename usage. + 2011-05-20 Teodor Zlatanov * gnus-sum.el (gnus-summary-hide-thread): Fix bug where moving to hide === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-05-10 07:30:49 +0000 +++ lisp/gnus/gnus-art.el 2011-05-24 09:46:18 +0000 @@ -5048,7 +5048,7 @@ (let ((desc (mm-handle-description data))) (when desc (mail-decode-encoded-word-string desc)))) - (filename (or (mm-handle-filename (mm-handle-disposition data)) "(none)")) + (filename (or (mm-handle-filename data) "(none)")) (type (mm-handle-media-type data))) (unless data (error "No MIME part under point")) ------------------------------------------------------------ revno: 104349 committer: Leo Liu branch nick: trunk timestamp: Tue 2011-05-24 16:22:58 +0800 message: Implement primitive `sha1' and remove sha1.el diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 03:54:18 +0000 +++ lisp/ChangeLog 2011-05-24 08:22:58 +0000 @@ -1,3 +1,12 @@ +2011-05-24 Leo Liu + + * vc/vc-bzr.el (vc-bzr-sha1-program): Rename from sha1-program. + (vc-bzr-sha1): Adapt. + + * sha1.el: Remove. Function `sha1' is now builtin. + + * bindings.el: Provide sha1 feature. + 2011-05-24 Kenichi Handa * mail/sendmail.el: Require `rfc2047'. === modified file 'lisp/bindings.el' --- lisp/bindings.el 2011-04-19 13:44:55 +0000 +++ lisp/bindings.el 2011-05-24 08:22:58 +0000 @@ -646,9 +646,10 @@ (make-variable-buffer-local 'indent-tabs-mode) -;; We have base64 and md5 functions built in now. +;; We have base64, md5 and sha1 functions built in now. (provide 'base64) (provide 'md5) +(provide 'sha1) (provide 'overlay '(display syntax-table field)) (provide 'text-properties '(display syntax-table field point-entered)) === removed file 'lisp/sha1.el' --- lisp/sha1.el 2011-01-25 04:08:28 +0000 +++ lisp/sha1.el 1970-01-01 00:00:00 +0000 @@ -1,441 +0,0 @@ -;;; sha1.el --- SHA1 Secure Hash Algorithm in Emacs-Lisp - -;; Copyright (C) 1999, 2001-2011 Free Software Foundation, Inc. - -;; Author: Shuhei KOBAYASHI -;; Keywords: SHA1, FIPS 180-1 - -;; 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 . - -;;; Commentary: - -;; This program is implemented from the definition of SHA-1 in FIPS PUB -;; 180-1 (Federal Information Processing Standards Publication 180-1), -;; "Announcing the Standard for SECURE HASH STANDARD". -;; -;; (EXCEPTION; two optimizations taken from GnuPG/cipher/sha1.c) -;; -;; Test cases from FIPS PUB 180-1. -;; -;; (sha1 "abc") -;; => a9993e364706816aba3e25717850c26c9cd0d89d -;; -;; (sha1 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") -;; => 84983e441c3bd26ebaae4aa1f95129e5e54670f1 -;; -;; (sha1 (make-string 1000000 ?a)) -;; => 34aa973cd4c4daa4f61eeb2bdbad27316534016f -;; -;; BUGS: -;; * It is assumed that length of input string is less than 2^29 bytes. -;; * It is caller's responsibility to make string (or region) unibyte. -;; -;; TODO: -;; * Rewrite from scratch! -;; This version is much faster than Keiichi Suzuki's another sha1.el, -;; but it is too dirty. - -;;; Code: - -(require 'hex-util) - -;;; -;;; external SHA1 function. -;;; - -(defgroup sha1 nil - "Elisp interface for SHA1 hash computation." - :version "22.1" - :group 'extensions) - -(defcustom sha1-maximum-internal-length 500 - "Maximum length of message to use Lisp version of SHA1 function. -If message is longer than this, `sha1-program' is used instead. - -If this variable is set to 0, use external program only. -If this variable is set to nil, use internal function only." - :type 'integer - :group 'sha1) - -(defcustom sha1-program '("sha1sum") - "Name of program to compute SHA1. -It must be a string \(program name\) or list of strings \(name and its args\)." - :type '(repeat string) - :group 'sha1) - -(defcustom sha1-use-external (condition-case () - (executable-find (car sha1-program)) - (error)) - "Use external SHA1 program. -If this variable is set to nil, use internal function only." - :type 'boolean - :group 'sha1) - -(defun sha1-string-external (string &optional binary) - (let ((default-directory "/") ;; in case otherwise non-existent - (process-connection-type nil) ;; pipe - prog args digest) - (if (consp sha1-program) - (setq prog (car sha1-program) - args (cdr sha1-program)) - (setq prog sha1-program - args nil)) - (with-temp-buffer - (unless (featurep 'xemacs) (set-buffer-multibyte nil)) - (insert string) - (apply (function call-process-region) - (point-min) (point-max) - prog t t nil args) - ;; SHA1 is 40 bytes long in hexadecimal form. - (setq digest (buffer-substring (point-min)(+ (point-min) 40)))) - (if binary - (decode-hex-string digest) - digest))) - -(defun sha1-region-external (beg end &optional binary) - (sha1-string-external (buffer-substring-no-properties beg end) binary)) - -;;; -;;; internal SHA1 function. -;;; - -(eval-when-compile - ;; optional second arg of string-to-number is new in v20. - (defconst sha1-K0-high 23170) ; (string-to-number "5A82" 16) - (defconst sha1-K0-low 31129) ; (string-to-number "7999" 16) - (defconst sha1-K1-high 28377) ; (string-to-number "6ED9" 16) - (defconst sha1-K1-low 60321) ; (string-to-number "EBA1" 16) - (defconst sha1-K2-high 36635) ; (string-to-number "8F1B" 16) - (defconst sha1-K2-low 48348) ; (string-to-number "BCDC" 16) - (defconst sha1-K3-high 51810) ; (string-to-number "CA62" 16) - (defconst sha1-K3-low 49622) ; (string-to-number "C1D6" 16) - - ;; original definition of sha1-F0. - ;; (defmacro sha1-F0 (B C D) - ;; (` (logior (logand (, B) (, C)) - ;; (logand (lognot (, B)) (, D))))) - ;; a little optimization from GnuPG/cipher/sha1.c. - (defmacro sha1-F0 (B C D) - `(logxor ,D (logand ,B (logxor ,C ,D)))) - (defmacro sha1-F1 (B C D) - `(logxor ,B ,C ,D)) - ;; original definition of sha1-F2. - ;; (defmacro sha1-F2 (B C D) - ;; (` (logior (logand (, B) (, C)) - ;; (logand (, B) (, D)) - ;; (logand (, C) (, D))))) - ;; a little optimization from GnuPG/cipher/sha1.c. - (defmacro sha1-F2 (B C D) - `(logior (logand ,B ,C) - (logand ,D (logior ,B ,C)))) - (defmacro sha1-F3 (B C D) - `(logxor ,B ,C ,D)) - - (defmacro sha1-S1 (W-high W-low) - `(let ((W-high ,W-high) - (W-low ,W-low)) - (setq S1W-high (+ (% (* W-high 2) 65536) - (/ W-low ,(/ 65536 2)))) - (setq S1W-low (+ (/ W-high ,(/ 65536 2)) - (% (* W-low 2) 65536))))) - (defmacro sha1-S5 (A-high A-low) - `(progn - (setq S5A-high (+ (% (* ,A-high 32) 65536) - (/ ,A-low ,(/ 65536 32)))) - (setq S5A-low (+ (/ ,A-high ,(/ 65536 32)) - (% (* ,A-low 32) 65536))))) - (defmacro sha1-S30 (B-high B-low) - `(progn - (setq S30B-high (+ (/ ,B-high 4) - (* (% ,B-low 4) ,(/ 65536 4)))) - (setq S30B-low (+ (/ ,B-low 4) - (* (% ,B-high 4) ,(/ 65536 4)))))) - - (defmacro sha1-OP (round) - `(progn - (sha1-S5 sha1-A-high sha1-A-low) - (sha1-S30 sha1-B-high sha1-B-low) - (setq sha1-A-low (+ (,(intern (format "sha1-F%d" round)) - sha1-B-low sha1-C-low sha1-D-low) - sha1-E-low - ,(symbol-value - (intern (format "sha1-K%d-low" round))) - (aref block-low idx) - (progn - (setq sha1-E-low sha1-D-low) - (setq sha1-D-low sha1-C-low) - (setq sha1-C-low S30B-low) - (setq sha1-B-low sha1-A-low) - S5A-low))) - (setq carry (/ sha1-A-low 65536)) - (setq sha1-A-low (% sha1-A-low 65536)) - (setq sha1-A-high (% (+ (,(intern (format "sha1-F%d" round)) - sha1-B-high sha1-C-high sha1-D-high) - sha1-E-high - ,(symbol-value - (intern (format "sha1-K%d-high" round))) - (aref block-high idx) - (progn - (setq sha1-E-high sha1-D-high) - (setq sha1-D-high sha1-C-high) - (setq sha1-C-high S30B-high) - (setq sha1-B-high sha1-A-high) - S5A-high) - carry) - 65536)))) - - (defmacro sha1-add-to-H (H X) - `(progn - (setq ,(intern (format "sha1-%s-low" H)) - (+ ,(intern (format "sha1-%s-low" H)) - ,(intern (format "sha1-%s-low" X)))) - (setq carry (/ ,(intern (format "sha1-%s-low" H)) 65536)) - (setq ,(intern (format "sha1-%s-low" H)) - (% ,(intern (format "sha1-%s-low" H)) 65536)) - (setq ,(intern (format "sha1-%s-high" H)) - (% (+ ,(intern (format "sha1-%s-high" H)) - ,(intern (format "sha1-%s-high" X)) - carry) - 65536)))) - ) - -;;; buffers (H0 H1 H2 H3 H4). -(defvar sha1-H0-high) -(defvar sha1-H0-low) -(defvar sha1-H1-high) -(defvar sha1-H1-low) -(defvar sha1-H2-high) -(defvar sha1-H2-low) -(defvar sha1-H3-high) -(defvar sha1-H3-low) -(defvar sha1-H4-high) -(defvar sha1-H4-low) - -(defun sha1-block (block-high block-low) - (let (;; step (c) --- initialize buffers (A B C D E). - (sha1-A-high sha1-H0-high) (sha1-A-low sha1-H0-low) - (sha1-B-high sha1-H1-high) (sha1-B-low sha1-H1-low) - (sha1-C-high sha1-H2-high) (sha1-C-low sha1-H2-low) - (sha1-D-high sha1-H3-high) (sha1-D-low sha1-H3-low) - (sha1-E-high sha1-H4-high) (sha1-E-low sha1-H4-low) - (idx 16)) - ;; step (b). - (let (;; temporary variables used in sha1-S1 macro. - S1W-high S1W-low) - (while (< idx 80) - (sha1-S1 (logxor (aref block-high (- idx 3)) - (aref block-high (- idx 8)) - (aref block-high (- idx 14)) - (aref block-high (- idx 16))) - (logxor (aref block-low (- idx 3)) - (aref block-low (- idx 8)) - (aref block-low (- idx 14)) - (aref block-low (- idx 16)))) - (aset block-high idx S1W-high) - (aset block-low idx S1W-low) - (setq idx (1+ idx)))) - ;; step (d). - (setq idx 0) - (let (;; temporary variables used in sha1-OP macro. - S5A-high S5A-low S30B-high S30B-low carry) - (while (< idx 20) (sha1-OP 0) (setq idx (1+ idx))) - (while (< idx 40) (sha1-OP 1) (setq idx (1+ idx))) - (while (< idx 60) (sha1-OP 2) (setq idx (1+ idx))) - (while (< idx 80) (sha1-OP 3) (setq idx (1+ idx)))) - ;; step (e). - (let (;; temporary variables used in sha1-add-to-H macro. - carry) - (sha1-add-to-H H0 A) - (sha1-add-to-H H1 B) - (sha1-add-to-H H2 C) - (sha1-add-to-H H3 D) - (sha1-add-to-H H4 E)))) - -(defun sha1-binary (string) - "Return the SHA1 of STRING in binary form." - (let (;; prepare buffers for a block. byte-length of block is 64. - ;; input block is split into two vectors. - ;; - ;; input block: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ... - ;; block-high: +-0-+ +-1-+ +-2-+ +-3-+ - ;; block-low: +-0-+ +-1-+ +-2-+ +-3-+ - ;; - ;; length of each vector is 80, and elements of each vector are - ;; 16bit integers. elements 0x10-0x4F of each vector are - ;; assigned later in `sha1-block'. - (block-high (eval-when-compile (make-vector 80 nil))) - (block-low (eval-when-compile (make-vector 80 nil)))) - (unwind-protect - (let* (;; byte-length of input string. - (len (length string)) - (lim (* (/ len 64) 64)) - (rem (% len 4)) - (idx 0)(pos 0)) - ;; initialize buffers (H0 H1 H2 H3 H4). - (setq sha1-H0-high 26437 ; (string-to-number "6745" 16) - sha1-H0-low 8961 ; (string-to-number "2301" 16) - sha1-H1-high 61389 ; (string-to-number "EFCD" 16) - sha1-H1-low 43913 ; (string-to-number "AB89" 16) - sha1-H2-high 39098 ; (string-to-number "98BA" 16) - sha1-H2-low 56574 ; (string-to-number "DCFE" 16) - sha1-H3-high 4146 ; (string-to-number "1032" 16) - sha1-H3-low 21622 ; (string-to-number "5476" 16) - sha1-H4-high 50130 ; (string-to-number "C3D2" 16) - sha1-H4-low 57840) ; (string-to-number "E1F0" 16) - ;; loop for each 64 bytes block. - (while (< pos lim) - ;; step (a). - (setq idx 0) - (while (< idx 16) - (aset block-high idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (setq pos (+ pos 2)) - (aset block-low idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (setq pos (+ pos 2)) - (setq idx (1+ idx))) - (sha1-block block-high block-low)) - ;; last block. - (if (prog1 - (< (- len lim) 56) - (setq lim (- len rem)) - (setq idx 0) - (while (< pos lim) - (aset block-high idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (setq pos (+ pos 2)) - (aset block-low idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (setq pos (+ pos 2)) - (setq idx (1+ idx))) - ;; this is the last (at most) 32bit word. - (cond - ((= rem 3) - (aset block-high idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (setq pos (+ pos 2)) - (aset block-low idx (+ (* (aref string pos) 256) - 128))) - ((= rem 2) - (aset block-high idx (+ (* (aref string pos) 256) - (aref string (1+ pos)))) - (aset block-low idx 32768)) - ((= rem 1) - (aset block-high idx (+ (* (aref string pos) 256) - 128)) - (aset block-low idx 0)) - (t ;; (= rem 0) - (aset block-high idx 32768) - (aset block-low idx 0))) - (setq idx (1+ idx)) - (while (< idx 16) - (aset block-high idx 0) - (aset block-low idx 0) - (setq idx (1+ idx)))) - ;; last block has enough room to write the length of string. - (progn - ;; write bit length of string to last 4 bytes of the block. - (aset block-low 15 (* (% len 8192) 8)) - (setq len (/ len 8192)) - (aset block-high 15 (% len 65536)) - ;; XXX: It is not practical to compute SHA1 of - ;; such a huge message on emacs. - ;; (setq len (/ len 65536)) ; for 64bit emacs. - ;; (aset block-low 14 (% len 65536)) - ;; (aset block-high 14 (/ len 65536)) - (sha1-block block-high block-low)) - ;; need one more block. - (sha1-block block-high block-low) - (fillarray block-high 0) - (fillarray block-low 0) - ;; write bit length of string to last 4 bytes of the block. - (aset block-low 15 (* (% len 8192) 8)) - (setq len (/ len 8192)) - (aset block-high 15 (% len 65536)) - ;; XXX: It is not practical to compute SHA1 of - ;; such a huge message on emacs. - ;; (setq len (/ len 65536)) ; for 64bit emacs. - ;; (aset block-low 14 (% len 65536)) - ;; (aset block-high 14 (/ len 65536)) - (sha1-block block-high block-low)) - ;; make output string (in binary form). - (let ((result (make-string 20 0))) - (aset result 0 (/ sha1-H0-high 256)) - (aset result 1 (% sha1-H0-high 256)) - (aset result 2 (/ sha1-H0-low 256)) - (aset result 3 (% sha1-H0-low 256)) - (aset result 4 (/ sha1-H1-high 256)) - (aset result 5 (% sha1-H1-high 256)) - (aset result 6 (/ sha1-H1-low 256)) - (aset result 7 (% sha1-H1-low 256)) - (aset result 8 (/ sha1-H2-high 256)) - (aset result 9 (% sha1-H2-high 256)) - (aset result 10 (/ sha1-H2-low 256)) - (aset result 11 (% sha1-H2-low 256)) - (aset result 12 (/ sha1-H3-high 256)) - (aset result 13 (% sha1-H3-high 256)) - (aset result 14 (/ sha1-H3-low 256)) - (aset result 15 (% sha1-H3-low 256)) - (aset result 16 (/ sha1-H4-high 256)) - (aset result 17 (% sha1-H4-high 256)) - (aset result 18 (/ sha1-H4-low 256)) - (aset result 19 (% sha1-H4-low 256)) - result)) - ;; do not leave a copy of input string. - (fillarray block-high nil) - (fillarray block-low nil)))) - -(defun sha1-string-internal (string &optional binary) - (if binary - (sha1-binary string) - (encode-hex-string (sha1-binary string)))) - -(defun sha1-region-internal (beg end &optional binary) - (sha1-string-internal (buffer-substring-no-properties beg end) binary)) - -;;; -;;; application interface. -;;; - -(defun sha1-region (beg end &optional binary) - (if (and sha1-use-external - sha1-maximum-internal-length - (> (abs (- end beg)) sha1-maximum-internal-length)) - (sha1-region-external beg end binary) - (sha1-region-internal beg end binary))) - -(defun sha1-string (string &optional binary) - (if (and sha1-use-external - sha1-maximum-internal-length - (> (length string) sha1-maximum-internal-length)) - (sha1-string-external string binary) - (sha1-string-internal string binary))) - -;;;###autoload -(defun sha1 (object &optional beg end binary) - "Return the SHA1 (Secure Hash Algorithm) of an object. -OBJECT is either a string or a buffer. -Optional arguments BEG and END denote buffer positions for computing the -hash of a portion of OBJECT. -If BINARY is non-nil, return a string in binary form." - (if (stringp object) - (sha1-string object binary) - (with-current-buffer object - (sha1-region (or beg (point-min)) (or end (point-max)) binary)))) - -(provide 'sha1) - -;;; sha1.el ends here === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2011-03-12 15:26:33 +0000 +++ lisp/vc/vc-bzr.el 2011-05-24 08:22:58 +0000 @@ -65,6 +65,14 @@ :group 'vc-bzr :type 'string) +(defcustom vc-bzr-sha1-program '("sha1sum") + "Name of program to compute SHA1. +It must be a string \(program name\) or list of strings \(name and its args\)." + :type '(repeat string) + :group 'vc-bzr) + +(define-obsolete-variable-alias 'sha1-program 'vc-bzr-sha1-program "24.1") + (defcustom vc-bzr-diff-switches nil "String or list of strings specifying switches for bzr diff under VC. If nil, use the value of `vc-diff-switches'. If t, use no switches." @@ -156,12 +164,10 @@ (push (cons (match-string 1) (match-string 2)) settings))) settings)) -(require 'sha1) ;For sha1-program - (defun vc-bzr-sha1 (file) (with-temp-buffer (set-buffer-multibyte nil) - (let ((prog sha1-program) + (let ((prog vc-bzr-sha1-program) (args nil) process-file-side-effects) (when (consp prog) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-23 00:03:40 +0000 +++ src/ChangeLog 2011-05-24 08:22:58 +0000 @@ -1,3 +1,12 @@ +2011-05-24 Leo Liu + + * deps.mk (fns.o): + * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h. + + * fns.c (crypto_hash_function, Fsha1): New function. + (Fmd5): Use crypto_hash_function. + (syms_of_fns): Add Ssha1. + 2011-05-22 Paul Eggert * gnutls.c: Remove unused macros. === modified file 'src/deps.mk' --- src/deps.mk 2011-04-23 10:33:28 +0000 +++ src/deps.mk 2011-05-24 08:22:58 +0000 @@ -284,7 +284,8 @@ floatfns.o: floatfns.c syssignal.h lisp.h globals.h $(config_h) fns.o: fns.c commands.h lisp.h $(config_h) frame.h buffer.h character.h \ keyboard.h keymap.h window.h $(INTERVALS_H) coding.h ../lib/md5.h \ - blockinput.h atimer.h systime.h xterm.h ../lib/unistd.h globals.h + ../lib/sha1.h blockinput.h atimer.h systime.h xterm.h ../lib/unistd.h \ + globals.h print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \ lisp.h globals.h $(config_h) termchar.h $(INTERVALS_H) msdos.h termhooks.h \ blockinput.h atimer.h systime.h font.h charset.h coding.h ccl.h \ === modified file 'src/fns.c' --- src/fns.c 2011-05-15 17:17:44 +0000 +++ src/fns.c 2011-05-24 08:22:58 +0000 @@ -4514,42 +4514,17 @@ /************************************************************************ - MD5 + MD5 and SHA1 ************************************************************************/ #include "md5.h" - -DEFUN ("md5", Fmd5, Smd5, 1, 5, 0, - doc: /* Return MD5 message digest of OBJECT, a buffer or string. - -A message digest is a cryptographic checksum of a document, and the -algorithm to calculate it is defined in RFC 1321. - -The two optional arguments START and END are character positions -specifying for which part of OBJECT the message digest should be -computed. If nil or omitted, the digest is computed for the whole -OBJECT. - -The MD5 message digest is computed from the result of encoding the -text in a coding system, not directly from the internal Emacs form of -the text. The optional fourth argument CODING-SYSTEM specifies which -coding system to encode the text with. It should be the same coding -system that you used or will use when actually writing the text into a -file. - -If CODING-SYSTEM is nil or omitted, the default depends on OBJECT. If -OBJECT is a buffer, the default for CODING-SYSTEM is whatever coding -system would be chosen by default for writing this text into a file. - -If OBJECT is a string, the most preferred coding system (see the -command `prefer-coding-system') is used. - -If NOERROR is non-nil, silently assume the `raw-text' coding if the -guesswork fails. Normally, an error is signaled in such case. */) - (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) +#include "sha1.h" + +/* TYPE: 0 for md5, 1 for sha1. */ + +Lisp_Object +crypto_hash_function (int type, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, Lisp_Object binary) { - unsigned char digest[16]; - char value[33]; int i; EMACS_INT size; EMACS_INT size_byte = 0; @@ -4558,6 +4533,7 @@ register EMACS_INT b, e; register struct buffer *bp; EMACS_INT temp; + Lisp_Object res=Qnil; if (STRINGP (object)) { @@ -4728,15 +4704,93 @@ object = code_convert_string (object, coding_system, Qnil, 1, 0, 0); } - md5_buffer (SSDATA (object) + start_byte, - SBYTES (object) - (size_byte - end_byte), - digest); - - for (i = 0; i < 16; i++) - sprintf (&value[2 * i], "%02x", digest[i]); - value[32] = '\0'; - - return make_string (value, 32); + switch (type) + { + case 0: /* MD5 */ + { + unsigned char digest[16]; + md5_buffer (SSDATA (object) + start_byte, + SBYTES (object) - (size_byte - end_byte), + digest); + + if (NILP(binary)) + { + unsigned char value[33]; + for (i = 0; i < 16; i++) + sprintf (&value[2 * i], "%02x", digest[i]); + value[32] = '\0'; + res = make_string (value, 32); + } + else + res = make_string (digest, 16); + break; + } + + case 1: /* SHA1 */ + { + unsigned char digest[20]; + sha1_buffer (SDATA (object) + start_byte, + SBYTES (object) - (size_byte - end_byte), + digest); + if (NILP(binary)) + { + unsigned char value[41]; + for (i = 0; i < 20; i++) + sprintf (&value[2 * i], "%02x", digest[i]); + value[40] = '\0'; + res = make_string (value, 40); + } + else + res = make_string (digest, 20); + break; + } + } + + return res; +} + +DEFUN ("md5", Fmd5, Smd5, 1, 5, 0, + doc: /* Return MD5 message digest of OBJECT, a buffer or string. + +A message digest is a cryptographic checksum of a document, and the +algorithm to calculate it is defined in RFC 1321. + +The two optional arguments START and END are character positions +specifying for which part of OBJECT the message digest should be +computed. If nil or omitted, the digest is computed for the whole +OBJECT. + +The MD5 message digest is computed from the result of encoding the +text in a coding system, not directly from the internal Emacs form of +the text. The optional fourth argument CODING-SYSTEM specifies which +coding system to encode the text with. It should be the same coding +system that you used or will use when actually writing the text into a +file. + +If CODING-SYSTEM is nil or omitted, the default depends on OBJECT. If +OBJECT is a buffer, the default for CODING-SYSTEM is whatever coding +system would be chosen by default for writing this text into a file. + +If OBJECT is a string, the most preferred coding system (see the +command `prefer-coding-system') is used. + +If NOERROR is non-nil, silently assume the `raw-text' coding if the +guesswork fails. Normally, an error is signaled in such case. */) + (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) +{ + return crypto_hash_function (0, object, start, end, coding_system, noerror, Qnil); +} + +DEFUN ("sha1", Fsha1, Ssha1, 1, 4, 0, + doc: /* Return the SHA-1 (Secure Hash Algorithm) of an OBJECT. + +OBJECT is either a string or a buffer. Optional arguments START and +END are character positions specifying which portion of OBJECT for +computing the hash. If BINARY is non-nil, return a string in binary +form. */) + (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object binary) +{ + return crypto_hash_function (1, object, start, end, Qnil, Qnil, binary); } @@ -4911,6 +4965,7 @@ defsubr (&Sbase64_encode_string); defsubr (&Sbase64_decode_string); defsubr (&Smd5); + defsubr (&Ssha1); defsubr (&Slocale_info); } === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2011-05-18 11:32:07 +0000 +++ src/makefile.w32-in 2011-05-24 08:22:58 +0000 @@ -866,6 +866,7 @@ $(EMACS_ROOT)/nt/inc/unistd.h \ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(EMACS_ROOT)/lib/md5.h \ + $(EMACS_ROOT)/lib/sha1.h \ $(LISP_H) \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ ------------------------------------------------------------ revno: 104348 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 01:16:58 -0700 message: Remove dead code in configure.in. * configure.in: Remove test for already configured source directory. AM_INIT_AUTOMAKE has already done a more stringent test. (Bug#953) diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 08:12:52 +0000 +++ ChangeLog 2011-05-24 08:16:58 +0000 @@ -10,6 +10,9 @@ 2011-05-24 Glenn Morris + * configure.in: Remove test for already configured source directory. + AM_INIT_AUTOMAKE has already done a more stringent test. (Bug#953) + * Makefile.in (TAGS, tags, check): Pass MFLAGS to sub-makes. * configure.in (OPT_MAKEFILES_IN): Remove. === modified file 'configure.in' --- configure.in 2011-05-24 08:02:58 +0000 +++ configure.in 2011-05-24 08:16:58 +0000 @@ -364,17 +364,6 @@ * ) srcdir="`(cd ${srcdir}; pwd)`" ;; esac -#### Check if the source directory already has a configured system in it. -if test `pwd` != `(cd ${srcdir} && pwd)` \ - && test -f "${srcdir}/src/config.h" ; then - AC_MSG_WARN([[The directory tree `${srcdir}' is being used - as a build directory right now; it has been configured in its own - right. To configure in another directory as well, you MUST - use GNU make. If you do not have GNU make, then you must - now do `make distclean' in ${srcdir}, - and then run $0 again.]]) -fi - #### Given the configuration name, set machfile and opsysfile to the #### names of the m/*.h and s/*.h files we should use. ------------------------------------------------------------ revno: 104347 committer: Leo Liu branch nick: trunk timestamp: Tue 2011-05-24 16:12:52 +0800 message: Add crypto/sha1 module from gnulib diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 08:04:27 +0000 +++ ChangeLog 2011-05-24 08:12:52 +0000 @@ -1,3 +1,13 @@ +2011-05-24 Leo Liu + + * m4/sha1.m4: + * m4/gl-comp.m4: + * lib/sha1.h: + * lib/sha1.c: + * lib/makefile.w32-in (GNULIBOBJS): + * lib/gnulib.mk: + * Makefile.in (GNULIB_MODULES): Add crypto/sha1 module. + 2011-05-24 Glenn Morris * Makefile.in (TAGS, tags, check): Pass MFLAGS to sub-makes. === modified file 'Makefile.in' --- Makefile.in 2011-05-24 08:04:27 +0000 +++ Makefile.in 2011-05-24 08:12:52 +0000 @@ -332,8 +332,8 @@ # $(gnulib_srcdir) (relative to $(srcdir) and should have build tools # as per $(gnulib_srcdir)/DEPENDENCIES. GNULIB_MODULES = \ - careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu \ - ignore-value intprops lstat mktime readlink \ + careadlinkat crypto/md5 crypto/sha1 dtoastr filemode getloadavg \ + getopt-gnu ignore-value intprops lstat mktime readlink \ socklen stdarg stdio strftime strtoumax symlink sys_stat GNULIB_TOOL_FLAGS = \ --conditional-dependencies --import --no-changelog --no-vc-files \ === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-05-18 00:39:40 +0000 +++ lib/gnulib.mk 2011-05-24 08:12:52 +0000 @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 crypto/sha1 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat MOSTLYCLEANFILES += core *.stackdump @@ -94,6 +94,15 @@ ## end gnulib module crypto/md5 +## begin gnulib module crypto/sha1 + + +EXTRA_DIST += sha1.c sha1.h + +EXTRA_libgnu_a_SOURCES += sha1.c + +## end gnulib module crypto/sha1 + ## begin gnulib module dosname if gl_GNULIB_ENABLED_dosname === modified file 'lib/makefile.w32-in' --- lib/makefile.w32-in 2011-04-06 16:05:49 +0000 +++ lib/makefile.w32-in 2011-05-24 08:12:52 +0000 @@ -29,6 +29,7 @@ $(BLD)/strftime.$(O) \ $(BLD)/time_r.$(O) \ $(BLD)/md5.$(O) \ + $(BLD)/sha1.$(O) \ $(BLD)/filemode.$(O) # @@ -110,6 +111,15 @@ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h +$(BLD)/sha1.$(O) : \ + $(SRC)/sha1.c \ + $(SRC)/sha1.h \ + $(EMACS_ROOT)/nt/inc/stdint.h \ + $(EMACS_ROOT)/nt/inc/sys/stat.h \ + $(EMACS_ROOT)/src/s/ms-w32.h \ + $(EMACS_ROOT)/src/m/intel386.h \ + $(EMACS_ROOT)/src/config.h + $(BLD)/filemode.$(O) : \ $(SRC)/filemode.c \ $(SRC)/filemode.h \ === added file 'lib/sha1.c' --- lib/sha1.c 1970-01-01 00:00:00 +0000 +++ lib/sha1.c 2011-05-24 08:12:52 +0000 @@ -0,0 +1,427 @@ +/* sha1.c - Functions to compute SHA1 message digest of files or + memory blocks according to the NIST specification FIPS-180-1. + + Copyright (C) 2000-2001, 2003-2006, 2008-2011 Free Software Foundation, Inc. + + This program 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, or (at your option) any + later version. + + This program 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 this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Scott G. Miller + Credits: + Robert Klep -- Expansion function fix +*/ + +#include + +#include "sha1.h" + +#include +#include +#include + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +#ifdef WORDS_BIGENDIAN +# define SWAP(n) (n) +#else +# define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) +#endif + +#define BLOCKSIZE 32768 +#if BLOCKSIZE % 64 != 0 +# error "invalid BLOCKSIZE" +#endif + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (RFC 1321, 3.1: Step 1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; + + +/* Take a pointer to a 160 bit block of data (five 32 bit ints) and + initialize it to the start constants of the SHA1 algorithm. This + must be called before using hash in the call to sha1_hash. */ +void +sha1_init_ctx (struct sha1_ctx *ctx) +{ + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; + ctx->E = 0xc3d2e1f0; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +} + +/* Copy the 4 byte value from v into the memory location pointed to by *cp, + If your architecture allows unaligned access this is equivalent to + * (uint32_t *) cp = v */ +static inline void +set_uint32 (char *cp, uint32_t v) +{ + memcpy (cp, &v, sizeof v); +} + +/* Put result from CTX in first 20 bytes following RESBUF. The result + must be in little endian byte order. */ +void * +sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) +{ + char *r = resbuf; + set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); + set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); + set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); + set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); + set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E)); + + return resbuf; +} + +/* Process the remaining bytes in the internal buffer and the usual + prolog according to the standard and write the result to RESBUF. */ +void * +sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) +{ + /* Take yet unprocessed bytes into account. */ + uint32_t bytes = ctx->buflen; + size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; + + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if (ctx->total[0] < bytes) + ++ctx->total[1]; + + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); + ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3); + + memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); + + /* Process last bytes. */ + sha1_process_block (ctx->buffer, size * 4, ctx); + + return sha1_read_ctx (ctx, resbuf); +} + +/* Compute SHA1 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +int +sha1_stream (FILE *stream, void *resblock) +{ + struct sha1_ctx ctx; + size_t sum; + + char *buffer = malloc (BLOCKSIZE + 72); + if (!buffer) + return 1; + + /* Initialize the computation context. */ + sha1_init_ctx (&ctx); + + /* Iterate over full file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + computation function processes the whole buffer so that with the + next round of the loop another block can be read. */ + size_t n; + sum = 0; + + /* Read block. Take care for partial reads. */ + while (1) + { + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); + + sum += n; + + if (sum == BLOCKSIZE) + break; + + if (n == 0) + { + /* Check for the error flag IFF N == 0, so that we don't + exit the loop after a partial read due to e.g., EAGAIN + or EWOULDBLOCK. */ + if (ferror (stream)) + { + free (buffer); + return 1; + } + goto process_partial_block; + } + + /* We've read at least one byte, so ignore errors. But always + check for EOF, since feof may be true even though N > 0. + Otherwise, we could end up calling fread after EOF. */ + if (feof (stream)) + goto process_partial_block; + } + + /* Process buffer with BLOCKSIZE bytes. Note that + BLOCKSIZE % 64 == 0 + */ + sha1_process_block (buffer, BLOCKSIZE, &ctx); + } + + process_partial_block:; + + /* Process any remaining bytes. */ + if (sum > 0) + sha1_process_bytes (buffer, sum, &ctx); + + /* Construct result in desired memory. */ + sha1_finish_ctx (&ctx, resblock); + free (buffer); + return 0; +} + +/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +void * +sha1_buffer (const char *buffer, size_t len, void *resblock) +{ + struct sha1_ctx ctx; + + /* Initialize the computation context. */ + sha1_init_ctx (&ctx); + + /* Process whole buffer but last len % 64 bytes. */ + sha1_process_bytes (buffer, len, &ctx); + + /* Put result in desired memory area. */ + return sha1_finish_ctx (&ctx, resblock); +} + +void +sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) +{ + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) + { + size_t left_over = ctx->buflen; + size_t add = 128 - left_over > len ? len : 128 - left_over; + + memcpy (&((char *) ctx->buffer)[left_over], buffer, add); + ctx->buflen += add; + + if (ctx->buflen > 64) + { + sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); + + ctx->buflen &= 63; + /* The regions in the following copy operation cannot overlap. */ + memcpy (ctx->buffer, + &((char *) ctx->buffer)[(left_over + add) & ~63], + ctx->buflen); + } + + buffer = (const char *) buffer + add; + len -= add; + } + + /* Process available complete blocks. */ + if (len >= 64) + { +#if !_STRING_ARCH_unaligned +# define alignof(type) offsetof (struct { char c; type x; }, x) +# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0) + if (UNALIGNED_P (buffer)) + while (len > 64) + { + sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); + buffer = (const char *) buffer + 64; + len -= 64; + } + else +#endif + { + sha1_process_block (buffer, len & ~63, ctx); + buffer = (const char *) buffer + (len & ~63); + len &= 63; + } + } + + /* Move remaining bytes in internal buffer. */ + if (len > 0) + { + size_t left_over = ctx->buflen; + + memcpy (&((char *) ctx->buffer)[left_over], buffer, len); + left_over += len; + if (left_over >= 64) + { + sha1_process_block (ctx->buffer, 64, ctx); + left_over -= 64; + memcpy (ctx->buffer, &ctx->buffer[16], left_over); + } + ctx->buflen = left_over; + } +} + +/* --- Code below is the primary difference between md5.c and sha1.c --- */ + +/* SHA1 round constants */ +#define K1 0x5a827999 +#define K2 0x6ed9eba1 +#define K3 0x8f1bbcdc +#define K4 0xca62c1d6 + +/* Round functions. Note that F2 is the same as F4. */ +#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) ) +#define F2(B,C,D) (B ^ C ^ D) +#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) ) +#define F4(B,C,D) (B ^ C ^ D) + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. + Most of this code comes from GnuPG's cipher/sha1.c. */ + +void +sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) +{ + const uint32_t *words = buffer; + size_t nwords = len / sizeof (uint32_t); + const uint32_t *endp = words + nwords; + uint32_t x[16]; + uint32_t a = ctx->A; + uint32_t b = ctx->B; + uint32_t c = ctx->C; + uint32_t d = ctx->D; + uint32_t e = ctx->E; + + /* First increment the byte count. RFC 1321 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if (ctx->total[0] < len) + ++ctx->total[1]; + +#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n)))) + +#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ + ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ + , (x[I&0x0f] = rol(tm, 1)) ) + +#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \ + + F( B, C, D ) \ + + K \ + + M; \ + B = rol( B, 30 ); \ + } while(0) + + while (words < endp) + { + uint32_t tm; + int t; + for (t = 0; t < 16; t++) + { + x[t] = SWAP (*words); + words++; + } + + R( a, b, c, d, e, F1, K1, x[ 0] ); + R( e, a, b, c, d, F1, K1, x[ 1] ); + R( d, e, a, b, c, F1, K1, x[ 2] ); + R( c, d, e, a, b, F1, K1, x[ 3] ); + R( b, c, d, e, a, F1, K1, x[ 4] ); + R( a, b, c, d, e, F1, K1, x[ 5] ); + R( e, a, b, c, d, F1, K1, x[ 6] ); + R( d, e, a, b, c, F1, K1, x[ 7] ); + R( c, d, e, a, b, F1, K1, x[ 8] ); + R( b, c, d, e, a, F1, K1, x[ 9] ); + R( a, b, c, d, e, F1, K1, x[10] ); + R( e, a, b, c, d, F1, K1, x[11] ); + R( d, e, a, b, c, F1, K1, x[12] ); + R( c, d, e, a, b, F1, K1, x[13] ); + R( b, c, d, e, a, F1, K1, x[14] ); + R( a, b, c, d, e, F1, K1, x[15] ); + R( e, a, b, c, d, F1, K1, M(16) ); + R( d, e, a, b, c, F1, K1, M(17) ); + R( c, d, e, a, b, F1, K1, M(18) ); + R( b, c, d, e, a, F1, K1, M(19) ); + R( a, b, c, d, e, F2, K2, M(20) ); + R( e, a, b, c, d, F2, K2, M(21) ); + R( d, e, a, b, c, F2, K2, M(22) ); + R( c, d, e, a, b, F2, K2, M(23) ); + R( b, c, d, e, a, F2, K2, M(24) ); + R( a, b, c, d, e, F2, K2, M(25) ); + R( e, a, b, c, d, F2, K2, M(26) ); + R( d, e, a, b, c, F2, K2, M(27) ); + R( c, d, e, a, b, F2, K2, M(28) ); + R( b, c, d, e, a, F2, K2, M(29) ); + R( a, b, c, d, e, F2, K2, M(30) ); + R( e, a, b, c, d, F2, K2, M(31) ); + R( d, e, a, b, c, F2, K2, M(32) ); + R( c, d, e, a, b, F2, K2, M(33) ); + R( b, c, d, e, a, F2, K2, M(34) ); + R( a, b, c, d, e, F2, K2, M(35) ); + R( e, a, b, c, d, F2, K2, M(36) ); + R( d, e, a, b, c, F2, K2, M(37) ); + R( c, d, e, a, b, F2, K2, M(38) ); + R( b, c, d, e, a, F2, K2, M(39) ); + R( a, b, c, d, e, F3, K3, M(40) ); + R( e, a, b, c, d, F3, K3, M(41) ); + R( d, e, a, b, c, F3, K3, M(42) ); + R( c, d, e, a, b, F3, K3, M(43) ); + R( b, c, d, e, a, F3, K3, M(44) ); + R( a, b, c, d, e, F3, K3, M(45) ); + R( e, a, b, c, d, F3, K3, M(46) ); + R( d, e, a, b, c, F3, K3, M(47) ); + R( c, d, e, a, b, F3, K3, M(48) ); + R( b, c, d, e, a, F3, K3, M(49) ); + R( a, b, c, d, e, F3, K3, M(50) ); + R( e, a, b, c, d, F3, K3, M(51) ); + R( d, e, a, b, c, F3, K3, M(52) ); + R( c, d, e, a, b, F3, K3, M(53) ); + R( b, c, d, e, a, F3, K3, M(54) ); + R( a, b, c, d, e, F3, K3, M(55) ); + R( e, a, b, c, d, F3, K3, M(56) ); + R( d, e, a, b, c, F3, K3, M(57) ); + R( c, d, e, a, b, F3, K3, M(58) ); + R( b, c, d, e, a, F3, K3, M(59) ); + R( a, b, c, d, e, F4, K4, M(60) ); + R( e, a, b, c, d, F4, K4, M(61) ); + R( d, e, a, b, c, F4, K4, M(62) ); + R( c, d, e, a, b, F4, K4, M(63) ); + R( b, c, d, e, a, F4, K4, M(64) ); + R( a, b, c, d, e, F4, K4, M(65) ); + R( e, a, b, c, d, F4, K4, M(66) ); + R( d, e, a, b, c, F4, K4, M(67) ); + R( c, d, e, a, b, F4, K4, M(68) ); + R( b, c, d, e, a, F4, K4, M(69) ); + R( a, b, c, d, e, F4, K4, M(70) ); + R( e, a, b, c, d, F4, K4, M(71) ); + R( d, e, a, b, c, F4, K4, M(72) ); + R( c, d, e, a, b, F4, K4, M(73) ); + R( b, c, d, e, a, F4, K4, M(74) ); + R( a, b, c, d, e, F4, K4, M(75) ); + R( e, a, b, c, d, F4, K4, M(76) ); + R( d, e, a, b, c, F4, K4, M(77) ); + R( c, d, e, a, b, F4, K4, M(78) ); + R( b, c, d, e, a, F4, K4, M(79) ); + + a = ctx->A += a; + b = ctx->B += b; + c = ctx->C += c; + d = ctx->D += d; + e = ctx->E += e; + } +} === added file 'lib/sha1.h' --- lib/sha1.h 1970-01-01 00:00:00 +0000 +++ lib/sha1.h 2011-05-24 08:12:52 +0000 @@ -0,0 +1,92 @@ +/* Declarations of functions and data types used for SHA1 sum + library functions. + Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2011 Free Software + Foundation, Inc. + + This program 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, or (at your option) any + later version. + + This program 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 this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef SHA1_H +# define SHA1_H 1 + +# include +# include + +# ifdef __cplusplus +extern "C" { +# endif + +#define SHA1_DIGEST_SIZE 20 + +/* Structure to save state of computation between the single steps. */ +struct sha1_ctx +{ + uint32_t A; + uint32_t B; + uint32_t C; + uint32_t D; + uint32_t E; + + uint32_t total[2]; + uint32_t buflen; + uint32_t buffer[32]; +}; + + +/* Initialize structure containing state of computation. */ +extern void sha1_init_ctx (struct sha1_ctx *ctx); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is necessary that LEN is a multiple of 64!!! */ +extern void sha1_process_block (const void *buffer, size_t len, + struct sha1_ctx *ctx); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is NOT required that LEN is a multiple of 64. */ +extern void sha1_process_bytes (const void *buffer, size_t len, + struct sha1_ctx *ctx); + +/* Process the remaining bytes in the buffer and put result from CTX + in first 20 bytes following RESBUF. The result is always in little + endian byte order, so that a byte-wise output yields to the wanted + ASCII representation of the message digest. */ +extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); + + +/* Put result from CTX in first 20 bytes following RESBUF. The result is + always in little endian byte order, so that a byte-wise output yields + to the wanted ASCII representation of the message digest. */ +extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); + + +/* Compute SHA1 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 20 bytes + beginning at RESBLOCK. */ +extern int sha1_stream (FILE *stream, void *resblock); + +/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +extern void *sha1_buffer (const char *buffer, size_t len, void *resblock); + +# ifdef __cplusplus +} +# endif + +#endif === modified file 'm4/gl-comp.m4' --- m4/gl-comp.m4 2011-05-04 07:19:21 +0000 +++ m4/gl-comp.m4 2011-05-24 08:12:52 +0000 @@ -31,6 +31,7 @@ # Code from module c++defs: # Code from module careadlinkat: # Code from module crypto/md5: + # Code from module crypto/sha1: # Code from module dosname: # Code from module dtoastr: # Code from module extensions: @@ -92,6 +93,7 @@ gl_source_base='lib' AC_CHECK_FUNCS_ONCE([readlinkat]) gl_MD5 +gl_SHA1 AC_REQUIRE([gl_C99_STRTOLD]) gl_FILEMODE gl_GETLOADAVG([$gl_source_base]) @@ -364,6 +366,8 @@ lib/mktime-internal.h lib/mktime.c lib/readlink.c + lib/sha1.c + lib/sha1.h lib/stat.c lib/stdarg.in.h lib/stdbool.in.h @@ -399,6 +403,7 @@ m4/mktime.m4 m4/multiarch.m4 m4/readlink.m4 + m4/sha1.m4 m4/socklen.m4 m4/ssize_t.m4 m4/st_dm_mode.m4 === added file 'm4/sha1.m4' --- m4/sha1.m4 1970-01-01 00:00:00 +0000 +++ m4/sha1.m4 2011-05-24 08:12:52 +0000 @@ -0,0 +1,15 @@ +# sha1.m4 serial 9 +dnl Copyright (C) 2002-2006, 2008-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, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_SHA1], +[ + AC_LIBOBJ([sha1]) + + dnl Prerequisites of lib/sha1.c. + AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([AC_C_INLINE]) + : +]) ------------------------------------------------------------ revno: 104346 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 01:04:27 -0700 message: * Makefile.in (TAGS, tags, check): Pass MFLAGS to sub-makes. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 08:02:58 +0000 +++ ChangeLog 2011-05-24 08:04:27 +0000 @@ -1,5 +1,7 @@ 2011-05-24 Glenn Morris + * Makefile.in (TAGS, tags, check): Pass MFLAGS to sub-makes. + * configure.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. (SUBDIR_MAKEFILES_IN): New output variable. === modified file 'Makefile.in' --- Makefile.in 2011-05-24 08:02:58 +0000 +++ Makefile.in 2011-05-24 08:04:27 +0000 @@ -855,13 +855,13 @@ # The src subdir knows how to do the right thing # even when the build directory and source dir are different. TAGS tags: lib lib-src src - cd src; $(MAKE) tags + cd src; $(MAKE) $(MFLAGS) tags check: @if test ! -d test/automated; then \ echo "You do not seem to have the test/ directory."; exit 1; \ else true; fi - cd test/automated && $(MAKE) check + cd test/automated && $(MAKE) $(MFLAGS) check dist: cd ${srcdir}; ./make-dist ------------------------------------------------------------ revno: 104345 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 01:02:58 -0700 message: Define the list of subdir Makefiles only in configure.in. * configure.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. (SUBDIR_MAKEFILES_IN): New output variable. * Makefile.in (OPT_MAKEFILES_IN): Remove. (SUBDIR_MAKEFILES_IN): Let configure set it. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 04:00:56 +0000 +++ ChangeLog 2011-05-24 08:02:58 +0000 @@ -1,5 +1,13 @@ 2011-05-24 Glenn Morris + * configure.in (OPT_MAKEFILES_IN): Remove. + (SUBDIR_MAKEFILES): New variable, passed to AC_CONFIG_FILES. + (SUBDIR_MAKEFILES_IN): New output variable. + * Makefile.in (OPT_MAKEFILES_IN): Remove. + (SUBDIR_MAKEFILES_IN): Let configure set it. + +2011-05-24 Glenn Morris + * make-dist: Don't distribute test/. (Bug#8107) * configure.in (OPT_MAKEFILES_IN): New output variable. (AC_CONFIG_FILES): Conditionally include test/automated/Makefile. === modified file 'Makefile.in' --- Makefile.in 2011-05-24 07:06:44 +0000 +++ Makefile.in 2011-05-24 08:02:58 +0000 @@ -264,22 +264,8 @@ # checked out from a VCS. SUBDIR = lib lib-src src lisp -# test/automated/Makefile.in, if you have it (test/ is not in the release). -OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ - # The subdir makefiles created by config.status. -SUBDIR_MAKEFILES_IN = $(srcdir)/lib/Makefile.in \ - $(srcdir)/lib-src/Makefile.in \ - $(srcdir)/doc/emacs/Makefile.in \ - $(srcdir)/doc/misc/Makefile.in \ - $(srcdir)/doc/lispref/Makefile.in \ - $(srcdir)/doc/lispintro/Makefile.in \ - $(srcdir)/src/Makefile.in \ - $(srcdir)/oldXMenu/Makefile.in \ - $(srcdir)/lwlib/Makefile.in \ - $(srcdir)/leim/Makefile.in \ - $(srcdir)/lisp/Makefile.in $(OPT_MAKEFILES_IN) - +SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` # Subdirectories to install, and where they'll go. === modified file 'configure.in' --- configure.in 2011-05-24 07:06:44 +0000 +++ configure.in 2011-05-24 08:02:58 +0000 @@ -3712,19 +3712,18 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] -AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ - doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ - doc/lispref/Makefile src/Makefile \ - lwlib/Makefile lisp/Makefile leim/Makefile]) +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" dnl test/ is not present in release tarfiles. -if test -f $srcdir/test/automated/Makefile.in; then - OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" - AC_CONFIG_FILES([test/automated/Makefile]) -else - OPT_MAKEFILES_IN= -fi -AC_SUBST(OPT_MAKEFILES_IN) +opt_makefile=test/automated/Makefile + +test -f $srcdir/${opt_makefile}.in && \ + SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" + +SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` + +AC_SUBST(SUBDIR_MAKEFILES_IN) +AC_CONFIG_FILES([Makefile ${SUBDIR_MAKEFILES}]) dnl Make the necessary directories, if they don't exist. AC_CONFIG_COMMANDS([mkdirs], [ ------------------------------------------------------------ revno: 104344 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 03:20:51 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2011-05-24 04:03:44 +0000 +++ autogen/configure 2011-05-24 07:20:51 +0000 @@ -20913,7 +20913,7 @@ if test -f $srcdir/test/automated/Makefile.in; then - OPT_MAKEFILES_IN=test/automated/Makefile.in + OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" ac_config_files="$ac_config_files test/automated/Makefile" else ------------------------------------------------------------ revno: 104343 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 00:06:44 -0700 message: Fix previous Makefile change. * configure.in (OPT_MAKEFILES_IN): Use full path. * Makefile.in (SUBDIR_MAKEFILES_IN): Use full path. (SUBDIR_MAKEFILES): Use relative path. diff: === modified file 'Makefile.in' --- Makefile.in 2011-05-24 04:00:56 +0000 +++ Makefile.in 2011-05-24 07:06:44 +0000 @@ -268,12 +268,19 @@ OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ # The subdir makefiles created by config.status. -SUBDIR_MAKEFILES_IN = lib/Makefile.in lib-src/Makefile.in \ - doc/emacs/Makefile.in doc/misc/Makefile.in doc/lispref/Makefile.in \ - doc/lispintro/Makefile.in src/Makefile.in oldXMenu/Makefile.in \ - lwlib/Makefile.in leim/Makefile.in lisp/Makefile.in $(OPT_MAKEFILES_IN) +SUBDIR_MAKEFILES_IN = $(srcdir)/lib/Makefile.in \ + $(srcdir)/lib-src/Makefile.in \ + $(srcdir)/doc/emacs/Makefile.in \ + $(srcdir)/doc/misc/Makefile.in \ + $(srcdir)/doc/lispref/Makefile.in \ + $(srcdir)/doc/lispintro/Makefile.in \ + $(srcdir)/src/Makefile.in \ + $(srcdir)/oldXMenu/Makefile.in \ + $(srcdir)/lwlib/Makefile.in \ + $(srcdir)/leim/Makefile.in \ + $(srcdir)/lisp/Makefile.in $(OPT_MAKEFILES_IN) -SUBDIR_MAKEFILES = $(SUBDIR_MAKEFILES_IN:.in=) +SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` # Subdirectories to install, and where they'll go. # lib-src's makefile knows how to install it, so we don't do that here. === modified file 'configure.in' --- configure.in 2011-05-24 04:00:56 +0000 +++ configure.in 2011-05-24 07:06:44 +0000 @@ -3719,7 +3719,7 @@ dnl test/ is not present in release tarfiles. if test -f $srcdir/test/automated/Makefile.in; then - OPT_MAKEFILES_IN=test/automated/Makefile.in + OPT_MAKEFILES_IN="\$(srcdir)/test/automated/Makefile.in" AC_CONFIG_FILES([test/automated/Makefile]) else OPT_MAKEFILES_IN= ------------------------------------------------------------ revno: 104342 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 00:03:44 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2011-05-20 00:54:09 +0000 +++ autogen/Makefile.in 2011-05-24 04:03:44 +0000 @@ -508,6 +508,7 @@ OLDXMENU = @OLDXMENU@ OLDXMENU_DEPS = @OLDXMENU_DEPS@ OLDXMENU_TARGET = @OLDXMENU_TARGET@ +OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ OTHER_FILES = @OTHER_FILES@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ === modified file 'autogen/configure' --- autogen/configure 2011-05-20 00:54:09 +0000 +++ autogen/configure 2011-05-24 04:03:44 +0000 @@ -603,6 +603,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +OPT_MAKEFILES_IN LIB_GCC LD_FIRSTFLAG LD_SWITCH_SYSTEM_TEMACS @@ -20908,7 +20909,16 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` -ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + + +if test -f $srcdir/test/automated/Makefile.in; then + OPT_MAKEFILES_IN=test/automated/Makefile.in + ac_config_files="$ac_config_files test/automated/Makefile" + +else + OPT_MAKEFILES_IN= +fi ac_config_commands="$ac_config_commands mkdirs" ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.