unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69740: project-mode-line-format restarts ispell process on every keystroke
@ 2024-03-12  7:53 Juri Linkov
  2024-03-13 17:42 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2024-03-12  7:53 UTC (permalink / raw)
  To: 69740; +Cc: Dmitry Gutov

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#69740: project-mode-line-format restarts ispell process on every keystroke
  2024-03-12  7:53 bug#69740: project-mode-line-format restarts ispell process on every keystroke Juri Linkov
@ 2024-03-13 17:42 ` Dmitry Gutov
  2024-03-14 17:37   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2024-03-13 17:42 UTC (permalink / raw)
  To: Juri Linkov, 69740

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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#69740: project-mode-line-format restarts ispell process on every keystroke
  2024-03-13 17:42 ` Dmitry Gutov
@ 2024-03-14 17:37   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2024-03-14 17:37 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 69740

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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-14 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-12  7:53 bug#69740: project-mode-line-format restarts ispell process on every keystroke Juri Linkov
2024-03-13 17:42 ` Dmitry Gutov
2024-03-14 17:37   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).