GNU bug report logs - #49865
28.0.50; Customize project-find-file without thing-at-pont

Previous Next

Package: emacs;

Reported by: Manuel Uberti <manuel.uberti <at> inventati.org>

Date: Wed, 4 Aug 2021 06:17:01 UTC

Severity: minor

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Manuel Uberti <manuel.uberti <at> inventati.org>
Cc: 49865 <at> debbugs.gnu.org
Subject: bug#49865: 28.0.50; Customize project-find-file without thing-at-pont
Date: Fri, 6 Aug 2021 03:51:13 +0300
Hi Lars,

On 04.08.2021 11:37, Lars Ingebrigtsen wrote:
> 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?

I don't know if it will be the best choice here.

First of all, we already have the hook file-name-at-point-functions, 
which is consulted by read-file-name--defaults. So one can already e.g. 
move point to some existing file name, press C-x C-f M-n and with the 
power of the ffap package have the file name inserted.

But when we're completing project-wide, there will also be references 
that are not relative to the current directory (and instead relate to 
some project-configured path). Like

#include "stuff/thingy.h"

or

require 'actor/abc'

...where the string is both not relative to the current dir and is 
missing the extension.

ffap actually includes support for this, like having

(require 'cl-lib)

be recognized as '.../lisp/emacs-lisp/cl-lib.el', but it only works for 
a limited set of languages, and OOTB only for Elisp (for all others you 
need to configure variables like ffap-c++-path).




This bug report was last modified 4 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.