Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
d3517077
Commit
d3517077
authored
Feb 07, 2013
by
Bastien Guerry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge Org 7.9.3e (commit b07a9bb).
parent
e364bc67
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
510 additions
and
289 deletions
+510
-289
doc/misc/ChangeLog
doc/misc/ChangeLog
+7
-0
doc/misc/org.texi
doc/misc/org.texi
+15
-12
lisp/org/ChangeLog
lisp/org/ChangeLog
+117
-0
lisp/org/ob-python.el
lisp/org/ob-python.el
+4
-2
lisp/org/org-agenda.el
lisp/org/org-agenda.el
+59
-50
lisp/org/org-bibtex.el
lisp/org/org-bibtex.el
+1
-1
lisp/org/org-clock.el
lisp/org/org-clock.el
+81
-82
lisp/org/org-element.el
lisp/org/org-element.el
+73
-14
lisp/org/org-exp.el
lisp/org/org-exp.el
+2
-1
lisp/org/org-footnote.el
lisp/org/org-footnote.el
+2
-1
lisp/org/org-html.el
lisp/org/org-html.el
+10
-1
lisp/org/org-indent.el
lisp/org/org-indent.el
+61
-62
lisp/org/org-install.el
lisp/org/org-install.el
+6
-4
lisp/org/org-list.el
lisp/org/org-list.el
+3
-1
lisp/org/org-macs.el
lisp/org/org-macs.el
+1
-1
lisp/org/org-version.el
lisp/org/org-version.el
+2
-2
lisp/org/org.el
lisp/org/org.el
+66
-55
No files found.
doc/misc/ChangeLog
View file @
d3517077
2013-02-07 Bastien Guerry <bzg@gnu.org>
* org.texi (References): Clarify an example.
(Installation): Fix instructions.
(Org-Plot): Fix link.
(Checkboxes, Radio lists): Fix typos.
2013-02-06 Glenn Morris <rgm@gnu.org>
* cl.texi (Equality Predicates): Mention memql.
...
...
doc/misc/org.texi
View file @
d3517077
...
...
@@ -2,7 +2,7 @@
@c %**start of header
@setfilename ../../info/org
@settitle The Org Manual
@set VERSION 7.9.3
d
(GNU Emacs 24.3)
@set VERSION 7.9.3
e
(GNU Emacs 24.3)
@c Use proper quote and backtick for code sections in PDF output
@c Cf. Texinfo manual 14.2
...
...
@@ -903,17 +903,20 @@ $ git clone git://orgmode.org/org-mode.git
$ make autoloads
@end example
Note that @code{make autoloads} is mandatory: it defines Org's
version and
Org's autoloaded functions, respectively
in @file{org-version.el} and in
Note that
in this case,
@code{make autoloads} is mandatory: it defines Org's
version
in @file{org-version.el} and
Org's autoloads
in
@file{org-loaddefs.el}.
Remember to add the correct load-path as described in the method above.
You can also compile and install Org from this git repository: check
@code{make help} to get the list of compilation/installation options.
You can also compile with @code{make}, generate the documentation with
@code{make doc}, create a local configuration with @code{make config} and
install Org with @code{make install}. Please run @code{make help} to get
the list of compilation/installation options.
For more detailed explanations on Org's build system, please check the Org
Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html, Worg}.
Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html,
Worg}.
@node Activation, Feedback, Installation, Introduction
@section Activation
...
...
@@ -2444,7 +2447,7 @@ $1..$3 @r{first three fields in the current row}
$P..$Q @r{range, using column names (see under Advanced)}
$<<<..$>> @r{start in third column, continue to the one but last}
@@2$1..@@4$3 @r{6 fields between these two fields (same as @code{A2..C4})}
@@-1$-2..@@-1 @r{
3 number
s from
the
column
to
the left
, 2 up to current row
}
@@-1$-2..@@-1 @r{
in the first row up, 3 field
s from
2
column
s on
the left}
@@I..II @r{between first and second hline, short for @code{@@I..@@II}}
@end example
...
...
@@ -3023,9 +3026,9 @@ functions.
Org-Plot can produce 2D and 3D graphs of information stored in org tables
using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
@uref{http://
cars9.uchicago.edu/~ravel/software/g
nuplot
-m
ode
.html
}. To see
this in action, ensure
that you have both Gnuplot and Gnuplot mode installed
on your system, then
call @code{org-plot/gnuplot} on the following table.
@uref{http://
xafs.org/BruceRavel/G
nuplot
M
ode}. To see
this in action, ensure
that you have both Gnuplot and Gnuplot mode installed
on your system, then
call @code{org-plot/gnuplot} on the following table.
@example
@group
...
...
@@ -4486,7 +4489,7 @@ off a box while there are unchecked boxes above it.
@orgcmd{C-c C-c,org-toggle-checkbox}
Toggle checkbox status or (with prefix arg) checkbox presence at point.
With a single prefix argument, add an empty checkbox or remove the current
one@footnote{
`
C-u C-c C-c
'
on the @emph{first} item of a list with no checkbox
one@footnote{
@kbd{
C-u C-c C-c
}
on the @emph{first} item of a list with no checkbox
will add checkboxes to the rest of the list.}. With a double prefix argument, set it to @samp{[-]}, which is
considered to be an intermediate state.
@orgcmd{C-c C-x C-b,org-toggle-checkbox}
...
...
@@ -15987,7 +15990,7 @@ Here is a @LaTeX{} example. Let's say that you have this in your
\end@{comment@}
@end example
Pressing
`
C-c C-c
'
on @code{a new house} and will insert the converted
Pressing
@kbd{
C-c C-c
}
on @code{a new house} and will insert the converted
@LaTeX{} list between the two marker lines.
@node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
...
...
lisp/org/ChangeLog
View file @
d3517077
2013-02-07 Bastien Guerry <bzg@gnu.org>
* org-agenda.el (org-agenda-get-deadlines)
(org-agenda-get-scheduled): Fix bug: use text properties for the
headline text since we rely on properties to get e.g. the effort.
* org-exp.el (org-export-normalize-links): Don't match links
within tags.
* org-html.el (org-export-html-preamble-format)
(org-export-html-postamble-format): Mention that
org-export-html-preamble/postamble need to be `t' in order for
these variables to have any effect.
* org-html.el (org-html-handle-links): When the link description
is an image and the attribute is "width", pass the attribute to
the <img ...> tag.
* org.el (org-mode): Always honor `org-startup-indented', even
when `org-inhibit-startup' is non-nil.
* org-indent.el (org-indent-mode): Don't check
`org-inhibit-startup'.
* org.el (org-fontify-meta-lines-and-blocks-1): Don't try to add
text properties outside of the buffer.
* org.el (org-agenda-inhibit-startup): Rename from
`org-agenda-inhibit-startup-visibility-cycling'.
(org-agenda-prepare-buffers): Bind `org-inhibit-startup' to
`org-agenda-inhibit-startup'.
* org.el (org-mode): Don't initialize `org-beamer-mode' when
`org-inhibit-startup' is non-nil.
* org-footnote.el (org-footnote-create-definition): Prevent
`electric-indent-mode' from inserting the definition at the wrong
place.
* org-agenda.el (org-agenda-no-heading-message): Delete.
(org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-get-deadlines, org-agenda-get-scheduled)
(org-agenda-get-blocks): Don't use
`org-agenda-no-heading-message', skip the entry.
* org.el (org-agenda-inhibit-startup-visibility-cycling): New
option.
(org-agenda-prepare-buffers): Use it to speed up the agenda
generation.
* org-agenda.el (org-agenda-skip): Fix bug by correctly skipping
commented scheduled/deadline lines.
* org-clock.el (org-clock-in): Fix bug when fetching the effort
value.
* ob-python.el (org-babel-python-command): Fix docstring.
(org-babel-python-initiate-session-by-key): Fix bug: `run-python'
from Emacs >24.1 requires a python command as an argument.
* org-element.el (org-element-at-point): Fix typo in docstring.
* org-agenda.el (org-agenda-get-deadlines): Fix bug: use
`org-agenda-show-inherited-tags'.
* org-agenda.el (org-agenda-skip): Correctly handle commented out
scheduled/deadline lines. Refactor.
* org-install.el: Do not warn users.
* org.el (org-adaptive-fill-function): In message-mode, don't
lines in the message header, nor table lines in the body.
Correctly fill lines starting with `org-outline-regexp' in the
body.
* org-agenda.el (org-agenda-open-link): Fix bug with opening all
links.
2013-02-07 Francesco Pizzolante <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> (tiny change)
* org-clock.el (org-clock-sum): Protect with `org-unmodified'.
* org-macs.el (org-unmodified): Inhibit modification hooks.
2013-02-07 John K. Luebs <jkluebs@luebsphoto.com> (tiny change)
* org.el (org-get-wdays): Handle matching a lead time specified in
hours.
2013-02-07 Muchenxuan Tong <demon386@gmail.com> (tiny change)
* org-agenda.el (org-agenda-quit): Delete indirect buffer's window
only when it exists.
2013-02-07 Nicolas Goaziou <n.goaziou@gmail.com>
* org-element.el (org-element-macro-parser): Fix error when last
argument ends with a protected comma.
* org-element.el (org-element-parse-buffer, org-element-map)
(org-element-at-point, org-element-context): Be more verbose in
docstrings. Also fix typos.
* org-list.el (org-list-struct-fix-box): When a checkbox has to be
resetted because of a non-nil ORDERED property value, make sure it
had a checkbox already.
2013-02-07 Tokuya Kameshima <kametoku@gmail.com> (tiny change)
* org-agenda.el (org-search-view): Fix checking
`org-agenda-show-inherited-tags'.
2013-02-07 racin <racin@free.fr> (tiny change)
* org-bibtex.el (org-bibtex-search): Don't throw an error when
`org-bibtex-prefix' is nil.
2013-01-13 Bastien Guerry <bzg@gnu.org>
* org-compat.el (org-condition-case-unless-debug): Delete.
...
...
lisp/org/ob-python.el
View file @
d3517077
...
...
@@ -44,7 +44,7 @@
(
defvar
org-babel-default-header-args:python
'
())
(
defvar
org-babel-python-command
"python"
"Name of command for executing Python code."
)
"Name of
the
command for executing Python code."
)
(
defvar
org-babel-python-mode
(
if
(
featurep
'xemacs
)
'python-mode
'python
)
"Preferred python mode for use in running python interactively.
...
...
@@ -143,7 +143,9 @@ then create. Return the initialized session."
(
cond
((
and
(
eq
'python
org-babel-python-mode
)
(
fboundp
'run-python
))
; python.el
(
run-python
))
(
if
(
version<
"24.1"
emacs-version
)
(
run-python
org-babel-python-command
)
(
run-python
)))
((
and
(
eq
'python-mode
org-babel-python-mode
)
(
fboundp
'py-shell
))
; python-mode.el
;; Make sure that py-which-bufname is initialized, as otherwise
...
...
lisp/org/org-agenda.el
View file @
d3517077
...
...
@@ -530,7 +530,7 @@ This is a list of four items:
the project is considered to be not stuck. If you specify \"*\" as
a tag, any tag will mark the project unstuck. Note that this is about
the explicit presence of a tag somewhere in the subtree, inherited
tags
t
o not count here. If inherited tags make a project not stuck,
tags
d
o not count here. If inherited tags make a project not stuck,
use \"-TAG\" in the tags part of the matcher under (1.) above.
4. An arbitrary regular expression matching non-stuck projects.
...
...
@@ -3728,19 +3728,18 @@ A good way to set it is through options in `org-agenda-custom-commands'.")
Also moves point to the end of the skipped region, so that search can
continue from there."
(let ((p (point-at-bol)) to)
(when (org-in-src-block-p t) (throw :skip t))
(and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
(get-text-property p :org-archived)
(org-end-of-subtree t)
(throw :skip t))
(and org-agenda-skip-comment-trees
(get-text-property p :org-comment)
(org-end-of-subtree t)
(throw :skip t))
(if (equal (char-after p) ?#) (throw :skip t))
(when (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global)
(org-agenda-skip-eval org-agenda-skip-function)))
(goto-char to)
(when (or
(save-excursion (goto-char p) (looking-at comment-start-skip))
(and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
(get-text-property p :org-archived)
(org-end-of-subtree t))
(and org-agenda-skip-comment-trees
(get-text-property p :org-comment)
(org-end-of-subtree t))
(and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global)
(org-agenda-skip-eval org-agenda-skip-function)))
(goto-char to))
(org-in-src-block-p t))
(throw :skip t))))
(defun org-agenda-skip-eval (form)
...
...
@@ -4479,7 +4478,8 @@ in `org-agenda-text-search-extra-files'."
category-pos (get-text-property (point) 'org-category-position)
inherited-tags
(or (eq org-agenda-show-inherited-tags 'always)
(memq 'todo org-agenda-show-inherited-tags)
(and (listp org-agenda-show-inherited-tags)
(memq 'todo org-agenda-show-inherited-tags))
(and (eq org-agenda-show-inherited-tags t)
(or (eq org-agenda-use-tag-inheritance t)
(memq 'todo org-agenda-use-tag-inheritance))))
...
...
@@ -5406,9 +5406,6 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
\(fn
&optional
END
)
" nil nil)
(defconst org-agenda-no-heading-message
"
No
heading
for
this
item
in
buffer
or
region.
")
(defun org-agenda-get-timestamps (&optional deadline-results)
"
Return
the
date
stamp
information
for
agenda
display.
"
(let* ((props (list 'face 'org-agenda-calendar-event
...
...
@@ -5488,7 +5485,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
category-pos (get-text-property b0 'org-category-position))
(save-excursion
(if (not (re-search-backward org-outline-regexp-bol nil t))
(
setq txt org-agenda-no-heading-message
)
(
throw :skip nil
)
(goto-char (match-beginning 0))
(if (and (eq t org-agenda-skip-timestamp-if-deadline-is-shown)
(assoc (point) deadline-position-alist))
...
...
@@ -5724,7 +5721,7 @@ please use `org-class' instead."
(and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
(match-string 1)))))
(if (not (re-search-backward org-outline-regexp-bol nil t))
(
setq txt org-agenda-no-heading-message
)
(
throw :skip nil
)
(goto-char (match-beginning 0))
(setq hdmarker (org-agenda-new-marker)
inherited-tags
...
...
@@ -5892,7 +5889,7 @@ See also the user option `org-agenda-clock-consistency-checks'."
(d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
d2 diff dfrac wdays pos pos1 category category-pos
tags suppress-prewarning ee txt head face s todo-state
show-all upcomingp donep timestr warntime)
show-all upcomingp donep timestr warntime
inherited-tags
)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(setq suppress-prewarning nil)
...
...
@@ -5941,11 +5938,18 @@ See also the user option `org-agenda-clock-consistency-checks'."
warntime (get-text-property (point) 'org-appt-warntime)
category-pos (get-text-property (point) 'org-category-position))
(if (not (re-search-backward "
^\\*+[
\t]+
" nil t))
(
setq txt org-agenda-no-heading-message
)
(
throw :skip nil
)
(goto-char (match-end 0))
(setq pos1 (match-beginning 0))
(setq tags (org-get-tags-at pos1 t))
(setq head (buffer-substring-no-properties
(setq inherited-tags
(or (eq org-agenda-show-inherited-tags 'always)
(and (listp org-agenda-show-inherited-tags)
(memq 'agenda org-agenda-show-inherited-tags))
(and (eq org-agenda-show-inherited-tags t)
(or (eq org-agenda-use-tag-inheritance t)
(memq 'agenda org-agenda-use-tag-inheritance))))
tags (org-get-tags-at pos1 (not inherited-tags)))
(setq head (buffer-substring
(point)
(progn (skip-chars-forward "
^\r\n
")
(point))))
...
...
@@ -6059,7 +6063,7 @@ FRACTION is what fraction of the head-warning time has passed."
(setq category (org-get-category)
category-pos (get-text-property (point) 'org-category-position))
(if (not (re-search-backward "
^\\*+[
\t]+
" nil t))
(
setq txt org-agenda-no-heading-message
)
(
throw :skip nil
)
(goto-char (match-end 0))
(setq pos1 (match-beginning 0))
(if habitp
...
...
@@ -6082,7 +6086,7 @@ FRACTION is what fraction of the head-warning time has passed."
(or (eq org-agenda-use-tag-inheritance t)
(memq 'agenda org-agenda-use-tag-inheritance))))
tags (org-get-tags-at nil (not inherited-tags)))
(setq head (buffer-substring
-no-properties
(setq head (buffer-substring
(point)
(progn (skip-chars-forward "
^\r\n
") (point))))
(if (string-match "
\\
(
[012]?[0-9]:[0-9][0-9]\\
)
" s)
...
...
@@ -6160,7 +6164,7 @@ FRACTION is what fraction of the head-warning time has passed."
(setq category (org-get-category)
category-pos (get-text-property (point) 'org-category-position))
(if (not (re-search-backward org-outline-regexp-bol nil t))
(
setq txt org-agenda-no-heading-message
)
(
throw :skip nil
)
(goto-char (match-beginning 0))
(setq hdmarker (org-agenda-new-marker (point))
inherited-tags
...
...
@@ -6892,7 +6896,10 @@ Allowed types are 'agenda 'timeline 'todo 'tags 'search."
(
interactive
)
(
if
(
and
(
eq
org-indirect-buffer-display
'other-window
)
org-last-indirect-buffer
)
(
delete-window
(
get-buffer-window
org-last-indirect-buffer
)))
(
let
((
org-last-indirect-window
(
get-buffer-window
org-last-indirect-buffer
)))
(
if
org-last-indirect-window
(
delete-window
org-last-indirect-window
))))
(
if
org-agenda-columns-active
(
org-columns-quit
)
(
if
org-agenda-sticky
...
...
@@ -8012,32 +8019,34 @@ It also looks at the text of the entry itself."
(
let*
((
marker
(
or
(
org-get-at-bol
'org-hd-marker
)
(
org-get-at-bol
'org-marker
)))
(
buffer
(
and
marker
(
marker-buffer
marker
)))
(
prefix
(
buffer-substring
(
point-at-bol
)
(
point-at-eol
)))
(
prefix
(
buffer-substring
(
point-at-bol
)
(
point-at-eol
)))
(
lkall
(
org-offer-links-in-entry
buffer
marker
arg
prefix
))
(
lk
(
car
lkall
))
(
lk0
(
car
lkall
))
(
lk
(
if
(
stringp
lk0
)
(
list
lk0
)
lk0
))
(
lkend
(
cdr
lkall
))
trg
)
(
cond
((
and
buffer
(
stringp
lk
))
(
with-current-buffer
buffer
(
setq
trg
(
and
(
string-match
org-bracket-link-regexp
lk
)
(
match-string
1
lk
)))
(
if
(
or
(
not
trg
)
(
string-match
org-any-link-re
trg
))
(
save-excursion
(
save-restriction
(
widen
)
(
goto-char
marker
)
(
when
(
search-forward
lk
nil
lkend
)
(
goto-char
(
match-beginning
0
))
(
org-open-at-point
))))
;; This is an internal link, widen the buffer
(
switch-to-buffer-other-window
buffer
)
(
widen
)
(
goto-char
marker
)
(
when
(
search-forward
lk
nil
lkend
)
(
goto-char
(
match-beginning
0
))
(
org-open-at-point
)))))
((
and
buffer
lk
)
(
mapcar
(
lambda
(
l
)
(
with-current-buffer
buffer
(
setq
trg
(
and
(
string-match
org-bracket-link-regexp
l
)
(
match-string
1
l
)))
(
if
(
or
(
not
trg
)
(
string-match
org-any-link-re
trg
))
(
save-excursion
(
save-restriction
(
widen
)
(
goto-char
marker
)
(
when
(
search-forward
l
nil
lkend
)
(
goto-char
(
match-beginning
0
))
(
org-open-at-point
))))
;; This is an internal link, widen the buffer
(
switch-to-buffer-other-window
buffer
)
(
widen
)
(
goto-char
marker
)
(
when
(
search-forward
l
nil
lkend
)
(
goto-char
(
match-beginning
0
))
(
org-open-at-point
)))))
lk
))
((
or
(
org-in-regexp
(
concat
"\\("
org-bracket-link-regexp
"\\)"
))
(
save-excursion
(
beginning-of-line
1
)
...
...
lisp/org/org-bibtex.el
View file @
d3517077
...
...
@@ -679,7 +679,7 @@ This function relies `org-search-view' to locate results."
(
org-agenda-search-view-always-boolean
t
))
(
org-search-view
nil
(
format
"%s +{:%s%s:}"
string
org-bibtex-prefix
string
(
or
org-bibtex-prefix
""
)
org-bibtex-type-property-name
))))
(
provide
'org-bibtex
)
...
...
lisp/org/org-clock.el
View file @
d3517077
...
...
@@ -1204,7 +1204,7 @@ make this the default behavior.)"
(setq org-clock-start-time
(apply 'encode-time
(org-parse-time-string (match-string 1))))
(setq org-clock-effort (
get-text-property
(point)
'
org-effort))
(setq org-clock-effort (
org-entry-get
(point) org-effort
-property
))
(setq org-clock-total-time (org-clock-sum-current-item
(org-clock-get-sum-start))))
((eq org-clock-in-resume 'auto-restart)
...
...
@@ -1224,7 +1224,7 @@ make this the default behavior.)"
(beginning-of-line 1)
(org-indent-line-to (- (org-get-indentation) 2)))
(insert org-clock-string "
")
(setq org-clock-effort (
get-text-property
(point)
'
org-effort))
(setq org-clock-effort (
org-entry-get
(point) org-effort
-property
))
(setq org-clock-total-time (org-clock-sum-current-item
(org-clock-get-sum-start)))
(setq org-clock-start-time
...
...
@@ -1675,86 +1675,85 @@ each headline in the time range with point at the headline. Headlines for
which HEADLINE-FILTER returns nil are excluded from the clock summation.
PROPNAME lets you set a custom text property instead of :org-clock-minutes."
(
interactive
)
(
let*
((
bmp
(
buffer-modified-p
))
(
re
(
concat
"^\\(\\*+\\)[ \t]\\|^[ \t]*"
org-clock-string
"[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)"
))
(
lmax
30
)
(
ltimes
(
make-vector
lmax
0
))
(
t1
0
)
(
level
0
)
ts
te
dt
time
)
(
if
(
stringp
tstart
)
(
setq
tstart
(
org-time-string-to-seconds
tstart
)))
(
if
(
stringp
tend
)
(
setq
tend
(
org-time-string-to-seconds
tend
)))
(
if
(
consp
tstart
)
(
setq
tstart
(
org-float-time
tstart
)))
(
if
(
consp
tend
)
(
setq
tend
(
org-float-time
tend
)))
(
remove-text-properties
(
point-min
)
(
point-max
)
`
(
,
(
or
propname
:org-clock-minutes
)
t
:org-clock-force-headline-inclusion
t
))
(
save-excursion
(
goto-char
(
point-max
))
(
while
(
re-search-backward
re
nil
t
)
(
cond
((
match-end
2
)
;; Two time stamps
(
setq
ts
(
match-string
2
)
te
(
match-string
3
)
ts
(
org-float-time
(
apply
'encode-time
(
org-parse-time-string
ts
)))
te
(
org-float-time
(
apply
'encode-time
(
org-parse-time-string
te
)))
ts
(
if
tstart
(
max
ts
tstart
)
ts
)
te
(
if
tend
(
min
te
tend
)
te
)
dt
(
-
te
ts
)
t1
(
if
(
>
dt
0
)
(
+
t1
(
floor
(
/
dt
60
)))
t1
)))
((
match-end
4
)
;; A naked time
(
setq
t1
(
+
t1
(
string-to-number
(
match-string
5
))
(
*
60
(
string-to-number
(
match-string
4
))))))
(
t
;; A headline
;; Add the currently clocking item time to the total
(
when
(
and
org-clock-report-include-clocking-task
(
equal
(
org-clocking-buffer
)
(
current-buffer
))
(
equal
(
marker-position
org-clock-hd-marker
)
(
point
))
tstart
tend
(
>=
(
org-float-time
org-clock-start-time
)
tstart
)
(
<=
(
org-float-time
org-clock-start-time
)
tend
))
(
let
((
time
(
floor
(
-
(
org-float-time
)
(
org-float-time
org-clock-start-time
))
60
)))
(
setq
t1
(
+
t1
time
))))
(
let*
((
headline-forced
(
get-text-property
(
point
)
:org-clock-force-headline-inclusion
))
(
headline-included
(
or
(
null
headline-filter
)
(
save-excursion
(
save-match-data
(
funcall
headline-filter
))))))
(
setq
level
(
-
(
match-end
1
)
(
match-beginning
1
)))
(
when
(
or
(
>
t1
0
)
(
>
(
aref
ltimes
level
)
0
))
(
when
(
or
headline-included
headline-forced
)
(
if
headline-included
(
loop
for
l
from
0
to
level
do
(
aset
ltimes
l
(
+
(
aref
ltimes
l
)
t1
))))
(
setq
time
(
aref
ltimes
level
))
(
goto-char
(
match-beginning
0
))
(
put-text-property
(
point
)
(
point-at-eol
)
(
or
propname
:org-clock-minutes
)
time
)
(
if
headline-filter
(
save-excursion
(
save-match-data
(
while
(
>
(
funcall
outline-level
)
1
)
(
outline-up-heading
1
t
)
(
put-text-property
(
point
)
(
point-at-eol
)
:org-clock-force-headline-inclusion
t
))))))
(
setq
t1
0
)
(
loop
for
l
from
level
to
(
1-
lmax
)
do
(
aset
ltimes
l
0
)))))))
(
setq
org-clock-file-total-minutes
(
aref
ltimes
0
)))
(
set-buffer-modified-p
bmp
)))
(
org-unmodified
(
let*
((
re
(
concat
"^\\(\\*+\\)[ \t]\\|^[ \t]*"
org-clock-string
"[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)"
))
(
lmax
30
)
(
ltimes
(
make-vector
lmax
0
))
(
t1
0
)
(
level
0
)
ts
te
dt
time
)
(
if
(
stringp
tstart
)
(
setq
tstart
(
org-time-string-to-seconds
tstart
)))
(
if
(
stringp
tend
)
(
setq
tend
(
org-time-string-to-seconds
tend
)))
(
if
(
consp
tstart
)
(
setq
tstart
(
org-float-time
tstart
)))
(
if
(
consp
tend
)
(
setq
tend
(
org-float-time
tend
)))
(
remove-text-properties
(
point-min
)
(
point-max
)
`
(
,
(
or
propname
:org-clock-minutes
)
t
:org-clock-force-headline-inclusion
t
))
(
save-excursion
(
goto-char
(
point-max
))
(
while
(
re-search-backward
re
nil
t
)
(
cond
((
match-end
2
)
;; Two time stamps
(
setq
ts
(
match-string
2
)
te
(
match-string
3
)
ts
(
org-float-time
(
apply
'encode-time
(
org-parse-time-string
ts
)))
te
(
org-float-time
(
apply
'encode-time
(
org-parse-time-string
te
)))
ts
(
if
tstart
(
max
ts
tstart
)
ts
)
te
(
if
tend
(
min
te
tend
)
te
)
dt
(
-
te
ts
)
t1
(
if
(
>
dt
0
)
(
+
t1
(
floor
(
/
dt
60
)))
t1
)))
((
match-end
4
)
;; A naked time
(
setq
t1
(
+
t1
(
string-to-number
(
match-string
5
))
(
*
60
(
string-to-number
(
match-string
4
))))))
(
t
;; A headline
;; Add the currently clocking item time to the total
(
when
(
and
org-clock-report-include-clocking-task
(
equal
(
org-clocking-buffer
)
(
current-buffer
))
(
equal
(
marker-position
org-clock-hd-marker
)
(
point
))
tstart
tend
(
>=
(
org-float-time
org-clock-start-time
)
tstart
)
(
<=
(
org-float-time
org-clock-start-time
)
tend
))
(
let
((
time
(
floor
(
-
(
org-float-time
)
(
org-float-time
org-clock-start-time
))
60
)))
(
setq
t1
(
+
t1
time
))))
(
let*
((
headline-forced
(
get-text-property
(
point
)
:org-clock-force-headline-inclusion
))
(
headline-included
(
or
(
null
headline-filter
)
(
save-excursion
(
save-match-data
(
funcall
headline-filter
))))))
(
setq
level
(
-
(
match-end
1
)
(
match-beginning
1
)))
(
when
(
or
(
>
t1
0
)
(
>
(
aref
ltimes
level
)
0
))
(
when
(
or
headline-included
headline-forced
)
(
if
headline-included
(
loop
for
l
from
0
to
level
do
(
aset
ltimes
l
(
+
(
aref
ltimes
l
)
t1
))))
(
setq
time
(
aref
ltimes
level
))
(
goto-char
(
match-beginning
0
))
(
put-text-property
(
point
)
(
point-at-eol
)
(
or
propname
:org-clock-minutes
)
time
)
(
if
headline-filter
(
save-excursion
(
save-match-data
(
while
(
>
(
funcall
outline-level
)
1
)
(
outline-up-heading
1
t
)
(
put-text-property
(
point
)
(
point-at-eol
)
:org-clock-force-headline-inclusion
t
))))))
(
setq
t1
0
)
(
loop
for
l
from
level
to
(
1-
lmax
)
do
(
aset
ltimes
l
0
)))))))
(
setq
org-clock-file-total-minutes
(
aref
ltimes
0
))))))
(
defun
org-clock-sum-current-item
(
&optional
tstart
)
"Return time, clocked on current item in total."
...
...
lisp/org/org-element.el
View file @
d3517077
...
...
@@ -2893,10 +2893,13 @@ Assume point is at the macro."
(
end
(
point
))
(
args
(
let
((
args
(
org-match-string-no-properties
3
))
args2
)
(
when
args
(
setq
args
(
org-split-string
args
","
))
;; Do not use `org-split-string' since empty
;; strings are meaningful here.