瀏覽代碼

Small refactoring

* lisp/org.el (org-log-beginning):
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Small
  refactoring.
Nicolas Goaziou 10 年之前
父節點
當前提交
fe63e59faf
共有 2 個文件被更改,包括 2 次插入12 次删除
  1. 1 5
      lisp/org-agenda.el
  2. 1 7
      lisp/org.el

+ 1 - 5
lisp/org-agenda.el

@@ -9505,11 +9505,7 @@ a timestamp can be added there."
      (org-do-demote)
      (setq col (current-column))
      (insert text)
-     (forward-line)
-     (when (org-looking-at-p org-planning-line-re) (forward-line))
-     (when (looking-at org-property-drawer-re)
-       (goto-char (match-end 0))
-       (forward-line))
+     (org-end-of-meta-data)
      (unless (bolp) (insert "\n"))
      (when org-adapt-indentation (org-indent-to-column col))
      (let ((org-show-following-heading t)

+ 1 - 7
lisp/org.el

@@ -13563,13 +13563,7 @@ When optional argument CREATE is non-nil, the function creates
 a drawer to store notes, if necessary.  Returned position ignores
 narrowing."
   (org-with-wide-buffer
-   (org-back-to-heading t)
-   ;; Skip planning info and property drawer.
-   (forward-line)
-   (when (org-looking-at-p org-planning-line-re) (forward-line))
-   (when (looking-at org-property-drawer-re)
-     (goto-char (match-end 0))
-     (forward-line))
+   (org-end-of-meta-data)
    (let ((end (if (org-at-heading-p) (point)
 		(save-excursion (outline-next-heading) (point))))
 	 (drawer (org-log-into-drawer)))