emacs-devel
[Top][All Lists]
Advanced

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

Re: recompile uses wrong buffer.. hint


From: Juri Linkov
Subject: Re: recompile uses wrong buffer.. hint
Date: Mon, 07 Jun 2004 15:36:48 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

>       ((eq major-mode (nth 1 compilation-arguments))
>        (buffer-name))

I think exactly the same condition should be used in `recompile'
to get the right directory when invoked in the compilation buffer:

Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.320
diff -u -r1.320 compile.el
--- lisp/progmodes/compile.el   28 May 2004 21:11:41 -0000      1.320
+++ lisp/progmodes/compile.el   7 Jun 2004 12:20:15 -0000
@@ -787,7 +787,10 @@
 original use.  Otherwise, recompile using `compile-command'."
   (interactive)
   (save-some-buffers (not compilation-ask-about-save) nil)
-  (let ((default-directory (or compilation-directory default-directory)))
+  (let ((default-directory
+          (or (and (not (eq major-mode (nth 1 compilation-arguments)))
+                   compilation-directory)
+              default-directory)))
     (apply 'compilation-start (or compilation-arguments
                                  `(,(eval compile-command))))))
 
@@ -814,8 +817,7 @@
         (funcall name-function mode-name))
        (compilation-buffer-name-function
         (funcall compilation-buffer-name-function mode-name))
-       ((and (eq major-mode 'compilation-mode)
-             (equal mode-name (nth 2 compilation-arguments)))
+       ((eq major-mode (nth 1 compilation-arguments))
         (buffer-name))
        (t
         (concat "*" (downcase mode-name) "*"))))

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





reply via email to

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