mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 01:02:52 +00:00
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:
parent
a561b3b77e
commit
c9a510cf8e
|
@ -1763,17 +1763,6 @@ buffer and update it."
|
||||||
(org-combine-plists org-clock-clocktable-default-properties props))))
|
(org-combine-plists org-clock-clocktable-default-properties props))))
|
||||||
(org-update-dblock))
|
(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)
|
(defun org-day-of-week (day month year)
|
||||||
"Returns the day of the week as an integer."
|
"Returns the day of the week as an integer."
|
||||||
(nth 6
|
(nth 6
|
||||||
|
|
11
lisp/org.el
11
lisp/org.el
|
@ -19335,6 +19335,17 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
|
||||||
(eval form)
|
(eval form)
|
||||||
(error (format "%%![Error: %s]" error))))
|
(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 ()
|
(defun org-in-commented-line ()
|
||||||
"Is point in a line starting with `#'?"
|
"Is point in a line starting with `#'?"
|
||||||
(equal (char-after (point-at-bol)) ?#))
|
(equal (char-after (point-at-bol)) ?#))
|
||||||
|
|
Loading…
Reference in a new issue