emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode-flyspell-verify: Why skip checking the LOGBOOK?
@ 2024-08-09 17:03 Morgan Willcock
  2024-08-10 15:02 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Morgan Willcock @ 2024-08-09 17:03 UTC (permalink / raw)
  To: emacs-orgmode

With org-log-into-drawer set to t any notes that are taken with
org-add-note go into a LOGBOOK drawer, but this also removes the
spell-checking provided by Flyspell.

It seems intentional to prevent checking the LOGBOOK (or equivalent)
when the value of org-log-into-drawer is non-nil:

  ;; Ignore checks in LOGBOOK (or equivalent) drawer.
  ((let ((log (org-log-into-drawer)))
     (and log
          (let ((drawer (org-element-lineage element 'drawer)))
            (and drawer
                 (org-string-equal-ignore-case
                  log (org-element-property :drawer-name drawer))))))
   nil)

...but why should the location of the note matter to the spell-checker?

Is there any way to re-enable spell-checking of the notes without adding
advice to org-mode-flyspell-verify to hijack the result?

Thanks,
Morgan

-- 
Morgan Willcock


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

* Re: org-mode-flyspell-verify: Why skip checking the LOGBOOK?
  2024-08-09 17:03 org-mode-flyspell-verify: Why skip checking the LOGBOOK? Morgan Willcock
@ 2024-08-10 15:02 ` Ihor Radchenko
  2024-08-10 17:19   ` Morgan Willcock
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-08-10 15:02 UTC (permalink / raw)
  To: Morgan Willcock; +Cc: emacs-orgmode

Morgan Willcock <morgan@ice9.digital> writes:

> With org-log-into-drawer set to t any notes that are taken with
> org-add-note go into a LOGBOOK drawer, but this also removes the
> spell-checking provided by Flyspell.
>
> It seems intentional to prevent checking the LOGBOOK (or equivalent)
> when the value of org-log-into-drawer is non-nil:
>
>   ;; Ignore checks in LOGBOOK (or equivalent) drawer.
>   ((let ((log (org-log-into-drawer)))
>      (and log
>           (let ((drawer (org-element-lineage element 'drawer)))
>             (and drawer
>                  (org-string-equal-ignore-case
>                   log (org-element-property :drawer-name drawer))))))
>    nil)
>
> ...but why should the location of the note matter to the spell-checker?

I am not sure about the reasoning behind disabling flyspell inside
logbook drawers. I cannot find anything meaningful in git history either.

> Is there any way to re-enable spell-checking of the notes without adding
> advice to org-mode-flyspell-verify to hijack the result?

It looks like LOGBOOK drawers should not be ignored by flyspell.
May you comment out that check locally and see how it goes?
Ideally, please check things like CLOCK and automatic todo state change
notes.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
 


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

* Re: org-mode-flyspell-verify: Why skip checking the LOGBOOK?
  2024-08-10 15:02 ` Ihor Radchenko
@ 2024-08-10 17:19   ` Morgan Willcock
  2024-08-11 15:33     ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Morgan Willcock @ 2024-08-10 17:19 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

>> Is there any way to re-enable spell-checking of the notes without adding
>> advice to org-mode-flyspell-verify to hijack the result?
>
> It looks like LOGBOOK drawers should not be ignored by flyspell.
> May you comment out that check locally and see how it goes?

I switch between computers fairly frequently and the Org versions may
not be exactly in sync.  Rather than editing the source code or
redefining the entire function, would it be acceptable to you if I use
the following advice for testing?

  (advice-add 'org-mode-flyspell-verify
              :around (lambda (orig-fun &rest args)
                        (let (org-log-into-drawer)
                          (apply orig-fun args))))

> Ideally, please check things like CLOCK and automatic todo state change
> notes.

Moving over those entries with the advice added, I cannot see any
obvious issues, although I imagine some people may see a difference if
their todo-keywords are spelled in a way that doesn't match the
dictionary being used by Flyspell, e.g. CANCELED vs. CANCELLED.

-- 
Morgan Willcock


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

* Re: org-mode-flyspell-verify: Why skip checking the LOGBOOK?
  2024-08-10 17:19   ` Morgan Willcock
@ 2024-08-11 15:33     ` Ihor Radchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-08-11 15:33 UTC (permalink / raw)
  To: Morgan Willcock; +Cc: emacs-orgmode

Morgan Willcock <morgan@ice9.digital> writes:

> I switch between computers fairly frequently and the Org versions may
> not be exactly in sync.  Rather than editing the source code or
> redefining the entire function, would it be acceptable to you if I use
> the following advice for testing?
>
>   (advice-add 'org-mode-flyspell-verify
>               :around (lambda (orig-fun &rest args)
>                         (let (org-log-into-drawer)
>                           (apply orig-fun args))))

Sure.

>> Ideally, please check things like CLOCK and automatic todo state change
>> notes.
>
> Moving over those entries with the advice added, I cannot see any
> obvious issues, although I imagine some people may see a difference if
> their todo-keywords are spelled in a way that doesn't match the
> dictionary being used by Flyspell, e.g. CANCELED vs. CANCELLED.

Those should not be a big deal - todo keywords are enclosed in
"quotation marks". No worse than any other use of special terms inside
quotes.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=86abaf6407

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-08-11 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 17:03 org-mode-flyspell-verify: Why skip checking the LOGBOOK? Morgan Willcock
2024-08-10 15:02 ` Ihor Radchenko
2024-08-10 17:19   ` Morgan Willcock
2024-08-11 15:33     ` Ihor Radchenko

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).