emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] More flyspell-overlays removed


From: Bjarte Johansen
Subject: [O] More flyspell-overlays removed
Date: Fri, 20 Jul 2012 22:14:02 +0200

Hi -

I made a patch to remove some more flyspell-overlays in #-blocks. The reason 
for no : in the latex_header is that for some reason the : does not get 
captured in dc1. flyspell is also removed for the full verbatim, lstlisting and 
src blocks.

I hope you guys can use the patch.

Regards,
Bjarte

--------------------------------------------------------------------------------
diff --git a/lisp/org.el b/lisp/org.el
index 4241168..80fbdd0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5465,7 +5465,8 @@ by a #."
              (dc3 (downcase (match-string 3)))
              end end1 quoting block-type ovl)
          (cond
-          ((member dc1 '("html:" "ascii:" "latex:" "docbook:"))
+          ((member dc1 '("html:" "ascii:" "latex:" "docbook:" "startup:"
+                         "options:" "latex_header"))
            ;; a single line of backend-specific content
            (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
            (remove-text-properties (match-beginning 0) (match-end 0)
@@ -5478,6 +5479,7 @@ by a #."
            t)
           ((and (match-end 4) (equal dc3 "begin"))
            ;; Truly a block
+           (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
            (setq block-type (downcase (match-string 5))
                  quoting (member block-type org-protecting-blocks))
            (when (re-search-forward
@@ -5486,6 +5488,9 @@ by a #."
              (setq end (min (point-max) (match-end 0))
                    end1 (min (point-max) (1- (match-beginning 0))))
              (setq block-end (match-beginning 0))
+             (when (member block-type '("lstlisting" "verbatim" "src"))
+                (org-remove-flyspell-overlays-in block-start block-end))
+              (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 
0))
              (when quoting
                (remove-text-properties beg end
                                        '(display t invisible t intangible t)))
@@ -5540,6 +5545,7 @@ by a #."
                              "orgtbl:" "tblfm:" "tblname:" "results:"
                              "call:" "header:" "headers:" "name:"))
                (and (match-end 4) (equal dc3 "attr")))
+           (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
            (add-text-properties
             beg (match-end 0)
             '(font-lock-fontified t face org-meta-line))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]