From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: xh yang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Dec 2018 04:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33784 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33784@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154510821118258 (code B ref -1); Tue, 18 Dec 2018 04:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Dec 2018 04:43:31 +0000 Received: from localhost ([127.0.0.1]:52464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ7EA-0004kO-UA for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:43:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ6o1-00046p-2I for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ6nu-0005i3-45 for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZ6ns-0005gP-AD for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ6np-0003vV-W7 for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:16:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ6h7-00006u-A8 for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:09:22 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:43633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ6h7-00006X-4N for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:09:21 -0500 Received: by mail-qt1-x843.google.com with SMTP id i7so16730837qtj.10 for ; Mon, 17 Dec 2018 20:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=KSHpfP2/0bkoUw1rGknGbL3t1ErPWi6bM9gEouZeH0A=; b=LISIH47aaJhPUQ0J1iOZzW6tqDQe2/mv8OF1t/CfBVE4kHq4Z6QkaQhyEETtvy59WX eHu9yiRR9vO36woLcGPD34fptGHnxO365gyND68+5gb3fPOTAo8wgCnSScNmbmgMEZ7r 6Fsj0OSgU7it8gUsHjoqLmxaq6lgleuk6R73DJcmMPS9SFVK3Fr0mmzZvmLox4aDpcTy uXH6j7CxNWqr9IxaL352oLR685ScWOcREzntXaCQGUrVDTp/NhK+mLdZsxrrfwUWVicM 1lLcV8Q+NWfC6yCyAmaPa5LtRuZ4qGObtfhD+zlmH9E551+ULeHAY7MA2A7TJ/6rJ6fT llTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KSHpfP2/0bkoUw1rGknGbL3t1ErPWi6bM9gEouZeH0A=; b=Q3tvMaf9IjaHcYdO9DB/Xn1M5GM3gChmE87qrsWDg/9jz/FH5/9+CDHjjtRAkLDbL+ 18Qy5BZL6Z67zpBVQwdspa0pY7e0InjZDae9Zm3usV74OvDGkfDqvGqhctwB9gtSFJGS Free3Pvxpihhj/K/2/XLKOwze7u+fY705QW17jYlEmYr806f1nE+0Yb3tgYMOIPuudRh j3L045a4T7W9c1OdsiLbekurVlW5C4G1v6UNcDKguJZvx49xQEU5qVP5G53xVP6oqbbJ nJ2qfrokDUSJGQTYMvRTt96yIXWJ0kxQZ/HLAKrOuPqJ5gDbRazjmURYgFC3CZM4VEwe hGuA== X-Gm-Message-State: AA+aEWYW9vFsrMsF7AaSJK61eFGi9pClJTHfsLOWSJnuxe8s/4iSDmd7 L/KuqdK89rk93kyG72PWDRlBEnP5sRXvJ7RHlBsBeKcvSXsWoQ== X-Google-Smtp-Source: AFSGD/UNMCQkQ6SGkIN/40OYIAPbH6T/MgeohLWUsdmP7pz0bH+1iA9mY+99wVLgqkyF6E/aGCfYJA9Y3vAh98uZL3Y= X-Received: by 2002:a0c:a4a3:: with SMTP id x32mr15532187qvx.89.1545106160254; Mon, 17 Dec 2018 20:09:20 -0800 (PST) MIME-Version: 1.0 From: xh yang Date: Tue, 18 Dec 2018 12:09:01 +0800 Message-ID: Content-Type: multipart/alternative; boundary="000000000000d285c8057d440f01" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Mon, 17 Dec 2018 23:43:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --000000000000d285c8057d440f01 Content-Type: text/plain; charset="UTF-8" follow case: (let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n __VA_ARGS__))")) (with-temp-buffer (delay-mode-hooks (funcall 'c++-mode)) (insert str) (font-lock-ensure) (buffer-string) ) ) execute up code, emacs will hang In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2018-12-18 built on xhyang-ThinkPad-T470p Repository revision: 1691a51094d35ac4b2c311fa407c6b77eea7a105 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 16.04.3 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set #("#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))" 0 1 (c-is-sws t c-in-sws t) 1 7 (c-in-sws t) 7 8 (c-in-sws t) 8 13 (c-in-sws t) 13 19 (c-in-sws t) 19 21 (c-in-sws t c-is-sws t) 21 22 (c-is-sws t)) next-line: End of buffer Configured using: 'configure --enable-link-time-optimization --without-pop --without-kerberos --without-kerberos5 --without-hesiod --with-sound=alsa --with-x-toolkit=gtk3 --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-xml2 --with-imagemagick --with-xft --without-libotf --without-xim --with-xaw3d --with-dbus --without-gconf --without-gsettings --without-selinux --with-gnutls --with-zlib --with-modules --with-file-notification=inotify --without-makeinfo --with-x --exec-prefix=/usr/' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LCMS2 GMP Important settings: value of $LC_MONETARY: zh_CN.UTF-8 value of $LC_NUMERIC: zh_CN.UTF-8 value of $LC_TIME: zh_CN.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs time-date 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 elec-pair mule-util 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 menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer 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 font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 114827 9593) (symbols 48 22507 1) (strings 32 34433 2178) (string-bytes 1 1049070) (vectors 16 16742) (vector-slots 8 532827 13806) (floats 8 49 68) (intervals 56 261 1) (buffers 992 11) (heap 1024 38686 1099)) --000000000000d285c8057d440f01 Content-Type: text/html; charset="UTF-8"


follow case:

(let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n __VA_ARGS__))"))
(with-temp-buffer
(delay-mode-hooks (funcall 'c++-mode))
(insert str)
(font-lock-ensure)
(buffer-string)
)
)

execute up code, emacs will hang


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2018-12-18 built on xhyang-ThinkPad-T470p
Repository revision: 1691a51094d35ac4b2c311fa407c6b77eea7a105
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 16.04.3 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
#("#define SLOGE(...)
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,
__VA_ARGS__))" 0 1 (c-is-sws t c-in-sws t) 1 7 (c-in-sws t) 7 8 (c-in-sws t) 8 13 (c-in-sws t) 13 19 (c-in-sws t) 19 21 (c-in-sws t c-is-sws t) 21 22 (c-is-sws t))
next-line: End of buffer

Configured using:
'configure --enable-link-time-optimization --without-pop
--without-kerberos --without-kerberos5 --without-hesiod
--with-sound=alsa --with-x-toolkit=gtk3 --with-xpm --with-jpeg
--with-tiff --with-gif --with-png --with-rsvg --with-xml2
--with-imagemagick --with-xft --without-libotf --without-xim
--with-xaw3d --with-dbus --without-gconf --without-gsettings
--without-selinux --with-gnutls --with-zlib --with-modules
--with-file-notification=inotify --without-makeinfo --with-x
--exec-prefix=/usr/'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GLIB NOTIFY
INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS LCMS2 GMP

Important settings:
value of $LC_MONETARY: zh_CN.UTF-8
value of $LC_NUMERIC: zh_CN.UTF-8
value of $LC_TIME: zh_CN.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=fcitx
locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
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

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs time-date 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 elec-pair mule-util 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 menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer 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
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 114827 9593)
(symbols 48 22507 1)
(strings 32 34433 2178)
(string-bytes 1 1049070)
(vectors 16 16742)
(vector-slots 8 532827 13806)
(floats 8 49 68)
(intervals 56 261 1)
(buffers 992 11)
(heap 1024 38686 1099))

--000000000000d285c8057d440f01-- From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang References: Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 17:48:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: xh yang Cc: 33784@debbugs.gnu.org Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.154515524111045 (code B ref 33784); Tue, 18 Dec 2018 17:48:03 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 17:47:21 +0000 Received: from localhost ([127.0.0.1]:53647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZJSj-0002s4-0d for submit@debbugs.gnu.org; Tue, 18 Dec 2018 12:47:21 -0500 Received: from colin.muc.de ([193.149.48.1]:16595 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gZJSh-0002ru-0D for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 12:47:19 -0500 Received: (qmail 96823 invoked by uid 3782); 18 Dec 2018 17:47:16 -0000 Date: 18 Dec 2018 17:47:16 -0000 Message-ID: <20181218174716.96822.qmail@mail.muc.de> From: Alan Mackenzie Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4 (amd64)) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, xh. In article you wrote: > [-- text/plain, encoding 7bit, charset: UTF-8, 117 lines --] > follow case: > (let ((str "#define SLOGE(...)\n > ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n > __VA_ARGS__))")) > (with-temp-buffer > (delay-mode-hooks (funcall 'c++-mode)) > (insert str) > (font-lock-ensure) > (buffer-string) > ) > ) > execute up code, emacs will hang Yes. The problem here is the (font-lock-ensure). This is being called even though font-lock-mode is disabled. I think there should be a check for this in font-lock-ensure, but there isn't. So, yes, we have a bug here. Thanks for taking the trouble to report it. Incidentally, the temporary buffer created by with-temp-buffer never has font-lock-mode enabled, and font-lock-mode is spiked so that it cannot be enabled in such a buffer. I don't know why. Attempting to enable it fails silently, which is probably another bug. Incidentally[2], the delay-mode-hooks in your recipe has nothing to do with the problem. > In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) > of 2018-12-18 built on xhyang-ThinkPad-T470p > Repository revision: 1691a51094d35ac4b2c311fa407c6b77eea7a105 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 > System Description: Ubuntu 16.04.3 LTS [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.154515912032532 (code B ref 33784); Tue, 18 Dec 2018 18:52:01 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 18:52:00 +0000 Received: from localhost ([127.0.0.1]:53701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZKTH-0008Se-OW for submit@debbugs.gnu.org; Tue, 18 Dec 2018 13:51:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZKTG-0008SS-At for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 13:51:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZKT8-0000co-91 for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 13:51:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZKT8-0000bY-4b; Tue, 18 Dec 2018 13:51:50 -0500 Received: from [176.228.60.248] (port=4247 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gZKT5-0001Jq-S8; Tue, 18 Dec 2018 13:51:50 -0500 Date: Tue, 18 Dec 2018 20:51:48 +0200 Message-Id: <83tvjad5x7.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20181218174716.96822.qmail@mail.muc.de> (message from Alan Mackenzie on 18 Dec 2018 17:47:16 -0000) References: <20181218174716.96822.qmail@mail.muc.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: 18 Dec 2018 17:47:16 -0000 > From: Alan Mackenzie > Cc: 33784@debbugs.gnu.org > > Incidentally, the temporary buffer created by with-temp-buffer never has > font-lock-mode enabled, and font-lock-mode is spiked so that it cannot > be enabled in such a buffer. I don't know why. Attempting to enable it > fails silently, which is probably another bug. It's not a bug, since the temporary buffer starts in Fundamental mode. From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 19:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.15451596771004 (code B ref 33784); Tue, 18 Dec 2018 19:02:01 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 19:01:17 +0000 Received: from localhost ([127.0.0.1]:53709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZKcH-0000G7-3O for submit@debbugs.gnu.org; Tue, 18 Dec 2018 14:01:17 -0500 Received: from colin.muc.de ([193.149.48.1]:17959 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gZKcE-0000Fz-Rl for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 14:01:15 -0500 Received: (qmail 30660 invoked by uid 3782); 18 Dec 2018 19:01:13 -0000 Received: from acm.muc.de (p2E5D5B55.dip0.t-ipconnect.de [46.93.91.85]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 18 Dec 2018 20:01:12 +0100 Received: (qmail 12962 invoked by uid 1000); 18 Dec 2018 18:55:05 -0000 Date: Tue, 18 Dec 2018 18:55:05 +0000 Message-ID: <20181218185505.GC8949@ACM> References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83tvjad5x7.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Tue, Dec 18, 2018 at 20:51:48 +0200, Eli Zaretskii wrote: > > Date: 18 Dec 2018 17:47:16 -0000 > > From: Alan Mackenzie > > Cc: 33784@debbugs.gnu.org > > Incidentally, the temporary buffer created by with-temp-buffer never has > > font-lock-mode enabled, and font-lock-mode is spiked so that it cannot > > be enabled in such a buffer. I don't know why. Attempting to enable it > > fails silently, which is probably another bug. > It's not a bug, since the temporary buffer starts in Fundamental mode. If fails silently even after M-: c++-mode in that buffer. The current strategy is silently to ignore (font-lock-mode) when the buffer name begins with a space. It feels to me like an easy to implement, but suboptimal, workaround to a real problem, whatever that real problem might be. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.15451610283020 (code B ref 33784); Tue, 18 Dec 2018 19:24:02 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 19:23:48 +0000 Received: from localhost ([127.0.0.1]:53722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZKy4-0000me-K1 for submit@debbugs.gnu.org; Tue, 18 Dec 2018 14:23:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZKy3-0000mS-R9 for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 14:23:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZKxy-0004TA-0y for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 14:23:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZKxx-0004SJ-Rb; Tue, 18 Dec 2018 14:23:41 -0500 Received: from [176.228.60.248] (port=2466 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gZKxw-0002k7-Ew; Tue, 18 Dec 2018 14:23:41 -0500 Date: Tue, 18 Dec 2018 21:23:45 +0200 Message-Id: <83r2eed4fy.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20181218185505.GC8949@ACM> (message from Alan Mackenzie on Tue, 18 Dec 2018 18:55:05 +0000) References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> <20181218185505.GC8949@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Tue, 18 Dec 2018 18:55:05 +0000 > Cc: linux.xhyang@gmail.com, 33784@debbugs.gnu.org > From: Alan Mackenzie > > The current strategy is silently to ignore (font-lock-mode) when the > buffer name begins with a space. It feels to me like an easy to > implement, but suboptimal, workaround to a real problem, whatever that > real problem might be. The real problem is probably performance. But that's a guess; someone will have to do the forensics to find out which change did that, and then try to find related bug reports and/or discussions. From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 21:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.154516747913288 (code B ref 33784); Tue, 18 Dec 2018 21:12:01 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 21:11:19 +0000 Received: from localhost ([127.0.0.1]:53770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZMe7-0003SG-C4 for submit@debbugs.gnu.org; Tue, 18 Dec 2018 16:11:19 -0500 Received: from colin.muc.de ([193.149.48.1]:20186 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gZMe6-0003S7-8y for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 16:11:19 -0500 Received: (qmail 74297 invoked by uid 3782); 18 Dec 2018 21:11:15 -0000 Received: from acm.muc.de (p2E5D5B55.dip0.t-ipconnect.de [46.93.91.85]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 18 Dec 2018 22:11:15 +0100 Received: (qmail 13602 invoked by uid 1000); 18 Dec 2018 21:05:07 -0000 Date: Tue, 18 Dec 2018 21:05:07 +0000 Message-ID: <20181218210507.GD8949@ACM> References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> <20181218185505.GC8949@ACM> <83r2eed4fy.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83r2eed4fy.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Tue, Dec 18, 2018 at 21:23:45 +0200, Eli Zaretskii wrote: > > Date: Tue, 18 Dec 2018 18:55:05 +0000 > > Cc: linux.xhyang@gmail.com, 33784@debbugs.gnu.org > > From: Alan Mackenzie > > The current strategy is silently to ignore (font-lock-mode) when the > > buffer name begins with a space. It feels to me like an easy to > > implement, but suboptimal, workaround to a real problem, whatever that > > real problem might be. > The real problem is probably performance. But that's a guess; someone > will have to do the forensics to find out which change did that, and > then try to find related bug reports and/or discussions. Hah! The change, not to fontify buffers with names beginning with spaces, was made by Simon Marshall on 1995-12-09. The list archives only go back to 2000. :-( I suspect what happened was that back last millenium, there was a strong convention for what a buffer with a name beginning with a space meant, and it was perfectly OK then not to fontify such a buffer. Over time, that convention became diluted such that even buffers created by users (e.g. by with-temp-buffer) get names starting with a space. But that's only a guess. Maybe the solution would be not to start with-temp-buffer names with a space. Indeed page "Buffer Names" in Elisp states "Buffers that are ephemeral and generally uninteresting to the user have names starting with a space", which is ambiguous - does a buffer have to be both ephemeral and generally uninteresting, or will one of these properties do? Probably the latter. Maybe the documentation for with-temp-buffer should be amended to recommend Lisp programmers not to use it for buffers holding user text. Or something like that. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 18 Dec 2018 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: Eli Zaretskii , 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.154517073826545 (code B ref 33784); Tue, 18 Dec 2018 22:06:01 +0000 Received: (at 33784) by debbugs.gnu.org; 18 Dec 2018 22:05:38 +0000 Received: from localhost ([127.0.0.1]:53820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZNUg-0006u5-FD for submit@debbugs.gnu.org; Tue, 18 Dec 2018 17:05:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZNUe-0006to-Ob for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 17:05:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZNUX-0005lV-Lk for 33784@debbugs.gnu.org; Tue, 18 Dec 2018 17:05:30 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZNUQ-0005fa-Hj; Tue, 18 Dec 2018 17:05:25 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gZNUQ-000646-9O; Tue, 18 Dec 2018 17:05:22 -0500 From: Glenn Morris References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> <20181218185505.GC8949@ACM> <83r2eed4fy.fsf@gnu.org> <20181218210507.GD8949@ACM> X-Spook: CESID WHO Flood Lon Horiuchi oil MARTA Blister agent X-Ran: u?WZ$_6:xn$lgt?|e@[NDhR7DLl5CdC\;S=7HyS( (Alan Mackenzie's message of "Tue, 18 Dec 2018 21:05:07 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Maybe the solution would be not to start with-temp-buffer names with a > space. This sounds totally wrong to me. > Maybe the documentation for with-temp-buffer should be amended to > recommend Lisp programmers not to use it for buffers holding user text. This also sounds wrong to me. I confess I have no idea what problem you are trying to solve here. From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 19 Dec 2018 15:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.15452329224683 (code B ref 33784); Wed, 19 Dec 2018 15:23:02 +0000 Received: (at 33784) by debbugs.gnu.org; 19 Dec 2018 15:22:02 +0000 Received: from localhost ([127.0.0.1]:54969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZdfe-0001DH-4s for submit@debbugs.gnu.org; Wed, 19 Dec 2018 10:22:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZdfd-0001D0-02 for 33784@debbugs.gnu.org; Wed, 19 Dec 2018 10:22:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZdfT-0005b6-Kx for 33784@debbugs.gnu.org; Wed, 19 Dec 2018 10:21:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZdfR-0005a6-Ph; Wed, 19 Dec 2018 10:21:50 -0500 Received: from [176.228.60.248] (port=4694 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gZdfQ-0007T9-SJ; Wed, 19 Dec 2018 10:21:49 -0500 Date: Wed, 19 Dec 2018 17:22:00 +0200 Message-Id: <83k1k5czjb.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20181218210507.GD8949@ACM> (message from Alan Mackenzie on Tue, 18 Dec 2018 21:05:07 +0000) References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> <20181218185505.GC8949@ACM> <83r2eed4fy.fsf@gnu.org> <20181218210507.GD8949@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Tue, 18 Dec 2018 21:05:07 +0000 > Cc: linux.xhyang@gmail.com, 33784@debbugs.gnu.org > From: Alan Mackenzie > > > The real problem is probably performance. But that's a guess; someone > > will have to do the forensics to find out which change did that, and > > then try to find related bug reports and/or discussions. > > Hah! The change, not to fontify buffers with names beginning with > spaces, was made by Simon Marshall on 1995-12-09. The list archives only > go back to 2000. :-( Maybe we should simply remove that limitation. Most temporary buffers are in Fundamental mode anyway, and a few that aren't should support font-lock. If they are rarely or never displayed, we should be fine. > Maybe the documentation for with-temp-buffer should be amended to > recommend Lisp programmers not to use it for buffers holding user text. I believe this is a limitation that is unjustifiably harsh. From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 19 Dec 2018 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Glenn Morris Cc: Eli Zaretskii , 33784@debbugs.gnu.org, linux.xhyang@gmail.com Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.15452475884234 (code B ref 33784); Wed, 19 Dec 2018 19:27:01 +0000 Received: (at 33784) by debbugs.gnu.org; 19 Dec 2018 19:26:28 +0000 Received: from localhost ([127.0.0.1]:55099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZhUC-00016D-32 for submit@debbugs.gnu.org; Wed, 19 Dec 2018 14:26:28 -0500 Received: from colin.muc.de ([193.149.48.1]:58510 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gZhUA-000164-Cc for 33784@debbugs.gnu.org; Wed, 19 Dec 2018 14:26:27 -0500 Received: (qmail 63762 invoked by uid 3782); 19 Dec 2018 19:26:24 -0000 Received: from acm.muc.de (p2E5D5B90.dip0.t-ipconnect.de [46.93.91.144]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 19 Dec 2018 20:26:23 +0100 Received: (qmail 5184 invoked by uid 1000); 19 Dec 2018 19:20:08 -0000 Date: Wed, 19 Dec 2018 19:20:08 +0000 Message-ID: <20181219192008.GA5683@ACM> References: <20181218174716.96822.qmail@mail.muc.de> <83tvjad5x7.fsf@gnu.org> <20181218185505.GC8949@ACM> <83r2eed4fy.fsf@gnu.org> <20181218210507.GD8949@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Glenn. On Tue, Dec 18, 2018 at 17:05:22 -0500, Glenn Morris wrote: > > Maybe the solution would be not to start with-temp-buffer names with > > a space. > This sounds totally wrong to me. > > Maybe the documentation for with-temp-buffer should be amended to > > recommend Lisp programmers not to use it for buffers holding user > > text. > This also sounds wrong to me. > I confess I have no idea what problem you are trying to solve here. I have lost the clear overview I had of the problem yesterday, I'm afraid. There is an assemblage of confusing features around this bug which seem to be contributing to the reported bug: (i) A temporary buffer is created and made a C++ Mode buffer. (ii) Font Lock Mode isn't enabled. (iii) Although font lock isn't enabled, font-lock-ensure is called. This hangs. (iv) An attempt to enable Font Lock Mode on this buffer fails silently, because the buffer name begins with a space. (v) It is unclear whether font-lock-ensure is intended to work when Font Lock Mode is disabled. (vi) The spiking of Font Lock Mode to fail on "space buffers" is not documented, and 23 years later, the reason for it is obscure. Hope that helps, if only a little. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 12:14:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33784: References: In-Reply-To: Resent-From: xh yang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 20 Dec 2018 07:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33784 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: 33784@debbugs.gnu.org Received: via spool by 33784-submit@debbugs.gnu.org id=B33784.154529034818658 (code B ref 33784); Thu, 20 Dec 2018 07:20:01 +0000 Received: (at 33784) by debbugs.gnu.org; 20 Dec 2018 07:19:08 +0000 Received: from localhost ([127.0.0.1]:55374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZsbr-0004qs-NR for submit@debbugs.gnu.org; Thu, 20 Dec 2018 02:19:07 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]:45385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZsbp-0004qJ-S0 for 33784@debbugs.gnu.org; Thu, 20 Dec 2018 02:19:06 -0500 Received: by mail-qt1-f177.google.com with SMTP id e5so719211qtr.12 for <33784@debbugs.gnu.org>; Wed, 19 Dec 2018 23:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xiEzRhb8JlWvf3bWiLdwdUwS5FFKrDSqZKGjcEeK1JQ=; b=T437l/k/cGY62r7bWPP+At06PFAKq6Vi/2ho5+dwp1eEfdQTCPP6EVtFxszz0ln6V7 LcQ+Dlld45uTmoPbl3res9oHKK+rbuI6Gf/bW0WTh4GmSPz2pSb+Jdu0aWvb3dYumEdK jV9v8HM/40c6QPW+doboJlbeImsgR1MJYrTA1RdLWz8sYWVUVnfr6k8EEsUGRw2BNC2a UiOosZDnmMiBb+LZ1vOtdPXCjLyp/TKWk0x24ffT3xWif9hYgppmrpau0P1Klh6dAkN7 0LjvA4NUnPt3P7SdXshnsqH0dg45szbMPu3FWYrdPEvI6bXK08t/zvyRDrlc8ZW5TGjF UQUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xiEzRhb8JlWvf3bWiLdwdUwS5FFKrDSqZKGjcEeK1JQ=; b=l2k4ML0Iw9JeWGlHGGSKJt7tKuOsvsB5JN3Cosgt7vMcPeU5Ftxam9HkvVbdyFpDPX 3isb9xK1oaqEBo5qk9xK3lvZKYOHXzHCcQJr8cE/zMWNmpbKglbYfzwGLsTTID6hOifr 6zMZM+vygEyCR05rtCjHXdQkN71/hUnQzt4oA118vGHUpzS/DOx9v7i/YbjdQF1H/PhB i10HVSRmbij4H/dYxwR3ugR1am9WyiJeON/ipfo+GYDKWfFWNjKaKaHqTiQRBs3qmHN5 AB2Ss5ok8n+xSN7aAKMgyE10thyohNiRUdKLD84DtSPZsys5YixzwfC7YmM+pN5sILI8 sUbQ== X-Gm-Message-State: AA+aEWaME/T/D4HLKkTi2bFKq81ak43a185Bweh+LhnIRAHNWG23Vfa4 Bwe95/Av/hiZlzD31IK37hptAK/AIISsfF158/e8E0VfxcpEzQ== X-Google-Smtp-Source: AFSGD/W6vPC+2t9CX3twGqrxcl23JUim1KCJCP8C6SmTBGVgUH6Kqhj+7fmDhv+n0s+DySad+GhNH0nBrhOHV42ZOkM= X-Received: by 2002:ac8:3f5c:: with SMTP id w28mr24824305qtk.151.1545290340157; Wed, 19 Dec 2018 23:19:00 -0800 (PST) MIME-Version: 1.0 From: xh yang Date: Thu, 20 Dec 2018 15:18:49 +0800 Message-ID: Content-Type: multipart/alternative; boundary="000000000000cccdce057d6ef10f" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I found if remove first '\n' from the *str,then run emacs will not hang.* *May be it has nothing to do with font-lock, just str parsing ?* (let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (linux.xhyang[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.160.177 listed in list.dnswl.org] 0.0 HTML_MESSAGE BODY: HTML included in message 2.0 BLANK_SUBJECT Subject is present but empty X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --000000000000cccdce057d6ef10f Content-Type: text/plain; charset="UTF-8" I found if remove first '\n' from the *str,then run emacs will not hang.* *May be it has nothing to do with font-lock, just str parsing ?* (let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n change to (let ((str "#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n --000000000000cccdce057d6ef10f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I found if remove first '\n' from the str,= then run emacs will not hang.
May be it has nothing to do = with font-lock, just str parsing ?

<=
span style=3D"color:rgb(0,0,0)">(let ((str "#define SLOGE(...)<=
font color=3D"#ff0000">\n
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n=

change to=C2=A0
(let ((str "#defi= ne SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERR= OR, LOG_TAG,\n

--000000000000cccdce057d6ef10f-- From unknown Sat Jun 21 12:14:17 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: xh yang Subject: bug#33784: closed (Re: bug#33784:) Message-ID: References: <20181220125326.GA4404@ACM> X-Gnu-PR-Message: they-closed 33784 X-Gnu-PR-Package: emacs,cc-mode Reply-To: 33784@debbugs.gnu.org Date: Thu, 20 Dec 2018 13:00:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1545310802-2819-1" This is a multi-part message in MIME format... ------------=_1545310802-2819-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #33784: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang which was filed against the emacs,cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 33784@debbugs.gnu.org. --=20 33784: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D33784 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1545310802-2819-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 33784-done) by debbugs.gnu.org; 20 Dec 2018 12:59:56 +0000 Received: from localhost ([127.0.0.1]:55576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZxvg-0000io-I1 for submit@debbugs.gnu.org; Thu, 20 Dec 2018 07:59:56 -0500 Received: from colin.muc.de ([193.149.48.1]:20847 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gZxve-0000ie-7W for 33784-done@debbugs.gnu.org; Thu, 20 Dec 2018 07:59:54 -0500 Received: (qmail 74870 invoked by uid 3782); 20 Dec 2018 12:59:52 -0000 Received: from acm.muc.de (p2E5D57C9.dip0.t-ipconnect.de [46.93.87.201]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 20 Dec 2018 13:59:52 +0100 Received: (qmail 4425 invoked by uid 1000); 20 Dec 2018 12:53:26 -0000 Date: Thu, 20 Dec 2018 12:53:26 +0000 To: xh yang Subject: Re: bug#33784: Message-ID: <20181220125326.GA4404@ACM> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33784-done Cc: 33784-done@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, xh. On Thu, Dec 20, 2018 at 15:18:49 +0800, xh yang wrote: > I found if remove first '\n' from the *str,then run emacs will not hang.* > *May be it has nothing to do with font-lock, just str parsing ?* Sorry for all the distraction in the last couple of days. As you suggested in your opening post, the problem was a simple infinite loop involving c-backward-token-2. This was in CC Mode's font-locking code. I've committed a fix to the emacs-26 branch, and it should find its way to the master branch within a few days. I'm closing the bug. Here is the patch: # HG changeset patch # User Alan Mackenzie # Date 1545307557 0 # Thu Dec 20 12:05:57 2018 +0000 # Node ID 5319aa054ccb77924e19b836093c9e1b3ff91d4b # Parent a3f28b92890acc5289cde497ea1335f4b39239d7 Check result from c-backward-token-2 to avoid infinite loop This fixes bug #33784. * cc-fonts.el (c-get-fontification-context): While moving back over enclosing parentheses, check that c-backward-token-2 actually moves. diff -r a3f28b92890a -r 5319aa054ccb cc-fonts.el --- a/cc-fonts.el Thu Dec 20 12:04:53 2018 +0000 +++ b/cc-fonts.el Thu Dec 20 12:05:57 2018 +0000 @@ -1255,8 +1255,8 @@ (save-excursion (goto-char match-pos) (while - (progn (c-backward-token-2) - (eq (char-after) ?\())) + (and (zerop (c-backward-token-2)) + (eq (char-after) ?\())) (looking-at c-arithmetic-op-regexp))) (cons nil nil)) ;; In a C++ member initialization list. Thanks, once more, for the bug report. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1545310802-2819-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Dec 2018 04:43:31 +0000 Received: from localhost ([127.0.0.1]:52464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ7EA-0004kO-UA for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:43:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ6o1-00046p-2I for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ6nu-0005i3-45 for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZ6ns-0005gP-AD for submit@debbugs.gnu.org; Mon, 17 Dec 2018 23:16:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ6np-0003vV-W7 for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:16:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ6h7-00006u-A8 for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:09:22 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:43633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ6h7-00006X-4N for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 23:09:21 -0500 Received: by mail-qt1-x843.google.com with SMTP id i7so16730837qtj.10 for ; Mon, 17 Dec 2018 20:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=KSHpfP2/0bkoUw1rGknGbL3t1ErPWi6bM9gEouZeH0A=; b=LISIH47aaJhPUQ0J1iOZzW6tqDQe2/mv8OF1t/CfBVE4kHq4Z6QkaQhyEETtvy59WX eHu9yiRR9vO36woLcGPD34fptGHnxO365gyND68+5gb3fPOTAo8wgCnSScNmbmgMEZ7r 6Fsj0OSgU7it8gUsHjoqLmxaq6lgleuk6R73DJcmMPS9SFVK3Fr0mmzZvmLox4aDpcTy uXH6j7CxNWqr9IxaL352oLR685ScWOcREzntXaCQGUrVDTp/NhK+mLdZsxrrfwUWVicM 1lLcV8Q+NWfC6yCyAmaPa5LtRuZ4qGObtfhD+zlmH9E551+ULeHAY7MA2A7TJ/6rJ6fT llTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KSHpfP2/0bkoUw1rGknGbL3t1ErPWi6bM9gEouZeH0A=; b=Q3tvMaf9IjaHcYdO9DB/Xn1M5GM3gChmE87qrsWDg/9jz/FH5/9+CDHjjtRAkLDbL+ 18Qy5BZL6Z67zpBVQwdspa0pY7e0InjZDae9Zm3usV74OvDGkfDqvGqhctwB9gtSFJGS Free3Pvxpihhj/K/2/XLKOwze7u+fY705QW17jYlEmYr806f1nE+0Yb3tgYMOIPuudRh j3L045a4T7W9c1OdsiLbekurVlW5C4G1v6UNcDKguJZvx49xQEU5qVP5G53xVP6oqbbJ nJ2qfrokDUSJGQTYMvRTt96yIXWJ0kxQZ/HLAKrOuPqJ5gDbRazjmURYgFC3CZM4VEwe hGuA== X-Gm-Message-State: AA+aEWYW9vFsrMsF7AaSJK61eFGi9pClJTHfsLOWSJnuxe8s/4iSDmd7 L/KuqdK89rk93kyG72PWDRlBEnP5sRXvJ7RHlBsBeKcvSXsWoQ== X-Google-Smtp-Source: AFSGD/UNMCQkQ6SGkIN/40OYIAPbH6T/MgeohLWUsdmP7pz0bH+1iA9mY+99wVLgqkyF6E/aGCfYJA9Y3vAh98uZL3Y= X-Received: by 2002:a0c:a4a3:: with SMTP id x32mr15532187qvx.89.1545106160254; Mon, 17 Dec 2018 20:09:20 -0800 (PST) MIME-Version: 1.0 From: xh yang Date: Tue, 18 Dec 2018 12:09:01 +0800 Message-ID: Subject: 27.0.50; some case c-backward-token-2 takes cpu more and emacs hang To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000d285c8057d440f01" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 17 Dec 2018 23:43:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --000000000000d285c8057d440f01 Content-Type: text/plain; charset="UTF-8" follow case: (let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n __VA_ARGS__))")) (with-temp-buffer (delay-mode-hooks (funcall 'c++-mode)) (insert str) (font-lock-ensure) (buffer-string) ) ) execute up code, emacs will hang In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2018-12-18 built on xhyang-ThinkPad-T470p Repository revision: 1691a51094d35ac4b2c311fa407c6b77eea7a105 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 16.04.3 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set #("#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))" 0 1 (c-is-sws t c-in-sws t) 1 7 (c-in-sws t) 7 8 (c-in-sws t) 8 13 (c-in-sws t) 13 19 (c-in-sws t) 19 21 (c-in-sws t c-is-sws t) 21 22 (c-is-sws t)) next-line: End of buffer Configured using: 'configure --enable-link-time-optimization --without-pop --without-kerberos --without-kerberos5 --without-hesiod --with-sound=alsa --with-x-toolkit=gtk3 --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-xml2 --with-imagemagick --with-xft --without-libotf --without-xim --with-xaw3d --with-dbus --without-gconf --without-gsettings --without-selinux --with-gnutls --with-zlib --with-modules --with-file-notification=inotify --without-makeinfo --with-x --exec-prefix=/usr/' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LCMS2 GMP Important settings: value of $LC_MONETARY: zh_CN.UTF-8 value of $LC_NUMERIC: zh_CN.UTF-8 value of $LC_TIME: zh_CN.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs time-date 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 elec-pair mule-util 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 menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer 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 font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 114827 9593) (symbols 48 22507 1) (strings 32 34433 2178) (string-bytes 1 1049070) (vectors 16 16742) (vector-slots 8 532827 13806) (floats 8 49 68) (intervals 56 261 1) (buffers 992 11) (heap 1024 38686 1099)) --000000000000d285c8057d440f01 Content-Type: text/html; charset="UTF-8"


follow case:

(let ((str "#define SLOGE(...)\n ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,\n __VA_ARGS__))"))
(with-temp-buffer
(delay-mode-hooks (funcall 'c++-mode))
(insert str)
(font-lock-ensure)
(buffer-string)
)
)

execute up code, emacs will hang


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2018-12-18 built on xhyang-ThinkPad-T470p
Repository revision: 1691a51094d35ac4b2c311fa407c6b77eea7a105
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 16.04.3 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
#("#define SLOGE(...)
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG,
__VA_ARGS__))" 0 1 (c-is-sws t c-in-sws t) 1 7 (c-in-sws t) 7 8 (c-in-sws t) 8 13 (c-in-sws t) 13 19 (c-in-sws t) 19 21 (c-in-sws t c-is-sws t) 21 22 (c-is-sws t))
next-line: End of buffer

Configured using:
'configure --enable-link-time-optimization --without-pop
--without-kerberos --without-kerberos5 --without-hesiod
--with-sound=alsa --with-x-toolkit=gtk3 --with-xpm --with-jpeg
--with-tiff --with-gif --with-png --with-rsvg --with-xml2
--with-imagemagick --with-xft --without-libotf --without-xim
--with-xaw3d --with-dbus --without-gconf --without-gsettings
--without-selinux --with-gnutls --with-zlib --with-modules
--with-file-notification=inotify --without-makeinfo --with-x
--exec-prefix=/usr/'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GLIB NOTIFY
INOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS LCMS2 GMP

Important settings:
value of $LC_MONETARY: zh_CN.UTF-8
value of $LC_NUMERIC: zh_CN.UTF-8
value of $LC_TIME: zh_CN.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=fcitx
locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
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

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs time-date 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 elec-pair mule-util 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 menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer 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
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 114827 9593)
(symbols 48 22507 1)
(strings 32 34433 2178)
(string-bytes 1 1049070)
(vectors 16 16742)
(vector-slots 8 532827 13806)
(floats 8 49 68)
(intervals 56 261 1)
(buffers 992 11)
(heap 1024 38686 1099))

--000000000000d285c8057d440f01-- ------------=_1545310802-2819-1--