comparison lisp/progmodes/compile.el @ 56877:e2576d47dd53

(compilation-buffer-name): Compare major mode with second element of compilation-arguments instead of third to reflect latest changes in compilation-arguments structure. (recompile): Use global variable `compilation-directory' to get recent compilation directory only when `recompile' is invoked NOT in the compilation buffer. Otherwise, use `default-directory' of the compilation buffer.
author Juri Linkov <juri@jurta.org>
date Thu, 02 Sep 2004 09:45:31 +0000
parents c77183f170cf
children 6bb35c70240a
comparison
equal deleted inserted replaced
56876:3dcc647295da 56877:e2576d47dd53
456 "Face used to highlight compiler warnings." 456 "Face used to highlight compiler warnings."
457 :group 'font-lock-highlighting-faces 457 :group 'font-lock-highlighting-faces
458 :version "21.4") 458 :version "21.4")
459 459
460 (defface compilation-info-face 460 (defface compilation-info-face
461 '((((class color) (min-colors 16) (background light)) 461 '((((class color) (min-colors 16) (background light))
462 (:foreground "Green3" :weight bold)) 462 (:foreground "Green3" :weight bold))
463 (((class color) (min-colors 16) (background dark)) 463 (((class color) (min-colors 16) (background dark))
464 (:foreground "Green" :weight bold)) 464 (:foreground "Green" :weight bold))
465 (((class color)) (:foreground "green" :weight bold)) 465 (((class color)) (:foreground "green" :weight bold))
466 (t (:weight bold))) 466 (t (:weight bold)))
467 "Face used to highlight compiler warnings." 467 "Face used to highlight compiler warnings."
468 :group 'font-lock-highlighting-faces 468 :group 'font-lock-highlighting-faces
787 "Re-compile the program including the current buffer. 787 "Re-compile the program including the current buffer.
788 If this is run in a Compilation mode buffer, re-use the arguments from the 788 If this is run in a Compilation mode buffer, re-use the arguments from the
789 original use. Otherwise, recompile using `compile-command'." 789 original use. Otherwise, recompile using `compile-command'."
790 (interactive) 790 (interactive)
791 (save-some-buffers (not compilation-ask-about-save) nil) 791 (save-some-buffers (not compilation-ask-about-save) nil)
792 (let ((default-directory (or compilation-directory default-directory))) 792 (let ((default-directory
793 (or (and (not (eq major-mode (nth 1 compilation-arguments)))
794 compilation-directory)
795 default-directory)))
793 (apply 'compilation-start (or compilation-arguments 796 (apply 'compilation-start (or compilation-arguments
794 `(,(eval compile-command)))))) 797 `(,(eval compile-command))))))
795 798
796 (defcustom compilation-scroll-output nil 799 (defcustom compilation-scroll-output nil
797 "*Non-nil to scroll the *compilation* buffer window as output appears. 800 "*Non-nil to scroll the *compilation* buffer window as output appears.
814 Otherwise, construct a buffer name from MODE-NAME." 817 Otherwise, construct a buffer name from MODE-NAME."
815 (cond (name-function 818 (cond (name-function
816 (funcall name-function mode-name)) 819 (funcall name-function mode-name))
817 (compilation-buffer-name-function 820 (compilation-buffer-name-function
818 (funcall compilation-buffer-name-function mode-name)) 821 (funcall compilation-buffer-name-function mode-name))
819 ((and (eq major-mode 'compilation-mode) 822 ((eq major-mode (nth 1 compilation-arguments))
820 (equal mode-name (nth 2 compilation-arguments)))
821 (buffer-name)) 823 (buffer-name))
822 (t 824 (t
823 (concat "*" (downcase mode-name) "*")))) 825 (concat "*" (downcase mode-name) "*"))))
824 826
825 ;; This is a rough emulation of the old hack, until the transition to new 827 ;; This is a rough emulation of the old hack, until the transition to new
1520 (point)))) 1522 (point))))
1521 (set-window-point w mk)) 1523 (set-window-point w mk))
1522 1524
1523 (defun compilation-goto-locus (msg mk end-mk) 1525 (defun compilation-goto-locus (msg mk end-mk)
1524 "Jump to an error corresponding to MSG at MK. 1526 "Jump to an error corresponding to MSG at MK.
1525 All arguments are markers. If END-MK is non nil, mark is set there." 1527 All arguments are markers. If END-MK is non-nil, mark is set there."
1526 (if (eq (window-buffer (selected-window)) 1528 (if (eq (window-buffer (selected-window))
1527 (marker-buffer msg)) 1529 (marker-buffer msg))
1528 ;; If the compilation buffer window is selected, 1530 ;; If the compilation buffer window is selected,
1529 ;; keep the compilation buffer in this window; 1531 ;; keep the compilation buffer in this window;
1530 ;; display the source in another window. 1532 ;; display the source in another window.