Now on revision 110034. ------------------------------------------------------------ revno: 110034 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-09-14 21:11:52 -0400 message: Improve vc-bzr-working-revision for lightweight checkouts * lisp/vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local checkouts, check the parent dirstate matches the branch. Add "--tree" to "bzr revno" arguments. Don't try to shorten the empty string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-15 00:33:40 +0000 +++ lisp/ChangeLog 2012-09-15 01:11:52 +0000 @@ -1,5 +1,10 @@ 2012-09-15 Glenn Morris + * vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local + checkouts, check the parent dirstate matches the branch. + Add "--tree" to "bzr revno" arguments. Don't try to shorten the + empty string. + * version.el (emacs-bzr-version): Doc fix. (emacs-bzr-version-dirstate): New function. (emacs-bzr-get-version): For lightweight checkouts, if the parent === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2012-07-19 14:38:01 +0000 +++ lisp/vc/vc-bzr.el 2012-09-15 01:11:52 +0000 @@ -534,7 +534,9 @@ ;; FIXME: maybe it's overkill to check if both these ;; files exist. (and (file-exists-p branch-format-file) - (file-exists-p lastrev-file))))) + (file-exists-p lastrev-file) + (equal (emacs-bzr-version-dirstate l-c-parent-dir) + (emacs-bzr-version-dirstate rootdir)))))) t))) (with-temp-buffer (insert-file-contents branch-format-file) @@ -553,13 +555,17 @@ (insert-file-contents lastrev-file) (when (re-search-forward "[0-9]+" nil t) (buffer-substring (match-beginning 0) (match-end 0)))))) - ;; fallback to calling "bzr revno" + ;; Fallback to calling "bzr revno --tree". + ;; The "--tree" matters for lightweight checkouts not on the same + ;; revision as the parent. (let* ((result (vc-bzr-command-discarding-stderr - vc-bzr-program "revno" (file-relative-name file))) + vc-bzr-program "revno" "--tree" + (file-relative-name file))) (exitcode (car result)) (output (cdr result))) (cond - ((eq exitcode 0) (substring output 0 -1)) + ((and (eq exitcode 0) (not (zerop (length output)))) + (substring output 0 -1)) (t nil)))))) (defun vc-bzr-create-repo () ------------------------------------------------------------ revno: 110033 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-09-14 20:45:00 -0400 message: Tweak previous emacs-bzr-get-version change diff: === modified file 'lisp/version.el' --- lisp/version.el 2012-09-15 00:33:40 +0000 +++ lisp/version.el 2012-09-15 00:45:00 +0000 @@ -113,7 +113,7 @@ Optional argument DIR is a directory to use instead of `source-directory'." (or dir (setq dir source-directory)) - (when (file-directory-p dir) + (when (file-directory-p (expand-file-name ".bzr/branch" dir)) (let (file loc rev) (cond ((file-readable-p (setq file (expand-file-name ".bzr/branch/last-revision" dir))) ------------------------------------------------------------ revno: 110032 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-09-14 20:33:40 -0400 message: Improve emacs-bzr-version for lightweight checkouts (bug#12441) * lisp/version.el (emacs-bzr-version): Doc fix. (emacs-bzr-version-dirstate): New function. (emacs-bzr-get-version): For lightweight checkouts, if the parent is local try and check that it matches the branch. If not, just use dirstate information. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-14 22:58:43 +0000 +++ lisp/ChangeLog 2012-09-15 00:33:40 +0000 @@ -1,3 +1,11 @@ +2012-09-15 Glenn Morris + + * version.el (emacs-bzr-version): Doc fix. + (emacs-bzr-version-dirstate): New function. + (emacs-bzr-get-version): For lightweight checkouts, if the parent + is local try and check that it matches the branch. If not, just + use dirstate information. (Bug#12441) + 2012-09-14 Juri Linkov * dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. === modified file 'lisp/version.el' --- lisp/version.el 2012-05-27 17:31:31 +0000 +++ lisp/version.el 2012-09-15 00:33:40 +0000 @@ -87,23 +87,36 @@ ;; Set during dumping, this is a defvar so that it can be setq'd. (defvar emacs-bzr-version nil "String giving the bzr revision from which this Emacs was built. -Value is the bzr revision number and a revision ID separated by a blank. +The format is: [revno] revision_id, where revno may be absent. Value is nil if Emacs was not built from a bzr checkout, or if we could not determine the revision.") +(defun emacs-bzr-version-dirstate (dir) + "Try to return as a string the bzr revision ID of directory DIR. +This uses the dirstate file's parent revision entry. +Returns nil if unable to find this information." + (let ((file (expand-file-name ".bzr/checkout/dirstate" dir))) + (when (file-readable-p file) + (with-temp-buffer + (insert-file-contents file) + (and (looking-at "#bazaar dirstate flat format 3") + (forward-line 3) + (looking-at "[0-9]+\0\\([^\0\n]+\\)\0") + (match-string 1)))))) + (defun emacs-bzr-get-version (&optional dir) - "Try to return as a string the bzr revision number of the Emacs sources. -Value is the bzr revision number and a revision ID separated by a blank. + "Try to return as a string the bzr revision of the Emacs sources. +The format is: [revno] revision_id, where revno may be absent. Value is nil if the sources do not seem to be under bzr, or if we could not determine the revision. Note that this reports on the current state of the sources, which may not correspond to the running Emacs. Optional argument DIR is a directory to use instead of `source-directory'." (or dir (setq dir source-directory)) - (when (file-directory-p (setq dir (expand-file-name ".bzr/branch" dir))) - (let (file loc) + (when (file-directory-p dir) + (let (file loc rev) (cond ((file-readable-p - (setq file (expand-file-name "last-revision" dir))) + (setq file (expand-file-name ".bzr/branch/last-revision" dir))) (with-temp-buffer (insert-file-contents file) (goto-char (point-max)) @@ -112,14 +125,26 @@ (buffer-string))) ;; OK, no last-revision. Is it a lightweight checkout? ((file-readable-p - (setq file (expand-file-name "location" dir))) - ;; If the parent branch is local, try looking there for the revid. - (if (setq loc (with-temp-buffer + (setq file (expand-file-name ".bzr/branch/location" dir))) + (setq rev (emacs-bzr-version-dirstate dir)) + ;; If the parent branch is local, try looking there for the rev. + ;; Note: there is no guarantee that the parent branch's rev + ;; corresponds to this branch. This branch could have + ;; been made with a specific -r revno argument, or the + ;; parent could have been updated since this branch was created. + ;; To try and detect this, we check the dirstate revids + ;; to see if they match. + (if (and (setq loc (with-temp-buffer (insert-file-contents file) (if (looking-at "file://\\(.*\\)") (match-string 1)))) - (emacs-bzr-get-version loc))) - ;; Could fall back to eg `bzr testament' at this point. + (equal rev (emacs-bzr-version-dirstate loc))) + (emacs-bzr-get-version loc) + ;; If parent does not match, the best we can do without + ;; calling external commands is to use the dirstate rev. + rev)) + ;; At this point, could fall back to: + ;; bzr version-info --custom --template='{revno} {revision_id}\n' )))) ;; We put version info into the executable in the form that `ident' uses. ------------------------------------------------------------ revno: 110031 fixes bug: http://debbugs.gnu.org/12399 committer: Juri Linkov branch nick: trunk timestamp: Sat 2012-09-15 01:58:43 +0300 message: * lisp/dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-14 13:44:31 +0000 +++ lisp/ChangeLog 2012-09-14 22:58:43 +0000 @@ -1,3 +1,8 @@ +2012-09-14 Juri Linkov + + * dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. + (Bug#12399) + 2012-09-14 Stefan Monnier * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-13 23:42:39 +0000 +++ lisp/dired-aux.el 2012-09-14 22:58:43 +0000 @@ -281,7 +281,10 @@ "Change mode of %s to: " nil 'chmod arg files default)) num-modes) - (cond ((equal modes "") + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) ;; We used to treat empty input as DEFAULT, but that is not ;; such a good idea (Bug#9361). (error "No file mode specified")) ------------------------------------------------------------ revno: 110030 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-09-14 15:01:19 -0700 message: Fix glitches with 'configure --without-sync-input'. * configure.ac (--without-sync-input): Fix typo in usage message. * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: Include "syssignal.h", for 'main_thread'. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-14 18:56:19 +0000 +++ ChangeLog 2012-09-14 22:01:19 +0000 @@ -1,5 +1,7 @@ 2012-09-14 Paul Eggert + * configure.ac (--without-sync-input): Fix typo in usage message. + * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. === modified file 'configure.ac' --- configure.ac 2012-09-14 18:56:19 +0000 +++ configure.ac 2012-09-14 22:01:19 +0000 @@ -128,7 +128,7 @@ OPTION_DEFAULT_ON([sound],[don't compile with sound support]) -OPTION_DEFAULT_ON([sync-input],[process async input synchronously]) +OPTION_DEFAULT_ON([sync-input],[don't process async input synchronously]) if test "$with_sync_input" = yes; then AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.]) fi === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-14 14:23:50 +0000 +++ src/ChangeLog 2012-09-14 22:01:19 +0000 @@ -1,3 +1,8 @@ +2012-09-14 Paul Eggert + + * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: + Include "syssignal.h", for 'main_thread'. + 2012-09-14 Dmitry Antipov Avoid out-of-range marker position (Bug#12426). === modified file 'src/alloc.c' --- src/alloc.c 2012-09-13 05:18:26 +0000 +++ src/alloc.c 2012-09-14 22:01:19 +0000 @@ -100,6 +100,8 @@ #if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT #ifdef HAVE_PTHREAD +# include "syssignal.h" + /* When GTK uses the file chooser dialog, different backends can be loaded dynamically. One such a backend is the Gnome VFS backend that gets loaded if you run Gnome. That backend creates several threads and also allocates ------------------------------------------------------------ revno: 110029 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-09-14 11:56:19 -0700 message: * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. This is useful on hosts that don't have pkg-config. (GTK_MODULES): Do not exit 'configure' simply because gtk3 and gtk2 are both missing. Problem found on Solaris 8. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-13 12:02:00 +0000 +++ ChangeLog 2012-09-14 18:56:19 +0000 @@ -1,3 +1,12 @@ +2012-09-14 Paul Eggert + + * configure.ac: Port to hosts lacking gtk. + (PKG_CHECK_MODULES): Capture pkg-config diagnostics + better, in particular, problems in invoking pkg-config itself. + This is useful on hosts that don't have pkg-config. + (GTK_MODULES): Do not exit 'configure' simply because gtk3 + and gtk2 are both missing. Problem found on Solaris 8. + 2012-09-13 Jan Djärv * configure.ac: Reorder Xaw3d messages. === modified file 'configure.ac' --- configure.ac 2012-09-13 12:02:00 +0000 +++ configure.ac 2012-09-14 18:56:19 +0000 @@ -1189,9 +1189,10 @@ $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + $1_PKG_ERRORS=`($PKG_CONFIG --print-errors "$2") 2>&1` + ifelse([$4], ,echo "$$1_PKG_ERRORS",) fi AC_SUBST($1_CFLAGS) @@ -1934,10 +1935,10 @@ dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no"; then - if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then - AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) - fi + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) fi fi ------------------------------------------------------------ revno: 110028 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-09-14 18:23:50 +0400 message: Avoid out-of-range marker position (Bug#12426). * insdel.c (replace_range, replace_range_2): Adjust markers before overlays, as suggested by comments. (insert_1_both, insert_from_buffer_1, adjust_after_replace): Remove redundant check before calling offset_intervals. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-14 06:55:38 +0000 +++ src/ChangeLog 2012-09-14 14:23:50 +0000 @@ -1,3 +1,11 @@ +2012-09-14 Dmitry Antipov + + Avoid out-of-range marker position (Bug#12426). + * insdel.c (replace_range, replace_range_2): Adjust + markers before overlays, as suggested by comments. + (insert_1_both, insert_from_buffer_1, adjust_after_replace): + Remove redundant check before calling offset_intervals. + 2012-09-14 Martin Rudalics * xdisp.c (Fformat_mode_line): Unconditionally save/restore === modified file 'src/insdel.c' --- src/insdel.c 2012-09-11 04:22:03 +0000 +++ src/insdel.c 2012-09-14 14:23:50 +0000 @@ -840,8 +840,7 @@ PT + nchars, PT_BYTE + nbytes, before_markers); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); if (!inherit && buffer_intervals (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), @@ -1153,8 +1152,7 @@ PT_BYTE + outgoing_nbytes, 0); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ intervals = buffer_intervals (buf); @@ -1222,8 +1220,7 @@ else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, from, len - nchars_del); + offset_intervals (current_buffer, from, len - nchars_del); if (from < PT) adjust_point (len - nchars_del, len_byte - nbytes_del); @@ -1394,16 +1391,16 @@ eassert (GPT <= GPT_BYTE); - /* Adjust the overlay center as needed. This must be done after - adjusting the markers that bound the overlays. */ - adjust_overlays_for_delete (from, nchars_del); - adjust_overlays_for_insert (from, inschars); - /* Adjust markers for the deletion and the insertion. */ if (markers) adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, inschars, outgoing_insbytes); + /* Adjust the overlay center as needed. This must be done after + adjusting the markers that bound the overlays. */ + adjust_overlays_for_delete (from, nchars_del); + adjust_overlays_for_insert (from, inschars); + offset_intervals (current_buffer, from, inschars - nchars_del); /* Get the intervals for the part of the string we are inserting-- @@ -1510,6 +1507,12 @@ eassert (GPT <= GPT_BYTE); + /* Adjust markers for the deletion and the insertion. */ + if (markers + && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) + adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, + inschars, insbytes); + /* Adjust the overlay center as needed. This must be done after adjusting the markers that bound the overlays. */ if (nchars_del != inschars) @@ -1518,12 +1521,6 @@ adjust_overlays_for_delete (from + inschars, nchars_del); } - /* Adjust markers for the deletion and the insertion. */ - if (markers - && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) - adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, - inschars, insbytes); - offset_intervals (current_buffer, from, inschars - nchars_del); /* Relocate point as if it were a marker. */ ------------------------------------------------------------ revno: 110027 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2012-09-14 09:44:31 -0400 message: * lisp/emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-14 03:55:16 +0000 +++ lisp/ChangeLog 2012-09-14 13:44:31 +0000 @@ -1,5 +1,7 @@ 2012-09-14 Stefan Monnier + * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. + * emacs-lisp/edebug.el: Miscellaneous cleanup. Remove obsolete byte-compiler hack that tried to silence some warnings. (edebug-submit-bug-report): Remove. === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2012-09-14 03:55:16 +0000 +++ lisp/emacs-lisp/advice.el 2012-09-14 13:44:31 +0000 @@ -1746,6 +1746,7 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") +(require 'macroexp) (eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: @@ -2538,11 +2539,6 @@ (byte-compile symbol) (fset function (symbol-function symbol)))))) -(defun ad-prognify (forms) - (cond ((<= (length forms) 1) - (car forms)) - (t (cons 'progn forms)))) - ;; @@@ Accessing argument lists: ;; ============================= @@ -2954,7 +2950,7 @@ before-forms) (setq before-forms `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq before-forms @@ -2971,12 +2967,12 @@ (ad-substitute-tree (function (lambda (form) (eq form 'ad-do-it))) (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (macroexp-progn (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,around-form)) (append before-forms (list around-form)))) (dolist (advice afters) @@ -2984,7 +2980,7 @@ after-forms) (setq after-forms `((unwind-protect - ,(ad-prognify after-forms) + ,(macroexp-progn after-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq after-forms @@ -3013,7 +3009,7 @@ (ad-body-forms (ad-advice-definition advice)))) (ad-get-enabled-advices function hook-name)))) (if hook-forms - (ad-prognify (apply 'append hook-forms))))) + (macroexp-progn (apply 'append hook-forms))))) ;; @@ Caching: ------------------------------------------------------------ revno: 110026 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-09-14 06:17:31 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-09-13 10:17:31 +0000 +++ autogen/configure 2012-09-14 10:17:31 +0000 @@ -24254,11 +24254,7 @@ #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - if test "${with_gtk3}" = "yes"; then - USE_X_TOOLKIT=GTK3 - else - USE_X_TOOLKIT=GTK - fi + USE_X_TOOLKIT=GTK fi echo " ------------------------------------------------------------ revno: 110025 committer: martin rudalics branch nick: trunk timestamp: Fri 2012-09-14 08:55:38 +0200 message: In Fformat_mode_line always save/restore current buffer. (Bug#12387) * xdisp.c (Fformat_mode_line): Unconditionally save/restore current buffer. (Bug#12387) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-14 01:22:21 +0000 +++ src/ChangeLog 2012-09-14 06:55:38 +0000 @@ -1,3 +1,8 @@ +2012-09-14 Martin Rudalics + + * xdisp.c (Fformat_mode_line): Unconditionally save/restore + current buffer (Bug#12387). + 2012-09-14 Juanma Barranquero * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-12 00:14:50 +0000 +++ src/xdisp.c 2012-09-14 06:55:38 +0000 @@ -21039,8 +21039,7 @@ : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID : DEFAULT_FACE_ID; - if (XBUFFER (buffer) != current_buffer) - old_buffer = current_buffer; + old_buffer = current_buffer; /* Save things including mode_line_proptrans_alist, and set that to nil so that we don't alter the outer value. */ @@ -21051,8 +21050,7 @@ mode_line_proptrans_alist = Qnil; Fselect_window (window, Qt); - if (old_buffer) - set_buffer_internal_1 (XBUFFER (buffer)); + set_buffer_internal_1 (XBUFFER (buffer)); init_iterator (&it, w, -1, -1, NULL, face_id);