emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error when editing C code


From: T.V Raman
Subject: Re: Error when editing C code
Date: Thu, 16 Jun 2022 06:52:35 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]