GNU bug report logs - #76815
31.0.50; [PATCH] Turning off semantic-mode should apply to each buffer

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7 <at> hotmail.com>

Date: Fri, 7 Mar 2025 17:23:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 76815 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76815; Package emacs. (Fri, 07 Mar 2025 17:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lin Sun <sunlin7 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Mar 2025 17:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lin Sun <sunlin7 <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 31.0.50; [PATCH] Turning off semantic-mode should apply to each buffer
Date: Fri, 7 Mar 2025 17:22:16 +0000
[Message part 1 (text/plain, inline)]
Hi,
There is a bug that turn off semantic-mode it only restores current buffer's imenu-create-index-function but actually turning on semantic-mode had changed each buffer's variable.
Reproduce steps:
1) Open two files (eg /tmp/a.c, /tmp/b.c) in two buffers; 
2) Turn on semantic-mode, it will change the imenu-create-index-function value for each buffer;
3) Turn off semantic-mode, it will restore current buffer's value (eg: b.c), but another one (eg: a.c) won't restored.

When turning on semantic-mode, it applies changes to each buffer, 
 1048         (dolist (b (buffer-list))
 1049           (with-current-buffer b
 1050             (semantic-new-buffer-fcn))))

But turning off semantic does not restore the var for each buffer, only restores current buffer.

This patch will fix the issue. Please help review it. Thanks.
Best Regards, Lin
[0001-lisp-cedet-semantic.el-Turning-off-semantic-mode-app.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76815; Package emacs. (Sat, 10 May 2025 05:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 76815 <at> debbugs.gnu.org (full text, mbox):

From: Lin Sun <sunlin7 <at> hotmail.com>
To: "76815 <at> debbugs.gnu.org" <76815 <at> debbugs.gnu.org>, Eli Zaretskii
 <eliz <at> gnu.org>
Subject: Re: bug#76815: 31.0.50; [PATCH] Turning off semantic-mode should
 apply to each buffer)
Date: Sat, 10 May 2025 05:15:17 +0000
[Message part 1 (text/plain, inline)]
Hi Eli, Please help review the patch, thank you!

From: Lin Sun
> There is a bug that turn off semantic-mode it only restores current buffer's imenu-create-index-function but actually turning on semantic-mode had changed each buffer's variable.
> Reproduce steps:
> 1) Open two files (eg /tmp/a.c, /tmp/b.c) in two buffers;
> 2) Turn on semantic-mode, it will change the imenu-create-index-function value for each buffer;
> 3) Turn off semantic-mode, it will restore current buffer's value (eg: b.c), but another one (eg: a.c) won't restored.
>
> When turning on semantic-mode, it applies changes to each buffer,
>  1048         (dolist (b (buffer-list))
>  1049           (with-current-buffer b
>  1050             (semantic-new-buffer-fcn))))
>
> But turning off semantic does not restore the var for each buffer, only restores current buffer.
>
> This patch will fix the issue. Please help review it. Thanks.
[0001-lisp-cedet-semantic.el-Turning-off-semantic-mode-app.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76815; Package emacs. (Sat, 10 May 2025 11:22:02 GMT) Full text and rfc822 format available.

Message #11 received at 76815 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lin Sun <sunlin7 <at> hotmail.com>, Po Lu <luangruo <at> yahoo.com>
Cc: 76815 <at> debbugs.gnu.org
Subject: Re: bug#76815: 31.0.50; [PATCH] Turning off semantic-mode should
 apply to each buffer)
Date: Sat, 10 May 2025 14:21:37 +0300
> From: Lin Sun <sunlin7 <at> hotmail.com>
> Date: Sat, 10 May 2025 05:15:17 +0000
> 
> Hi Eli, Please help review the patch, thank you!
> 
> From: Lin Sun
> > There is a bug that turn off semantic-mode it only restores current buffer's imenu-create-index-function but actually turning on semantic-mode had changed each buffer's variable.
> > Reproduce steps:
> > 1) Open two files (eg /tmp/a.c, /tmp/b.c) in two buffers;
> > 2) Turn on semantic-mode, it will change the imenu-create-index-function value for each buffer;
> > 3) Turn off semantic-mode, it will restore current buffer's value (eg: b.c), but another one (eg: a.c) won't restored.
> >
> > When turning on semantic-mode, it applies changes to each buffer,
> >  1048         (dolist (b (buffer-list))
> >  1049           (with-current-buffer b
> >  1050             (semantic-new-buffer-fcn))))
> >
> > But turning off semantic does not restore the var for each buffer, only restores current buffer.
> >
> > This patch will fix the issue. Please help review it. Thanks.

It looks reasonable, but then I don't use semantic-mode.

Po Lu, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76815; Package emacs. (Sat, 24 May 2025 08:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 76815 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com
Cc: sunlin7 <at> hotmail.com, 76815 <at> debbugs.gnu.org
Subject: Re: bug#76815: 31.0.50;
 [PATCH] Turning off semantic-mode should apply to each buffer)
Date: Sat, 24 May 2025 11:56:15 +0300
Ping! Po Lu, could you please respond?

> Cc: 76815 <at> debbugs.gnu.org
> Date: Sat, 10 May 2025 14:21:37 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Lin Sun <sunlin7 <at> hotmail.com>
> > Date: Sat, 10 May 2025 05:15:17 +0000
> > 
> > Hi Eli, Please help review the patch, thank you!
> > 
> > From: Lin Sun
> > > There is a bug that turn off semantic-mode it only restores current buffer's imenu-create-index-function but actually turning on semantic-mode had changed each buffer's variable.
> > > Reproduce steps:
> > > 1) Open two files (eg /tmp/a.c, /tmp/b.c) in two buffers;
> > > 2) Turn on semantic-mode, it will change the imenu-create-index-function value for each buffer;
> > > 3) Turn off semantic-mode, it will restore current buffer's value (eg: b.c), but another one (eg: a.c) won't restored.
> > >
> > > When turning on semantic-mode, it applies changes to each buffer,
> > >  1048         (dolist (b (buffer-list))
> > >  1049           (with-current-buffer b
> > >  1050             (semantic-new-buffer-fcn))))
> > >
> > > But turning off semantic does not restore the var for each buffer, only restores current buffer.
> > >
> > > This patch will fix the issue. Please help review it. Thanks.
> 
> It looks reasonable, but then I don't use semantic-mode.
> 
> Po Lu, any comments?
> 
> 
> 
> 




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 07 Jun 2025 07:38:02 GMT) Full text and rfc822 format available.

Notification sent to Lin Sun <sunlin7 <at> hotmail.com>:
bug acknowledged by developer. (Sat, 07 Jun 2025 07:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 76815-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lin Sun <sunlin7 <at> hotmail.com>
Cc: 76815-done <at> debbugs.gnu.org
Subject: Re: bug#76815: 31.0.50; [PATCH] Turning off semantic-mode should
 apply to each buffer)
Date: Sat, 07 Jun 2025 10:37:38 +0300
> From: Lin Sun <sunlin7 <at> hotmail.com>
> Date: Sat, 10 May 2025 05:15:17 +0000
> msip_labels:
> 
> Hi Eli, Please help review the patch, thank you!
> 
> From: Lin Sun
> > There is a bug that turn off semantic-mode it only restores current buffer's imenu-create-index-function but actually turning on semantic-mode had changed each buffer's variable.
> > Reproduce steps:
> > 1) Open two files (eg /tmp/a.c, /tmp/b.c) in two buffers;
> > 2) Turn on semantic-mode, it will change the imenu-create-index-function value for each buffer;
> > 3) Turn off semantic-mode, it will restore current buffer's value (eg: b.c), but another one (eg: a.c) won't restored.
> >
> > When turning on semantic-mode, it applies changes to each buffer,
> >  1048         (dolist (b (buffer-list))
> >  1049           (with-current-buffer b
> >  1050             (semantic-new-buffer-fcn))))
> >
> > But turning off semantic does not restore the var for each buffer, only restores current buffer.
> >
> > This patch will fix the issue. Please help review it. Thanks.

Thanks, installed on the master branch, and closing the bug.




This bug report was last modified 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.