[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58860: 29.0.50; [PATCH] semantic/fw.el: speed up the 'semantic-find-
From: |
Eli Zaretskii |
Subject: |
bug#58860: 29.0.50; [PATCH] semantic/fw.el: speed up the 'semantic-find-file-noselect' |
Date: |
Sat, 29 Oct 2022 09:31:01 +0300 |
> Date: Sat, 29 Oct 2022 05:01:42 +0000
> From: lin Sun via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> The emacs will be extremely slow after I first time enable the
> semantic mode and open a simple C source file which includes the
> stdio.h.
> I find the semantic mode will try to analyse the chained header files,
> by calling the function (semantic-find-file-noselect ...) to open the
> file and analyse its content, while the `find-file-hook` may have many
> heavy functions.
> Disabling the `find-file-hook` do have great performance improvement
> for semantic mode.
> Please help review this patch. Thanks
>
>
> From 7ae72df1680f405d4b8d718fb13015e002e0076d Mon Sep 17 00:00:00 2001
> From: Lin Sun <sunlin7@yahoo.com>
> Date: Sat, 29 Oct 2022 00:00:07 +0000
> Subject: [PATCH] * semantic/fw.el: speed up the 'semantic-find-file-noselect'
>
> Disabling the find-file-hook for semantic-find-file-noselect to
> improve the performance on semantic chained source file analysis.
> ---
> lisp/cedet/semantic/fw.el | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
> index 9917c4c..cf5c60b 100644
> --- a/lisp/cedet/semantic/fw.el
> +++ b/lisp/cedet/semantic/fw.el
> @@ -361,6 +361,8 @@ semantic-find-file-noselect
> (enable-local-variables :safe)
> ;; ... or eval variables
> (enable-local-eval nil)
> + ;; also disable the find-file-hook
> + (find-file-hook nil)
> )
> (save-match-data
> (find-file-noselect file nowarn rawfile wildcards))))
> --
> 2.7.0
Thanks. But I don't see how we can override customizations of users
and modes in such a brutal way. find-file-hook is an important method
of getting Emacs to do something when a file is visited, it is used
for many different things in Emacs. I find the change you propose too
drastic for my palate. We certainly risk breaking some other use
cases.
Lars, Stefan, WDYT?