Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 99770. ------------------------------------------------------------ revno: 99770 [merge] committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2010-03-30 04:46:45 +0000 message: 2010-03-30 Martin Stjernholm * mm-decode.el (mm-add-meta-html-tag): Added option to override the charset. * gnus-art.el (gnus-article-browse-html-parts): Force the correct charset into the tag when the article is encoded to utf-8. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-03-30 04:03:00 +0000 +++ lisp/gnus/ChangeLog 2010-03-30 04:44:38 +0000 @@ -1,3 +1,11 @@ +2010-03-30 Martin Stjernholm + + * mm-decode.el (mm-add-meta-html-tag): Added option to override the + charset. + + * gnus-art.el (gnus-article-browse-html-parts): Force the correct + charset into the tag when the article is encoded to utf-8. + 2010-03-30 Katsumi Yamaoka * gnus-art.el (gnus-article-browse-delete-temp-files): Delete === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-03-30 04:03:00 +0000 +++ lisp/gnus/gnus-art.el 2010-03-30 04:44:38 +0000 @@ -2893,7 +2893,8 @@ ;; Add a meta html tag to specify charset and a header. (cond (header - (let (title eheader body hcharset coding cid-image-dir) + (let (title eheader body hcharset coding force-charset + cid-image-dir) (with-temp-buffer (mm-enable-multibyte) (setq case-fold-search t) @@ -2917,7 +2918,8 @@ title (when title (mm-encode-coding-string title charset)) body (mm-encode-coding-string (mm-get-part handle) - charset)) + charset) + force-charset t) (setq hcharset (mm-find-mime-charset-region (point-min) (point-max))) (cond ((= (length hcharset) 1) @@ -2948,7 +2950,8 @@ body (mm-encode-coding-string (mm-decode-coding-string (mm-get-part handle) body) - charset)))) + charset) + force-charset t))) (setq charset hcharset eheader (mm-encode-coding-string (buffer-string) coding) @@ -2962,7 +2965,7 @@ (mm-disable-multibyte) (insert body) (when charset - (mm-add-meta-html-tag handle charset)) + (mm-add-meta-html-tag handle charset force-charset)) (when title (goto-char (point-min)) (unless (search-forward "" nil t) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2010-03-29 10:16:37 +0000 +++ lisp/gnus/mm-decode.el 2010-03-30 04:44:38 +0000 @@ -1258,11 +1258,11 @@ (mm-save-part-to-file handle file) file)))) -(defun mm-add-meta-html-tag (handle &optional charset) +(defun mm-add-meta-html-tag (handle &optional charset force-charset) "Add meta html tag to specify CHARSET of HANDLE in the current buffer. CHARSET defaults to the one HANDLE specifies. Existing meta tag that -specifies charset will not be modified. Return t if meta tag is added -or replaced." +specifies charset will not be modified unless FORCE-CHARSET is non-nil. +Return t if meta tag is added or replaced." (when (equal (mm-handle-media-type handle) "text/html") (when (or charset (setq charset (mail-content-type-get (mm-handle-type handle) @@ -1274,7 +1274,8 @@ (if (re-search-forward "\ <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']\ text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t) - (if (and (match-beginning 2) + (if (and (not force-charset) + (match-beginning 2) (string-match "\\`html\\'" (match-string 1))) ;; Don't modify existing meta tag. nil ------------------------------------------------------------ revno: 99769 [merge] committer: Katsumi Yamaoka <yamaoka@jpl.org> branch nick: trunk timestamp: Tue 2010-03-30 04:04:58 +0000 message: 2010-03-30 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (gnus-article-browse-delete-temp-files): Delete directories as well. (gnus-article-browse-html-parts): Work for images that do not specify file names; delete temp directory when quitting; insert header at the right place; use file: scheme for image files. 2010-03-30 Eric Schulte <schulte.eric@gmail.com> * gnus-art.el (gnus-article-browse-html-save-cid-image): New function. (gnus-article-browse-html-parts): Use it to make temporary cid image files in addition to html file so that browser may display them. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-03-29 10:16:37 +0000 +++ lisp/gnus/ChangeLog 2010-03-30 04:03:00 +0000 @@ -1,3 +1,17 @@ +2010-03-30 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus-art.el (gnus-article-browse-delete-temp-files): Delete + directories as well. + (gnus-article-browse-html-parts): Work for images that do not specify + file names; delete temp directory when quitting; insert header at the + right place; use file: scheme for image files. + +2010-03-30 Eric Schulte <schulte.eric@gmail.com> + + * gnus-art.el (gnus-article-browse-html-save-cid-image): New function. + (gnus-article-browse-html-parts): Use it to make temporary cid image + files in addition to html file so that browser may display them. + 2010-03-29 Katsumi Yamaoka <yamaoka@jpl.org> * mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-03-23 07:37:09 +0000 +++ lisp/gnus/gnus-art.el 2010-03-30 04:03:00 +0000 @@ -2819,12 +2819,43 @@ ;; `how' is neither `nil', `ask' nor `t' (i.e. `file'): (gnus-y-or-n-p (format "Delete temporary HTML file `%s'? " file)))) - (delete-file file))) + (if (file-directory-p file) + (gnus-delete-directory file) + (delete-file file)))) ;; Also remove file from the list when not deleted or if file doesn't ;; exist anymore. (setq gnus-article-browse-html-temp-list nil)) gnus-article-browse-html-temp-list) +(defun gnus-article-browse-html-save-cid-image (cid dir) + "Save CID contents to a file in DIR. Return file name." + (save-match-data + (gnus-with-article-buffer + (let (cid-handle cid-tmp-file cid-type) + (mapc + (lambda (handle) + (when (and (listp handle) + (stringp (car (last handle))) + (string= (format "<%s>" cid) + (car (last handle)))) + (setq cid-handle handle) + (setq cid-tmp-file + (expand-file-name + (or (mail-content-type-get + (mm-handle-disposition handle) 'filename) + (mail-content-type-get + (setq cid-type (mm-handle-type handle)) 'name) + (concat (make-temp-name "cid") + (or (car (rassoc (car cid-type) + mailcap-mime-extensions)) + ""))) + dir)))) + gnus-article-mime-handles) + (when (and cid-handle cid-tmp-file) + (mm-save-part-to-file cid-handle + cid-tmp-file) + (concat "file://" cid-tmp-file)))))) + (defun gnus-article-browse-html-parts (list &optional header) "View all \"text/html\" parts from LIST. Recurse into multiparts. The optional HEADER that should be a decoded @@ -2862,7 +2893,7 @@ ;; Add a meta html tag to specify charset and a header. (cond (header - (let (title eheader body hcharset coding) + (let (title eheader body hcharset coding cid-image-dir) (with-temp-buffer (mm-enable-multibyte) (setq case-fold-search t) @@ -2943,6 +2974,18 @@ (re-search-forward "</head\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t)) (insert eheader) + ;; resolve cid images + (while (re-search-forward + "<img src=\"\\(cid:\\([^\"]+\\)\\)\"" + nil t) + (unless cid-image-dir + (setq cid-image-dir (make-temp-file "cid" t)) + (add-to-list 'gnus-article-browse-html-temp-list + cid-image-dir)) + (replace-match + (gnus-article-browse-html-save-cid-image + (match-string 2) cid-image-dir) + nil nil nil 1)) (mm-write-region (point-min) (point-max) tmp-file nil nil nil 'binary t)))) (charset ------------------------------------------------------------ revno: 99768 committer: Dan Nicolaescu <dann@ics.uci.edu> branch nick: trunk timestamp: Mon 2010-03-29 19:47:23 -0700 message: Remove all uses of C_DEBUG_SWITCH and LIBS_DEBUG. * s/usg5-4.h (LIBS_DEBUG): * s/irix6-5.h (C_DEBUG_SWITCH): * s/gnu-linux.h (LIBS_DEBUG): * s/darwin.h (LIBS_DEBUG): * s/bsd-common.h (LIBS_DEBUG): * s/aix4-2.h (LIBS_DEBUG, C_DEBUG_SWITCH): * m/iris4d.h (LIBS_DEBUG): * m/hp800.h (LIBS_DEBUG): Remove definitions. * Makefile.in (LIBES): Remove reference to LIBS_DEBUG. (LIBS_DEBUG): Remove definition. * configure.in: Remove all references to C_DEBUG_SWITCH. diff: === modified file 'ChangeLog' --- ChangeLog 2010-03-30 00:22:34 +0000 +++ ChangeLog 2010-03-30 02:47:23 +0000 @@ -1,3 +1,7 @@ +2010-03-30 Dan Nicolaescu <dann@ics.uci.edu> + + * configure.in: Remove all references to C_DEBUG_SWITCH. + 2010-03-27 Eli Zaretskii <eliz@gnu.org> * config.bat <lib-src>: Edit out lines that begin with several # === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-03-22 02:56:56 +0000 +++ admin/CPP-DEFINES 2010-03-30 02:47:23 +0000 @@ -106,7 +106,6 @@ CLASH_DETECTION COFF_BSD_SYMBOLS CRT0_DUMMIES -C_DEBUG_SWITCH C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SYSTEM_TEMACS @@ -234,7 +233,6 @@ LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_SYSTEM_tmp LD_SWITCH_X_DEFAULT -LIBS_DEBUG LIBS_MACHINE LIBS_SYSTEM LIBS_TERMCAP === modified file 'configure.in' --- configure.in 2010-03-24 18:02:56 +0000 +++ configure.in 2010-03-30 02:47:23 +0000 @@ -888,10 +888,6 @@ configure___ use_mmap_for_buffers=no #endif -#ifndef C_DEBUG_SWITCH -#define C_DEBUG_SWITCH -g -#endif - #ifndef C_OPTIMIZE_SWITCH #ifdef __GNUC__ #define C_OPTIMIZE_SWITCH -O2 @@ -923,18 +919,18 @@ /* Get the CFLAGS for tests in configure. */ #ifdef __GNUC__ -configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}' +configure___ CFLAGS=C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}' #else -configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}' +configure___ CFLAGS='${SPECIFIED_CFLAGS}' #endif #else /* not THIS_IS_CONFIGURE */ /* Get the CFLAGS for real compilation. */ #ifdef __GNUC__ -configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}' +configure___ REAL_CFLAGS=C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}' #else -configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}' +configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}' #endif #endif /* not THIS_IS_CONFIGURE */ === modified file 'src/ChangeLog' --- src/ChangeLog 2010-03-27 00:45:32 +0000 +++ src/ChangeLog 2010-03-30 02:47:23 +0000 @@ -1,3 +1,18 @@ +2010-03-30 Dan Nicolaescu <dann@ics.uci.edu> + + Remove all uses of C_DEBUG_SWITCH and LIBS_DEBUG. + * s/usg5-4.h (LIBS_DEBUG): + * s/irix6-5.h (C_DEBUG_SWITCH): + * s/gnu-linux.h (LIBS_DEBUG): + * s/darwin.h (LIBS_DEBUG): + * s/bsd-common.h (LIBS_DEBUG): + * s/aix4-2.h (LIBS_DEBUG, C_DEBUG_SWITCH): + * m/iris4d.h (LIBS_DEBUG): + * m/hp800.h (LIBS_DEBUG): Remove definitions. + + * Makefile.in (LIBES): Remove reference to LIBS_DEBUG. + (LIBS_DEBUG): Remove definition. + 2010-03-27 Chong Yidong <cyd@stupidchicken.com> * process.c (Fmake_network_process): Don't apply Bug#5173 fix for === modified file 'src/Makefile.in' --- src/Makefile.in 2010-03-21 11:57:49 +0000 +++ src/Makefile.in 2010-03-30 02:47:23 +0000 @@ -127,11 +127,6 @@ #define LIB_STANDARD #endif -/* Unless inhibited or changed, use -lg to link for debugging. */ -#ifndef LIBS_DEBUG -#define LIBS_DEBUG -lg -#endif - /* Some s/SYSTEM.h files define this to request special libraries. */ #ifndef LIBS_SYSTEM #define LIBS_SYSTEM @@ -850,7 +845,7 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \ @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \ - LIBS_DEBUG $(GETLOADAVG_LIBS) ${GCONF_LIBS} \ + $(GETLOADAVG_LIBS) ${GCONF_LIBS} \ @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \ $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR) === modified file 'src/m/hp800.h' --- src/m/hp800.h 2010-03-23 02:39:19 +0000 +++ src/m/hp800.h 2010-03-30 02:47:23 +0000 @@ -93,8 +93,6 @@ #define UNEXEC unexhp9k800.o -#define LIBS_DEBUG - /* Include the file bsdtty.h, since this machine has job control. */ #define NEED_BSDTTY === modified file 'src/m/iris4d.h' --- src/m/iris4d.h 2010-03-23 02:39:19 +0000 +++ src/m/iris4d.h 2010-03-30 02:47:23 +0000 @@ -53,8 +53,6 @@ #define DATA_START 0x10000000 #define DATA_SEG_BITS 0x10000000 -#define LIBS_DEBUG - /* Use terminfo instead of termcap. */ #define TERMINFO === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2010-03-23 02:39:19 +0000 +++ src/s/aix4-2.h 2010-03-30 02:47:23 +0000 @@ -87,10 +87,6 @@ #define LINKER cc #endif -/* Prevent -lg from being used for debugging. Not needed. */ - -#define LIBS_DEBUG - /* No need to specify -lc when linking. */ #define LIB_STANDARD @@ -130,16 +126,6 @@ It is just a guess which versions of AIX need this definition. */ #undef HAVE_STRING_H -/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g" - because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because - "cc -g" crashes. Go figure. --floppy@merlin.mit.edu */ -/* The above isn't generally true. If it occurs with some compiler - release, seek a fixed version, be it XLC or GCC. The XLC version - isn't tied to the OS version on AIX any more than elsewhere. XLC - (the IBM compiler) can use -g with -O. (-O3 is also a possibility - for the optimization level.) -- fx, after David Edelsohn. */ -#define C_DEBUG_SWITCH -g -O - /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */ #define SIGNALS_VIA_CHARACTERS #define MAIL_USE_LOCKF === modified file 'src/s/bsd-common.h' --- src/s/bsd-common.h 2010-03-20 07:57:11 +0000 +++ src/s/bsd-common.h 2010-03-30 02:47:23 +0000 @@ -46,8 +46,6 @@ #define HAVE_TERMIOS #define NO_TERMIO -#define LIBS_DEBUG - #define SYSV_SYSTEM_DIR /* POSIX-style pgrp behavior. */ === modified file 'src/s/darwin.h' --- src/s/darwin.h 2010-01-13 08:35:10 +0000 +++ src/s/darwin.h 2010-03-30 02:47:23 +0000 @@ -189,9 +189,6 @@ /* Link this program just by running cc. */ #define ORDINARY_LINK -/* We don't have a g library, so override the -lg LIBS_DEBUG switch. */ -#define LIBS_DEBUG - /* Adding -lm confuses the dynamic linker, so omit it. */ #define LIB_MATH === modified file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2010-03-23 02:47:41 +0000 +++ src/s/gnu-linux.h 2010-03-30 02:47:23 +0000 @@ -194,19 +194,10 @@ #define POSIX /* affects getpagesize.h and systty.h */ #define POSIX_SIGNALS -/* Best not to include -lg, unless it is last on the command line */ -#define LIBS_DEBUG #undef LIB_GCC #define LIB_GCC #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o -/* Don't use -g in test compiles in configure. - This is so we will use the same shared libs for that linking - that are used when linking temacs. */ -#ifdef THIS_IS_CONFIGURE -#define C_DEBUG_SWITCH -#endif - /* _BSD_SOURCE is redundant, at least in glibc2, since we define _GNU_SOURCE. Left in in case it's relevant to libc5 systems and anyone's still using Emacs on those. --fx 2002-12-14 */ === modified file 'src/s/irix6-5.h' --- src/s/irix6-5.h 2010-03-20 07:09:31 +0000 +++ src/s/irix6-5.h 2010-03-30 02:47:23 +0000 @@ -101,19 +101,6 @@ #define _LP64 /* lisp.h takes care of the rest */ #endif /* _MIPS_SZLONG */ -/* The only supported 32-bit configuration of GCC under IRIX6.x produces - n32 MIPS ABI binaries and also supports -g. */ -#ifdef __GNUC__ -#define C_DEBUG_SWITCH -g -#else -/* Optimize, inaccurate debugging, increase limit on size of what's - optimized. - - This should also be applicable other than on Irix 6.5, but I don't - know for which compiler versions. -- fx */ -#define C_DEBUG_SWITCH -g3 -O -OPT:Olimit=3500 -#endif - #undef SA_RESTART #undef TIOCSIGSEND /* defined in usg5-4.h */ === modified file 'src/s/sol2-6.h' --- src/s/sol2-6.h 2010-03-20 07:09:31 +0000 +++ src/s/sol2-6.h 2010-03-30 02:47:23 +0000 @@ -48,11 +48,6 @@ #define LIBS_TERMCAP -ltermcap #endif -#ifndef __GNUC__ -/* eggert thinks all versions of SunPro C allowed this. */ -#define C_DEBUG_SWITCH -g -O -#endif /* GCC */ - /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x === modified file 'src/s/usg5-4.h' --- src/s/usg5-4.h 2010-03-20 07:09:31 +0000 +++ src/s/usg5-4.h 2010-03-30 02:47:23 +0000 @@ -103,10 +103,6 @@ #define LIB_STANDARD -/* there are no -lg libraries on this system, and no libPW */ - -#define LIBS_DEBUG - /* Undump with ELF */ #undef COFF ------------------------------------------------------------ revno: 99767 committer: Nick Roberts <nickrob@snap.net.nz> branch nick: trunk timestamp: Tue 2010-03-30 13:22:34 +1300 message: *** empty log message *** diff: === modified file 'ChangeLog' --- ChangeLog 2010-03-27 13:27:43 +0000 +++ ChangeLog 2010-03-30 00:22:34 +0000 @@ -1,7 +1,3 @@ -2010-03-27 Nick Roberts <nickrob@snap.net.nz> - - * Restore GDB/MI fuctionality removed by r99212. - 2010-03-27 Eli Zaretskii <eliz@gnu.org> * config.bat <lib-src>: Edit out lines that begin with several # === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2010-03-28 04:00:37 +0000 +++ doc/emacs/ChangeLog 2010-03-30 00:22:34 +0000 @@ -2,6 +2,11 @@ * emacs.texi (Top): Update node names to those in building.texi. +2010-03-27 Nick Roberts <nickrob@snap.net.nz> + + doc/emacs/building.texi: Describe restored GDB/MI fuctionality removed by r99212. + doc/emacs/emacs.texi: Update node names for building.texi. + 2010-03-24 Glenn Morris <rgm@gnu.org> * ack.texi (Acknowledgments): === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-03-29 23:18:48 +0000 +++ lisp/ChangeLog 2010-03-30 00:22:34 +0000 @@ -15,6 +15,13 @@ * find-dired.el (find-dired): Use read-directory-name (Bug#5777). +2010-03-27 Nick Roberts <nickrob@snap.net.nz> + + Restore GDB/MI fuctionality removed by r99212. + * lisp/progmodes/gdb-mi.el: Restored. + * lisp/progmodes/gdb-ui.el: Removed. + * lisp/progmodes/gud.el: Re-accommodated for gdb-mi.el. + 2010-03-25 Glenn Morris <rgm@gnu.org> * desktop.el (desktop-save-buffer-p): Don't mistakenly include ------------------------------------------------------------ revno: 99766 committer: Chong Yidong <cyd@stupidchicken.com> branch nick: trunk timestamp: Mon 2010-03-29 19:18:48 -0400 message: * subr.el: Extend progress reporters to perform "spinning". (progress-reporter-update, progress-reporter-do-update): Handle non-numeric value arguments. (progress-reporter--pulse-characters): New var. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-03-27 13:27:43 +0000 +++ etc/NEWS 2010-03-29 23:18:48 +0000 @@ -112,6 +112,13 @@ `image-animate-max-time' and the delay between sub-images defined by the Graphic Control Extension of the image. +** Progress reporters can now "spin". +The MIN-VALUE and MAX-VALUE arguments of `make-progress-reporter' can +now be nil, or omitted. This makes a "non-numeric" reporter. Each +time you call `progress-reporter-update' on that progress reporter, +with a nil or omitted VALUE argument, the reporter message is +displayed with a "spinning bar". + * Changes in Emacs 24.1 on non-free operating systems === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-03-28 19:51:55 +0000 +++ lisp/ChangeLog 2010-03-29 23:18:48 +0000 @@ -1,3 +1,11 @@ +2010-03-29 Phil Hagelberg <phil@evri.com> + Chong Yidong <cyd@stupidchicken.com> + + * subr.el: Extend progress reporters to perform "spinning". + (progress-reporter-update, progress-reporter-do-update): Handle + non-numeric value arguments. + (progress-reporter--pulse-characters): New var. + 2010-03-28 Chong Yidong <cyd@stupidchicken.com> * progmodes/compile.el (compilation-start): Fix regexp detection === modified file 'lisp/subr.el' --- lisp/subr.el 2010-03-03 03:58:26 +0000 +++ lisp/subr.el 2010-03-29 23:18:48 +0000 @@ -3421,51 +3421,59 @@ ;; digits of precision, it doesn't really matter here. On the other ;; hand, it greatly simplifies the code. -(defsubst progress-reporter-update (reporter value) +(defsubst progress-reporter-update (reporter &optional value) "Report progress of an operation in the echo area. -However, if the change since last echo area update is too small -or not enough time has passed, then do nothing (see -`make-progress-reporter' for details). - -First parameter, REPORTER, should be the result of a call to -`make-progress-reporter'. Second, VALUE, determines the actual -progress of operation; it must be between MIN-VALUE and MAX-VALUE -as passed to `make-progress-reporter'. - -This function is very inexpensive, you may not bother how often -you call it." - (when (>= value (car reporter)) +REPORTER should be the result of a call to `make-progress-reporter'. + +If REPORTER is a numerical progress reporter---i.e. if it was + made using non-nil MIN-VALUE and MAX-VALUE arguments to + `make-progress-reporter'---then VALUE should be a number between + MIN-VALUE and MAX-VALUE. + +If REPORTER is a non-numerical reporter, VALUE should be nil. + +This function is relatively inexpensive. If the change since +last update is too small or insufficient time has passed, it does +nothing." + (when (or (not (numberp value)) ; For pulsing reporter + (>= value (car reporter))) ; For numerical reporter (progress-reporter-do-update reporter value))) -(defun make-progress-reporter (message min-value max-value - &optional current-value - min-change min-time) - "Return progress reporter object to be used with `progress-reporter-update'. - -MESSAGE is shown in the echo area. When at least 1% of operation -is complete, the exact percentage will be appended to the -MESSAGE. When you call `progress-reporter-done', word \"done\" -is printed after the MESSAGE. You can change MESSAGE of an -existing progress reporter with `progress-reporter-force-update'. - -MIN-VALUE and MAX-VALUE designate starting (0% complete) and -final (100% complete) states of operation. The latter should be -larger; if this is not the case, then simply negate all values. -Optional CURRENT-VALUE specifies the progress by the moment you -call this function. You should omit it or set it to nil in most -cases since it defaults to MIN-VALUE. - -Optional MIN-CHANGE determines the minimal change in percents to -report (default is 1%.) Optional MIN-TIME specifies the minimal -time before echo area updates (default is 0.2 seconds.) If -`float-time' function is not present, then time is not tracked -at all. If OS is not capable of measuring fractions of seconds, -then this parameter is effectively rounded up." - +(defun make-progress-reporter (message &optional min-value max-value + current-value min-change min-time) + "Return progress reporter object for use with `progress-reporter-update'. + +MESSAGE is shown in the echo area, with a status indicator +appended to the end. When you call `progress-reporter-done', the +word \"done\" is printed after the MESSAGE. You can change the +MESSAGE of an existing progress reporter by calling +`progress-reporter-force-update'. + +MIN-VALUE and MAX-VALUE, if non-nil, are starting (0% complete) +and final (100% complete) states of operation; the latter should +be larger. In this case, the status message shows the percentage +progress. + +If MIN-VALUE and/or MAX-VALUE is omitted or nil, the status +message shows a \"spinning\", non-numeric indicator. + +Optional CURRENT-VALUE is the initial progress; the default is +MIN-VALUE. +Optional MIN-CHANGE is the minimal change in percents to report; +the default is 1%. +CURRENT-VALUE and MIN-CHANGE do not have any effect if MIN-VALUE +and/or MAX-VALUE are nil. + +Optional MIN-TIME specifies the minimum interval time between +echo area updates (default is 0.2 seconds.) If the function +`float-time' is not present, time is not tracked at all. If the +OS is not capable of measuring fractions of seconds, this +parameter is effectively rounded up." (unless min-time (setq min-time 0.2)) (let ((reporter - (cons min-value ;; Force a call to `message' now + ;; Force a call to `message' now + (cons (or min-value 0) (vector (if (and (fboundp 'float-time) (>= min-time 0.02)) (float-time) nil) @@ -3477,12 +3485,11 @@ (progress-reporter-update reporter (or current-value min-value)) reporter)) -(defun progress-reporter-force-update (reporter value &optional new-message) +(defun progress-reporter-force-update (reporter &optional value new-message) "Report progress of an operation in the echo area unconditionally. -First two parameters are the same as for -`progress-reporter-update'. Optional NEW-MESSAGE allows you to -change the displayed message." +The first two arguments are the same as in `progress-reporter-update'. +NEW-MESSAGE, if non-nil, sets a new message for the reporter." (let ((parameters (cdr reporter))) (when new-message (aset parameters 3 new-message)) @@ -3490,15 +3497,15 @@ (aset parameters 0 (float-time))) (progress-reporter-do-update reporter value))) +(defvar progress-reporter--pulse-characters ["-" "\\" "|" "/"] + "Characters to use for pulsing progress reporters.") + (defun progress-reporter-do-update (reporter value) (let* ((parameters (cdr reporter)) + (update-time (aref parameters 0)) (min-value (aref parameters 1)) (max-value (aref parameters 2)) - (one-percent (/ (- max-value min-value) 100.0)) - (percentage (if (= max-value min-value) - 0 - (truncate (/ (- value min-value) one-percent)))) - (update-time (aref parameters 0)) + (text (aref parameters 3)) (current-time (float-time)) (enough-time-passed ;; See if enough time has passed since the last update. @@ -3506,26 +3513,41 @@ (when (>= current-time update-time) ;; Calculate time for the next update (aset parameters 0 (+ update-time (aref parameters 5))))))) - ;; - ;; Calculate NEXT-UPDATE-VALUE. If we are not going to print - ;; message this time because not enough time has passed, then use - ;; 1 instead of MIN-CHANGE. This makes delays between echo area - ;; updates closer to MIN-TIME. - (setcar reporter - (min (+ min-value (* (+ percentage - (if enough-time-passed - (aref parameters 4) ;; MIN-CHANGE - 1)) - one-percent)) - max-value)) - (when (integerp value) - (setcar reporter (ceiling (car reporter)))) - ;; - ;; Only print message if enough time has passed - (when enough-time-passed - (if (> percentage 0) - (message "%s%d%%" (aref parameters 3) percentage) - (message "%s" (aref parameters 3)))))) + (cond ((and min-value max-value) + ;; Numerical indicator + (let* ((one-percent (/ (- max-value min-value) 100.0)) + (percentage (if (= max-value min-value) + 0 + (truncate (/ (- value min-value) + one-percent))))) + ;; Calculate NEXT-UPDATE-VALUE. If we are not printing + ;; message because not enough time has passed, use 1 + ;; instead of MIN-CHANGE. This makes delays between echo + ;; area updates closer to MIN-TIME. + (setcar reporter + (min (+ min-value (* (+ percentage + (if enough-time-passed + ;; MIN-CHANGE + (aref parameters 4) + 1)) + one-percent)) + max-value)) + (when (integerp value) + (setcar reporter (ceiling (car reporter)))) + ;; Only print message if enough time has passed + (when enough-time-passed + (if (> percentage 0) + (message "%s%d%%" text percentage) + (message "%s" text))))) + ;; Pulsing indicator + (enough-time-passed + (let ((index (mod (1+ (car reporter)) 4)) + (message-log-max nil)) + (setcar reporter index) + (message "%s %s" + text + (aref progress-reporter--pulse-characters + index))))))) (defun progress-reporter-done (reporter) "Print reporter's message followed by word \"done\" in echo area." ------------------------------------------------------------ revno: 99765 [merge] committer: Katsumi Yamaoka <yamaoka@jpl.org> branch nick: trunk timestamp: Mon 2010-03-29 10:19:03 +0000 message: (mm-add-meta-html-tag): Fix regexp matching meta tag. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-03-29 09:28:20 +0000 +++ lisp/gnus/ChangeLog 2010-03-29 10:16:37 +0000 @@ -1,3 +1,7 @@ +2010-03-29 Katsumi Yamaoka <yamaoka@jpl.org> + + * mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag. + 2010-03-29 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-source-pick): Fix for non-secrets specifier. === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2010-03-19 02:55:37 +0000 +++ lisp/gnus/mm-decode.el 2010-03-29 10:16:37 +0000 @@ -1273,7 +1273,7 @@ (goto-char (point-min)) (if (re-search-forward "\ <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']\ -text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+?\\)\\)?[\"'][^>]*>" nil t) +text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t) (if (and (match-beginning 2) (string-match "\\`html\\'" (match-string 1))) ;; Don't modify existing meta tag. ------------------------------------------------------------ revno: 99764 [merge] committer: Katsumi Yamaoka <yamaoka@jpl.org> branch nick: trunk timestamp: Mon 2010-03-29 09:29:19 +0000 message: 2010-03-29 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-source-pick): Fix for non-secrets specifier. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-03-28 23:52:01 +0000 +++ lisp/gnus/ChangeLog 2010-03-29 09:28:20 +0000 @@ -1,3 +1,7 @@ +2010-03-29 Teodor Zlatanov <tzz@lifelogs.com> + + * auth-source.el (auth-source-pick): Fix for non-secrets specifier. + 2010-03-27 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Change default to be simpler. Explain === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2010-03-28 23:52:01 +0000 +++ lisp/gnus/auth-source.el 2010-03-29 09:28:20 +0000 @@ -214,7 +214,7 @@ (dolist (choice auth-sources) (let* ((s (plist-get choice :source)) ;; this is only set for Secret Service API specs (see secrets.el) - (coll (plist-get s :secrets)) + (coll (and (consp s) (plist-get s :secrets))) (score 0)) (cond (coll ; use secrets.el here ------------------------------------------------------------ revno: 99763 [merge] committer: Katsumi Yamaoka <yamaoka@jpl.org> branch nick: trunk timestamp: Sun 2010-03-28 23:57:34 +0000 message: 2010-03-27 Teodor Zlatanov <tzz@lifelogs.com> * auth.texi (Secret Service API): Add TODO node. (Help for users): Explain the new source options for `auth-sources'. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-03-24 18:02:56 +0000 +++ doc/misc/ChangeLog 2010-03-28 23:55:59 +0000 @@ -1,3 +1,8 @@ +2010-03-27 Teodor Zlatanov <tzz@lifelogs.com> + + * auth.texi (Secret Service API): Add TODO node. + (Help for users): Explain the new source options for `auth-sources'. + 2010-03-24 Michael Albinus <michael.albinus@gmx.de> * trampver.texi: Update release number. === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2010-01-13 08:35:10 +0000 +++ doc/misc/auth.texi 2010-03-28 23:55:59 +0000 @@ -57,6 +57,7 @@ @menu * Overview:: Overview of the auth-source library. * Help for users:: +* Secret Service API:: * Help for developers:: * Index:: * Function Index:: @@ -68,15 +69,15 @@ @chapter Overview The auth-source library is simply a way for Emacs and Gnus, among -others, to find the answer to the old burning question ``I have a -server name and a port, what are my user name and password?'' +others, to answer the old burning question ``I have a server name and +a port, what are my user name and password?'' The auth-source library actually supports more than just the user name (known as the login) or the password, but only those two are in use -today in Emacs or Gnus. Similarly, the auth-source library can in -theory support multiple storage formats, but currently it only -understands the classic ``netrc'' format, examples of which you can -see later in this document. +today in Emacs or Gnus. Similarly, the auth-source library supports +multiple storage formats, currently either the classic ``netrc'' +format, examples of which you can see later in this document, or the +Secret Service API. @node Help for users @chapter Help for users @@ -120,17 +121,21 @@ @defvar auth-sources The @code{auth-sources} variable tells the auth-source library where -your netrc files live for a particular host and protocol. While you -can get fancy, the default and simplest configuration is: +your netrc files or Secret Service API collection items live for a +particular host and protocol. While you can get fancy, the default +and simplest configuration is: @lisp +;;; old default: required :host and :protocol, not needed anymore (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t))) +;;; mostly equivalent (see below about fallbacks) but shorter: +(setq auth-sources '((:source "~/.authinfo.gpg"))) @end lisp This says ``for any host and any protocol, use just that one file.'' -Sweet simplicity. In fact, this is already the default, so unless you -want to move your netrc file, it will just work if you have that -file. You may not, though, so make sure it exists. +Sweet simplicity. In fact, the latter is already the default, so +unless you want to move your netrc file, it will just work if you have +that file. Make sure it exists. By adding multiple entries to @code{auth-sources} with a particular host or protocol, you can have specific netrc files for that host or @@ -138,6 +143,35 @@ shared netrc files or some other unusual setup (90% of Emacs users have unusual setups and the remaining 10% are @emph{really} unusual). +Here's an example that uses the Secret Service API for all lookups, +using the default collection: + +@lisp +(setq auth-sources '((:source (:secrets default)))) +@end lisp + +And here's a mixed example, using two sources: + +@lisp +(setq auth-sources '((:source (:secrets default) :host "myserver" :user "joe") + (:source "~/.authinfo.gpg"))) +@end lisp + +The best match is determined by order (starts from the bottom) only +for the first pass, where things are checked exactly. In the example +above, the first pass would find a single match for host +@code{myserver}. The netrc choice would fail because it matches any +host and protocol implicitly (as a @emph{fallback}). A specified +value of @code{:host t} in @code{auth-sources} is considered a match +on the first pass, unlike a missing @code{:host}. + +Now if you look for host @code{missing}, it won't match either source +explicitly. The second pass (the @emph{fallback} pass) will look at +all the implicit matches and collect them. They will be scored and +returned sorted by score. The score is based on the number of +explicit parameters that matched. See the @code{auth-pick} function +for details. + @end defvar If you don't customize @code{auth-sources}, you'll have to live with @@ -190,25 +224,32 @@ earlier. Since Tramp has about 88 connection methods, this may be necessary if you have an unusual (see earlier comment on those) setup. +@node Secret Service API +@chapter Secret Service API + +TODO: how does it work generally, how does secrets.el work, some examples. + @node Help for developers @chapter Help for developers The auth-source library only has one function for external use. -@defun auth-source-user-or-password mode host port +@defun auth-source-user-or-password mode host port &optional username Retrieve appropriate authentication tokens, determined by @var{mode}, -for host @var{host} and @var{port}. If @code{auth-source-debug} is t, -debugging messages will be printed. Set @code{auth-source-debug} to a -function to use that function for logging. The parameters passed will -be the same that the @code{message} function takes, that is, a string +for host @var{host} and @var{port}. If @var{username} is provided it +will also be checked. If @code{auth-source-debug} is t, debugging +messages will be printed. Set @code{auth-source-debug} to a function +to use that function for logging. The parameters passed will be the +same that the @code{message} function takes, that is, a string formatting spec and optional parameters. If @var{mode} is a list of strings, the function will return a list of strings or @code{nil} objects (thus you can avoid parsing the netrc -file more than once). If it's a string, the function will return a -string or a @code{nil} object. Currently only the modes ``login'' and -``password'' are recognized but more may be added in the future. +file or checking the Secret Service API more than once). If it's a +string, the function will return a string or a @code{nil} object. +Currently only the modes ``login'' and ``password'' are recognized but +more may be added in the future. @var{host} is a string containing the host name. @@ -216,6 +257,8 @@ a port number. It must be a string, corresponding to the port in the users' netrc files. +@var{username} contains the user name (e.g. ``joe'') as a string. + @example ;; IMAP example (setq auth (auth-source-user-or-password ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.