From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer Date: Thu, 02 May 2024 10:11:53 +0300 Message-ID: <86sez0n0w6.fsf@gnu.org> References: <920b0c20-c6ee-4b41-84ec-5adfa06c64a2@jbornemann.de> <320b09d1-2af4-4110-bdf3-94da122f3dd6@gutov.dev> <86il3m1zi7.fsf@mail.linkov.net> <60842df3-8a64-4bde-b6d6-f94b9a964a17@gutov.dev> <86fryp7ubp.fsf@mail.linkov.net> <871a3ea4-46d9-419e-a375-1d32968ccc88@jbornemann.de> <867ck0leif.fsf@mail.linkov.net> <0598898e-8e25-43b1-92c0-4596ad242ec8@gutov.dev> <86bk9b6vu4.fsf@mail.linkov.net> <86o7da1ws8.fsf@mail.linkov.net> <2a3f08b8-5334-41c6-8003-707424a8a0fe@gutov.dev> <86a5oqmzmp.fsf@mail.linkov.net> <7062f157-0e9c-4c72-8edd-5a86d0dfcc43@gutov.dev> <86fry57ar4.fsf@mail.linkov.net> <153e53c0-1673-4eb4-9c31-2be677ca2f08@gutov.dev> <86msp87nnz.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18250"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 68570@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 02 09:13:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s2Qcu-0004ZN-AP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 May 2024 09:13:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2Qca-0005CS-BI; Thu, 02 May 2024 03:12:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2QcS-0005Bs-Qw for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 03:12:40 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2QcS-0002tn-H2 for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 03:12:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2Qcn-0001sk-UM for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 03:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2024 07:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68570 X-GNU-PR-Package: emacs Original-Received: via spool by 68570-submit@debbugs.gnu.org id=B68570.17146339467227 (code B ref 68570); Thu, 02 May 2024 07:13:01 +0000 Original-Received: (at 68570) by debbugs.gnu.org; 2 May 2024 07:12:26 +0000 Original-Received: from localhost ([127.0.0.1]:42011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2QcD-0001sV-QG for submit@debbugs.gnu.org; Thu, 02 May 2024 03:12:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2QcC-0001sO-Aj for 68570@debbugs.gnu.org; Thu, 02 May 2024 03:12:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2Qbl-0002lX-6A; Thu, 02 May 2024 03:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=iezKbEnQanVLUog33v3ak/i+AVEjaWVywpu3FE0pcD0=; b=aRB5Xmq3eewE 57F2voq47L/8gLWUo93NdMrtLuUvKBUMtG0nX5ubGQ0s6WRF3TnuuXF21O5SLJ8mLti9XChjLuWkP r2H8s6dqm6Lp/nKb8TlhFlUt5AsdzBitMLKFcwOA28RjI4LUsLSNjtjaito7g9sqAbLaQRef5dvD5 /560IQcB3GHvCpVqTg2XcTWYmMB5sQGag6GHWYlCwCAh7TzrUp/UiV7dC09Bl/gxOzPvrOqZY+VVZ f1ftrdgpa9X2xCrWIGDxVE4nZU18Wb8ZXKX7GO+Pcjnf0oFF4UpHmUpyqMRFSr8MoJf9Ov1x5kiOr 941uI9YWaqIWoickQL+0Gg==; In-Reply-To: <86msp87nnz.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 02 May 2024 09:16:40 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284278 Archived-At: > Cc: 68570@debbugs.gnu.org > From: Juri Linkov > 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.