GNU bug report logs - #37862
[PATCH] Use alternative C++ source files for determining C/C++ header files.

Previous Next

Packages: emacs, cc-mode;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Tue, 22 Oct 2019 03:14:03 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 37862 <at> debbugs.gnu.org (full text, mbox):

From: Hong Xu <hong <at> topbug.net>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 37862 <at> debbugs.gnu.org
Subject: Re: bug#37862: [PATCH] Use alternative C++ source files for
 determining C/C++ header files.
Date: Sun, 27 Oct 2019 13:31:33 -0700
On 10/27/19 6:30 AM, Alan Mackenzie wrote:
> 
> Thanks for writing this proposal.
> 
> I think it would be better, given a foo.h, to find all files foo.*, and
> test each one in turn for a match in auto-mode-alist.  Searching this
> alist is really not that slow, particularly as it is only being done a
> few times, and not in a tight loop.

I agree with this approach, if it would not be too slow. Perhaps we can set a limit on the number of files that match foo.*.
> 
> For this, we really want a function in the Emacs core which would find
> the match in auto-mode-alist.  Currently, this functionality is open
> coded in set-auto-mode (in .../lisp/files.el).

I like the idea to create a separate function that provides this feature. Do you mean it's somewhat buried in `set-auto-mode'? It's probably also useful in other places.

> 
> However, I'm a bit sceptical about the use of this proposed facility.
> Many projects (possibly most) have .c/.c++ files in a directory called
> "src", and .h files in a separate directory called "include".  This
> proposed facility wouldn't work in such a set up.  To extend it to cope
> with separate "src"/"include" directories would make it messy.


This is true; but I think no guessing is perfect. At least the proposed solution should help with some smaller projects.





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

Previous Next


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