emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [21.1.90]: point put at point-min in *compilation*


From: Juri Linkov
Subject: Re: [21.1.90]: point put at point-min in *compilation*
Date: Thu, 07 Feb 2008 21:57:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> Feel free to extend this feature.  It probably makes sense to make it
> either not jump to the source (only jump to the error message itself)

The patch below adds a third option to compilation-scroll-output,
as Richard suggested, by reusing a part of the functionality of
compilation-auto-jump-to-first-error.

> or to use pop-to-buffer (so that people who set pop-up-frames do not
> get bothered either).

Maybe, the default value of compilation-auto-jump-to-first-error
should depend on pop-up-frames?

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.451
diff -c -r1.451 compile.el
*** lisp/progmodes/compile.el   14 Jan 2008 15:41:33 -0000      1.451
--- lisp/progmodes/compile.el   7 Feb 2008 19:57:04 -0000
***************
*** 762,768 ****
  (defun compilation-auto-jump (buffer pos)
    (with-current-buffer buffer
      (goto-char pos)
!     (compile-goto-error)))
  
  ;; This function is the central driver, called when font-locking to gather
  ;; all information needed to later jump to corresponding source code.
--- 762,769 ----
  (defun compilation-auto-jump (buffer pos)
    (with-current-buffer buffer
      (goto-char pos)
!     (if compilation-auto-jump-to-first-error
!       (compile-goto-error))))
  
  ;; This function is the central driver, called when font-locking to gather
  ;; all information needed to later jump to corresponding source code.
***************
*** 1054,1061 ****
  
  Setting it causes the Compilation mode commands to put point at the
  end of their output window so that the end of the output is always
! visible rather than the beginning."
!   :type 'boolean
    :version "20.3"
    :group 'compilation)
  
--- 1055,1067 ----
  
  Setting it causes the Compilation mode commands to put point at the
  end of their output window so that the end of the output is always
! visible rather than the beginning.
! 
! The value `first-error' stops scrolling on encountering the first error,
! and moves point to its location in the *compilation* buffer."
!   :type '(choice (const :tag "No scrolling" nil)
!                (const :tag "Scroll compilation output" t)
!                (const :tag "Stop scrolling on the first error" first-error))
    :version "20.3"
    :group 'compilation)
  
***************
*** 1168,1174 ****
        (if highlight-regexp
            (set (make-local-variable 'compilation-highlight-regexp)
                 highlight-regexp))
!         (if compilation-auto-jump-to-first-error
              (set (make-local-variable 'compilation-auto-jump-to-next) t))
        ;; Output a mode setter, for saving and later reloading this buffer.
        (insert "-*- mode: " name-of-mode
--- 1174,1181 ----
        (if highlight-regexp
            (set (make-local-variable 'compilation-highlight-regexp)
                 highlight-regexp))
!         (if (or compilation-auto-jump-to-first-error
!               (eq compilation-scroll-output 'first-error))
              (set (make-local-variable 'compilation-auto-jump-to-next) t))
        ;; Output a mode setter, for saving and later reloading this buffer.
        (insert "-*- mode: " name-of-mode
***************
*** 2159,2165 ****
    ;; compilations, to set the beginning of "this compilation", it's a good
    ;; place to reset compilation-auto-jump-to-next.
    (set (make-local-variable 'compilation-auto-jump-to-next)
!        compilation-auto-jump-to-first-error))
  
  ;;;###autoload
  (add-to-list 'auto-mode-alist '("\\.gcov\\'" . compilation-mode))
--- 2166,2173 ----
    ;; compilations, to set the beginning of "this compilation", it's a good
    ;; place to reset compilation-auto-jump-to-next.
    (set (make-local-variable 'compilation-auto-jump-to-next)
!        (or compilation-auto-jump-to-first-error
!          (eq compilation-scroll-output 'first-error))))
  
  ;;;###autoload
  (add-to-list 'auto-mode-alist '("\\.gcov\\'" . compilation-mode))

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]