From unknown Tue Jun 17 22:25:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50142: 27.1; Meaning of interactive specifier "f" unexpectedly depends on visited file Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Aug 2021 08:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50142 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 50142@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16295357162621 (code B ref -1); Sat, 21 Aug 2021 08:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Aug 2021 08:48:36 +0000 Received: from localhost ([127.0.0.1]:35833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHMg7-0000gD-US for submit@debbugs.gnu.org; Sat, 21 Aug 2021 04:48:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:47096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHMg6-0000g6-7N for submit@debbugs.gnu.org; Sat, 21 Aug 2021 04:48:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHMg6-0003hU-00 for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 04:48:34 -0400 Received: from [78.47.144.35] (port=55130 helo=metalevel.at) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHMg4-0003jH-9u for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 04:48:33 -0400 Received: from mt-mbpro.localdomain (localhost [127.0.0.1]) by metalevel.at (Postfix) with ESMTP id 30F469C73E for ; Sat, 21 Aug 2021 10:40:19 +0200 (CEST) Received: by mt-mbpro.localdomain (Postfix, from userid 501) id ECA7113F58C5; Sat, 21 Aug 2021 10:40:18 +0200 (CEST) From: Markus Triska Date: Sat, 21 Aug 2021 10:40:18 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 78.47.144.35 (failed) Received-SPF: none client-ip=78.47.144.35; envelope-from=triska@metalevel.at; helo=metalevel.at X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Let ~/f.el consist of: (defun f (file) (interactive "fFile:") (message "The file is: %s" file)) When I start Emacs with: $ cd $ emacs -Q -l f.el And then, in Emacs, do: M-x f RET RET Then the echo area shows, as expected: The file is: ~/ In contrast, when I start Emacs with: $ emacs -Q -l f.el f.el And then perform the same steps as above, i.e., M-x f RET RET then the echo area unexpectedly shows: The file is: ~/f.el This is unexpected, since the minibuffer prompt when doing M-x f RET shows: "File:~/" (as before), indicating that pressing RET would yield "~/", also as before, not "~/f.el". The key difference between the two cases is that in the second invocation, f.el is visited, and in the first case it is not visited. I noticed this difference when testing cdvdmacs, visiting cdvdmacs.el and then trying to add the directory in which cdvdmacs.el resides to the list of files and directories I want to archive, and unexpectedly adding only the file itself (cdvdmacs.el) instead of the entire directory: https://www.metalevel.at/cdvdmacs/ Thank you and all the best, Markus In GNU Emacs 27.1 (build 1, x86_64-apple-darwin15.3.0, X toolkit, Xaw scroll bars) of 2020-12-12 built on mt-macbook Windowing system distributor 'The X.Org Foundation', version 11.0.11502000 System Description: Mac OS X 10.11.3 From unknown Tue Jun 17 22:25:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50142: 27.1; Meaning of interactive specifier "f" unexpectedly depends on visited file Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Aug 2022 13:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50142 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Markus Triska Cc: 50142@debbugs.gnu.org Received: via spool by 50142-submit@debbugs.gnu.org id=B50142.166117636610173 (code B ref 50142); Mon, 22 Aug 2022 13:53:01 +0000 Received: (at 50142) by debbugs.gnu.org; 22 Aug 2022 13:52:46 +0000 Received: from localhost ([127.0.0.1]:38354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7rB-0002e1-UD for submit@debbugs.gnu.org; Mon, 22 Aug 2022 09:52:46 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7r9-0002dj-Cs for 50142@debbugs.gnu.org; Mon, 22 Aug 2022 09:52:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ueq/r/FaeDpFyMxzuDNTqM6pEtnnmIxGpHy1x1sNkDI=; b=uftn8GnnEBTGqUkK8+ARpaofzQ vUeAzj7WF4ishzPG/31nj0YWazEZkFJUyTMM2wNCMokmiU0Be0QWI3UojsFV+tyWWEMQ66lSoS5E1 Hlc7gdRTVx0kO5MsbpzGM23k+9Or09fTG33F2Ps+YpK7Ko42qD/xuBPw02C5PuF+x+vw=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ7r0-000621-6Y; Mon, 22 Aug 2022 15:52:36 +0200 From: Lars Ingebrigtsen In-Reply-To: (Markus Triska's message of "Sat, 21 Aug 2021 10:40:18 +0200") References: X-Now-Playing: The Amorphous Androgynous & Peter Hammill's _The Amorphous Androgynous & Peter Hammill_: "Synthony " Date: Mon, 22 Aug 2022 15:52:33 +0200 Message-ID: <87a67w5qse.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Markus Triska writes: > then the echo area unexpectedly shows: > > The file is: ~/f.el > > This is unexpected, since the minibuffer prompt when doing M-x f RET > shows: "File:~/" (as before), indicating that pressing RET w [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Markus Triska writes: > then the echo area unexpectedly shows: > > The file is: ~/f.el > > This is unexpected, since the minibuffer prompt when doing M-x f RET > shows: "File:~/" (as before), indicating that pressing RET would yield > "~/", also as before, not "~/f.el". The "f" interactive spec is basically `read-file-name'. As the doc string says: --- If DEFAULT-FILENAME is omitted or nil, then if INITIAL is non-nil, the default is DIR combined with INITIAL; otherwise, if the current buffer is visiting a file, that file serves as the default; otherwise, the default is simply the string inserted into the minibuffer. --- Which is what you're seeing. So this is working as intended (and in any case, we can't change this long standing behaviour), and I'm therefore closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 09:52:50 2022 Received: (at control) by debbugs.gnu.org; 22 Aug 2022 13:52:50 +0000 Received: from localhost ([127.0.0.1]:38357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7rG-0002eG-92 for submit@debbugs.gnu.org; Mon, 22 Aug 2022 09:52:50 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7rD-0002dp-9l for control@debbugs.gnu.org; Mon, 22 Aug 2022 09:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jwc3jiY/O070okAobLujkiTpEg1hys6YCjAQUK3CD/k=; b=TWLSbLZIjSOZANT/7SR+D25iE9 KfCRq9D+XNSEMYwwN3FBPYqXysjPqoRV+qQQnLNBDW6WVEHUt0WUzkN5RSv2tVpNpaODYzIjDClbV KGv9XAhH3vfC8S17tdESysl4rhSObaxeKQ5JYnf1zAhW2xFIez7TKAu0DGfYNbnQBMwI=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ7r5-000629-DN for control@debbugs.gnu.org; Mon, 22 Aug 2022 15:52:41 +0200 Date: Mon, 22 Aug 2022 15:52:38 +0200 Message-Id: <878rng5qs9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #50142 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 50142 notabug close 50142 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 50142 notabug close 50142 quit