unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "T.V Raman" <raman@google.com>
To: acm@muc.de
Cc: raman@google.com, emacs-devel@gnu.org, schwab@linux-m68k.org,
	eliz@gnu.org
Subject: Re: Error when editing C code
Date: Thu, 16 Jun 2022 06:52:35 -0700	[thread overview]
Message-ID: <25259.13731.386273.213641@retriever.mtv.corp.google.com> (raw)
In-Reply-To: <Yqr5/imRHJo+956X@ACM>

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.
 > 
 > 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.
 > 
 > > If I try editing a c/c++ file, I get this backtrace.
 > 
 > > This emacs from Git @HEAD, I even did a make distclean followed by a
 > > rebuild  but the error persists.
 > 
 > > Debugger entered--Lisp error: (void-function c-with-string-fences)
 > >   (c-with-string-fences nil nil nil nil t nil nil t (c-depropertize-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-strings c-extend-font-lock-region-for-macros c-neutralize-syntax-in-CPP c-restore-<>-properties c-change-expand-fl-region))
 > >   (c-after-change 2617 2617 6)
 > >   (delete-and-extract-region 2617 2623)
 > 
 > [ .... ]
 > 
 > 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 function
 > in cc-mode.el.
 > 
 > 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 and
 > rebuild (amongs others) cc-mode.elc.  That section looks like:
 > 
 > #########################################################################
 > $(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\  <======
 >  $(lisp)/progmodes/cc-vars.elc: \
 >    $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
 > #########################################################################
 > 
 > So, why was cc-mode.elc not rebuilt with the new cc-defs.elc?
 > 
 > > -- 
 > 
 > > Thanks,
 > 
 > > --Raman(I Search, I Find, I Misplace, I Research)
 > > ♈ Id: kg:/m/0285kf1  🦮
 > 
 > -- 
 > Alan Mackenzie (Nuremberg, Germany).

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



      reply	other threads:[~2022-06-16 13:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 19:59 Error when editing C code T.V Raman
2022-06-15 20:17 ` Andreas Schwab
2022-06-15 20:29   ` T.V Raman
2022-06-15 21:24   ` T.V Raman
2022-06-16  5:10     ` Eli Zaretskii
2022-06-16  9:38 ` Alan Mackenzie
2022-06-16 13:52   ` T.V Raman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25259.13731.386273.213641@retriever.mtv.corp.google.com \
    --to=raman@google.com \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).