GNU bug report logs -
#55002
27.1; Abnormal behaviour in C mode
Previous Next
Reported by: bill <at> billp.org
Date: Mon, 18 Apr 2022 14:20:02 UTC
Severity: normal
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55002 in the body.
You can then email your comments to 55002 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55002
; Package
emacs
.
(Mon, 18 Apr 2022 14:20:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
bill <at> billp.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 18 Apr 2022 14:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I was creating a C program, and part way through I skipped back to
define an additional variable. I started to type: 'static int...'
but instead of displaying the characters it inserted newlines until it
encountered a punctuation character, whereupon the characters I had
typed appeared and the inserted newlines disappeared. I found this very
disconcerting. Saving the file, restarting emacs and the problem
remains.
I have eventually tracked down what brings it up, spending the whole of
a morning trying variants of code, and finally tracked it down to an
incomplete character string lower down in the program. However, I still
rate this behaviour as a bug and did a google search on Stack Exchange
and was advised by 'drew' to look at me .emacs file. I have been using
for many years (30+?) and my .emacs file has accumulated over the years.
Most of the entries I can't what they do or why I added them, so I spent
quite a while commenting them out, to see if that modifies the effect.
I have finally concluded that the line:
(global-font-lock-mode 0)
appears to be the culprit.
Here is a copy of my current .emacs file:
---------------------------o><o---------------------------------
(display-time) ; Enable time (& date ?) display.
(setq default-frame-alist
'(
;;; Define here the default geometry or via ~/.Xdefaults.
(width . 84) (height . 58)
(cursor-color . "red")
(cursor-type . box)
(foreground-color . "black")
(background-color . "white")))
(defun force-revert-buffer ()
"reload from disk without prompt"
(interactive )
(revert-buffer t t))
(setq inhibit-startup-message t)
(global-set-key [f1] 'what-line)
(global-set-key [f2] 'goto-line)
(global-set-key [f3] 'scroll-right)
(global-set-key [f4] 'scroll-left)
(global-set-key [f5] 'compile)
(global-set-key [f6] 'indent-region)
(global-set-key [f7] 'force-revert-buffer)
(global-set-key [f8] 'nexttab)
(global-set-key [f10] 'word-search-forward)
(global-set-key [f11] 'word-search-backward)
(global-set-key [f12] 'call-last-kbd-macro)
;;(global-font-lock-mode 0)
------------------------------o><o-------------------------------
The final statement, is uncommented provokes the problem with the
following C file
------------------------------o><o-------------------------------
// encode.c
//
static FILE *out, *in;
static char filename[300];
static int linect;
static int ch;
static int key=-1;
static int size;
static int mode='n'; // type static int on next line....
static void parseSetting(void);
static int next(void) {
if (ch == EOF)
abort("unexpected end of file
ch = fgetc(in);
if (ch == '
')
linect++;
while (ch == '=')
parseSetting();
return ch;
--------------------------------o><o-----------------------------
As you can see it is incomplete, and there is an incomplete character
string. I have added a comment at the place where I encounter the problem.
I hope the above demonstrates the problem to you. I am happy to engage
in testing any proposed fixes.
Bill
--------------
In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23,
cairo version 1.16.0)
of 2021-01-18, modified by Debian built on lgw01-amd64-045
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 21.10
Recent messages:
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Saving file /home/bill/Church/SongSheets/XML/bug1.c...
Wrote /home/bill/Church/SongSheets/XML/bug1.c
No other windows to delete
Configured using:
'configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --enable-libsystemd --with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --build
x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
--with-pop=yes
--enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-mailutils --with-cairo
--with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
'CFLAGS=-g -O2
-ffile-prefix-map=/build/emacs-P5Mppj/emacs-27.1+1=.
-fstack-protector-strong
-Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''
Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
JSON PDUMPER LCMS2 GMP
Important settings:
value of $LC_COLLATE: C
value of $LC_CTYPE: en_GB.UTF-8
value of $LC_MESSAGES: en_GB.UTF-8
value of $LANG: C
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: C/*l
Minor modes in effect:
display-time-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cc-mode cc-fonts
easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs cl-loaddefs cl-lib time tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
x multi-tty make-network-process emacs)
Memory information:
((conses 16 68177 7974)
(symbols 48 8621 1)
(strings 32 22059 2059)
(string-bytes 1 820630)
(vectors 16 12846)
(vector-slots 8 162294 9650)
(floats 8 22 41)
(intervals 56 369 8)
(buffers 1000 13))
--
+----------------------------------------+
| Bill Purvis |
| email: bill <at> billp.org |
+----------------------------------------+
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55002
; Package
emacs
.
(Tue, 19 Apr 2022 09:40:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The culprit seems to be the unterminated string (no ending double quote)
with a parenthesis in front of it.
emacs -q dummy.c --eval='(global-font-lock-mode 0)
===
// dummy.c
// type anything after this line without global font-lock-mode
// parenthesis + unterminated string seems to be the culprit
("unterminated string
=== EOF
--
G. Mounié - Associate Prof., Univ. Grenoble Alpes (Grenoble-INP/Ensimag)
LIG - Datamove Inria team, off. 440, IMAG building,+33(0)457 421 533, FR
[OpenPGP_signature (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55002
; Package
emacs
.
(Tue, 19 Apr 2022 11:53:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 55002 <at> debbugs.gnu.org (full text, mbox):
Grégory Mounié <Gregory.Mounie <at> imag.fr> writes:
> The culprit seems to be the unterminated string (no ending double
> quote) with a parenthesis in front of it.
>
> emacs -q dummy.c --eval='(global-font-lock-mode 0)
>
> ===
> // dummy.c
>
> // type anything after this line without global font-lock-mode
>
> // parenthesis + unterminated string seems to be the culprit
> ("unterminated string
> === EOF
I can reproduce this in Emacs 27.2, but not in Emacs 28.1, so it looks
like this has been fixed by now, and you just have to upgrade Emacs.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 28.1, send any further explanations to
55002 <at> debbugs.gnu.org and bill <at> billp.org
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 19 Apr 2022 11:53:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 18 May 2022 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 31 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.