GNU bug report logs -
#55267
29.0.50; Provide customization to save project-find-file arg to savehist
Previous Next
Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>
Date: Thu, 5 May 2022 03:25:01 UTC
Severity: normal
Fixed in version 29.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>> 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.
[project-find-file.patch (text/x-diff, inline)]
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)
This bug report was last modified 2 years and 356 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.