emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* More flyspell-overlays removed
@ 2012-07-20 20:14 Bjarte Johansen
  2012-07-28  9:27 ` Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Bjarte Johansen @ 2012-07-20 20:14 UTC (permalink / raw)
  To: emacs-orgmode

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

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

end of thread, other threads:[~2012-08-07 11:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 20:14 More flyspell-overlays removed Bjarte Johansen
2012-07-28  9:27 ` Bastien
2012-07-28 22:38   ` Bjarte Johansen
2012-07-29  8:35     ` Jeffrey Spencer
2012-07-29 14:47       ` Bjarte Johansen
2012-07-30 11:03         ` Bastien
2012-07-30 11:13           ` Jeffrey Spencer
2012-07-30 11:44           ` Bjarte Johansen
2012-07-31 13:56             ` Jeffrey Spencer
2012-07-31 15:32             ` Bastien
2012-07-31 15:38               ` Bjarte Johansen
2012-07-31 16:33                 ` Bastien
2012-07-31 15:10         ` Sebastien Vauban
2012-07-31 15:32           ` Bastien
2012-08-07  3:57             ` Jeffrey Spencer
2012-08-07  9:18               ` Bastien
2012-08-07 11:40                 ` Jeffrey Spencer

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