From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#55267: 29.0.50; Provide customization to save project-find-file arg to savehist Date: Thu, 12 May 2022 19:38:48 +0300 Organization: LINKOV.NET Message-ID: <86czgj5e6n.fsf@mail.linkov.net> References: <87bkwc64qw.fsf@codeisgreat.org> <877d7063ka.fsf@codeisgreat.org> <86a6bwv2qk.fsf_-_@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40807"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 55267@debbugs.gnu.org To: Pankaj Jangid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 12 19:09:45 2022 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 1npCJs-000AVb-Fz for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 19:09:44 +0200 Original-Received: from localhost ([::1]:52954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npCJr-0002Se-AQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 13:09:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npCJE-0001Gg-MR for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 13:09:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npCJE-00026V-Ck for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 13:09:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npCJE-000553-8G for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 13:09:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2022 17:09:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55267 X-GNU-PR-Package: emacs Original-Received: via spool by 55267-submit@debbugs.gnu.org id=B55267.165237528219321 (code B ref 55267); Thu, 12 May 2022 17:09:04 +0000 Original-Received: (at 55267) by debbugs.gnu.org; 12 May 2022 17:08:02 +0000 Original-Received: from localhost ([127.0.0.1]:42131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npCIE-00051Y-91 for submit@debbugs.gnu.org; Thu, 12 May 2022 13:08:02 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:57165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npCIB-00050w-KP for 55267@debbugs.gnu.org; Thu, 12 May 2022 13:08:01 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 56D14100002; Thu, 12 May 2022 17:07:51 +0000 (UTC) In-Reply-To: <86a6bwv2qk.fsf_-_@mail.linkov.net> (Juri Linkov's message of "Thu, 05 May 2022 10:28:15 +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" Xref: news.gmane.io gmane.emacs.bugs:232073 Archived-At: --=-=-= Content-Type: text/plain >> I just noticed that "project-find-file" is ultimately calling >> "find-file" only. So it should save the file to minibuffer history if >> savehist-mode is enabled. >> >> But this is not happening in my environment right now. Is this a bug >> (instead of feature request)? > > Recently I noticed this problem too. So project-find-file-in > needs to specify the same history variable 'file-name-history' > as used in read-file-name-default. > > Then you could add 'file-name-history' to savehist-additional-variables. BTW, here is another improvement for project-find-file. If there is no file name under point, it could propose the current file name for editing in the minibuffer, to find another file based on the current file when their names are similar. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=project-find-file.patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 6c50135358..5eee20e408 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -863,8 +863,12 @@ project-find-file for VCS directories listed in `vc-directory-exclusion-list'." (interactive "P") (let* ((pr (project-current t)) - (dirs (list (project-root pr)))) - (project-find-file-in (thing-at-point 'filename) dirs pr include-all))) + (root (project-root pr)) + (dirs (list root))) + (project-find-file-in + (or (thing-at-point 'filename) + (and buffer-file-name (file-relative-name buffer-file-name root))) + dirs pr include-all))) ;;;###autoload (defun project-or-external-find-file (&optional include-all) --=-=-=--