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.
This commit is contained in:
David Maus 2012-02-08 20:09:48 +01:00
parent a561b3b77e
commit c9a510cf8e
2 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -19335,6 +19335,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)) ?#))