From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Slight confusion in project-find-file Date: Mon, 13 Sep 2021 16:07:49 +0200 Message-ID: <871r5sd0wa.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23847"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 13 16:22:27 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mPmqo-0005yB-FS for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Sep 2021 16:22:26 +0200 Original-Received: from localhost ([::1]:54246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPmqm-0007WV-LB for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Sep 2021 10:22:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPmcp-0004VM-RK for emacs-devel@gnu.org; Mon, 13 Sep 2021 10:07:59 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:49340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPmco-0004i0-10 for emacs-devel@gnu.org; Mon, 13 Sep 2021 10:07:59 -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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=897opILIrudTHysA22NycavZV8wqBOZYdj8v8pfCEj0=; b=lfuDoAN+v2l23xqzNILmKtygf1 nZoSvlAVxLZJ+qkM4NwW/fK3lZcMIYN58x4vJkKEnH5qW/fiKIqqaGYXAvhLOCtgQMxBYPtWcjbPO Qom2FJqUurSyfwGFun6SU5UKfx/ueONCoTexPiT6nxTA/VYCZdb03xs3zFxsh6X8ffig=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mPmcj-0001zQ-3k; Mon, 13 Sep 2021 16:07:55 +0200 Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:274651 Archived-At: I was looking at *** 'project-find-file' doesn't use the string at point as default input. Now it's only suggested as part of the "future history". which comes from commit fa895379d6166c52b89774a9e450a94c2e429dae Author: Dmitry Gutov AuthorDate: Fri Aug 6 03:30:10 2021 +0300 Change how project-find-file's completion works * lisp/progmodes/project.el (project--completing-read-strict): Allow to choose a non-existent file, with confirmation (bug#49204). Don't use the string at point as a "real" default, and instead only include it in "future history": meaning, it will be inserted on 'M-n' (bug#49865). And, indeed, it doesn't put anything in the default. However, I'm getting a bit confused trying to follow the logic: (defun project-or-external-find-file () "Visit a file (with completion) in the current project or external roots. The completion default is the filename at point, determined by `thing-at-point' (whether such file exists or not)." So this says "default", but "completion default"... (And same string in project-find-file). Also: @findex project-find-file [...] belonging to the current project, and nothing else. If there's a file name at point, this command offers that file as the default to visit. However, we basically end up calling: (uniq-file-read "Prompt" nil nil nil "file-name") there "file-name" is in the DEFAULT position, but is put in the "future history". Furthermore, `M-x project-find-file RET RET': Debugger entered--Lisp error: (wrong-type-argument stringp nil) expand-file-name(nil) find-file-noselect(nil nil nil nil) find-file(nil) project-find-file-in(#("." 0 1 (fontified t)) ("~/src/emacs/trunk/") (vc . "~/src/emacs/trunk/")) project-find-file() funcall-interactively(project-find-file) So I think this needs a bit more updating in the doc strings/documentation/parameter names, and perhaps a different way of erroring out on RET. (Or even actually using the DEFAULT as a default.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no