From c3b77995ae770e7d5f1d8b84a0d7d49dfd9d2d48 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 17 Feb 2020 16:20:47 +0100 Subject: emacs: outline all headlines when running flyspell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When calling `flyspell-check-next-highlighted-word', expand all headlines, so flyspell does not struggle with hidden text. Signed-off-by: Miquel Sabaté Solà --- .emacs.d/init.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.emacs.d/init.org b/.emacs.d/init.org index d07b784..0966663 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -796,6 +796,12 @@ Let's use == for checking words, and =M-= for moving into the next highl (defun flyspell-check-next-highlighted-word () "Custom function to spell check next highlighted word" (interactive) + + ;; If we are in org mode, unfold everything, since flyspell does not work + ;; smoothly with folded stuff. + (when (string= major-mode "org-mode") + (outline-show-all)) + (flyspell-goto-next-error) (ispell-word)) -- cgit v1.2.3