help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How modify behavior when you click on a compile error?


From: Rob Giardina
Subject: Re: How modify behavior when you click on a compile error?
Date: Tue, 16 Dec 2008 13:13:53 -0800 (PST)
User-agent: G2/1.0

On Dec 13, 7:18 pm, "seber...@spawar.navy.mil"
<seber...@spawar.navy.mil> wrote:
> When I compile/run a Python program with errors, I can click on an
> error to move to a buffer with corresponding offending source code line
> (s).
>
> How modify what happens when you click on these "error links"??
>
> Specifically, I want the "error link" to *not* split the window but
> rather display source code buffer in the current window.
>
> Chris

;;this is just a little bit dirty :)
(require 'cl)
(defadvice compilation-goto-locus (around stay-in-comp-buffer
activate)
  (let ((same-window-buffer-names (cons (buffer-name (marker-buffer
(ad-get-arg 1))) same-window-buffer-names))
        (orig-pop-to-buffer (symbol-function 'pop-to-buffer)))
    ;;override pop-to-buffer -- compilation-goto-locus always sets
other-window which ignores same-window-buffer-names
    (flet ((pop-to-buffer (buffer &optional other-window norecord)
             (funcall orig-pop-to-buffer buffer nil norecord)))
      ad-do-it)))


reply via email to

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