all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Juri Linkov <juri@linkov.net>
Cc: "Jörg Bornemann" <foss@jbornemann.de>, 68570@debbugs.gnu.org
Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer
Date: Sun, 28 Jan 2024 15:42:10 +0200	[thread overview]
Message-ID: <7062f157-0e9c-4c72-8edd-5a86d0dfcc43@gutov.dev> (raw)
In-Reply-To: <86a5oqmzmp.fsf@mail.linkov.net>

On 27/01/2024 19:53, Juri Linkov wrote:
>>> It's very useful to always create a unique buffer for every compilation:
>>> this allows keeping error messages from previous compilations.
>>
>> Hmm, but I suppose it can be a personal preference whether a "recompile"
>> should create a new buffer or not.
>>
>> Because it's also reasonable to expect that 'M-x compile' creates a new
>> buffer (e.g. project-prefixed and unique), but 'recompile', or
>> 'revert-buffer' - keep that buffer around and reuse it. When one wants to
>> keep the old contents, they could 'M-x compile' (or 'M-x project-compile')
>> instead.
>>
>> This might be my preference anyway, because OT1H old compilations are often
>> (but not always) handy to have around, OT2H I don't like to have too many
>> buffers, and the above distinction between 'compile' and 'recompile' would
>> be a tool to make that choice.
> 
> A new option could be added indeed.  But currently 'g' after 'compile'
> uses 'compilation-buffer-name-function' that can be configured
> to generate a new buffer.  So it's expected that 'g' after
> 'project-compile' should do the same and use
> 'project-compilation-buffer-name-function', especially
> when it's configured to generate a new buffer.

Again, I'm not sure if it's expected: even if I do like the idea of 
unique per-project compilation buffers, seeing 'g' reuse the existing 
buffer feels pretty natural.

> IOW, I think these two 'compile' and 'project-compile'
> should be in sync in regard to what 'recompile' does.

When I'm saying is that when 'recompile' reuses the current buffer it 
already follows the result of project-compilation-buffer-name-function 
(when it was invoked from project-compile, of course).

>>> I propose even to add such an option to the choice list in
>>> project-compilation-buffer-name-function, e.g.:
>>> (defcustom project-compilation-buffer-name-function nil
>>>     :type '(choice (const :tag "Default" nil)
>>>                    (const :tag "Prefixed with project name"
>>>                           project-prefixed-buffer-name)
>>>                    (const :tag "Prefixed and unique with project name"
>>>                           project-prefixed-unique-buffer-name)
>>>                    (function :tag "Custom function")))
>>
>> Sounds good.
> 
> There is also a proposal to add the same option
> to 'compilation-buffer-name-function' in bug#68697.

Sounds good to me. We could also ask the reporter there what they think 
'g' should do in such buffers (create a new one or reuse current).

>>> The previous patch would be needed as well since currently
>>> there is no way to allow unique project compilation buffers.
>>
>> The one in 0a07603ae8d?
> 
> Actually I meant https://debbugs.gnu.org/68570#23

We could make a new option in compile.el which would determine whether 
to do this in general: when non-nil, 'compilation-start' would save the 
current dynamic value of 'compilation-buffer-name-function', and 
'recompile' would call it again.

Otherwise the distinction remains that when 'recompile' is invoked 
inside a compilation buffer, the same buffer is used; and when it's 
invoked from some other buffer, a new compilation buffer can be created.





  reply	other threads:[~2024-01-28 13:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 16:17 bug#68570: 29.1; recompile might not re-use project-compile's buffer Jörg Bornemann
2024-01-19 20:19 ` Pengji Zhang
2024-01-20 14:27   ` Dmitry Gutov
2024-01-21  5:09 ` Dmitry Gutov
2024-01-21 18:18   ` Juri Linkov
2024-01-21 18:33     ` Dmitry Gutov
2024-01-22  7:31       ` Juri Linkov
2024-01-22  8:42         ` Jörg Bornemann
2024-01-22 18:20           ` Dmitry Gutov
2024-01-23  7:09           ` Juri Linkov
2024-01-23 12:21             ` Dmitry Gutov
2024-01-23 13:15               ` Jörg Bornemann
2024-01-23 17:31                 ` Dmitry Gutov
2024-01-24  7:46               ` Juri Linkov
2024-01-24 12:06                 ` Dmitry Gutov
2024-01-24 17:11                   ` Juri Linkov
2024-01-26  0:44                     ` Dmitry Gutov
2024-01-27 17:53                       ` Juri Linkov
2024-01-28 13:42                         ` Dmitry Gutov [this message]
2024-02-06 17:39                           ` Juri Linkov
2024-02-07 18:43                             ` Dmitry Gutov
2024-05-02  6:16                               ` Juri Linkov
2024-05-02  7:11                                 ` Eli Zaretskii
2024-01-22  8:39   ` Jörg Bornemann
2024-01-22 18:20     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7062f157-0e9c-4c72-8edd-5a86d0dfcc43@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=68570@debbugs.gnu.org \
    --cc=foss@jbornemann.de \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.