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

Previous Next

Packages: cc-mode, emacs;

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


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Hong Xu <hong <at> topbug.net>
Cc: 37862 <at> debbugs.gnu.org
Subject: bug#37862: [PATCH] Use alternative C++ source files for determining C/C++ header files.
Date: Sat, 4 Jul 2020 17:10:22 +0000
Hello, Hong.

On Sun, Oct 27, 2019 at 13:31:33 -0700, Hong Xu wrote:
> 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.

After thinking it over for some time, I'm sorry to say I've decided not
to commit your change to Emacs.  I think the disadvantages would
outweigh the advantages.

But again, thanks for taking the trouble to post the idea on the buglist.

-- 
Alan Mackenzie (Nuremberg, Germany).




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.