all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#33416: GUI (X) Emacs 26.1 locks up when '(' character is entered into a comment in (C/*l Abbrev) mode
@ 2018-11-17 22:04 James Vaughan
       [not found] ` <mailman.4183.1542493624.1284.bug-gnu-emacs@gnu.org>
  0 siblings, 1 reply; 3+ messages in thread
From: James Vaughan @ 2018-11-17 22:04 UTC (permalink / raw)
  To: 33416

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

Reproduction
These are the precise steps I took, using this code
<https://gitlab.com/jvaughan/bpm.c> @
b6e7e4a6462644d83642ef2b1fae0a937c2fb339 :
1. With working directory in 'bpm.c/', start GUI Emacs in the background
with `emacs &`
2. Enter `C-x 3` to get vertical split, click into the right window, and
enter `C-x 2`.
3. From there, `M-x shell` to get a shell (zsh) in the bottom right corner.
4. Click into top right corner, `C-x C-f inc/parser.h`
5. Click into left half, `C-x C-f src/parser.c`
6. Append `// Continue checking if line is a comment (`.
Emacs will hang, not showing `(` or responding to clicks, commands, or GUI
interaction.
I had to `kill -9` it to get rid of it completely.
ps -a shows stat of emacs as RNl

$ uname -a
Linux workstation 4.19.1-arch1-1-ARCH #1 SMP PREEMPT Sun Nov 4 16:49:26 UTC
2018 x86_64 GNU/Linux

Thank you for looking into this.

[-- Attachment #2: Type: text/html, Size: 10466 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33416: GUI (X) Emacs 26.1 locks up when '(' character is entered into a comment in (C/*l Abbrev) mode
       [not found] ` <mailman.4183.1542493624.1284.bug-gnu-emacs@gnu.org>
@ 2018-11-19 12:30   ` Alan Mackenzie
       [not found]     ` <CAPj0kmyrn+HKW-2SKOmU_iUj5OnTuwJac4JCsa0xdo-ZJcr+fQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2018-11-19 12:30 UTC (permalink / raw)
  To: James Vaughan; +Cc: acm, 33416

Hello, James.

In article <mailman.4183.1542493624.1284.bug-gnu-emacs@gnu.org> you wrote:
> [-- text/plain, encoding 7bit, charset: UTF-8, 23 lines --]

> Reproduction
> These are the precise steps I took, using this code
> <https://gitlab.com/jvaughan/bpm.c> @
> b6e7e4a6462644d83642ef2b1fae0a937c2fb339 :
> 1. With working directory in 'bpm.c/', start GUI Emacs in the background
> with `emacs &`
> 2. Enter `C-x 3` to get vertical split, click into the right window, and
> enter `C-x 2`.
> 3. From there, `M-x shell` to get a shell (zsh) in the bottom right corner.
> 4. Click into top right corner, `C-x C-f inc/parser.h`
> 5. Click into left half, `C-x C-f src/parser.c`
> 6. Append `// Continue checking if line is a comment (`.
> Emacs will hang, not showing `(` or responding to clicks, commands, or GUI
> interaction.
> I had to `kill -9` it to get rid of it completely.
> ps -a shows stat of emacs as RNl

> $ uname -a
> Linux workstation 4.19.1-arch1-1-ARCH #1 SMP PREEMPT Sun Nov 4 16:49:26 UTC
> 2018 x86_64 GNU/Linux

> Thank you for looking into this.

Thank you for taking the trouble to report this bug.

It is triggered solely by the events in the file you are typing the
comment into, and that because the comment is right at the end of the
buffer without even a newline after it.  CC Mode was getting into a loop
because it assumed that it wasn't in a comment when in fact it was.

Would you please apply the following patch to
.../emacs/lisp/progmodes/cc-mode.el in your Emacs 26.1:


diff -r 9c8496488dda cc-mode.el
--- a/cc-mode.el	Tue Oct 30 11:17:42 2018 +0000
+++ b/cc-mode.el	Mon Nov 19 12:05:28 2018 +0000
@@ -1784,7 +1784,10 @@
 	 (c-syntactic-skip-backward "^;{}" bod-lim t)
 	 (> (point) bod-lim)
 	 (progn (c-forward-syntactic-ws)
-		(setq bo-decl (point))
+		;; Have we got stuck in a comment at EOB?
+		(not (and (eobp)
+			  (c-literal-start))))
+	 (progn (setq bo-decl (point))
 		(or (not (looking-at c-protection-key))
 		    (c-forward-keyword-clause 1)))
 	 (progn

, then byte compile the file, reload it into Emacs, and then check that
the bug has indeed been fixed.  Then, please let me know!  If you want
any help with the patching or byte compiling, feel free to send me
personal email.

Thanks once more for the bug report!

-- 
Alan Mackenzie (Nuremberg, Germany).






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33416: GUI (X) Emacs 26.1 locks up when '(' character is entered into a comment in (C/*l Abbrev) mode
       [not found]     ` <CAPj0kmyrn+HKW-2SKOmU_iUj5OnTuwJac4JCsa0xdo-ZJcr+fQ@mail.gmail.com>
@ 2018-11-24 10:39       ` Alan Mackenzie
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2018-11-24 10:39 UTC (permalink / raw)
  To: James Vaughan; +Cc: 33416-done

Hello, James.

Thanks for the testing!

I've committed the patch to the emacs-26 branch, so it should hopefully
be part of the "soon" to be released Emacs 26.2.  With this post I'm
closing the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).

On Mon, Nov 19, 2018 at 18:15:42 -0500, James Vaughan wrote:
> Hello Alan,

> Your patch does appear to have solved the problem, thank you!

> I also got to learn some things about Emacs in the process.
> Win-win situation to me ;)

> Thanks,

> James Vaughan





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-24 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-17 22:04 bug#33416: GUI (X) Emacs 26.1 locks up when '(' character is entered into a comment in (C/*l Abbrev) mode James Vaughan
     [not found] ` <mailman.4183.1542493624.1284.bug-gnu-emacs@gnu.org>
2018-11-19 12:30   ` Alan Mackenzie
     [not found]     ` <CAPj0kmyrn+HKW-2SKOmU_iUj5OnTuwJac4JCsa0xdo-ZJcr+fQ@mail.gmail.com>
2018-11-24 10:39       ` Alan Mackenzie

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.