aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab1998-05-04 08:35:40 +0000
committerAndreas Schwab1998-05-04 08:35:40 +0000
commitaa53db6a6e919636e0dde96ea0b4a1081f31bd41 (patch)
tree5d40915ab2b69e7492d7c64dfaacb1be0ca434ba
parent5e0082a529d74e5f8d677146788fba08b7a115b0 (diff)
downloademacs-aa53db6a6e919636e0dde96ea0b4a1081f31bd41.tar.gz
emacs-aa53db6a6e919636e0dde96ea0b4a1081f31bd41.zip
* progmodes/compile.el (compilation-directory-stack): Doc fix.
(compilation-mode): Accept optional parameter and initialize mode-name from it. (compile-internal): Pass name-of-mode to compilation-mode. Don't set mode-name here. (compilation-minor-mode): Don't let mode-line-process change. (compilation-next-error-locus): Use forward-char instead of move-to-column. (compilation-parse-errors): Set default-directory from head of compilation-directory-stack.
-rw-r--r--lisp/progmodes/compile.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index fa20a9742a3..9114266570e 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -450,7 +450,7 @@ You might also use mode hooks to specify it in certain modes, like this:
450 450
451(defvar compilation-directory-stack nil 451(defvar compilation-directory-stack nil
452 "Stack of previous directories for `compilation-leave-directory-regexp'. 452 "Stack of previous directories for `compilation-leave-directory-regexp'.
453The head element is the directory the compilation was started in.") 453The last element is the directory the compilation was started in.")
454 454
455(defvar compilation-exit-message-function nil "\ 455(defvar compilation-exit-message-function nil "\
456If non-nil, called when a compilation process dies to return a status message. 456If non-nil, called when a compilation process dies to return a status message.
@@ -678,7 +678,7 @@ Returns the compilation buffer created."
678 (setq outwin (display-buffer outbuf)) 678 (setq outwin (display-buffer outbuf))
679 (save-excursion 679 (save-excursion
680 (set-buffer outbuf) 680 (set-buffer outbuf)
681 (compilation-mode) 681 (compilation-mode name-of-mode)
682 ;; (setq buffer-read-only t) ;;; Non-ergonomic. 682 ;; (setq buffer-read-only t) ;;; Non-ergonomic.
683 (set (make-local-variable 'compilation-parse-errors-function) parser) 683 (set (make-local-variable 'compilation-parse-errors-function) parser)
684 (set (make-local-variable 'compilation-error-message) error-message) 684 (set (make-local-variable 'compilation-error-message) error-message)
@@ -705,7 +705,6 @@ Returns the compilation buffer created."
705 (setq default-directory thisdir 705 (setq default-directory thisdir
706 compilation-directory-stack (list default-directory)) 706 compilation-directory-stack (list default-directory))
707 (set-window-start outwin (point-min)) 707 (set-window-start outwin (point-min))
708 (setq mode-name name-of-mode)
709 (or (eq outwin (selected-window)) 708 (or (eq outwin (selected-window))
710 (set-window-point outwin (point-min))) 709 (set-window-point outwin (point-min)))
711 (compilation-set-window-height outwin) 710 (compilation-set-window-height outwin)
@@ -839,7 +838,7 @@ exited abnormally with code %d\n"
839(put 'compilation-mode 'mode-class 'special) 838(put 'compilation-mode 'mode-class 'special)
840 839
841;;;###autoload 840;;;###autoload
842(defun compilation-mode () 841(defun compilation-mode (&optional name-of-mode)
843 "Major mode for compilation log buffers. 842 "Major mode for compilation log buffers.
844\\<compilation-mode-map>To visit the source for a line-numbered error, 843\\<compilation-mode-map>To visit the source for a line-numbered error,
845move point to the error message line and type \\[compile-goto-error]. 844move point to the error message line and type \\[compile-goto-error].
@@ -850,7 +849,7 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
850 (kill-all-local-variables) 849 (kill-all-local-variables)
851 (use-local-map compilation-mode-map) 850 (use-local-map compilation-mode-map)
852 (setq major-mode 'compilation-mode 851 (setq major-mode 'compilation-mode
853 mode-name "Compilation") 852 mode-name (or name-of-mode "Compilation"))
854 (compilation-setup) 853 (compilation-setup)
855 (set (make-local-variable 'font-lock-defaults) 854 (set (make-local-variable 'font-lock-defaults)
856 '(compilation-mode-font-lock-keywords t)) 855 '(compilation-mode-font-lock-keywords t))
@@ -912,7 +911,7 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
912 (if (setq compilation-minor-mode (if (null arg) 911 (if (setq compilation-minor-mode (if (null arg)
913 (null compilation-minor-mode) 912 (null compilation-minor-mode)
914 (> (prefix-numeric-value arg) 0))) 913 (> (prefix-numeric-value arg) 0)))
915 (progn 914 (let ((mode-line-process))
916 (compilation-setup) 915 (compilation-setup)
917 (run-hooks 'compilation-minor-mode-hook)))) 916 (run-hooks 'compilation-minor-mode-hook))))
918 917
@@ -1441,7 +1440,7 @@ The current buffer should be the desired compilation output buffer."
1441 (goto-line last-line) 1440 (goto-line last-line)
1442 (if (and column (> column 0)) 1441 (if (and column (> column 0))
1443 ;; Columns in error msgs are 1-origin. 1442 ;; Columns in error msgs are 1-origin.
1444 (move-to-column (1- column)) 1443 (forward-char (1- column))
1445 (beginning-of-line)) 1444 (beginning-of-line))
1446 (setcdr next-error (point-marker)) 1445 (setcdr next-error (point-marker))
1447 ;; Make all the other error messages referring 1446 ;; Make all the other error messages referring
@@ -1465,7 +1464,7 @@ The current buffer should be the desired compilation output buffer."
1465 lines)) 1464 lines))
1466 (forward-line lines)) 1465 (forward-line lines))
1467 (if (and column (> column 1)) 1466 (if (and column (> column 1))
1468 (move-to-column (1- column)) 1467 (forward-char (1- column))
1469 (beginning-of-line)) 1468 (beginning-of-line))
1470 (setq last-line this) 1469 (setq last-line this)
1471 (setcdr (car errors) (point-marker)))) 1470 (setcdr (car errors) (point-marker))))
@@ -1624,7 +1623,7 @@ See variable `compilation-parse-errors-function' for the interface it uses."
1624 (if (null compilation-error-regexp-alist) 1623 (if (null compilation-error-regexp-alist)
1625 (error "compilation-error-regexp-alist is empty!")) 1624 (error "compilation-error-regexp-alist is empty!"))
1626 (let* ((compilation-regexps nil) ; Variable set by compile-collect-regexps. 1625 (let* ((compilation-regexps nil) ; Variable set by compile-collect-regexps.
1627 (default-directory default-directory) 1626 (default-directory (car compilation-directory-stack))
1628 (found-desired nil) 1627 (found-desired nil)
1629 (compilation-num-errors-found 0) 1628 (compilation-num-errors-found 0)
1630 ;; Set up now the expanded, abbreviated directory variables 1629 ;; Set up now the expanded, abbreviated directory variables