unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* recompile uses wrong buffer.. hint
@ 2004-06-07  8:40 Stephan Stahl
  2004-06-07  9:29 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Stahl @ 2004-06-07  8:40 UTC (permalink / raw)


Hi.

I tried to find a solution to this problem and at least found what was
causing this strange behaviour.

The function `compilation-buffer-name' tries to get a name for the
compilation buffer. There is a test:
	((and (eq major-mode 'compilation-mode)
	      (equal mode-name (nth 2 compilation-arguments)))
	 (buffer-name))
that equal will (always?) return nil because the structure of
compilation-arguments has changed in the recent compile.el rewrite.
Because of this the function will always return a default name. Maybe its
sufficient to remove that equal but i'm not sure..

-- 
Stephan Stahl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recompile uses wrong buffer.. hint
  2004-06-07  8:40 recompile uses wrong buffer.. hint Stephan Stahl
@ 2004-06-07  9:29 ` Juri Linkov
  2004-06-07 12:36   ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2004-06-07  9:29 UTC (permalink / raw)
  Cc: emacs-devel

"Stephan Stahl" <stahl@eos.franken.de> writes:
> I tried to find a solution to this problem and at least found what was
> causing this strange behaviour.
>
> The function `compilation-buffer-name' tries to get a name for the
> compilation buffer. There is a test:
> 	((and (eq major-mode 'compilation-mode)
> 	      (equal mode-name (nth 2 compilation-arguments)))
> 	 (buffer-name))
> that equal will (always?) return nil because the structure of
> compilation-arguments has changed in the recent compile.el rewrite.
> Because of this the function will always return a default name. Maybe its
> sufficient to remove that equal but i'm not sure..

Removing `equal' and thus leaving only `(eq major-mode 'compilation-mode)'
doesn't work for grep mode.  I think the right condition should be:

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recompile uses wrong buffer.. hint
  2004-06-07  9:29 ` Juri Linkov
@ 2004-06-07 12:36   ` Juri Linkov
  2004-06-09 19:52     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2004-06-07 12:36 UTC (permalink / raw)
  Cc: emacs-devel

> 	((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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recompile uses wrong buffer.. hint
  2004-06-07 12:36   ` Juri Linkov
@ 2004-06-09 19:52     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2004-06-09 19:52 UTC (permalink / raw)
  Cc: stahl, emacs-devel

    > 	((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:

If nobody finds a flaw in this patch in a few days, would you
please install it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-09 19:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-07  8:40 recompile uses wrong buffer.. hint Stephan Stahl
2004-06-07  9:29 ` Juri Linkov
2004-06-07 12:36   ` Juri Linkov
2004-06-09 19:52     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).