Subject: Re: bug#74803: 31.0.50; [PATCH] Fix bug that semantic did not restore imenu-create-index-function on exiting

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Dec 2024 12:40:35 +0200

> From: Lin Sun <[email-masked]>
> Date: Wed, 11 Dec 2024 22:30:02 +0000
> 
> The semantic minor mode changed the value of imenu-create-index-function on its startup, but does not restore the original value on its exiting. 
> 
> Here are the steps to reproduce the issue:
> 
> 1. Start the emacs and open a python script, now the imenu-create-index-function will be the `python-imenu-create-index'
> 
>  $ emacs -nw -q ~/a.py   
> 
> 2. Turn-on the semantic by "M-x semantic-mode", then the  imenu-create-index-function will be the `semantic-create-imenu-index'
> 
> 3. Turn-off the semantic by "M-x semantic-mode",  imenu-create-index-function is still the semantic one.
> 
> This patch will store the original imenu-create-index-function before changing it, and restore the original value when turn-off the semantic-mode. 

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