Browse Source

New function `org-insert-drawer'.

* org.el (org-insert-drawer): New function.
(org-insert-property-drawer): Use it.

Thanks to Olaf Dietsche for this patch.
Bastien Guerry 7 years ago
parent
commit
cf3e3e39f9
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lisp/org.el

+ 6 - 1
lisp/org.el

@@ -14400,6 +14400,11 @@ formats in the current buffer."
 (defun org-insert-property-drawer ()
   "Insert a property drawer into the current entry."
   (interactive)
+  (org-insert-drawer "PROPERTIES"))
+
+(defun org-insert-drawer (drawer)
+  "Insert a drawer into the current entry."
+  (interactive "sDrawer: ")
   (org-back-to-heading t)
   (looking-at org-outline-regexp)
   (let ((indent (if org-adapt-indentation
@@ -14425,7 +14430,7 @@ formats in the current buffer."
     (org-skip-over-state-notes)
     (skip-chars-backward " \t\n\r")
     (if (eq (char-before) ?*) (forward-char 1))
-    (let ((inhibit-read-only t)) (insert "\n:PROPERTIES:\n:END:"))
+    (let ((inhibit-read-only t)) (insert "\n:" drawer ":\n:END:"))
     (beginning-of-line 0)
     (org-indent-to-column indent)
     (beginning-of-line 2)