From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: The current state of the comment-cache branch Date: Sat, 24 Dec 2016 20:21:32 +0800 Message-ID: References: <20161223215056.GA2771@acm.fritz.box> <83fuldzre1.fsf@gnu.org> <20161224083054.GA2212@acm.fritz.box> <83bmw1zoy8.fsf@gnu.org> <20161224094246.GD2212@acm.fritz.box> <20161224113620.GF2212@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0122ae9a1aa4050544668b2f X-Trace: blaine.gmane.org 1482582144 24647 195.159.176.226 (24 Dec 2016 12:22:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Dec 2016 12:22:24 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 24 13:22:17 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKlL1-0004K3-NI for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2016 13:22:11 +0100 Original-Received: from localhost ([::1]:43246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKlL3-00013m-6G for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2016 07:22:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKlKT-0000ve-2E for emacs-devel@gnu.org; Sat, 24 Dec 2016 07:21:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKlKS-00009Y-1T for emacs-devel@gnu.org; Sat, 24 Dec 2016 07:21:37 -0500 Original-Received: from mail-wj0-x232.google.com ([2a00:1450:400c:c01::232]:34949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKlKR-00009H-Pd; Sat, 24 Dec 2016 07:21:35 -0500 Original-Received: by mail-wj0-x232.google.com with SMTP id v7so270955114wjy.2; Sat, 24 Dec 2016 04:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KBpeMKQ85WSeEC/7/aAQpblA4mtf/FWka+Xxu1/AHOo=; b=SXGBQu+6eb+YXMCRtdSzhQ4oIQSwRC7yE7svANJvDsc+xtzMs2p2N6iPrQIC6qAn6f c0tCvI07LW6Cli3XUPCO8Nt+PPN5HFRq375SmLNj1BQuPBsVmX/8sB7MyzRqwu6S/F3I wzccig/kfmjUU+Reikdf9Hr4ZmQ+tuCyi2rzfW4u9gPr0KR3ZmRqU8FqgYh8jUvvn1La zsvrMwwmZSwAQ/jatpSGWZSvU3u+iGrwuUivFu5L+Y9DwEQLkIJIt+1gXayCT9q0LA2y aM+BUtoGj55tNkGgbU6bQnVoQdTWzRQHH10AE2i/eADnsnzFzBurDxDx3T2Z1hGOt2Ad 7nSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KBpeMKQ85WSeEC/7/aAQpblA4mtf/FWka+Xxu1/AHOo=; b=uFm6yS7m7uwy18jlwA3fdJTHhKlPgaNIOtDR4Je0UbFEnvjlWgyaWiXZHNVY/iTPXK ACkvX6116mdlYsWT3IYtbAs7Ly1ztNTcLSJVpUKSpEfzadyEw7CWrPKyYh9cFUZfy80x avHUmyGj1FpfRp9+bthgwVWR1YlM4/9xgzgk/72XgXMA2TH9MOBtYdUhnnkxPQHEDVh1 3qfrfmgehvAtS9F2jWI+JUAOxnysvgi+KLhWbEIxVRtyIf9UnHrBR50F236RNc8HcwU+ sJ1taiN/AF01TM+K72UP6c6OdABYbfcx5+eSw51Q6ROxPfRsBUK3V6UzA7OWBrpVNnuD k4mw== X-Gm-Message-State: AIkVDXJgxcsoX0TyhgHL44nyXzuhxjhWW7wHhEaFPYk6gax7GmfK4VZc+iqE6pdJawC06YgvYw4GJDTjzhJdnw== X-Received: by 10.194.141.98 with SMTP id rn2mr17025645wjb.1.1482582094681; Sat, 24 Dec 2016 04:21:34 -0800 (PST) Original-Received: by 10.80.135.165 with HTTP; Sat, 24 Dec 2016 04:21:32 -0800 (PST) Original-Received: by 10.80.135.165 with HTTP; Sat, 24 Dec 2016 04:21:32 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c01::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210784 Archived-At: --089e0122ae9a1aa4050544668b2f Content-Type: text/plain; charset=UTF-8 On 24 Dec 2016 7:36 pm, "Alan Mackenzie" wrote: > Could you or someone else explain why an open paren in column 0 can affect > the parsing of syntax in cc-mode at all? After all, such parens have no > special syntactic nor semantic meaning in C nor C++. It is a convention established in Emacs around ?40 years ago, that such an open paren signalled the start of a defun. This sped Emacs up enormously, since the alternative was searching back to the beginning of the buffer to check whether the paren was at the top level. Thank you and Eli for clarifying this. It makes much more sense to me now. I'm still wondering how useful this could be for C code though. There are many coding conventions where the opening { of a function does not go in the left-most column. As far as I understand, such coding conventions would lead to slower parsing? I'm specifically asking this since I have sometimes used such style and at least I don't think I've felt any slowness. --089e0122ae9a1aa4050544668b2f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 24 Dec 2016 7:36 pm, "Alan Mackenzie" <acm@muc.de> wrote:

> Could you or someone else explain why an open paren in column 0 can af= fect
> the parsing of syntax in cc-mode at all? After all, such parens have n= o
> special syntactic nor semantic meaning in C nor C++.

It is a convention established in Emacs around ?40 years ago, that su= ch
an open paren signalled the start of a defun.=C2=A0 This sped Emacs up
enormously, since the alternative was searching back to the beginning of the buffer to check whether the paren was at the top level.

Thank you = and Eli for clarifying this. It makes much more sense to me now.=C2=A0

I'm still wondering how = useful this could be for C code though. There are many coding conventions w= here the opening { of a function does not go in the left-most column. As fa= r as I understand, such coding conventions would lead to slower parsing?=C2= =A0

I'm specifically= asking this since I have sometimes used such style and at least I don'= t think I've felt any slowness.=C2=A0
--089e0122ae9a1aa4050544668b2f--