Merge branch 'master' of git://repo.or.cz/org-mode

This commit is contained in:
Dan Davison 2010-04-24 14:35:06 -04:00
commit 037061e7d8
11 changed files with 108 additions and 34 deletions

1
.dir-locals.el Symbolic link
View File

@ -0,0 +1 @@
.dir-settings.el

View File

@ -127,8 +127,9 @@ specifying a var of the same value."
(let ((vars-forms (mapconcat ;; define any variables (let ((vars-forms (mapconcat ;; define any variables
(lambda (pair) (lambda (pair)
(format "%s %s" (car pair) (org-babel-clojure-var-to-clojure (cdr pair)))) (format "%s %s" (car pair) (org-babel-clojure-var-to-clojure (cdr pair))))
vars "\n "))) vars "\n "))
(format "(let [%s]\n %s)" vars-forms (org-babel-trim body)))) (body (org-babel-trim body)))
(if (> (length vars-forms) 0) (format "(let [%s]\n %s)" vars-forms body) body)))
(defun org-babel-prep-session:clojure (session params) (defun org-babel-prep-session:clojure (session params)
"Prepare SESSION according to the header arguments specified in PARAMS." "Prepare SESSION according to the header arguments specified in PARAMS."

View File

@ -45,15 +45,16 @@
(processed-params (org-babel-process-params params)) (processed-params (org-babel-process-params params))
(result-params (third processed-params)) (result-params (third processed-params))
(print-level nil) (print-length nil) (print-level nil) (print-length nil)
(body (concat "(let (" (body (if (> (length vars) 0)
(mapconcat (concat "(let ("
(lambda (var) (format "%S" (print `(,(car var) ',(cdr var))))) (mapconcat
vars "\n ") (lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
")\n" vars "\n ")
(if (or (member "code" result-params) ")\n" body ")")
(member "pp" result-params)) body)))
(concat "(pp " body ")") body) ")"))) (if (or (member "code" result-params)
body)) (member "pp" result-params))
(concat "(pp " body ")") body)))
(defun org-babel-execute:emacs-lisp (body params) (defun org-babel-execute:emacs-lisp (body params)
"Execute a block of emacs-lisp code with org-babel." "Execute a block of emacs-lisp code with org-babel."

View File

@ -187,13 +187,16 @@ code blocks by language."
(cons (cons
(cons src-lang (cons src-lang
(cons (list link source-name params (cons (list link source-name params
(funcall ((lambda (body)
(intern (if (assoc :no-expand params)
(concat "org-babel-expand-body:" src-lang)) body
(funcall
(intern (concat "org-babel-expand-body:" src-lang))
body
params)))
(if (and (cdr (assoc :noweb params)) (if (and (cdr (assoc :noweb params))
(string= "yes" (cdr (assoc :noweb params)))) (string= "yes" (cdr (assoc :noweb params))))
(org-babel-expand-noweb-references info) (second info)) (org-babel-expand-noweb-references info) (second info)))
params)
(third (cdr (assoc (third (cdr (assoc
src-lang org-babel-tangle-langs)))) src-lang org-babel-tangle-langs))))
by-lang)) blocks)))))) by-lang)) blocks))))))

View File

@ -5582,6 +5582,7 @@ new table. The @samp{BEGIN} line can specify options:
:tend @r{A time string specifying when to stop considering times.} :tend @r{A time string specifying when to stop considering times.}
:step @r{@code{week} or @code{day}, to split the table into chunks.} :step @r{@code{week} or @code{day}, to split the table into chunks.}
@r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.} @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
:tags @r{A tags match to select entries that should contribute}
:link @r{Link the item headlines in the table to their origins.} :link @r{Link the item headlines in the table to their origins.}
:formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.} :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
@r{As a special case, @samp{:formula %} adds a column with % time.} @r{As a special case, @samp{:formula %} adds a column with % time.}
@ -10476,7 +10477,7 @@ respectively. Any other value will mix files and folders.
@code{nil} to turn off sorting. @code{nil} to turn off sorting.
@item @code{:sitemap-ignore-case} @item @code{:sitemap-ignore-case}
@tab Should sorting be case-sensitively? Default @code{nil}. @tab Should sorting be case-sensitive? Default @code{nil}.
@end multitable @end multitable
@ -12708,7 +12709,7 @@ with links transformation to Org syntax.
chapter about publishing. chapter about publishing.
@item @item
@i{Stefan Vollmar} organized a video-recorded talk at the @i{Stefan Vollmar} organized a video-recorded talk at the
Max-PLanck-Institute for Neurology. He also inspired the creation of a Max-Planck-Institute for Neurology. He also inspired the creation of a
concept index for HTML export. concept index for HTML export.
@item @item
@i{J@"urgen Vollmer} contributed code generating the table of contents @i{J@"urgen Vollmer} contributed code generating the table of contents

View File

@ -1,5 +1,22 @@
2010-04-24 Carsten Dominik <carsten.dominik@gmail.com>
* org-table.el (org-table-justify-field-maybe): Make sure that
inserting a value does not turn a line into a hline.
2010-04-23 Carsten Dominik <carsten.dominik@gmail.com> 2010-04-23 Carsten Dominik <carsten.dominik@gmail.com>
* org-clock.el (org-clock-sum): New argument HEADLINE-FILTER.
(org-clock-sum): Add property to selected headlines.
(org-dblock-write:clocktable): Make tags matcher.
* org.el (org-set-autofill-regexps): XEmacs compatibility.
* org-latex.el (org-export-latex-set-initial-vars): Allow "-"
in latex class definitions
* org.el (org-shiftup-hook, org-shiftdown-hook)
(org-shiftleft-hook, org-shiftright-hook): New hooks.
* org-entities.el (org-entities): Use \land and \lor for logical * org-entities.el (org-entities): Use \land and \lor for logical
operators. operators.

59
lisp/org-clock.el Normal file → Executable file
View File

@ -1311,10 +1311,13 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
"Holds the file total time in minutes, after a call to `org-clock-sum'.") "Holds the file total time in minutes, after a call to `org-clock-sum'.")
(make-variable-buffer-local 'org-clock-file-total-minutes) (make-variable-buffer-local 'org-clock-file-total-minutes)
(defun org-clock-sum (&optional tstart tend) (defun org-clock-sum (&optional tstart tend headline-filter)
"Sum the times for each subtree. "Sum the times for each subtree.
Puts the resulting times in minutes as a text property on each headline. Puts the resulting times in minutes as a text property on each headline.
TSTART and TEND can mark a time range to be considered." TSTART and TEND can mark a time range to be considered. HEADLINE-FILTER is a
zero-arg function that, if specified, is called for each headline in the time
range with point at the headline. Headlines for which HEADLINE-FILTER returns
nil are excluded from the clock summation."
(interactive) (interactive)
(let* ((bmp (buffer-modified-p)) (let* ((bmp (buffer-modified-p))
(re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
@ -1330,7 +1333,9 @@ TSTART and TEND can mark a time range to be considered."
(if (stringp tend) (setq tend (org-time-string-to-seconds tend))) (if (stringp tend) (setq tend (org-time-string-to-seconds tend)))
(if (consp tstart) (setq tstart (org-float-time tstart))) (if (consp tstart) (setq tstart (org-float-time tstart)))
(if (consp tend) (setq tend (org-float-time tend))) (if (consp tend) (setq tend (org-float-time tend)))
(remove-text-properties (point-min) (point-max) '(:org-clock-minutes t)) (remove-text-properties (point-min) (point-max)
'(:org-clock-minutes t
:org-clock-force-headline-inclusion t))
(save-excursion (save-excursion
(goto-char (point-max)) (goto-char (point-max))
(while (re-search-backward re nil t) (while (re-search-backward re nil t)
@ -1359,15 +1364,34 @@ TSTART and TEND can mark a time range to be considered."
(let ((time (floor (- (org-float-time) (let ((time (floor (- (org-float-time)
(org-float-time org-clock-start-time)) 60))) (org-float-time org-clock-start-time)) 60)))
(setq t1 (+ t1 time)))) (setq t1 (+ t1 time))))
(setq level (- (match-end 1) (match-beginning 1))) (let* ((headline-forced
(when (or (> t1 0) (> (aref ltimes level) 0)) (get-text-property (point)
(loop for l from 0 to level do :org-clock-force-headline-inclusion))
(aset ltimes l (+ (aref ltimes l) t1))) (headline-included
(setq t1 0 time (aref ltimes level)) (or (null headline-filter)
(loop for l from level to (1- lmax) do (save-excursion
(aset ltimes l 0)) (save-match-data (funcall headline-filter))))))
(goto-char (match-beginning 0)) (setq level (- (match-end 1) (match-beginning 1)))
(put-text-property (point) (point-at-eol) :org-clock-minutes time))))) (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) :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))) (setq org-clock-file-total-minutes (aref ltimes 0)))
(set-buffer-modified-p bmp))) (set-buffer-modified-p bmp)))
@ -1687,6 +1711,8 @@ the currently selected interval size."
(te (plist-get params :tend)) (te (plist-get params :tend))
(block (plist-get params :block)) (block (plist-get params :block))
(link (plist-get params :link)) (link (plist-get params :link))
(tags (plist-get params :tags))
(matcher (if tags (cdr (org-make-tags-matcher tags))))
ipos time p level hlc hdl tsp props content recalc formula pcol ipos time p level hlc hdl tsp props content recalc formula pcol
cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st) cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st)
(setq org-clock-file-total-minutes nil) (setq org-clock-file-total-minutes nil)
@ -1768,7 +1794,14 @@ the currently selected interval size."
(goto-char pos) (goto-char pos)
(unless scope-is-list (unless scope-is-list
(org-clock-sum ts te) (org-clock-sum ts te
(unless (null matcher)
(lambda ()
(let ((tags-list
(org-split-string
(or (org-entry-get (point) "ALLTAGS") "")
":")))
(eval matcher)))))
(goto-char (point-min)) (goto-char (point-min))
(setq st t) (setq st t)
(while (or (and (bobp) (prog1 st (setq st nil)) (while (or (and (bobp) (prog1 st (setq st nil))

View File

@ -1086,7 +1086,7 @@ LEVEL indicates the default depth for export."
(save-restriction (save-restriction
(widen) (widen)
(goto-char (point-min)) (goto-char (point-min))
(and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\([a-zA-Z]+\\)" nil t) (and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\(-[a-zA-Z]+\\)" nil t)
(match-string 1)))) (match-string 1))))
(plist-get org-export-latex-options-plist :latex-class) (plist-get org-export-latex-options-plist :latex-class)
org-export-latex-default-class) org-export-latex-default-class)

View File

@ -184,7 +184,7 @@ sitemap of files or summary page for a given project.
Any other value will mix files and folders. Any other value will mix files and folders.
:sitemap-alphabetically The site map is normally sorted alphabetically. :sitemap-alphabetically The site map is normally sorted alphabetically.
Set this explicitly to nil to turn off sorting. Set this explicitly to nil to turn off sorting.
:sitemap-ignore-case Should sorting be case-sensitively? Default nil. :sitemap-ignore-case Should sorting be case-sensitive? Default nil.
The following properties control the creation of a concept index. The following properties control the creation of a concept index.

View File

@ -830,6 +830,7 @@ Optional argument NEW may specify text to replace the current field content."
(if (<= (length new) l) ;; FIXME: length -> str-width? (if (<= (length new) l) ;; FIXME: length -> str-width?
(setq n (format f new)) (setq n (format f new))
(setq n (concat new "|") org-table-may-need-update t))) (setq n (concat new "|") org-table-may-need-update t)))
(if (equal (string-to-char n) ?-) (setq n (concat " " n)))
(or (equal n o) (or (equal n o)
(let (org-table-may-need-update) (let (org-table-may-need-update)
(replace-match n t t)))) (replace-match n t t))))

View File

@ -15930,6 +15930,18 @@ See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-metareturn-hook nil (defvar org-metareturn-hook nil
"Hook for functions attaching themselves to `M-RET'. "Hook for functions attaching themselves to `M-RET'.
See `org-ctrl-c-ctrl-c-hook' for more information.") See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftup-hook nil
"Hook for functions attaching themselves to `S-up'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftdown-hook nil
"Hook for functions attaching themselves to `S-down'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftleft-hook nil
"Hook for functions attaching themselves to `S-left'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defvar org-shiftright-hook nil
"Hook for functions attaching themselves to `S-right'.
See `org-ctrl-c-ctrl-c-hook' for more information.")
(defun org-modifier-cursor-error () (defun org-modifier-cursor-error ()
"Throw an error, a modified cursor command was applied in wrong context." "Throw an error, a modified cursor command was applied in wrong context."
@ -16126,6 +16138,7 @@ Calls `org-timestamp-up' or `org-priority-up', or `org-previous-item',
depending on context. See the individual commands for more information." depending on context. See the individual commands for more information."
(interactive "P") (interactive "P")
(cond (cond
((run-hook-with-args-until-success 'org-shiftup-hook))
((and org-support-shift-select (org-region-active-p)) ((and org-support-shift-select (org-region-active-p))
(org-call-for-shift-select 'previous-line)) (org-call-for-shift-select 'previous-line))
((org-at-timestamp-p t) ((org-at-timestamp-p t)
@ -16148,6 +16161,7 @@ Calls `org-timestamp-down' or `org-priority-down', or `org-next-item'
depending on context. See the individual commands for more information." depending on context. See the individual commands for more information."
(interactive "P") (interactive "P")
(cond (cond
((run-hook-with-args-until-success 'org-shiftdown-hook))
((and org-support-shift-select (org-region-active-p)) ((and org-support-shift-select (org-region-active-p))
(org-call-for-shift-select 'next-line)) (org-call-for-shift-select 'next-line))
((org-at-timestamp-p t) ((org-at-timestamp-p t)
@ -16175,6 +16189,7 @@ Depending on context, this does one of the following:
- on a clocktable definition line, move time block into the future" - on a clocktable definition line, move time block into the future"
(interactive "P") (interactive "P")
(cond (cond
((run-hook-with-args-until-success 'org-shiftright-hook))
((and org-support-shift-select (org-region-active-p)) ((and org-support-shift-select (org-region-active-p))
(org-call-for-shift-select 'forward-char)) (org-call-for-shift-select 'forward-char))
((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day)) ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day))
@ -16209,6 +16224,7 @@ Depending on context, this does one of the following:
- on a clocktable definition line, move time block into the past" - on a clocktable definition line, move time block into the past"
(interactive "P") (interactive "P")
(cond (cond
((run-hook-with-args-until-success 'org-shiftleft-hook))
((and org-support-shift-select (org-region-active-p)) ((and org-support-shift-select (org-region-active-p))
(org-call-for-shift-select 'backward-char)) (org-call-for-shift-select 'backward-char))
((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day)) ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day))
@ -17774,7 +17790,7 @@ the functionality can be provided as a fall-back.")
(org-set-local 'fill-paragraph-function 'org-fill-paragraph) (org-set-local 'fill-paragraph-function 'org-fill-paragraph)
;; Adaptive filling: To get full control, first make sure that ;; Adaptive filling: To get full control, first make sure that
;; `adaptive-fill-regexp' never matches. Then install our own matcher. ;; `adaptive-fill-regexp' never matches. Then install our own matcher.
(unless (local-variable-p 'adaptive-fill-regexp) (unless (local-variable-p 'adaptive-fill-regexp (current-buffer))
(org-set-local 'org-adaptive-fill-regexp-backup (org-set-local 'org-adaptive-fill-regexp-backup
adaptive-fill-regexp)) adaptive-fill-regexp))
(org-set-local 'adaptive-fill-regexp "\000") (org-set-local 'adaptive-fill-regexp "\000")