瀏覽代碼

Moved `org-in-clocktable-p' from org-clock.el to org.el

* org-clock.el (org-in-clocktable-p): Moved to org.el.
* org.el (org-in-clocktable-p): New function. Moved from org-clock.el

Fixes a bug reported by suvayu ali in
<CAMXnza2W9VSJ2d-dDmsByNmTVgxnt1Onp=J5S=TsFEi8MOVNtg@mail.gmail.com>.

`org-context' depends on the function but org.el does not depend on
org-clock.el.
David Maus 13 年之前
父節點
當前提交
79105c48e2
共有 2 個文件被更改,包括 11 次插入11 次删除
  1. 0 11
      lisp/org-clock.el
  2. 11 0
      lisp/org.el

+ 0 - 11
lisp/org-clock.el

@@ -1763,17 +1763,6 @@ buffer and update it."
        (org-combine-plists org-clock-clocktable-default-properties props))))
   (org-update-dblock))
 
-(defun org-in-clocktable-p ()
-  "Check if the cursor is in a clocktable."
-  (let ((pos (point)) start)
-    (save-excursion
-      (end-of-line 1)
-      (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
-	   (setq start (match-beginning 0))
-	   (re-search-forward "^[ \t]*#\\+END:.*" nil t)
-	   (>= (match-end 0) pos)
-	   start))))
-
 (defun org-day-of-week (day month year)
   "Returns the day of the week as an integer."
   (nth 6

+ 11 - 0
lisp/org.el

@@ -19275,6 +19275,17 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
       (eval form)
     (error (format "%%![Error: %s]" error))))
 
+(defun org-in-clocktable-p ()
+  "Check if the cursor is in a clocktable."
+  (let ((pos (point)) start)
+    (save-excursion
+      (end-of-line 1)
+      (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
+	   (setq start (match-beginning 0))
+	   (re-search-forward "^[ \t]*#\\+END:.*" nil t)
+	   (>= (match-end 0) pos)
+	   start))))
+
 (defun org-in-commented-line ()
   "Is point in a line starting with `#'?"
   (equal (char-after (point-at-bol)) ?#))