GNU bug report logs - #69740
project-mode-line-format restarts ispell process on every keystroke

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 12 Mar 2024 08:02:01 UTC

Severity: normal

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69740 in the body.
You can then email your comments to 69740 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org:
bug#69740; Package emacs. (Tue, 12 Mar 2024 08:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org. (Tue, 12 Mar 2024 08:02:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: project-mode-line-format restarts ispell process on every keystroke
Date: Tue, 12 Mar 2024 09:53:37 +0200
[related to bug#69703]

When .dir-locals.el contains:

  ((nil . ((mode . flyspell))))

here is a backtrace that illustrates the problem:

    flyspell-mode()
    set-auto-mode-0(flyspell-mode t)
    hack-one-local-variable(mode flyspell)
    hack-local-variables-apply()
    hack-dir-local-variables-non-file-buffer()
    project--value-in-dir(project-vc-name "/tmp/test/")
    project-name((vc Git "/tmp/test/"))
    project-mode-line-format()
    eval((project-mode-line-format) t)
    redisplay_internal\ \(C\ function\)()

This can be fixed by not allowing to run any mode
while reading a project name from dir-locals.

So here is a patch that fixes it:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 9622b1b6768..8578af1cde4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -808,8 +808,8 @@ project--value-in-dir
   (with-temp-buffer
     (setq default-directory dir)
     (let ((enable-local-variables :all))
-      (hack-dir-local-variables-non-file-buffer))
-    (symbol-value var)))
+      (hack-dir-local-variables))
+    (alist-get var file-local-variables-alist)))
 
 (cl-defmethod project-buffers ((project (head vc)))
   (let* ((root (expand-file-name (file-name-as-directory (project-root project))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69740; Package emacs. (Wed, 13 Mar 2024 17:44:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Juri Linkov <juri <at> linkov.net>, 69740 <at> debbugs.gnu.org
Subject: Re: bug#69740: project-mode-line-format restarts ispell process on
 every keystroke
Date: Wed, 13 Mar 2024 19:42:59 +0200
Hi Juri!

On 12/03/2024 09:53, Juri Linkov wrote:
>       (let ((enable-local-variables :all))
> -      (hack-dir-local-variables-non-file-buffer))
> -    (symbol-value var)))
> +      (hack-dir-local-variables))
> +    (alist-get var file-local-variables-alist)))

Great suggestion, please install.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69740; Package emacs. (Thu, 14 Mar 2024 17:40:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 69740 <at> debbugs.gnu.org
Subject: Re: bug#69740: project-mode-line-format restarts ispell process on
 every keystroke
Date: Thu, 14 Mar 2024 19:37:51 +0200
close 69740 30.0.50
thanks

>>       (let ((enable-local-variables :all))
>> -      (hack-dir-local-variables-non-file-buffer))
>> -    (symbol-value var)))
>> +      (hack-dir-local-variables))
>> +    (alist-get var file-local-variables-alist)))
>
> Great suggestion, please install.

Thanks for the review, now pushed.




bug marked as fixed in version 30.0.50, send any further explanations to 69740 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Thu, 14 Mar 2024 17:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Apr 2024 11:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 124 days ago.

Previous Next


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