Re: Flyspell process called frequently when using Org export (was: Flyspell causes severe slowdown when manipulating footnotes)

2024-05-11 Thread Ihor Radchenko
Ihor Radchenko  writes:

>>   A new Ispell process started on export.
> ...
> Confirmed.
> This is because `org-html-final-function' uses `mhtml-mode' to indent the
> resulting html file. `mhtml-mode' unconditionally runs `prog-mode-hook'
> thus starting Ispell.
>
> We may try `delay-mode-hooks' around `set-auto-mode', but it is not
> honoured by `mhtml-mode'. I guess we can report this as Emacs bug.

Fixed, on main.
The fix will only work in Emacs 30+, because it requires Emacs bug fix
described in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70671
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e36a4fe20

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Flyspell process called frequently when using Org export (was: Flyspell causes severe slowdown when manipulating footnotes)

2022-12-12 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Upon further investigation, Org frequently starts and kills the
> spellchecker when the document contains `LocalWords' comments.
>
> 1. Start Emacs
>
>emacs -Q
>
> 2. Configure Flyspell
>
>(add-hook 'text-mode-hook #'flyspell-mode)
>(add-hook 'prog-mode-hook #'flyspell-prog-mode)
>
> 3. Create a new Org file
>
># LocalWords: xyz
>
>Hello there!
>
> 4. Export the file to HTML
>
> Expected:
>
>   No Ispell process started on export.
>
> Actual:
>
>   A new Ispell process started on export.

Confirmed.
This is because `org-html-final-function' uses `mhtml-mode' to indent the
resulting html file. `mhtml-mode' unconditionally runs `prog-mode-hook'
thus starting Ispell.

We may try `delay-mode-hooks' around `set-auto-mode', but it is not
honoured by `mhtml-mode'. I guess we can report this as Emacs bug.

> P.S. I also see Org starting Ispell over and over when holding down
> `C-v' in a long document that contains lots of scattered `LocalWords'
> comments.

This sounds like a normal Ispell behaviour.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Flyspell process called frequently when using Org export (was: Flyspell causes severe slowdown when manipulating footnotes)

2022-12-11 Thread Rudolf Adamkovič
Ihor Radchenko  writes:

> Rudolf Adamkovič  writes:
>
>> Unrelated to the footnotes mentioned above
>
> Note how I change the email subject to mark a new topic.
> In Emacs, it is M-x message-change-subject

TIL!  Thank you.

> I am unable to reproduce using the latest Org.

I apologize for not providing a sequence of reproduction steps.

Upon further investigation, Org frequently starts and kills the
spellchecker when the document contains `LocalWords' comments.

1. Start Emacs

   emacs -Q

2. Configure Flyspell

   (add-hook 'text-mode-hook #'flyspell-mode)
   (add-hook 'prog-mode-hook #'flyspell-prog-mode)

3. Create a new Org file

   # LocalWords: xyz
   
   Hello there!

4. Export the file to HTML

Expected:

  No Ispell process started on export.

Actual:

  A new Ispell process started on export.

P.S. I also see Org starting Ispell over and over when holding down
`C-v' in a long document that contains lots of scattered `LocalWords'
comments.

Rudy
-- 
"The whole science is nothing more than a refinement of everyday
thinking."
-- Albert Einstein, 1879-1955

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Flyspell process called frequently when using Org export (was: Flyspell causes severe slowdown when manipulating footnotes)

2022-12-11 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> Unrelated to the footnotes mentioned above

Note how I change the email subject to mark a new topic.
In Emacs, it is M-x message-change-subject

> ... , but I noticed that Org
> starts and kills Ispell all the time.  I see the following messages
> repeated over and over when working with Org:
>
>   Starting new Ispell process aspell with american dictionary...done
>   ...
>   Ispell process killed
>
> For the sake of experiment, I have just tried to export (to HTML) a
> subtree that contains nothing in it but a single BibTeX source block.
> Sure enough, Org started and killed a new Ispell process!
>
> P.S. I use Flyspell with the following (standard) configuration:
>
>   (add-hook 'after-init-hook
> (lambda ()
>   (add-hook 'text-mode-hook #'flyspell-mode)
>   (add-hook 'prog-mode-hook #'flyspell-prog-mode)))

I am unable to reproduce using the latest Org.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at