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.

Full log


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))))




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.