Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103643. ------------------------------------------------------------ revno: 103643 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sat 2011-03-12 22:43:00 -0800 message: Improve quality of tests for time stamp overflow. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-12 19:19:47 +0000 +++ src/ChangeLog 2011-03-13 06:43:00 +0000 @@ -1,3 +1,35 @@ +2011-03-13 Paul Eggert + + Improve quality of tests for time stamp overflow. + For example, without this patch (encode-time 0 0 0 1 1 + 1152921504606846976) returns the obviously-bogus value (-948597 + 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly + reports time overflow. See + . + * deps.mk (editfns.o): Depend on ../lib/intprops.h. + * editfns.c: Include limits.h and intprops.h. + (TIME_T_MIN, TIME_T_MAX): New macros. + (time_overflow): Move earlier, to before first use. + (hi_time, lo_time): New functions, for an accurate test for + out-of-range times. + (Fcurrent_time, Fget_internal_run_time, make_time): Use them. + (Fget_internal_run_time): Don't assume time_t fits in int. + (make_time): Use list2 instead of Fcons twice. + (Fdecode_time): More accurate test for out-of-range times. + (check_tm_member): New function. + (Fencode_time): Use it, to test for out-of-range times. + (lisp_time_argument): Don't rely on undefined left-shift and + right-shift behavior when checking for time stamp overflow. + + * editfns.c (time_overflow): New function, refactoring common code. + (Fformat_time_string, Fdecode_time, Fencode_time): + (Fcurrent_time_string): Use it. + + Move 'make_time' to be next to its inverse 'lisp_time_argument'. + * dired.c (make_time): Move to ... + * editfns.c (make_time): ... here. + * systime.h: Note the move. + 2011-03-12 YAMAMOTO Mitsuharu * fringe.c (update_window_fringes): Remove unused variables. === modified file 'src/deps.mk' --- src/deps.mk 2011-03-12 12:03:24 +0000 +++ src/deps.mk 2011-03-13 06:43:00 +0000 @@ -87,7 +87,8 @@ msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \ lisp.h $(config_h) editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ - coding.h frame.h blockinput.h atimer.h ../lib/unistd.h ../lib/strftime.h \ + coding.h frame.h blockinput.h atimer.h \ + ../lib/intprops.h ../lib/strftime.h ../lib/unistd.h \ lisp.h globals.h $(config_h) emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \ termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \ === modified file 'src/dired.c' --- src/dired.c 2011-02-25 19:08:18 +0000 +++ src/dired.c 2011-03-11 20:24:09 +0000 @@ -848,13 +848,6 @@ return value; } -Lisp_Object -make_time (time_t time) -{ - return Fcons (make_number (time >> 16), - Fcons (make_number (time & 0177777), Qnil)); -} - static char * stat_uname (struct stat *st) { === modified file 'src/editfns.c' --- src/editfns.c 2011-02-28 01:07:29 +0000 +++ src/editfns.c 2011-03-13 06:27:18 +0000 @@ -45,6 +45,8 @@ #endif #include +#include +#include #include #include "intervals.h" @@ -87,6 +89,7 @@ extern Lisp_Object w32_get_internal_run_time (void); #endif +static void time_overflow (void) NO_RETURN; static int tm_diff (struct tm *, struct tm *); static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, EMACS_INT *, Lisp_Object, EMACS_INT *); @@ -1414,6 +1417,49 @@ return make_number (getpid ()); } + + +#ifndef TIME_T_MIN +# define TIME_T_MIN TYPE_MINIMUM (time_t) +#endif +#ifndef TIME_T_MAX +# define TIME_T_MAX TYPE_MAXIMUM (time_t) +#endif + +/* Report that a time value is out of range for Emacs. */ +static void +time_overflow (void) +{ + error ("Specified time is not representable"); +} + +/* Return the upper part of the time T (everything but the bottom 16 bits), + making sure that it is representable. */ +static EMACS_INT +hi_time (time_t t) +{ + time_t hi = t >> 16; + + /* Check for overflow, helping the compiler for common cases where + no runtime check is needed, and taking care not to convert + negative numbers to unsigned before comparing them. */ + if (! ((! TYPE_SIGNED (time_t) + || MOST_NEGATIVE_FIXNUM <= TIME_T_MIN >> 16 + || MOST_NEGATIVE_FIXNUM <= hi) + && (TIME_T_MAX >> 16 <= MOST_POSITIVE_FIXNUM + || hi <= MOST_POSITIVE_FIXNUM))) + time_overflow (); + + return hi; +} + +/* Return the bottom 16 bits of the time T. */ +static EMACS_INT +lo_time (time_t t) +{ + return t & ((1 << 16) - 1); +} + DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00. The time is returned as a list of three integers. The first has the @@ -1428,8 +1474,8 @@ EMACS_TIME t; EMACS_GET_TIME (t); - return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), - make_number ((EMACS_SECS (t) >> 0) & 0xffff), + return list3 (make_number (hi_time (EMACS_SECS (t))), + make_number (lo_time (EMACS_SECS (t))), make_number (EMACS_USECS (t))); } @@ -1448,7 +1494,8 @@ { #ifdef HAVE_GETRUSAGE struct rusage usage; - int secs, usecs; + time_t secs; + int usecs; if (getrusage (RUSAGE_SELF, &usage) < 0) /* This shouldn't happen. What action is appropriate? */ @@ -1463,8 +1510,8 @@ secs++; } - return list3 (make_number ((secs >> 16) & 0xffff), - make_number ((secs >> 0) & 0xffff), + return list3 (make_number (hi_time (secs)), + make_number (lo_time (secs)), make_number (usecs)); #else /* ! HAVE_GETRUSAGE */ #ifdef WINDOWSNT @@ -1476,6 +1523,19 @@ } +/* Make a Lisp list that represents the time T. */ +Lisp_Object +make_time (time_t t) +{ + return list2 (make_number (hi_time (t)), + make_number (lo_time (t))); +} + +/* Decode a Lisp list SPECIFIED_TIME that represents a time. + If SPECIFIED_TIME is nil, use the current time. + Set *RESULT to seconds since the Epoch. + If USEC is not null, set *USEC to the microseconds component. + Return nonzero if successful. */ int lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec) { @@ -1496,6 +1556,7 @@ else { Lisp_Object high, low; + EMACS_INT hi; high = Fcar (specified_time); CHECK_NUMBER (high); low = Fcdr (specified_time); @@ -1519,8 +1580,21 @@ else if (usec) *usec = 0; CHECK_NUMBER (low); - *result = (XINT (high) << 16) + (XINT (low) & 0xffff); - return *result >> 16 == XINT (high); + hi = XINT (high); + + /* Check for overflow, helping the compiler for common cases + where no runtime check is needed, and taking care not to + convert negative numbers to unsigned before comparing them. */ + if (! ((TYPE_SIGNED (time_t) + ? (TIME_T_MIN >> 16 <= MOST_NEGATIVE_FIXNUM + || TIME_T_MIN >> 16 <= hi) + : 0 <= hi) + && (MOST_POSITIVE_FIXNUM <= TIME_T_MAX >> 16 + || hi <= TIME_T_MAX >> 16))) + return 0; + + *result = (hi << 16) + (XINT (low) & 0xffff); + return 1; } } @@ -1674,7 +1748,7 @@ tm = ut ? gmtime (&value) : localtime (&value); UNBLOCK_INPUT; if (! tm) - error ("Specified time is not representable"); + time_overflow (); synchronize_system_time_locale (); @@ -1732,8 +1806,10 @@ BLOCK_INPUT; decoded_time = localtime (&time_spec); UNBLOCK_INPUT; - if (! decoded_time) - error ("Specified time is not representable"); + if (! (decoded_time + && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= decoded_time->tm_year + && decoded_time->tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE)) + time_overflow (); XSETFASTINT (list_args[0], decoded_time->tm_sec); XSETFASTINT (list_args[1], decoded_time->tm_min); XSETFASTINT (list_args[2], decoded_time->tm_hour); @@ -1757,6 +1833,20 @@ return Flist (9, list_args); } +/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that + the result is representable as an int. Assume OFFSET is small and + nonnegative. */ +static int +check_tm_member (Lisp_Object obj, int offset) +{ + EMACS_INT n; + CHECK_NUMBER (obj); + n = XINT (obj); + if (! (INT_MIN + offset <= n && n - offset <= INT_MAX)) + time_overflow (); + return n - offset; +} + DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0, doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time. This is the reverse operation of `decode-time', which see. @@ -1785,19 +1875,12 @@ struct tm tm; Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil); - CHECK_NUMBER (args[0]); /* second */ - CHECK_NUMBER (args[1]); /* minute */ - CHECK_NUMBER (args[2]); /* hour */ - CHECK_NUMBER (args[3]); /* day */ - CHECK_NUMBER (args[4]); /* month */ - CHECK_NUMBER (args[5]); /* year */ - - tm.tm_sec = XINT (args[0]); - tm.tm_min = XINT (args[1]); - tm.tm_hour = XINT (args[2]); - tm.tm_mday = XINT (args[3]); - tm.tm_mon = XINT (args[4]) - 1; - tm.tm_year = XINT (args[5]) - TM_YEAR_BASE; + tm.tm_sec = check_tm_member (args[0], 0); + tm.tm_min = check_tm_member (args[1], 0); + tm.tm_hour = check_tm_member (args[2], 0); + tm.tm_mday = check_tm_member (args[3], 0); + tm.tm_mon = check_tm_member (args[4], 1); + tm.tm_year = check_tm_member (args[5], TM_YEAR_BASE); tm.tm_isdst = -1; if (CONSP (zone)) @@ -1846,7 +1929,7 @@ } if (time == (time_t) -1) - error ("Specified time is not representable"); + time_overflow (); return make_time (time); } @@ -1881,7 +1964,7 @@ tm = localtime (&value); UNBLOCK_INPUT; if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm)))) - error ("Specified time is not representable"); + time_overflow (); /* Remove the trailing newline. */ tem[strlen (tem) - 1] = '\0'; === modified file 'src/systime.h' --- src/systime.h 2011-01-25 04:08:28 +0000 +++ src/systime.h 2011-03-11 20:24:09 +0000 @@ -144,10 +144,8 @@ happen when this files is used outside the src directory). Use GCPRO1 to determine if lisp.h was included. */ #ifdef GCPRO1 -/* defined in dired.c */ +/* defined in editfns.c*/ extern Lisp_Object make_time (time_t); - -/* defined in editfns.c*/ extern int lisp_time_argument (Lisp_Object, time_t *, int *); #endif @@ -172,4 +170,3 @@ #define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0) #endif /* EMACS_SYSTIME_H */ - ------------------------------------------------------------ revno: 103642 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2011-03-13 04:07:38 +0000 message: Merge changes made in Gnus trunk. auth.texi (Help for developers): Update docs to explain that the :save-function will only run the first time. auth-source.el (auth-source-format-prompt): Always convert the value to a string to avoid evaluating non-string arguments. (auth-source-netrc-create): Offer default properly, not as initial content in `read-string'. (auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash of line to determine if we've been run before. If so, don't run again, but print a trivial message to indicate the cache was hit instead. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-12 19:19:47 +0000 +++ doc/misc/ChangeLog 2011-03-13 04:07:38 +0000 @@ -1,3 +1,8 @@ +2011-03-12 Teodor Zlatanov + + * auth.texi (Help for developers): Update docs to explain that the + :save-function will only run the first time. + 2011-03-12 Glenn Morris * Makefile.in (emacs-faq.html): Fix some more cross-refs. === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2011-03-09 14:37:30 +0000 +++ doc/misc/auth.texi 2011-03-13 04:07:38 +0000 @@ -289,11 +289,21 @@ (funcall (nth 2 credentials))) @end example -Which will work whether the @code{:save-function} was provided or not. +This will work whether the @code{:save-function} was provided or not. @code{:save-function} will be provided only when a new entry was created, so this effectively says ``after a successful login, save the authentication information we just used, if it was newly created.'' +After the first time it's called, the @code{:save-function} will not +run again (but it will log something if you have set +@code{auth-source-debug} to @code{'trivia}). This is so it won't ask +the same question again, which is annoying. This is so it won't ask +the same question again, which is annoying. This is so it won't ask +the same question again, which is annoying. + +So the responsibility of the API user that specified @code{:create t} +is to call the @code{:save-function} if it's provided. + @defun auth-source-delete SPEC TODO: how to include docstring? === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-12 08:53:34 +0000 +++ lisp/gnus/ChangeLog 2011-03-13 04:07:38 +0000 @@ -1,3 +1,13 @@ +2011-03-12 Teodor Zlatanov + + * auth-source.el (auth-source-format-prompt): Always convert the value + to a string to avoid evaluating non-string arguments. + (auth-source-netrc-create): Offer default properly, not as initial + content in `read-string'. + (auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash + of line to determine if we've been run before. If so, don't run again, + but print a trivial message to indicate the cache was hit instead. + 2011-03-11 Teodor Zlatanov * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-03-10 13:32:49 +0000 +++ lisp/gnus/auth-source.el 2011-03-13 04:07:38 +0000 @@ -54,6 +54,8 @@ (autoload 'secrets-list-collections "secrets") (autoload 'secrets-search-items "secrets") +(autoload 'rfc2104-hash "rfc2104") + (defvar secrets-enabled) (defgroup auth-source nil @@ -770,7 +772,9 @@ (let ((c (nth 0 cell)) (v (nth 1 cell))) (when (and c v) - (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt))))) + (setq prompt (replace-regexp-in-string (format "%%%c" c) + (format "%s" v) + prompt))))) prompt) (defun auth-source-ensure-strings (values) @@ -1096,7 +1100,7 @@ ;; special case prompt for passwords (read-passwd prompt)) ((null data) - (read-string prompt default)) + (read-string prompt nil nil default)) (t (or data default)))) (when data @@ -1138,70 +1142,79 @@ (list artificial))) -;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch") :user "tzz" :port "imap" :create t :max 1)) :save-function)) +;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch2") :user "tzz" :port "imap" :create t :max 1)) :save-function)) (defun auth-source-netrc-saver (file add) "Save a line ADD in FILE, prompting along the way. -Respects `auth-source-save-behavior'." - (with-temp-buffer - (when (file-exists-p file) - (insert-file-contents file)) - (when auth-source-gpg-encrypt-to - ;; (see bug#7487) making `epa-file-encrypt-to' local to - ;; this buffer lets epa-file skip the key selection query - ;; (see the `local-variable-p' check in - ;; `epa-file-write-region'). - (unless (local-variable-p 'epa-file-encrypt-to (current-buffer)) - (make-local-variable 'epa-file-encrypt-to)) - (if (listp auth-source-gpg-encrypt-to) - (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))) - ;; we want the new data to be found first, so insert at beginning - (goto-char (point-min)) - - ;; ask AFTER we've successfully opened the file - (let ((prompt (format "Save auth info to file %s? " file)) - (done (not (eq auth-source-save-behavior 'ask))) - (bufname "*auth-source Help*") - k) - (while (not done) - (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??))) - (case k - (?y (setq done t)) - (?? (save-excursion - (with-output-to-temp-buffer bufname - (princ - (concat "(y)es, save\n" - "(n)o but use the info\n" - "(N)o and don't ask to save again\n" - "(e)dit the line\n" - "(?) for help as you can see.\n")) - (set-buffer standard-output) - (help-mode)))) - (?n (setq add "" - done t)) - (?N (setq add "" - done t - auth-source-save-behavior nil)) - (?e (setq add (read-string "Line to add: " add))) - (t nil))) - - (when (get-buffer-window bufname) - (delete-window (get-buffer-window bufname))) - - ;; make sure the info is not saved - (when (null auth-source-save-behavior) - (setq add "")) - - (when (< 0 (length add)) - (progn - (unless (bolp) - (insert "\n")) - (insert add "\n") - (write-region (point-min) (point-max) file nil 'silent) - (auth-source-do-debug - "auth-source-netrc-create: wrote 1 new line to %s" - file) - (message "Saved new authentication information to %s" file) - nil))))) +Respects `auth-source-save-behavior'. Uses +`auth-source-netrc-cache' to avoid prompting more than once." + (let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add))) + (cached (assoc key auth-source-netrc-cache))) + + (if cached + (auth-source-do-trivia + "auth-source-netrc-saver: found previous run for key %s, returning" + key) + (with-temp-buffer + (when (file-exists-p file) + (insert-file-contents file)) + (when auth-source-gpg-encrypt-to + ;; (see bug#7487) making `epa-file-encrypt-to' local to + ;; this buffer lets epa-file skip the key selection query + ;; (see the `local-variable-p' check in + ;; `epa-file-write-region'). + (unless (local-variable-p 'epa-file-encrypt-to (current-buffer)) + (make-local-variable 'epa-file-encrypt-to)) + (if (listp auth-source-gpg-encrypt-to) + (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))) + ;; we want the new data to be found first, so insert at beginning + (goto-char (point-min)) + + ;; ask AFTER we've successfully opened the file + (let ((prompt (format "Save auth info to file %s? " file)) + (done (not (eq auth-source-save-behavior 'ask))) + (bufname "*auth-source Help*") + k) + (while (not done) + (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??))) + (case k + (?y (setq done t)) + (?? (save-excursion + (with-output-to-temp-buffer bufname + (princ + (concat "(y)es, save\n" + "(n)o but use the info\n" + "(N)o and don't ask to save again\n" + "(e)dit the line\n" + "(?) for help as you can see.\n")) + (set-buffer standard-output) + (help-mode)))) + (?n (setq add "" + done t)) + (?N (setq add "" + done t + auth-source-save-behavior nil)) + (?e (setq add (read-string "Line to add: " add))) + (t nil))) + + (when (get-buffer-window bufname) + (delete-window (get-buffer-window bufname))) + + ;; make sure the info is not saved + (when (null auth-source-save-behavior) + (setq add "")) + + (when (< 0 (length add)) + (progn + (unless (bolp) + (insert "\n")) + (insert add "\n") + (write-region (point-min) (point-max) file nil 'silent) + (auth-source-do-debug + "auth-source-netrc-create: wrote 1 new line to %s" + file) + (message "Saved new authentication information to %s" file) + nil)))) + (aput 'auth-source-netrc-cache key "ran")))) ;;; Backend specific parsing: Secrets API backend ------------------------------------------------------------ revno: 103641 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-03-12 22:50:33 -0500 message: admin/admin.el: Add some code for deploying web manuals. diff: === modified file 'admin/admin.el' --- admin/admin.el 2011-02-19 15:57:35 +0000 +++ admin/admin.el 2011-03-13 03:50:33 +0000 @@ -212,6 +212,236 @@ "\\\\def\\\\year{") "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) +;;; Various bits of magic for generating the web manuals + +(defun make-manuals (root) + "Generate the web manuals for the Emacs webpage." + (interactive "DEmacs root directory: ") + (let* ((dest (expand-file-name "manual" root)) + (html-node-dir (expand-file-name "html_node" dest)) + (html-mono-dir (expand-file-name "html_mono" dest)) + (txt-dir (expand-file-name "text" dest)) + (dvi-dir (expand-file-name "dvi" dest)) + (ps-dir (expand-file-name "ps" dest))) + (when (file-directory-p dest) + (if (y-or-n-p (format "Directory %s exists, delete it first?" dest)) + (delete-directory dest t) + (error "Aborted"))) + (make-directory dest) + (make-directory html-node-dir) + (make-directory html-mono-dir) + (make-directory txt-dir) + (make-directory dvi-dir) + (make-directory ps-dir) + ;; Emacs manual + (let ((texi (expand-file-name "doc/emacs/emacs.texi" root))) + (manual-html-node texi (expand-file-name "emacs" html-node-dir)) + (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir)) + (manual-txt texi (expand-file-name "emacs.txt" txt-dir)) + (manual-pdf texi (expand-file-name "emacs.pdf" dest)) + (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir) + (expand-file-name "emacs.ps" ps-dir))) + ;; Lisp manual + (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) + (manual-html-node texi (expand-file-name "elisp" html-node-dir)) + (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir)) + (manual-txt texi (expand-file-name "elisp.txt" txt-dir)) + (manual-pdf texi (expand-file-name "elisp.pdf" dest)) + (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir) + (expand-file-name "elisp.ps" ps-dir))) + (message "Manuals created in %s" dest))) + +(defconst manual-doctype-string + "\n\n") + +(defconst manual-meta-string + " + + + +\n\n") + +(defconst manual-style-string "\n") + +(defun manual-html-mono (texi-file dest) + "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST. +This function also edits the HTML files so that they validate as +HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using +the @import directive." + (call-process "makeinfo" nil nil nil + "--html" "--no-split" texi-file "-o" dest) + (with-temp-buffer + (insert-file-contents dest) + (setq buffer-file-name dest) + (manual-html-fix-headers) + (manual-html-fix-index-1) + (manual-html-fix-index-2 t) + (manual-html-fix-node-div) + (goto-char (point-max)) + (re-search-backward "[\n \t]*") + (insert "\n\n") + (save-buffer))) + +(defun manual-html-node (texi-file dir) + "Run Makeinfo on TEXI-FILE, emitting per-node HTML output to DIR. +This function also edits the HTML files so that they validate as +HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using +the @import directive." + (unless (file-exists-p texi-file) + (error "Manual file %s not found" texi-file)) + (call-process "makeinfo" nil nil nil + "--html" texi-file "-o" dir) + ;; Loop through the node files, fixing them up. + (dolist (f (directory-files dir nil "\\.html\\'")) + (let (opoint) + (with-temp-buffer + (insert-file-contents (expand-file-name f dir)) + (setq buffer-file-name (expand-file-name f dir)) + (if (looking-at "Copyright ©") + (setq opoint (match-beginning 0)) + (re-search-forward "") + (setq copyright-text (buffer-substring opoint (point))) + (delete-region opoint (point)) + (manual-html-fix-index-2) + (insert copyright-text "\n\n")) + ;; For normal nodes, give the header div a blue bg. + (manual-html-fix-node-div)) + (save-buffer)))))) + +(defun manual-txt (texi-file dest) + "Run Makeinfo on TEXI-FILE, emitting plaintext output to DEST." + (call-process "makeinfo" nil nil nil + "--plaintext" "--no-split" texi-file "-o" dest) + (shell-command (concat "gzip -c " dest " > " (concat dest ".gz")))) + +(defun manual-pdf (texi-file dest) + "Run texi2pdf on TEXI-FILE, emitting plaintext output to DEST." + (call-process "texi2pdf" nil nil nil texi-file "-o" dest)) + +(defun manual-dvi (texi-file dest ps-dest) + "Run texi2dvi on TEXI-FILE, emitting dvi output to DEST. +Also generate postscript output in PS-DEST." + (call-process "texi2dvi" nil nil nil texi-file "-o" dest) + (call-process "dvips" nil nil nil dest "-o" ps-dest) + (call-process "gzip" nil nil nil dest) + (call-process "gzip" nil nil nil ps-dest)) + +(defun manual-html-fix-headers () + "Fix up HTML headers for the Emacs manual in the current buffer." + (let (opoint) + (insert manual-doctype-string) + (search-forward "\n") + (insert manual-meta-string) + (search-forward "") + (delete-region opoint (match-beginning 0)))) + +(defun manual-html-fix-node-div () + "Fix up HTML \"node\" divs in the current buffer." + (let (opoint div-end) + (while (search-forward "
" nil t) + (replace-match + "
" + t t) + (setq opoint (point)) + (re-search-forward "
") + (setq div-end (match-beginning 0)) + (goto-char opoint) + (if (search-forward "
" div-end 'move) + (replace-match "" t t))))) + +(defun manual-html-fix-index-1 () + (let (opoint) + (re-search-forward "\n\\(

\n\n"))) + +(defun manual-html-fix-index-2 (&optional table-workaround) + "Replace the index list in the current buffer with a HTML table." + (let (done open-td tag desc) + ;; Convert the list that Makeinfo made into a table. + (search-forward "
    ") + (replace-match "") + (forward-line 1) + (while (not done) + (cond + ((or (looking-at "
  • \\(\\):[ \t]+\\(.*\\)$") + (looking-at "
  • \\(\\)$")) + (setq tag (match-string 1)) + (setq desc (match-string 2)) + (replace-match "" t t) + (when open-td + (save-excursion + (forward-char -1) + (skip-chars-backward " ") + (delete-region (point) (line-end-position)) + (insert "\n "))) + (insert "
  • \n ") + (if table-workaround + ;; This works around a Firefox bug in the mono file. + (insert "\n
    ") + (insert "")) + (insert tag "" (or desc "")) + (setq open-td t)) + ((eq (char-after) ?\n) + (delete-char 1) + ;; Negate the following `forward-line'. + (forward-line -1)) + ((looking-at "")) + ((looking-at "

    [- ]*The Detailed Node Listing[- \n]*") + (replace-match "

    \n +

    Detailed Node Listing

    \n\n" t t) + (search-forward "

    ") + (search-forward "

    ") + (goto-char (match-beginning 0)) + (skip-chars-backward "\n ") + (setq open-td nil) + (insert "

    \n\n")) + ((looking-at "") + (replace-match "" t t)) + ((looking-at "

    ") + (replace-match "" t t) + (when open-td + (insert " ") + (setq open-td nil)) + (insert "

    + ")) + ((looking-at "[ \t]*[ \t]*$") + (replace-match + (if open-td + " \n
    ") + (re-search-forward "

    [ \t\n]*
      ") + (replace-match "
    " + "") t t) + (setq done t)) + (t + (if (eobp) + (error "Parse error in %s" f)) + (unless open-td + (setq done t)))) + (forward-line 1)))) + (provide 'admin) ;;; admin.el ends here ------------------------------------------------------------ revno: 103640 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2011-03-13 02:57:40 +0100 message: lisp/help.el (describe-mode): Link to the mode's definition. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 19:19:47 +0000 +++ lisp/ChangeLog 2011-03-13 01:57:40 +0000 @@ -1,3 +1,7 @@ +2011-03-13 Juanma Barranquero + + * help.el (describe-mode): Link to the mode's definition (bug#8185). + 2011-03-12 Stefan Monnier * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization === modified file 'lisp/help.el' --- lisp/help.el 2011-01-25 04:08:28 +0000 +++ lisp/help.el 2011-03-13 01:57:40 +0000 @@ -871,7 +871,17 @@ (let ((start (point))) (insert (format-mode-line mode nil nil buffer)) (add-text-properties start (point) '(face bold))))) - (princ " mode:\n") + (princ " mode") + (let* ((mode major-mode) + (file-name (find-lisp-object-file-name mode nil))) + (when file-name + (princ (concat " defined in `" (file-name-nondirectory file-name) "'")) + ;; Make a hyperlink to the library. + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-function-def mode file-name))))) + (princ ":\n") (princ (documentation major-mode))))) ;; For the sake of IELM and maybe others nil) ------------------------------------------------------------ revno: 103639 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-03-12 11:19:47 -0800 message: Merge from emacs-23; up to r100524 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-03-10 05:48:33 +0000 +++ doc/emacs/ChangeLog 2011-03-12 19:19:47 +0000 @@ -1,3 +1,8 @@ +2011-03-12 Eli Zaretskii + + * msdog.texi (Windows HOME): Fix the wording to clarify how Emacs sets + HOME on Windows and where it looks for init files. (Bug#8221) + 2011-03-10 Eli Zaretskii * search.texi (Regexp Example): === modified file 'doc/emacs/msdog.texi' --- doc/emacs/msdog.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/msdog.texi 2011-03-12 19:19:47 +0000 @@ -404,36 +404,45 @@ @dfn{user-specific application data directory}. The actual location depends on your Windows version and system configuration; typical values are @file{C:\Documents and Settings\@var{username}\Application Data} on -Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data} +Windows 2K/XP/2K3, @file{C:\Users\@var{username}\AppData\Roaming} on +Windows Vista/7/2K8, and either @file{C:\WINDOWS\Application Data} or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the -older Windows 9X/ME systems. +older Windows 9X/ME systems. If this directory does not exist or +cannot be accessed, Emacs falls back to @file{C:\} as the default +value of @code{HOME}. - @code{HOME} can also be set in the system registry, for details see + You can override this default value of @code{HOME} by explicitly +setting the environment variable @env{HOME} to point to any directory +on your system. @env{HOME} can be set either from the command shell +prompt or from the @samp{My Computer}s @samp{Properties} dialog. +@code{HOME} can also be set in the system registry, for details see @ref{MS-Windows Registry}. -@cindex init file @file{.emacs} on MS-Windows - The home directory is where your init file @file{.emacs} is stored. -When Emacs starts, it first checks whether the environment variable -@env{HOME} is set. If it is, it looks for the init file in the -directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs -checks for an existing @file{.emacs} file in @file{C:\}, the root -directory of drive @file{C:}@footnote{ -The check in @file{C:\} is for compatibility with older versions of Emacs, -which didn't check the application data directory. -}. If there's no such file in @file{C:\}, Emacs next uses the Windows -system calls to find out the exact location of your application data -directory. If that system call fails, Emacs falls back to @file{C:\}. + For compatibility with older versions of Emacs@footnote{ +Older versions of Emacs didn't check the application data directory. +}, if there is a file named @file{.emacs} in @file{C:\}, the root +directory of drive @file{C:}, and @env{HOME} is set neither in the +environment nor in the Registry, Emacs will treat @file{C:\} as the +default @code{HOME} location, and will not look in the application +data directory, even if it exists. Note that only @file{.emacs} is +looked for in @file{C:\}; the older name @file{_emacs} (see below) is +not. This use of @file{C:\.emacs} to define @code{HOME} is +deprecated. - Whatever the final place is, Emacs sets the value of the @env{HOME} -environment variable to point to it, and it will use that location for -other files and directories it normally creates in the user's home -directory. + Whatever the final place is, Emacs sets the internal value of the +@env{HOME} environment variable to point to it, and it will use that +location for other files and directories it normally looks for or +creates in the user's home directory. You can always find out where Emacs thinks is your home directory's location by typing @kbd{C-x d ~/ @key{RET}}. This should present the list of files in the home directory, and show its full name on the first line. Likewise, to visit your init file, type @kbd{C-x C-f -~/.emacs @key{RET}}. +~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}). + +@cindex init file @file{.emacs} on MS-Windows + The home directory is where your init file is stored. It can have +any name mentioned in @ref{Init File}. @cindex @file{_emacs} init file, MS-Windows Because MS-DOS does not allow file names with leading dots, and === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 15:38:34 +0000 +++ lisp/ChangeLog 2011-03-12 19:19:47 +0000 @@ -1,3 +1,20 @@ +2011-03-12 Stefan Monnier + + * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization + into declaration. Remove redundant and harmful binding. + +2011-03-12 Eli Zaretskii + + * files.el (file-ownership-preserved-p): Pass `integer' as an + explicit 2nd argument to `file-attributes'. If the file's owner + is the Administrators group on Windows, and the current user is + Administrator, consider that a match. + + * server.el (server-ensure-safe-dir): Consider server directory + safe on MS-Windows if its owner is the Administrators group while + the current Emacs user is Administrator. Use `=' to compare + numerical UIDs, since they could be integers or floats. + 2011-03-12 Juanma Barranquero * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170). === modified file 'lisp/ebuff-menu.el' --- lisp/ebuff-menu.el 2011-01-25 04:08:28 +0000 +++ lisp/ebuff-menu.el 2011-03-12 19:19:47 +0000 @@ -34,7 +34,56 @@ ;; this depends on the format of list-buffers (from src/buffer.c) and ;; on stuff in lisp/buff-menu.el -(defvar electric-buffer-menu-mode-map nil) +(defvar electric-buffer-menu-mode-map + (let ((map (make-keymap))) + (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) + (define-key map "\e" nil) + (define-key map "\C-z" 'suspend-frame) + (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) + (define-key map (char-to-string help-char) 'Helper-help) + (define-key map "?" 'Helper-describe-bindings) + (define-key map "\C-c" nil) + (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit) + (define-key map "\C-]" 'Electric-buffer-menu-quit) + (define-key map "q" 'Electric-buffer-menu-quit) + (define-key map " " 'Electric-buffer-menu-select) + (define-key map "\C-m" 'Electric-buffer-menu-select) + (define-key map "\C-l" 'recenter) + (define-key map "s" 'Buffer-menu-save) + (define-key map "d" 'Buffer-menu-delete) + (define-key map "k" 'Buffer-menu-delete) + (define-key map "\C-d" 'Buffer-menu-delete-backwards) + ;; (define-key map "\C-k" 'Buffer-menu-delete) + (define-key map "\177" 'Buffer-menu-backup-unmark) + (define-key map "~" 'Buffer-menu-not-modified) + (define-key map "u" 'Buffer-menu-unmark) + (let ((i ?0)) + (while (<= i ?9) + (define-key map (char-to-string i) 'digit-argument) + (define-key map (concat "\e" (char-to-string i)) 'digit-argument) + (setq i (1+ i)))) + (define-key map "-" 'negative-argument) + (define-key map "\e-" 'negative-argument) + (define-key map "m" 'Buffer-menu-mark) + (define-key map "\C-u" 'universal-argument) + (define-key map "\C-p" 'previous-line) + (define-key map "\C-n" 'next-line) + (define-key map "p" 'previous-line) + (define-key map "n" 'next-line) + (define-key map "\C-v" 'scroll-up) + (define-key map "\ev" 'scroll-down) + (define-key map ">" 'scroll-right) + (define-key map "<" 'scroll-left) + (define-key map "\e\C-v" 'scroll-other-window) + (define-key map "\e>" 'end-of-buffer) + (define-key map "\e<" 'beginning-of-buffer) + (define-key map "\e\e" nil) + (define-key map "\e\e\e" 'Electric-buffer-menu-quit) + ;; This binding prevents the "escape => ESC" function-key-map mapping from + ;; kicking in! + ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit) + (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) + map)) (defvar electric-buffer-menu-mode-hook nil "Normal hook run by `electric-buffer-list'.") @@ -167,55 +216,7 @@ ;; generally the same as Buffer-menu-mode-map ;; (except we don't indirect to global-map) (put 'Electric-buffer-menu-undefined 'suppress-keymap t) -(if electric-buffer-menu-mode-map - nil - (let ((map (make-keymap))) - (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) - (define-key map "\e" nil) - (define-key map "\C-z" 'suspend-frame) - (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) - (define-key map (char-to-string help-char) 'Helper-help) - (define-key map "?" 'Helper-describe-bindings) - (define-key map "\C-c" nil) - (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit) - (define-key map "\C-]" 'Electric-buffer-menu-quit) - (define-key map "q" 'Electric-buffer-menu-quit) - (define-key map " " 'Electric-buffer-menu-select) - (define-key map "\C-m" 'Electric-buffer-menu-select) - (define-key map "\C-l" 'recenter) - (define-key map "s" 'Buffer-menu-save) - (define-key map "d" 'Buffer-menu-delete) - (define-key map "k" 'Buffer-menu-delete) - (define-key map "\C-d" 'Buffer-menu-delete-backwards) - ;(define-key map "\C-k" 'Buffer-menu-delete) - (define-key map "\177" 'Buffer-menu-backup-unmark) - (define-key map "~" 'Buffer-menu-not-modified) - (define-key map "u" 'Buffer-menu-unmark) - (let ((i ?0)) - (while (<= i ?9) - (define-key map (char-to-string i) 'digit-argument) - (define-key map (concat "\e" (char-to-string i)) 'digit-argument) - (setq i (1+ i)))) - (define-key map "-" 'negative-argument) - (define-key map "\e-" 'negative-argument) - (define-key map "m" 'Buffer-menu-mark) - (define-key map "\C-u" 'universal-argument) - (define-key map "\C-p" 'previous-line) - (define-key map "\C-n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "n" 'next-line) - (define-key map "\C-v" 'scroll-up) - (define-key map "\ev" 'scroll-down) - (define-key map ">" 'scroll-right) - (define-key map "<" 'scroll-left) - (define-key map "\e\C-v" 'scroll-other-window) - (define-key map "\e>" 'end-of-buffer) - (define-key map "\e<" 'beginning-of-buffer) - (define-key map "\e\e" nil) - (define-key map "\e\e\e" 'Electric-buffer-menu-quit) - (define-key map [escape escape escape] 'Electric-buffer-menu-quit) - (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) - (setq electric-buffer-menu-mode-map map))) + (defun Electric-buffer-menu-exit () (interactive) === modified file 'lisp/files.el' --- lisp/files.el 2011-03-05 21:56:00 +0000 +++ lisp/files.el 2011-03-12 19:19:47 +0000 @@ -3895,11 +3895,17 @@ (let ((handler (find-file-name-handler file 'file-ownership-preserved-p))) (if handler (funcall handler 'file-ownership-preserved-p file) - (let ((attributes (file-attributes file))) + (let ((attributes (file-attributes file 'integer))) ;; Return t if the file doesn't exist, since it's true that no ;; information would be lost by an (attempted) delete and create. (or (null attributes) - (= (nth 2 attributes) (user-uid))))))) + (= (nth 2 attributes) (user-uid)) + ;; Files created on Windows by Administrator (RID=500) + ;; have the Administrators group (RID=544) recorded as + ;; their owner. Rewriting them will still preserve the + ;; owner. + (and (eq system-type 'windows-nt) + (= (user-uid) 500) (= (nth 2 attributes) 544))))))) (defun file-name-sans-extension (filename) "Return FILENAME sans final \"extension\". === modified file 'lisp/server.el' --- lisp/server.el 2011-02-10 19:41:44 +0000 +++ lisp/server.el 2011-03-12 19:19:47 +0000 @@ -485,7 +485,13 @@ (file-name-as-directory dir)) :warning) (throw :safe t)) - (unless (eql uid (user-uid)) ; is the dir ours? + (unless (or (= uid (user-uid)) ; is the dir ours? + (and w32 + ;; Files created on Windows by + ;; Administrator (RID=500) have + ;; the Administrators (RID=544) + ;; group recorded as the owner. + (= uid 544) (= (user-uid) 500))) (throw :safe nil)) (when w32 ; on NTFS? (throw :safe t)) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-12 12:05:05 +0000 +++ src/ChangeLog 2011-03-12 19:19:47 +0000 @@ -1,3 +1,10 @@ +2011-03-12 YAMAMOTO Mitsuharu + + * fringe.c (update_window_fringes): Remove unused variables. + + * unexmacosx.c (copy_data_segment): Also copy __got section. + (Bug#8223) + 2011-03-12 Eli Zaretskii * termcap.c [MSDOS]: Include "msdos.h. === modified file 'src/fringe.c' --- src/fringe.c 2011-03-11 06:23:26 +0000 +++ src/fringe.c 2011-03-12 19:19:47 +0000 @@ -954,18 +954,10 @@ y < yb && rn < nrows; y += row->height, ++rn) { - unsigned indicate_bob_p, indicate_top_line_p; - unsigned indicate_eob_p, indicate_bottom_line_p; - row = w->desired_matrix->rows + rn; if (!row->enabled_p) row = w->current_matrix->rows + rn; - indicate_bob_p = row->indicate_bob_p; - indicate_top_line_p = row->indicate_top_line_p; - indicate_eob_p = row->indicate_eob_p; - indicate_bottom_line_p = row->indicate_bottom_line_p; - row->indicate_bob_p = row->indicate_top_line_p = 0; row->indicate_eob_p = row->indicate_bottom_line_p = 0; === modified file 'src/unexmacosx.c' --- src/unexmacosx.c 2011-01-25 04:08:28 +0000 +++ src/unexmacosx.c 2011-03-12 19:19:47 +0000 @@ -828,6 +828,7 @@ } else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 + || strncmp (sectp->sectname, "__got", 16) == 0 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0 || strncmp (sectp->sectname, "__dyld", 16) == 0 || strncmp (sectp->sectname, "__const", 16) == 0 ------------------------------------------------------------ revno: 103638 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-03-12 10:40:08 -0800 message: Some more html rules for doc/misc/Makefile.in. * doc/misc/Makefile.in (emacs-faq.html): Fix some more cross-refs. (emacs-faq.text): New target. (clean): Add emacs-faq. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-12 15:22:10 +0000 +++ doc/misc/ChangeLog 2011-03-12 18:40:08 +0000 @@ -1,3 +1,9 @@ +2011-03-12 Glenn Morris + + * Makefile.in (emacs-faq.html): Fix some more cross-refs. + (emacs-faq.text): New target. + (clean): Add emacs-faq. + 2011-03-12 Michael Albinus Sync with Tramp 2.2.1. === modified file 'doc/misc/Makefile.in' --- doc/misc/Makefile.in 2011-03-11 09:07:33 +0000 +++ doc/misc/Makefile.in 2011-03-12 18:40:08 +0000 @@ -408,7 +408,10 @@ emacs-faq.html: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi $(MAKEINFO) $(MAKEINFO_OPTS) --no-split \ --css-ref='/layout.css' --html -o $@ $< - sed -i 's|a href="emacs.html#\([^"]*\)"|a href="manual/html_node/emacs/\1.html"|g' $@ + sed -i -e 's|a href="\([a-z]*\)\.html#\([^"]*\)"|a href="manual/html_node/\1/\2.html"|g' \ + -e 's|/Top\.html|/|g' $@ +emacs-faq.text: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi + $(MAKEINFO) $(MAKEINFO_OPTS) --plaintext -o $@ $< flymake : $(infodir)/flymake $(infodir)/flymake: flymake.texi @@ -692,7 +695,7 @@ rm -f gnustmp.* clean: mostlyclean - rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) + rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) emacs-faq.text distclean: clean # rm -f Makefile ------------------------------------------------------------ revno: 103637 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2011-03-12 16:38:34 +0100 message: Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 15:26:33 +0000 +++ lisp/ChangeLog 2011-03-12 15:38:34 +0000 @@ -1,3 +1,7 @@ +2011-03-12 Juanma Barranquero + + * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170). + 2011-03-12 Michael Albinus Sync with Tramp 2.2.1. @@ -6,10 +10,6 @@ * net/trampver.el: Update release number. -2011-03-12 Juanma Barranquero - - * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170). - 2011-03-12 Stefan Monnier * progmodes/compile.el (compilation--previous-directory): Fix up @@ -22,12 +22,11 @@ 2011-03-11 Ken Manheimer - * allout-widgets.el (allout-widgets-tally) Initialize + * allout-widgets.el (allout-widgets-tally): Initialize allout-widgets-tally as a hash table rather than nil to prevent mode-line redisplay warnings. Also, clarify the module description and fix a comment typo. - 2011-03-11 Juanma Barranquero * help-fns.el (describe-variable): Don't complete keywords. @@ -77,7 +76,7 @@ preserves the existing header prefix, rebulleting it if necessary, rather than replacing it. This is necessary for proper operation of cooperative addons like allout-widgets. - (allout-make-topic-prefix) (allout-rebullet-heading): Change + (allout-make-topic-prefix, allout-rebullet-heading): Change SOLICIT arg to INSTEAD, and interpret additionally a string value as alternate bullet to be used, instead of prompting the user for a bullet character. @@ -913,7 +912,7 @@ 2011-02-17 Ken Manheimer * lisp/allout-widgets.el (allout-widgets-icons-light-subdir) - (allout-widgets-icons-dark-subdir): Track relocations of icons + (allout-widgets-icons-dark-subdir): Track relocations of icons. * lisp/allout.el: Remove commentary about remove encryption passphrase mnemonic support and verification. (allout-encrypt-string): Recognize epg failure to decrypt gpg2 @@ -1290,10 +1289,9 @@ (allout-auto-activation-helper, allout-setup): New autoloads implement new custom set procedure for allout-auto-activation. - Also, explicitly invoke - (allout-setup) after allout-auto-activation is custom-defined, to - effect the settings in emacs sessions besides the few where - allout-auto-activation customization is donea. + Also, explicitly invoke (allout-setup) after allout-auto-activation + is custom-defined, to affect the settings in emacs sessions besides + the few where allout-auto-activation customization is done. (allout-auto-activation): Use allout-auto-activation-helper to :set. Revise the docstring. (allout-init): Reduce functionality to just customizing ------------------------------------------------------------ revno: 103636 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2011-03-12 16:26:33 +0100 message: lisp/vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 15:19:29 +0000 +++ lisp/ChangeLog 2011-03-12 15:26:33 +0000 @@ -6,6 +6,10 @@ * net/trampver.el: Update release number. +2011-03-12 Juanma Barranquero + + * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170). + 2011-03-12 Stefan Monnier * progmodes/compile.el (compilation--previous-directory): Fix up === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2011-03-04 17:24:02 +0000 +++ lisp/vc/vc-bzr.el 2011-03-12 15:26:33 +0000 @@ -435,8 +435,13 @@ (defun vc-bzr-state (file) (lexical-let ((result (vc-bzr-status file))) (when (consp result) - (when (cdr result) - (message "Warnings in `bzr' output: %s" (cdr result))) + (let ((warnings (cdr result))) + (when warnings + ;; bzr 2.3.0 returns info about shelves, which is not really a warning + (when (string-match "[1-9]+ shel\\(f\\|ves\\) exists?\\..*?\n" warnings) + (setq warnings (replace-match "" nil nil warnings))) + (unless (string= warnings "") + (message "Warnings in `bzr' output: %s" warnings)))) (cdr (assq (car result) '((added . added) (kindchanged . edited) ------------------------------------------------------------ revno: 103635 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-03-12 16:22:10 +0100 message: Sync with Tramp 2.2.1. * trampver.texi: Update release number. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-11 09:02:58 +0000 +++ doc/misc/ChangeLog 2011-03-12 15:22:10 +0000 @@ -1,3 +1,9 @@ +2011-03-12 Michael Albinus + + Sync with Tramp 2.2.1. + + * trampver.texi: Update release number. + 2011-03-11 Glenn Morris * Makefile.in (HTML_TARGETS): New. === modified file 'doc/misc/trampver.texi' --- doc/misc/trampver.texi 2011-02-23 04:19:28 +0000 +++ doc/misc/trampver.texi 2011-03-12 15:22:10 +0000 @@ -8,7 +8,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.1-pre +@set trampver 2.2.1 @c Other flags from configuration @set instprefix /usr/local ------------------------------------------------------------ revno: 103634 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-03-12 16:19:29 +0100 message: Sync with Tramp 2.2.1. * net/tramp-sh.el (tramp-methods): Exchange "%k" marker with options. * net/trampver.el: Update release number. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 04:29:22 +0000 +++ lisp/ChangeLog 2011-03-12 15:19:29 +0000 @@ -1,3 +1,11 @@ +2011-03-12 Michael Albinus + + Sync with Tramp 2.2.1. + + * net/tramp-sh.el (tramp-methods): Exchange "%k" marker with options. + + * net/trampver.el: Update release number. + 2011-03-12 Stefan Monnier * progmodes/compile.el (compilation--previous-directory): Fix up === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2011-03-09 11:04:27 +0000 +++ lisp/net/tramp-sh.el 2011-03-12 15:19:29 +0000 @@ -90,7 +90,7 @@ (tramp-login-args (("%h") ("-l" "%u"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "rcp") - (tramp-copy-args (("%k" "-p") ("-r"))) + (tramp-copy-args (("-p" "%k") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t))) ;;;###tramp-autoload @@ -100,7 +100,7 @@ (tramp-login-args (("%h") ("-l" "%u"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "rcp") - (tramp-copy-args (("%k" "-p"))) + (tramp-copy-args (("-p" "%k"))) (tramp-copy-keep-date t))) ;;;###tramp-autoload (add-to-list 'tramp-methods @@ -110,7 +110,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") - (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) + (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -126,7 +126,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") - (tramp-copy-args (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) + (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -142,7 +142,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") - (tramp-copy-args (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r"))) + (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -160,7 +160,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") - (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r") + (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") ("-o" "ControlPath=%t.%%r@%%h:%%p") ("-o" "ControlMaster=auto"))) (tramp-copy-keep-date t) @@ -179,7 +179,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "scp") - (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r"))) + (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") @@ -202,7 +202,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "rsync") - (tramp-copy-args (("-e" "ssh") ("%k" "-t") ("-r"))) + (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-keep-tmpfile t) (tramp-copy-recursive t))) @@ -217,7 +217,7 @@ (tramp-async-args (("-q"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "rsync") - (tramp-copy-args (("%k" "-t") ("-r"))) + (tramp-copy-args (("-t" "%k") ("-r"))) (tramp-copy-env (("RSYNC_RSH") (,(concat "ssh" @@ -353,7 +353,7 @@ (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "pscp") - (tramp-copy-args (("-P" "%p") ("-scp") ("%k" "-p") + (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) @@ -366,7 +366,7 @@ (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "pscp") - (tramp-copy-args (("-P" "%p") ("-sftp") ("%k" "-p") + (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t) @@ -378,7 +378,7 @@ (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) (tramp-remote-sh "/bin/sh -i") (tramp-copy-program "fcp") - (tramp-copy-args (("%k" "-p"))) + (tramp-copy-args (("-p" "%k"))) (tramp-copy-keep-date t))) ;;;###tramp-autoload === modified file 'lisp/net/trampver.el' --- lisp/net/trampver.el 2011-01-25 04:08:28 +0000 +++ lisp/net/trampver.el 2011-03-12 15:19:29 +0000 @@ -31,7 +31,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.1-pre" +(defconst tramp-version "2.2.1" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.1-pre is not fit for %s" + (format "Tramp 2.2.1 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) ------------------------------------------------------------ revno: 103633 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-03-12 14:07:24 +0200 message: Adapt MSDOS build according to changes in revno 103623. src/termcap.c [MSDOS]: Include "msdos.h. (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent): Constify `char *' arguments and their references according to prototypes in tparam.h. src/deps.mk (termcap.o): Depend on tparam.h and msdos.h. src/msdos.c (XMenuAddPane): 3rd argument is `const char *' now. Adapt all references accordingly. src/msdos.h (XMenuAddPane): 3rd argument is `const char *' now. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-11 16:49:16 +0000 +++ src/ChangeLog 2011-03-12 12:05:05 +0000 @@ -1,3 +1,17 @@ +2011-03-12 Eli Zaretskii + + * termcap.c [MSDOS]: Include "msdos.h. + (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent): + Constify `char *' arguments and their references according to + prototypes in tparam.h. + + * deps.mk (termcap.o): Depend on tparam.h and msdos.h. + + * msdos.c (XMenuAddPane): 3rd argument is `const char *' now. + Adapt all references accordingly. + + * msdos.h (XMenuAddPane): 3rd argument is `const char *' now. + 2011-03-11 Tom Tromey * buffer.c (syms_of_buffer): Remove obsolete comment. === modified file 'src/deps.mk' --- src/deps.mk 2011-03-08 18:26:34 +0000 +++ src/deps.mk 2011-03-12 12:03:24 +0000 @@ -191,7 +191,7 @@ cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h -termcap.o: termcap.c lisp.h $(config_h) +termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h) terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ msdos.h === modified file 'src/msdos.c' --- src/msdos.c 2011-03-11 09:41:56 +0000 +++ src/msdos.c 2011-03-12 10:51:31 +0000 @@ -2999,17 +2999,17 @@ to do. */ int -XMenuAddPane (Display *foo, XMenu *menu, char *txt, int enable) +XMenuAddPane (Display *foo, XMenu *menu, const char *txt, int enable) { int len; - char *p; + const char *p; if (!enable) abort (); IT_menu_make_room (menu); menu->submenu[menu->count] = IT_menu_create (); - menu->text[menu->count] = txt; + menu->text[menu->count] = (char *)txt; menu->panenumber[menu->count] = ++menu->panecount; menu->help_text[menu->count] = NULL; menu->count++; === modified file 'src/msdos.h' --- src/msdos.h 2011-02-27 19:46:39 +0000 +++ src/msdos.h 2011-03-12 10:51:31 +0000 @@ -105,7 +105,7 @@ } XMenu; XMenu *XMenuCreate (Display *, Window, char *); -int XMenuAddPane (Display *, XMenu *, char *, int); +int XMenuAddPane (Display *, XMenu *, const char *, int); int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *); void XMenuLocate (Display *, XMenu *, int, int, int, int, int *, int *, int *, int *); === modified file 'src/termcap.c' --- src/termcap.c 2011-02-19 19:41:00 +0000 +++ src/termcap.c 2011-03-12 12:03:24 +0000 @@ -25,6 +25,10 @@ #include #include "lisp.h" +#include "tparam.h" +#ifdef MSDOS +#include "msdos.h" +#endif #ifndef NULL #define NULL (char *) 0 @@ -65,7 +69,7 @@ 0 if not found. */ static char * -find_capability (register char *bp, register char *cap) +find_capability (register char *bp, register const char *cap) { for (; *bp; bp++) if (bp[0] == ':' @@ -76,7 +80,7 @@ } int -tgetnum (char *cap) +tgetnum (const char *cap) { register char *ptr = find_capability (term_entry, cap); if (!ptr || ptr[-1] != '#') @@ -85,7 +89,7 @@ } int -tgetflag (char *cap) +tgetflag (const char *cap) { register char *ptr = find_capability (term_entry, cap); return ptr && ptr[-1] == ':'; @@ -97,7 +101,7 @@ If AREA is null, space is allocated with `malloc'. */ char * -tgetstr (char *cap, char **area) +tgetstr (const char *cap, char **area) { register char *ptr = find_capability (term_entry, cap); if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) @@ -263,7 +267,7 @@ char PC; void -tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) +tputs (register const char *str, int nlines, int (*outfun) (int)) { register int padcount = 0; register int speed; @@ -355,7 +359,7 @@ in it, and some other value otherwise. */ int -tgetent (char *bp, char *name) +tgetent (char *bp, const char *name) { register char *termcap_name; register int fd; @@ -442,7 +446,7 @@ buf.size = BUFSIZE; /* Add 1 to size to ensure room for terminating null. */ buf.beg = (char *) xmalloc (buf.size + 1); - term = indirect ? indirect : name; + term = indirect ? indirect : (char *)name; if (!bp) { ------------------------------------------------------------ revno: 103632 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2011-03-12 08:53:34 +0000 message: Merge changes made in Gnus trunk. gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't install `gnus-sync-read' to any hooks by default. It's buggy. The user will have to run `gnus-sync-read' manually and wait for Cloudy Gnus. mm-uu.el (mm-uu-type-alist): Add support for diff starting with "=== modified file". diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-10 13:32:49 +0000 +++ lisp/gnus/ChangeLog 2011-03-12 08:53:34 +0000 @@ -1,3 +1,15 @@ +2011-03-11 Teodor Zlatanov + + * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't + install `gnus-sync-read' to any hooks by default. It's buggy. The + user will have to run `gnus-sync-read' manually and wait for Cloudy + Gnus. + +2011-03-11 Julien Danjou + + * mm-uu.el (mm-uu-type-alist): Add support for diff starting with "=== + modified file". + 2011-03-09 Teodor Zlatanov * auth-source.el (auth-source-read-char-choice): New function to read a === modified file 'lisp/gnus/gnus-sync.el' --- lisp/gnus/gnus-sync.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/gnus-sync.el 2011-03-12 08:53:34 +0000 @@ -25,7 +25,8 @@ ;; This is the gnus-sync.el package. ;; It's due for a rewrite using gnus-after-set-mark-hook and -;; gnus-before-update-mark-hook. Until then please consider it +;; gnus-before-update-mark-hook, and my plan is to do this once No +;; Gnus development is done. Until then please consider it ;; experimental. ;; Put this in your startup file (~/.gnus.el for instance) @@ -42,7 +43,8 @@ ;; TODO: -;; - after gnus-sync-read, the message counts are wrong +;; - after gnus-sync-read, the message counts are wrong. So it's not +;; run automatically, you have to call it with M-x gnus-sync-read ;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to ;; catch the mark updates @@ -220,13 +222,13 @@ "Install the sync hooks." (interactive) ;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read) - (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save) - (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) + ;; (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read) + (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save)) (defun gnus-sync-unload-hook () "Uninstall the sync hooks." (interactive) - ;; (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read) + (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read) (remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save) (remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)) === modified file 'lisp/gnus/mm-uu.el' --- lisp/gnus/mm-uu.el 2011-02-01 23:46:27 +0000 +++ lisp/gnus/mm-uu.el 2011-03-12 08:53:34 +0000 @@ -158,6 +158,12 @@ mm-uu-diff-extract nil mm-uu-diff-test) + (diff + "^=== modified file " + nil + mm-uu-diff-extract + nil + mm-uu-diff-test) (git-format-patch "^diff --git " "^-- " ------------------------------------------------------------ revno: 103631 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-03-11 23:29:22 -0500 message: * lisp/progmodes/compile.el (compilation--previous-directory): Fix up various nil/dead-marker mismatches. (compilation-directory-properties, compilation-error-properties): Don't call it at a position past the one we're about to change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-12 02:59:24 +0000 +++ lisp/ChangeLog 2011-03-12 04:29:22 +0000 @@ -1,5 +1,10 @@ 2011-03-12 Stefan Monnier + * progmodes/compile.el (compilation--previous-directory): Fix up + various nil/dead-marker mismatches (bug#8014). + (compilation-directory-properties, compilation-error-properties): + Don't call it at a position past the one we're about to change. + * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable): Disable obsolescence warnings in the file that declares it. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-02-19 21:23:51 +0000 +++ lisp/progmodes/compile.el 2011-03-12 04:29:22 +0000 @@ -860,27 +860,29 @@ (car compilation--previous-directory-cache))) (prev (previous-single-property-change - pos 'compilation-directory nil cache))) - (cond - ((null cache) - (setq compilation--previous-directory-cache - (cons (copy-marker pos) (copy-marker prev))) - prev) - ((eq prev cache) - (if cache - (set-marker (car compilation--previous-directory-cache) pos) - (setq compilation--previous-directory-cache - (cons (copy-marker pos) nil))) - (cdr compilation--previous-directory-cache)) - (t - (if cache - (progn - (set-marker (car compilation--previous-directory-cache) pos) - (setcdr compilation--previous-directory-cache - (copy-marker prev))) - (setq compilation--previous-directory-cache - (cons (copy-marker pos) (copy-marker prev)))) - prev))))) + pos 'compilation-directory nil cache)) + (res + (cond + ((null cache) + (setq compilation--previous-directory-cache + (cons (copy-marker pos) (if prev (copy-marker prev)))) + prev) + ((and prev (= prev cache)) + (if cache + (set-marker (car compilation--previous-directory-cache) pos) + (setq compilation--previous-directory-cache + (cons (copy-marker pos) nil))) + (cdr compilation--previous-directory-cache)) + (t + (if cache + (progn + (set-marker cache pos) + (setcdr compilation--previous-directory-cache + (copy-marker prev))) + (setq compilation--previous-directory-cache + (cons (copy-marker pos) (if prev (copy-marker prev))))) + prev)))) + (if (markerp res) (marker-position res) res)))) ;; Internal function for calculating the text properties of a directory ;; change message. The compilation-directory property is important, because it @@ -889,7 +891,7 @@ (defun compilation-directory-properties (idx leave) (if leave (setq leave (match-end leave))) ;; find previous stack, and push onto it, or if `leave' pop it - (let ((dir (compilation--previous-directory (point)))) + (let ((dir (compilation--previous-directory (match-beginning 0)))) (setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory) (get-text-property dir 'compilation-directory)))) `(font-lock-face ,(if leave @@ -948,7 +950,8 @@ (match-string-no-properties file)))) (let ((dir (unless (file-name-absolute-p file) - (let ((pos (compilation--previous-directory (point)))) + (let ((pos (compilation--previous-directory + (match-beginning 0)))) (when pos (or (get-text-property (1- pos) 'compilation-directory) (get-text-property pos 'compilation-directory))))))) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.