aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen1999-12-26 12:59:52 +0000
committerThien-Thi Nguyen1999-12-26 12:59:52 +0000
commit721cfafec9a871e63f81910be516d5f8fa5d6468 (patch)
tree23df0e15a56edd6282c922f6cecf3c596ab85d56
parent26a0b3991e4bf4749b4486b264bfc05627606689 (diff)
downloademacs-721cfafec9a871e63f81910be516d5f8fa5d6468.tar.gz
emacs-721cfafec9a871e63f81910be516d5f8fa5d6468.zip
(compilation-goto-locus): Delete hideshow overlays if they interfere.
(compilation-find-file): Make intangible overlays tangible.
-rw-r--r--lisp/progmodes/compile.el83
1 files changed, 49 insertions, 34 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index dca54808e18..b3321baba99 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1627,6 +1627,13 @@ Selects a window with point at SOURCE, with another window displaying ERROR."
1627 (progn 1627 (progn
1628 (widen) 1628 (widen)
1629 (goto-char (cdr next-error)))) 1629 (goto-char (cdr next-error))))
1630 ;; If hideshow got in the way of
1631 ;; seeing the right place, open permanently.
1632 (mapcar (function (lambda (ov)
1633 (when (eq 'hs (overlay-get ov 'invisible))
1634 (delete-overlay ov)
1635 (goto-char (cdr next-error)))))
1636 (overlays-at (point)))
1630 1637
1631 ;; Show compilation buffer in other window, scrolled to this error. 1638 ;; Show compilation buffer in other window, scrolled to this error.
1632 (let* ((pop-up-windows t) 1639 (let* ((pop-up-windows t)
@@ -1646,49 +1653,57 @@ current directory, which is passed in DIR.
1646If FILENAME is not found at all, ask the user where to find it. 1653If FILENAME is not found at all, ask the user where to find it.
1647Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." 1654Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1648 (or formats (setq formats '("%s"))) 1655 (or formats (setq formats '("%s")))
1649 (let ((dirs compilation-search-path) 1656 (save-excursion
1650 buffer thisdir fmts name) 1657 (let ((dirs compilation-search-path)
1651 (if (file-name-absolute-p filename) 1658 buffer thisdir fmts name)
1659 (if (file-name-absolute-p filename)
1652 ;; The file name is absolute. Use its explicit directory as 1660 ;; The file name is absolute. Use its explicit directory as
1653 ;; the first in the search path, and strip it from FILENAME. 1661 ;; the first in the search path, and strip it from FILENAME.
1654 (setq filename (abbreviate-file-name (expand-file-name filename)) 1662 (setq filename (abbreviate-file-name (expand-file-name filename))
1655 dirs (cons (file-name-directory filename) dirs) 1663 dirs (cons (file-name-directory filename) dirs)
1656 filename (file-name-nondirectory filename))) 1664 filename (file-name-nondirectory filename)))
1657 ;; Now search the path. 1665 ;; Now search the path.
1658 (while (and dirs (null buffer)) 1666 (while (and dirs (null buffer))
1659 (setq thisdir (or (car dirs) dir) 1667 (setq thisdir (or (car dirs) dir)
1660 fmts formats) 1668 fmts formats)
1661 ;; For each directory, try each format string. 1669 ;; For each directory, try each format string.
1662 (while (and fmts (null buffer)) 1670 (while (and fmts (null buffer))
1663 (setq name (expand-file-name (format (car fmts) filename) thisdir) 1671 (setq name (expand-file-name (format (car fmts) filename) thisdir)
1664 buffer (and (file-exists-p name) 1672 buffer (and (file-exists-p name)
1665 (find-file-noselect name)) 1673 (find-file name))
1666 fmts (cdr fmts))) 1674 fmts (cdr fmts)))
1667 (setq dirs (cdr dirs))) 1675 (setq dirs (cdr dirs)))
1668 (or buffer 1676 (or buffer
1669 ;; The file doesn't exist. 1677 ;; The file doesn't exist.
1670 ;; Ask the user where to find it. 1678 ;; Ask the user where to find it.
1671 ;; If he hits C-g, then the next time he does 1679 ;; If he hits C-g, then the next time he does
1672 ;; next-error, he'll skip past it. 1680 ;; next-error, he'll skip past it.
1673 (let* ((pop-up-windows t) 1681 (let* ((pop-up-windows t)
1674 (w (display-buffer (marker-buffer marker)))) 1682 (w (display-buffer (marker-buffer marker))))
1675 (set-window-point w marker) 1683 (set-window-point w marker)
1676 (set-window-start w marker) 1684 (set-window-start w marker)
1677 (let ((name (expand-file-name 1685 (let ((name (expand-file-name
1678 (read-file-name 1686 (read-file-name
1679 (format "Find this error in: (default %s) " 1687 (format "Find this error in: (default %s) "
1680 filename) 1688 filename)
1681 dir filename t)))) 1689 dir filename t))))
1682 (if (file-directory-p name) 1690 (if (file-directory-p name)
1683 (setq name (expand-file-name filename name))) 1691 (setq name (expand-file-name filename name)))
1684 (and (file-exists-p name) 1692 (setq buffer (and (file-exists-p name)
1685 (find-file-noselect name))))))) 1693 (find-file name))))))
1694 ;; Make intangible overlays tangible.
1695 (mapcar (function (lambda (ov)
1696 (when (overlay-get ov 'intangible)
1697 (overlay-put ov 'intangible nil))))
1698 (overlays-in (point-min) (point-max)))
1699 buffer)))
1700
1686 1701
1687;; Set compilation-error-list to nil, and unchain the markers that point to the 1702;; Set compilation-error-list to nil, and unchain the markers that point to the
1688;; error messages and their text, so that they no longer slow down gap motion. 1703;; error messages and their text, so that they no longer slow down gap motion.
1689;; This would happen anyway at the next garbage collection, but it is better to 1704;; This would happen anyway at the next garbage collection, but it is better to
1690;; do it right away. 1705;; do it right away.
1691(defun compilation-forget-errors () 1706 (defun compilation-forget-errors ()
1692 (while compilation-old-error-list 1707 (while compilation-old-error-list
1693 (let ((next-error (car compilation-old-error-list))) 1708 (let ((next-error (car compilation-old-error-list)))
1694 (set-marker (car next-error) nil) 1709 (set-marker (car next-error) nil)
@@ -1860,7 +1875,7 @@ An error message with no file name and no file name has been seen earlier"))
1860 ;; descriptor or nil (meaning no position). 1875 ;; descriptor or nil (meaning no position).
1861 (save-excursion 1876 (save-excursion
1862 (funcall linenum filename column)))) 1877 (funcall linenum filename column))))
1863 1878
1864 ;; We have an error position descriptor. 1879 ;; We have an error position descriptor.
1865 ;; If we have found as many new errors as the user 1880 ;; If we have found as many new errors as the user
1866 ;; wants, or if we are past the buffer position he 1881 ;; wants, or if we are past the buffer position he