# HG changeset patch # User Andreas Schwab # Date 894270940 0 # Node ID b84bfe98263d921d14a8b82891f9d31ea10f2353 # Parent 5be79e4f188a6c6f81d25c6400b83978f9f9796a * 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. diff -r 5be79e4f188a -r b84bfe98263d lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Mon May 04 01:50:46 1998 +0000 +++ b/lisp/progmodes/compile.el Mon May 04 08:35:40 1998 +0000 @@ -450,7 +450,7 @@ (defvar compilation-directory-stack nil "Stack of previous directories for `compilation-leave-directory-regexp'. -The head element is the directory the compilation was started in.") +The last element is the directory the compilation was started in.") (defvar compilation-exit-message-function nil "\ If non-nil, called when a compilation process dies to return a status message. @@ -678,7 +678,7 @@ (setq outwin (display-buffer outbuf)) (save-excursion (set-buffer outbuf) - (compilation-mode) + (compilation-mode name-of-mode) ;; (setq buffer-read-only t) ;;; Non-ergonomic. (set (make-local-variable 'compilation-parse-errors-function) parser) (set (make-local-variable 'compilation-error-message) error-message) @@ -705,7 +705,6 @@ (setq default-directory thisdir compilation-directory-stack (list default-directory)) (set-window-start outwin (point-min)) - (setq mode-name name-of-mode) (or (eq outwin (selected-window)) (set-window-point outwin (point-min))) (compilation-set-window-height outwin) @@ -839,7 +838,7 @@ (put 'compilation-mode 'mode-class 'special) ;;;###autoload -(defun compilation-mode () +(defun compilation-mode (&optional name-of-mode) "Major mode for compilation log buffers. \\To visit the source for a line-numbered error, move point to the error message line and type \\[compile-goto-error]. @@ -850,7 +849,7 @@ (kill-all-local-variables) (use-local-map compilation-mode-map) (setq major-mode 'compilation-mode - mode-name "Compilation") + mode-name (or name-of-mode "Compilation")) (compilation-setup) (set (make-local-variable 'font-lock-defaults) '(compilation-mode-font-lock-keywords t)) @@ -912,7 +911,7 @@ (if (setq compilation-minor-mode (if (null arg) (null compilation-minor-mode) (> (prefix-numeric-value arg) 0))) - (progn + (let ((mode-line-process)) (compilation-setup) (run-hooks 'compilation-minor-mode-hook)))) @@ -1441,7 +1440,7 @@ (goto-line last-line) (if (and column (> column 0)) ;; Columns in error msgs are 1-origin. - (move-to-column (1- column)) + (forward-char (1- column)) (beginning-of-line)) (setcdr next-error (point-marker)) ;; Make all the other error messages referring @@ -1465,7 +1464,7 @@ lines)) (forward-line lines)) (if (and column (> column 1)) - (move-to-column (1- column)) + (forward-char (1- column)) (beginning-of-line)) (setq last-line this) (setcdr (car errors) (point-marker)))) @@ -1624,7 +1623,7 @@ (if (null compilation-error-regexp-alist) (error "compilation-error-regexp-alist is empty!")) (let* ((compilation-regexps nil) ; Variable set by compile-collect-regexps. - (default-directory default-directory) + (default-directory (car compilation-directory-stack)) (found-desired nil) (compilation-num-errors-found 0) ;; Set up now the expanded, abbreviated directory variables