changeset 26990:5d153e0fe112

(compilation-goto-locus): Delete hideshow overlays if they interfere. (compilation-find-file): Make intangible overlays tangible.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Sun, 26 Dec 1999 12:59:52 +0000
parents 340ed24f202a
children 4d568be7307b
files lisp/progmodes/compile.el
diffstat 1 files changed, 49 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Sun Dec 26 11:03:32 1999 +0000
+++ b/lisp/progmodes/compile.el	Sun Dec 26 12:59:52 1999 +0000
@@ -1627,6 +1627,13 @@
       (progn
 	(widen)
 	(goto-char (cdr next-error))))
+  ;; If hideshow got in the way of
+  ;; seeing the right place, open permanently.
+  (mapcar (function (lambda (ov)
+		      (when (eq 'hs (overlay-get ov 'invisible))
+			(delete-overlay ov)
+			(goto-char (cdr next-error)))))
+	  (overlays-at (point)))
 
   ;; Show compilation buffer in other window, scrolled to this error.
   (let* ((pop-up-windows t)
@@ -1646,49 +1653,57 @@
 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")))
-  (let ((dirs compilation-search-path)
-	buffer thisdir fmts name)
-    (if (file-name-absolute-p filename)
+  (save-excursion
+    (let ((dirs compilation-search-path)
+	  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) 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.
-	;; If he hits C-g, then the next time he does
-	;; next-error, he'll skip past it.
-	(let* ((pop-up-windows t)
-	       (w (display-buffer (marker-buffer marker))))
-	  (set-window-point w marker)
-	  (set-window-start w marker)
-	  (let ((name (expand-file-name
-		       (read-file-name
-			(format "Find this error in: (default %s) "
-				filename)
-			dir filename t))))
-	    (if (file-directory-p name)
-		(setq name (expand-file-name filename name)))
-	    (and (file-exists-p name)
-		 (find-file-noselect name)))))))
+      ;; Now search the path.
+      (while (and dirs (null buffer))
+	(setq thisdir (or (car dirs) 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 name))
+		fmts (cdr fmts)))
+	(setq dirs (cdr dirs)))
+      (or buffer
+	  ;; The file doesn't exist.
+	  ;; Ask the user where to find it.
+	  ;; If he hits C-g, then the next time he does
+	  ;; next-error, he'll skip past it.
+	  (let* ((pop-up-windows t)
+		 (w (display-buffer (marker-buffer marker))))
+	    (set-window-point w marker)
+	    (set-window-start w marker)
+	    (let ((name (expand-file-name
+			 (read-file-name
+			  (format "Find this error in: (default %s) "
+				  filename)
+			  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)))
+
 
 ;; Set compilation-error-list to nil, and unchain the markers that point to the
 ;; error messages and their text, so that they no longer slow down gap motion.
 ;; This would happen anyway at the next garbage collection, but it is better to
 ;; do it right away.
-(defun compilation-forget-errors ()
+  (defun compilation-forget-errors ()
   (while compilation-old-error-list
     (let ((next-error (car compilation-old-error-list)))
       (set-marker (car next-error) nil)
@@ -1860,7 +1875,7 @@
 			    ;; descriptor or nil (meaning no position).
 			    (save-excursion
 			      (funcall linenum filename column))))
-			
+
 		    ;; We have an error position descriptor.
 		    ;; If we have found as many new errors as the user
 		    ;; wants, or if we are past the buffer position he