From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#37862: [PATCH] Use alternative C++ source files for determining C/C++ header files. Date: Sat, 4 Jul 2020 17:10:22 +0000 Message-ID: <20200704171022.GC19042@ACM> References: <87r235scb0.fsf@topbug.net> <20191027133038.GA27906@ACM> <89b138ad-e044-d117-e26f-414d29ca7732@topbug.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 37862@debbugs.gnu.org To: Hong Xu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 04 19:11:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jrlh2-00054y-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jul 2020 19:11:12 +0200 Original-Received: from localhost ([::1]:34566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrlh1-0003f4-Sm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jul 2020 13:11:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrlgs-0003dL-8z for bug-gnu-emacs@gnu.org; Sat, 04 Jul 2020 13:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrlgr-0003Y6-VO; Sat, 04 Jul 2020 13:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jrlgr-0000Tm-RA; Sat, 04 Jul 2020 13:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 04 Jul 2020 17:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37862 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 37862-submit@debbugs.gnu.org id=B37862.15938826321805 (code B ref 37862); Sat, 04 Jul 2020 17:11:01 +0000 Original-Received: (at 37862) by debbugs.gnu.org; 4 Jul 2020 17:10:32 +0000 Original-Received: from localhost ([127.0.0.1]:59520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrlgO-0000Sy-5t for submit@debbugs.gnu.org; Sat, 04 Jul 2020 13:10:32 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:46979 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jrlgL-0000Sa-9q for 37862@debbugs.gnu.org; Sat, 04 Jul 2020 13:10:30 -0400 Original-Received: (qmail 24077 invoked by uid 3782); 4 Jul 2020 17:10:22 -0000 Original-Received: from acm.muc.de (p2e5d5832.dip0.t-ipconnect.de [46.93.88.50]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sat, 04 Jul 2020 19:10:22 +0200 Original-Received: (qmail 23162 invoked by uid 1000); 4 Jul 2020 17:10:22 -0000 Content-Disposition: inline In-Reply-To: <89b138ad-e044-d117-e26f-414d29ca7732@topbug.net> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182706 Archived-At: 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).