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#72311: [PATCH] Treat period as a symbol constituent in cc-mode Date: Sat, 27 Jul 2024 11:26:49 +0000 Message-ID: References: <87h6ccm02t.fsf@yegorov.org> <871q3g3qfp.fsf@yegorov.org> <86ikwr2xbo.fsf@gnu.org> <87wml78a0s.fsf@yegorov.org> 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="17508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , Jeremy Bryant , 72311@debbugs.gnu.org To: Vladislav Yegorov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 13:28:13 2024 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 1sXfav-0004PD-6p for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 13:28:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXfaj-00062c-Ba; Sat, 27 Jul 2024 07:28:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXfab-00061M-1q for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 07:27:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sXfaa-0007Ry-Lr for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 07:27:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=o0dqbStRQ4Y3ZrFP1235398xe9vRTNzhrAY2nohSrwU=; b=VhpG8axo5SywUcmoVsi7hbMf7KFiQ81jxNlFbcePnisweRS8caXj+pAjhH9obx0h3QycGydc5w58Mj1xHmgrO56SNc3wXiJO3sVZ0jxSRWwyMtlKdUf8rDSJiSa+mvbq2K0soP5bggfJItiL0gzOtBRvgiAWdQhZM7Zvs0eeJhmVF+w0xK+NPdqWeZ1tlDukotS0+vchFWl3CkAzLzoN6cehnAS2bpB75Po2fWZcKH3hKFx3+8mqCVa/Tv26vo/iWjTbIXoXvs/qz1MURaqvb6dSWobyFT5ZO7QVbnFr9k4gD745XhEJ7FFJLiwJQml0ZvIsbitlWikT5XrUpsFwOA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXfak-0007Fl-9s for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 07:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jul 2024 11:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72311-submit@debbugs.gnu.org id=B72311.172207962927758 (code B ref 72311); Sat, 27 Jul 2024 11:28:02 +0000 Original-Received: (at 72311) by debbugs.gnu.org; 27 Jul 2024 11:27:09 +0000 Original-Received: from localhost ([127.0.0.1]:40634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXfZs-0007DO-OP for submit@debbugs.gnu.org; Sat, 27 Jul 2024 07:27:08 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:41165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXfZq-0007CS-Cm for 72311@debbugs.gnu.org; Sat, 27 Jul 2024 07:27:06 -0400 Original-Received: (qmail 52350 invoked by uid 3782); 27 Jul 2024 13:26:50 +0200 Original-Received: from muc.de (p4fe15a81.dip0.t-ipconnect.de [79.225.90.129]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 27 Jul 2024 13:26:50 +0200 Original-Received: (qmail 9846 invoked by uid 1000); 27 Jul 2024 11:26:49 -0000 Content-Disposition: inline In-Reply-To: <87wml78a0s.fsf@yegorov.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289423 Archived-At: Hello, Vladislav and Eli. On Sat, Jul 27, 2024 at 11:22:11 +0200, Vladislav Yegorov wrote: > > What about stuff like 'foo.bar', where 'foo' is a struct and 'bar' > > is its member? won't this change make them a single symbol? That was my first reaction, too. > You are right, kind of forgot about that. I think in that case a > simple syntax table modification like my patch provides won't do the > trick. > My motivation for this patch was to able to use C-M-f (forward-sexp) > to skip over decimal numbers. What are your thoughts on defining a > forward-sexp-function that will use a alternate syntax table in > certain contexts? maybe a bit too hacky? It would be possible to put a syntax-table text property on a '.' when it is followed directly by a decimal digit, with no space between. Maybe we could also check that there's a valid number character before the . (space, BOL, 0-9, -, ...?), but that might be over engineering. My next thought is, for consistency, how would we handle something like 1.381E-23? For consistency, C-M-f ought to move forward over that number in its entirety. That would need some more rigorous analysis of every piece of text, probably by a regexp, and putting syntax-table properties on both the '.' and the '-'. This would slow CC Mode down, even if not by a lot. So, it could be done, yes. Is it worth doing, though? I've got very little experience of hacking files with lots of floating point constants in them, so it's difficult for me to judge just how annoying it is for C-M-f and C-M-b only to move over part of a number. -- Alan Mackenzie (Nuremberg, Germany).