bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49865: 28.0.50; Customize project-find-file without thing-at-pont


From: Lars Ingebrigtsen
Subject: bug#49865: 28.0.50; Customize project-find-file without thing-at-pont
Date: Wed, 04 Aug 2021 10:37:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Manuel Uberti <manuel.uberti@inventati.org> writes:

> when I use project-find-file it always picks up the thing at point
> even when it is something I am pretty sure that does not correspond to
> a filename, which, in my case, is all the times.
>
> I see that in project.el, project-find-file uses project-find-file-in:
>
> ;;;###autoload
> (defun project-find-file ()
>   "Visit a file (with completion) in the current project.
>
> The completion default is the filename at point, determined by
> `thing-at-point' (whether such file exists or not)."
>   (interactive)
>   (let* ((pr (project-current t))
>          (dirs (list (project-root pr))))
>     (project-find-file-in (thing-at-point 'filename) dirs pr)))

This reminded me that I've been meaning to add a thing-at-point target
that is like `filename', but returns nil if the file named doesn't
exist, so I've now done this in Emacs 28.

Perhaps project.el should use it here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]