Bläddra i källkod

Insert drawers/ planning info unindented when org-adapt-indentation is nil

Requested by Samuel Wales
Carsten Dominik 16 år sedan
förälder
incheckning
97f9817836
2 ändrade filer med 14 tillägg och 2 borttagningar
  1. 6 0
      lisp/ChangeLog
  2. 8 2
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-06-03  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-adapt-indentation): Improve documentation.
+	(org-insert-property-drawer): Respect org-adapt-indentation when
+	inserting the drawer.
+
 2009-06-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-edit-src-save): New function.

+ 8 - 2
lisp/org.el

@@ -686,7 +686,11 @@ lines to the buffer:
 When this is set and the *entire* text in an entry is indented, the
 indentation is increased by one space in a demotion command, and
 decreased by one in a promotion command.  If any line in the entry
-body starts at column 0, indentation is not changed at all."
+body starts at column 0, indentation is not changed at all.
+
+This variable also influences how property drawers and planning
+information is inserted.  When t, these lines drawers will be inserted
+indented.  When nil, they will not be indented."
   :group 'org-edit-structure
   :type 'boolean)
 
@@ -12068,7 +12072,9 @@ formats in the current buffer."
   (interactive)
   (org-back-to-heading t)
   (looking-at outline-regexp)
-  (let ((indent (- (match-end 0)(match-beginning 0)))
+  (let ((indent (if org-adapt-indentation
+		    (- (match-end 0)(match-beginning 0))
+		  0))
 	(beg (point))
 	(re (concat "^[ \t]*" org-keyword-time-regexp))
 	end hiddenp)