From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Error when editing C code Date: Thu, 16 Jun 2022 06:52:35 -0700 Message-ID: <25259.13731.386273.213641@retriever.mtv.corp.google.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8553"; mail-complaints-to="usenet@ciao.gmane.io" Cc: raman@google.com, emacs-devel@gnu.org, schwab@linux-m68k.org, eliz@gnu.org To: acm@muc.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 16 16:09:28 2022 Return-path: Envelope-to: ged-emacs-devel@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 1o1qBb-00025o-54 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Jun 2022 16:09:27 +0200 Original-Received: from localhost ([::1]:45638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1qBa-0001a2-8r for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Jun 2022 10:09:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1pvQ-0003LB-GJ for emacs-devel@gnu.org; Thu, 16 Jun 2022 09:52:44 -0400 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1pvO-0007IF-RU for emacs-devel@gnu.org; Thu, 16 Jun 2022 09:52:44 -0400 Original-Received: by mail-pf1-x431.google.com with SMTP id y6so1556572pfr.13 for ; Thu, 16 Jun 2022 06:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=from:mime-version:content-transfer-encoding:message-id:date:to:cc :subject:in-reply-to:references; bh=qKNTk0Z9cmxUULQyi48mES2xUUY4maYdvTCDVbnofPM=; b=Aad2o/1HSbkWZUB0Lb+13GUqH9wmeEJrx87kkKzYvLIyuBuvrXJqJoCY/acT1R3U07 xNRzRLw3w62FaldZA7pfJJUAkxnKJt5pc1UCwmYGom+oMtxgiDJqc2JueVFUNysOsxld sachMlk2EgJOWVh/L6vtYZOU+e+VDq708Zk0vpQ6TLxfc0vOvgOE4+Nk8UDmaONwy1Wm FxYhGnZXm6SkkN64ZCFADYzdm1FI5t3dY/6fE20RkhbQ6dyTdfJ3z/2ooRREYP6VyZ7s 6C0Zxo807dqxReP8hk9BEZKgqrZN45KI/yXu1whM9KOtGktXwJvmElRTjGlGktf5GKVw k4CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:content-transfer-encoding :message-id:date:to:cc:subject:in-reply-to:references; bh=qKNTk0Z9cmxUULQyi48mES2xUUY4maYdvTCDVbnofPM=; b=KAdLfgsIBy8TFl8o9zsT9ZbUBSD85rhsPtX+ND2MmNAO+KMFzcw9wI3RzI7ndMrImN aeC/RsDrsOyDA1wUXhpLWOfs/LEO9+W/RiC/4ApmQV9USBEOAzDQ9Ro4Z9/RFcCiunAP uJQw5Mi+hteMKaAafrkWm35BOWZYGUZHUEnnM5991RYctOFbltM8F4RtmlPY9rxA64B9 gau27Iznv3Qv5eqp0YR0ko8kS1n4E7D2w9AwVIoSRGNy47TyIdfnand5QVj9Rvo3rMGa H4vr72qCbd7a01JZ2yBCzFlAtkHruxpFrkFYe0l9f2QbESwgiAfwdaBFOUjw+Zww5Sbj kkrA== X-Gm-Message-State: AJIora9wqgNAM3BE21SV13yF8w7DYdpAYdwoAsF4WxMfWDgoIozhpPYW oLfXkKqSs02RWa3VD35StxH4Cg== X-Google-Smtp-Source: AGRyM1vW9qY4vJw+UtTOjUKyiEgLvlsM7PRSNlLF8WzreRgW2hpqezo/xaObTsm75944HzB7KVaRdA== X-Received: by 2002:a05:6a00:17a0:b0:51b:c7a9:bf0c with SMTP id s32-20020a056a0017a000b0051bc7a9bf0cmr4787791pfg.71.1655387560926; Thu, 16 Jun 2022 06:52:40 -0700 (PDT) Original-Received: from retriever.mtv.corp.google.com ([2620:0:1000:1510:84d3:e96d:7dd4:d76c]) by smtp.gmail.com with ESMTPSA id jh4-20020a170903328400b00168b113f222sm1654917plb.173.2022.06.16.06.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 06:52:40 -0700 (PDT) In-Reply-To: X-Mailer: VM 8.1.1 under 29.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=raman@google.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291248 Archived-At: Agreed, would be nice to get this cleaned up. The error when it occurs is very difficult to explain or track down. In my case it first occured with eglot and the root caused appeared to be fontification of markdown within C comments, which durprized me because I didn't have any markdown in my C comments:-) I finally tracked it down by writing a simple C file with no comments, no eglot running, and then deleting a word triggered the error. Alan Mackenzie writes: > Hello, Raman. >=20 > On Wed, Jun 15, 2022 at 12:59:39 -0700, T.V Raman wrote: > > Appears to be due to incorrect loading of macros in cc-mode. >=20 > > If I try editing a c/c++ file, I get this backtrace. >=20 > > This emacs from Git @HEAD, I even did a make distclean followed by= a > > rebuild but the error persists. >=20 > > Debugger entered--Lisp error: (void-function c-with-string-fences)= > > (c-with-string-fences nil nil nil nil t nil nil t (c-depropertiz= e-new-text c-after-change-escape-NL-in-string c-after-change-unmark-ml-= strings c-parse-quotes-after-change c-after-change-mark-abnormal-string= s c-extend-font-lock-region-for-macros c-neutralize-syntax-in-CPP c-res= tore-<>-properties c-change-expand-fl-region)) > > (c-after-change 2617 2617 6) > > (delete-and-extract-region 2617 2623) >=20 > [ .... ] >=20 > Noting that make bootstrap has fixed the problem, I am unhappy that = the > problem occurred in the first place. c-with-string-fences is a new > macro in cc-defs.el (in lisp/progmodes/). c-after-change is a funct= ion > in cc-mode.el. >=20 > There is a section in lisp/Makefile specifically for dependencies in= > cc-*.el, and this should have picked up the change in cc-defs.elc an= d > rebuild (amongs others) cc-mode.elc. That section looks like: >=20 > ####################################################################= ##### > $(lisp)/progmodes/cc-align.elc\ > $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\ > $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\ > $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\ > $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\ <=3D= =3D=3D=3D=3D=3D > $(lisp)/progmodes/cc-vars.elc: \ > $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc > ####################################################################= ##### >=20 > So, why was cc-mode.elc not rebuilt with the new cc-defs.elc=3F >=20 > > --=20 >=20 > > Thanks, >=20 > > --Raman(I Search, I Find, I Misplace, I Research) > > =E2=99=88 Id: kg:/m/0285kf1 =F0=9F=A6=AE >=20 > --=20 > Alan Mackenzie (Nuremberg, Germany). --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =E2=99=89 Id: kg:/m/0285kf1 =F0=9F=A6=AE -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮