unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: dmitry@gutov.dev, 68570@debbugs.gnu.org
Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer
Date: Thu, 02 May 2024 10:11:53 +0300	[thread overview]
Message-ID: <86sez0n0w6.fsf@gnu.org> (raw)
In-Reply-To: <86msp87nnz.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 02 May 2024 09:16:40 +0300)

> Cc: 68570@debbugs.gnu.org
> From: Juri Linkov <juri@linkov.net>
> Date: Thu, 02 May 2024 09:16:40 +0300
> 
> >>> 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.
> >> A new option would be nice, but it's so broken that I don't know
> >> if it helps.  For example, 'M-x compile RET' in a compilation buffer
> >> doesn't prefill the minibuffer with the current compilation command,
> >> but uses the default command that makes no sense.
> >
> > If it did so (pre-filled the command), perhaps you would just use 'M-x
> > compile', in cases when you do want the new buffer to be created?
> >
> > But it seems to work fine to me, including in 'emacs -Q':
> >
> > * 'M-x compile', input 'ls', RET.
> > * *compilation* buffer create.
> > * 'M-x compile' again, in any window (old or new) - 'ls' is pre-filled as
> >  the input.
> 
> Sorry for the delay, I tried to fix it, but it's too much broken.
> Here is the test case for 'emacs -Q':
> 1. add such line to .dir-locals.el:
>   ((nil . ((compile-command . "ls -la"))))
> 2. M-x compile
> 3. confirm that it's "ls -la" indeed
> 4. edit the minibuffer, replace "ls -la" with e.g. "ls" and type RET
> 5. in *compilation* buffer again type: M-x compile
> 6. the minibuffer contains "make -k "

I'm not sure I agree that this makes no sense.  We have the
"M-x recompile" command for a reason.  "M-x compile" can be
used after running a compilation command once or more, and
it is not outlandish for "M-x compile" to return to the original
default value, to allow running more than a single compilation
conveniently, without too much editing in the minibuffer.

> PS: I realized now this is related to bug#70136
> where Augusto posted the patch that fixes this bug.

Re-reading the dir-locals each time a command is run might not
always make sense, IMO.

IOW, beware: these suggestions change the long-time behavior of
Emacs, so we should do that only very cautiously, and we shouldn't
be surprised if someone then comes back complaining that we broke
their muscle memory.  The notion that some behavior which makes no
sense to me or you or Augusto is necessarily a bug is IME
fundamentally flawed, since (as we all should know) most things in
Emacs are the result of careful thinking and moreover withstood
testing by many users for many years.  We may not always see the
logic behind the existing behavior, but we should always assume
there is some non-trivial logic.





  reply	other threads:[~2024-05-02  7:11 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86sez0n0w6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=68570@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --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 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).