From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#37862: [PATCH] Use alternative C++ source files for determining C/C++ header files. Date: Sun, 27 Oct 2019 13:31:33 -0700 Message-ID: <89b138ad-e044-d117-e26f-414d29ca7732@topbug.net> References: <87r235scb0.fsf@topbug.net> <20191027133038.GA27906@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="78000"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: 37862@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 27 21:32:39 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iOpDI-000K84-CM for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 21:32:36 +0100 Original-Received: from localhost ([::1]:49360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOpDG-000412-62 for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 16:32:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOpCm-0003r7-Ck for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 16:32:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOpCl-0008T6-9y for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 16:32:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOpCk-0008Se-M0 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 16:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOpCk-0002JW-E9 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 16:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2019 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37862 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37862-submit@debbugs.gnu.org id=B37862.15722083018862 (code B ref 37862); Sun, 27 Oct 2019 20:32:02 +0000 Original-Received: (at 37862) by debbugs.gnu.org; 27 Oct 2019 20:31:41 +0000 Original-Received: from localhost ([127.0.0.1]:43581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOpCO-0002Iq-QJ for submit@debbugs.gnu.org; Sun, 27 Oct 2019 16:31:41 -0400 Original-Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOpCL-0002Ia-44 for 37862@debbugs.gnu.org; Sun, 27 Oct 2019 16:31:38 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1572208294; cv=none; d=zohomail.com; s=zohoarc; b=UL+DOvEDw1vOsRMvQSoMYXXBMuDl4bP1ta3RHDsIqQdZMyPU2DQWFac+DXJqfKXm6tLrPKw32o0tMOmUK2tAWQNi6e3mmJd+bTfrV2rTXCNYOFf7YyWUJU37CVbTkwzZfK6UpiSIPjxNppi572N8bHw0pJBvHX+ZvIyOAwvcjUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1572208294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=vSHJb4v52vrPaTvekFFa+3c3Gc1/lEvy8015bfMaBxE=; b=IqPT4an2sC3yvBUDf7pHjvLYVLAkQFY8yRiNbmCY/r19EWHBgWSemYV6+l1ATpsa9W3+F92I9Nmj20yTIwQjQ2gVFajxktF1UKzvgEWpDALvK/6TQxE7nufFBNd1AM5NxQMfIQgznEcwRWY43AulpHvfBxzlCNse7oKJ9oiGWDo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=topbug.net; spf=pass smtp.mailfrom=hong@topbug.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1572208294; s=zoho; d=topbug.net; i=hong@topbug.net; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; l=1334; bh=vSHJb4v52vrPaTvekFFa+3c3Gc1/lEvy8015bfMaBxE=; b=Ul1ZKlkOb4Yp62MevGaFfdrfcFXCRil9whzWYbMA4w6SAKwkq8dZon9dMy+H1g/s P+TKe/UnlQpJLVJawVSnB6aWu67qLKA/KNdlCQUbo9z1y8Mm1FGNntem1JLLGmzyHtU BabwsQQm0WG9PgIn/CdGne0dALOZ85boTt/2ntRk= Original-Received: from [192.168.88.88] (69-215-149-151.lightspeed.sntcca.sbcglobal.net [69.215.149.151]) by mx.zohomail.com with SMTPS id 1572208294404234.7524913405265; Sun, 27 Oct 2019 13:31:34 -0700 (PDT) Openpgp: preference=signencrypt In-Reply-To: <20191027133038.GA27906@ACM> Content-Language: en-US X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170270 Archived-At: 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.