瀏覽代碼

Remove line/wrap-prefix properties only if org-indent-mode is on

Carsten Dominik 15 年之前
父節點
當前提交
ff6ff85966
共有 2 個文件被更改,包括 21 次插入5 次删除
  1. 6 0
      lisp/ChangeLog
  2. 15 5
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-11-06  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-indent-mode): Define variable already in org.el.
+	(org-unfontify-region): Remove line-prefix and wrap-prefix
+	properties only if org-indent-mode is active.
+
 2009-11-05  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-icalendar.el (org-print-icalendar-entries): Save match data

+ 15 - 5
lisp/org.el

@@ -3304,6 +3304,11 @@ If yes, offer to stop it and to save the buffer with the changes."
 
 ;; Autoload org-indent.el
 
+;; Define the variable already here, to make sure we have it.
+(defvar org-indent-mode nil
+  "Non-nil if Org-Indent mode is enabled.
+Use the command `org-indent-mode' to change this variable.")
+
 (eval-and-compile
   (org-autoload
    "org-indent"
@@ -4917,11 +4922,16 @@ If KWD is a number, get the corresponding match group."
 	 (inhibit-read-only t) (inhibit-point-motion-hooks t)
 	 (inhibit-modification-hooks t)
 	 deactivate-mark buffer-file-name buffer-file-truename)
-    (remove-text-properties beg end
-			    '(mouse-face t keymap t org-linked-text t
-					 invisible t intangible t
-					 line-prefix t wrap-prefix t
-					 org-no-flyspell t))))
+    (remove-text-properties
+     beg end
+     (if org-indent-mode
+	 '(mouse-face t keymap t org-linked-text t
+		      invisible t intangible t
+		      line-prefix t wrap-prefix t
+		      org-no-flyspell t)
+       '(mouse-face t keymap t org-linked-text t
+		    invisible t intangible t
+		    org-no-flyspell t)))))
 
 ;;;; Visibility cycling, including org-goto and indirect buffer