# HG changeset patch # User Stefan Monnier # Date 1152630513 0 # Node ID aa53161fdb21da44090c281aa3be4052d5284e68 # Parent c4527316e6167e7bb8367bf8b2ca39db47147a4a (compilation-error-regexp-alist-alist): Fix ambiguity introduced by last change. (compilation-find-file): Move save-excursion to where it may make sense. Fix a left over `find-file'. diff -r c4527316e616 -r aa53161fdb21 lisp/ChangeLog --- a/lisp/ChangeLog Tue Jul 11 15:03:24 2006 +0000 +++ b/lisp/ChangeLog Tue Jul 11 15:08:33 2006 +0000 @@ -1,9 +1,16 @@ +2006-07-11 Stefan Monnier + + * progmodes/compile.el (compilation-error-regexp-alist-alist): + Fix ambiguity introduced by last change. + (compilation-find-file): Move save-excursion to where it may + make sense. Fix a left over `find-file'. + 2006-07-11 Robert J. Chassell * textmodes/texinfmt.el: (texinfo-format-separate-node): - Insert a string before point, which fits documentation, not after. - (texinfo-multitable-item): In a multitable row, insert any - additional needed @tabs and spaces. + Insert a string before point, which fits documentation, not after. + (texinfo-multitable-item): In a multitable row, insert any + additional needed @tabs and spaces. 2006-07-11 Nick Roberts @@ -19,7 +26,7 @@ (tumme-display-properties-format) (tumme-dired-insert-marked-thumbs, tumme-rotate-original) (tumme-get-exif-file-name) - (tumme-thumbnail-set-image-description, tumme-gallery-generate): + (tumme-thumbnail-set-image-description, tumme-gallery-generate): Fit to 80 columns. 2006-07-11 Kim F. Storm diff -r c4527316e616 -r aa53161fdb21 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Tue Jul 11 15:03:24 2006 +0000 +++ b/lisp/progmodes/compile.el Tue Jul 11 15:08:33 2006 +0000 @@ -223,8 +223,13 @@ \\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4)) (gnu + ;; I have no idea what this first line is supposed to match, but it + ;; makes things ambiguous with output such as "foo:344:50:blabla" since + ;; the "foo" part can match this first line (in which case the file + ;; name as "344"). To avoid this, we disallow filenames exclusively + ;; composed of digits. --Stef "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ -\\(.+?\\): ?\ +\\([0-9]*[^0-9\n].*?\\): ?\ \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\ \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\ \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ @@ -293,7 +298,7 @@ \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)) (gcov-file - "^ *-: *\\(0\\):Source:\\(.+\\)$" + "^ *-: *\\(0\\):Source:\\(.+\\)$" 2 1 nil 0 nil (1 compilation-line-face prepend) (2 compilation-info-face prepend)) (gcov-header @@ -312,11 +317,11 @@ (1 compilation-line-face prepend)) (gcov-called-line "^ *\\([0-9]+\\): *\\([0-9]+\\):.*$" - nil 2 nil 0 nil + nil 2 nil 0 nil (0 'default t) (1 compilation-info-face prepend) (2 compilation-line-face prepend)) (gcov-never-called - "^ *\\(#####\\): *\\([0-9]+\\):.*$" + "^ *\\(#####\\): *\\([0-9]+\\):.*$" nil 2 nil 2 nil (0 'default t) (1 compilation-error-face prepend) (2 compilation-line-face prepend)) @@ -1796,49 +1801,51 @@ If FILENAME is not found at all, ask the user where to find it. Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." (or formats (setq formats '("%s"))) - (save-excursion - (let ((dirs compilation-search-path) - (spec-dir (if directory - (expand-file-name directory) - default-directory)) - buffer thisdir fmts name) - (if (file-name-absolute-p filename) - ;; The file name is absolute. Use its explicit directory as - ;; the first in the search path, and strip it from FILENAME. - (setq filename (abbreviate-file-name (expand-file-name filename)) - dirs (cons (file-name-directory filename) dirs) - filename (file-name-nondirectory filename))) - ;; Now search the path. - (while (and dirs (null buffer)) - (setq thisdir (or (car dirs) spec-dir) - fmts formats) - ;; For each directory, try each format string. - (while (and fmts (null buffer)) - (setq name (expand-file-name (format (car fmts) filename) thisdir) - buffer (and (file-exists-p name) - (find-file-noselect name)) - fmts (cdr fmts))) - (setq dirs (cdr dirs))) - (or buffer - ;; The file doesn't exist. Ask the user where to find it. - (let ((pop-up-windows t)) - (compilation-set-window (display-buffer (marker-buffer marker)) - marker) - (let ((name (expand-file-name - (read-file-name - (format "Find this %s in (default %s): " - compilation-error filename) - spec-dir filename t)))) - (if (file-directory-p name) - (setq name (expand-file-name filename name))) - (setq buffer (and (file-exists-p name) - (find-file name)))))) - ;; Make intangible overlays tangible. - (mapcar (function (lambda (ov) - (when (overlay-get ov 'intangible) - (overlay-put ov 'intangible nil)))) - (overlays-in (point-min) (point-max))) - buffer))) + (let ((dirs compilation-search-path) + (spec-dir (if directory + (expand-file-name directory) + default-directory)) + buffer thisdir fmts name) + (if (file-name-absolute-p filename) + ;; The file name is absolute. Use its explicit directory as + ;; the first in the search path, and strip it from FILENAME. + (setq filename (abbreviate-file-name (expand-file-name filename)) + dirs (cons (file-name-directory filename) dirs) + filename (file-name-nondirectory filename))) + ;; Now search the path. + (while (and dirs (null buffer)) + (setq thisdir (or (car dirs) spec-dir) + fmts formats) + ;; For each directory, try each format string. + (while (and fmts (null buffer)) + (setq name (expand-file-name (format (car fmts) filename) thisdir) + buffer (and (file-exists-p name) + (find-file-noselect name)) + fmts (cdr fmts))) + (setq dirs (cdr dirs))) + (or buffer + ;; The file doesn't exist. Ask the user where to find it. + (save-excursion ;This save-excursion is probably not right. + (let ((pop-up-windows t)) + (compilation-set-window (display-buffer (marker-buffer marker)) + marker) + (let ((name (expand-file-name + (read-file-name + (format "Find this %s in (default %s): " + compilation-error filename) + spec-dir filename t)))) + (if (file-directory-p name) + (setq name (expand-file-name filename name))) + (setq buffer (and (file-exists-p name) + (find-file-noselect name))))))) + ;; Make intangible overlays tangible. + ;; This is very weird: it's not even clear which is the current buffer, + ;; so the code below can't be expected to DTRT here. --Stef + (mapcar (function (lambda (ov) + (when (overlay-get ov 'intangible) + (overlay-put ov 'intangible nil)))) + (overlays-in (point-min) (point-max))) + buffer)) (defun compilation-get-file-structure (file &optional fmt) "Retrieve FILE's file-structure or create a new one.