+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org.texi (Durations and time values): Fix typo.
+
2012-05-12 Andreas Schwab <schwab@linux-m68k.org>
* cc-mode.texi: Avoid space before macro in 4th argument of cross
@setfilename ../../info/org
@settitle The Org Manual
-@set VERSION 7.8.09
-@set DATE April 2012
+@set VERSION 7.8.10
+@set DATE May 2012
@c Use proper quote and backtick for code sections in PDF output
@c Cf. Texinfo manual 14.2
Input duration values must be of the form @code{[HH:MM[:SS]}, where seconds
are optional. With the @code{T} flag, computed durations will be displayed
-as @code{[HH:MM:SS} (see the first formula above). With the @code{t} flag,
+as @code{HH:MM:SS} (see the first formula above). With the @code{t} flag,
computed durations will be displayed according to the value of the variable
@code{org-table-duration-custom-format}, which defaults to @code{'hours} and
will display the result as a fraction of hours (see the second formula in the
Delete other windows.
@c
@orgcmdkskc{v d,d,org-agenda-day-view}
-@xorgcmdkskc{v w,w,org-agenda-day-view}
+@xorgcmdkskc{v w,w,org-agenda-week-view}
@xorgcmd{v m,org-agenda-month-view}
-@xorgcmd{v y,org-agenda-month-year}
+@xorgcmd{v y,org-agenda-year-view}
@xorgcmd{v SPC,org-agenda-reset-view}
@vindex org-agenda-span
Switch to day/week/month/year view. When switching to day or week view, this
% Reference Card for Org Mode
-\def\orgversionnumber{7.8.09}
+\def\orgversionnumber{7.8.10}
\def\versionyear{2012} % latest update
\def\year{2012} % latest copyright year
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org.el (org-scan-tags): Correctly match TODO keywords.
+
+2012-05-16 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org-list.el (org-list-struct): Fix white spaces.
+ (org-list-swap-items, org-list-send-item): Fix visibility
+ preservation.
+
+2012-05-16 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org-list.el (org-list-swap-items, org-list-send-item): Preserve
+ visibility when moving items.
+
+2012-05-16 Mark E. Shoulson <mark@kli.org> (tiny change)
+
+ * org.el (org-fontify-entities): Hide {} when prettifying
+ entities.
+
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org.el (org-cycle-internal-global): Prevent the display of
+ messages when cycling from with a Gnus article buffer.
+
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org-table.el (org-table-time-seconds-to-string): Fix bug about
+ handling a negative duration value.
+
+2012-05-16 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org.el (org-link-expand-abbrev): Fix docstring.
+
+2012-05-16 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org.el (org-translate-link): Fix bug.
+
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug when
+ setting the number of marked entries.
+
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org-table.el (org-tbl-calc-modes): Rename from
+ `org-table-modes'.
+ (org-set-calc-mode, org-table-eval-formula): Use it.
+
+2012-05-16 Eric Schulte <eric.schulte@gmx.com>
+
+ * ob.el (org-babel-find-named-result): Fix bug finding empty named
+ results.
+
+2012-05-16 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org.el (org-set-regexps-and-options): Fix
+ `org-planning-or-clock-line-re' regexp. Indeed "\\>" will never
+ match since time keywords must end with colons, which are not word
+ constituent.
+
+2012-05-16 Bastien Guerry <bzg@gnu.org>
+
+ * org-ctags.el (org-ctags-new-topic-template): Fix the option
+ default value back again.
+
+2012-05-16 Eric Schulte <eric.schulte@gmx.com>
+
+ * org-bibtex.el (org-bibtex-export-to-kill-ring): Don't rely on
+ kill-new to return a string.
+
+2012-05-16 Eric Schulte <eric.schulte@gmx.com>
+
+ * org-bibtex.el (org-bibtex-headline): Remove call to
+ bibtex-reformat which often hangs.
+
2012-04-26 Nicolas Goaziou <n.goaziou@gmail.com>
* org-table.el (org-table-number-fraction): Fix typo.
(catch 'is-a-code-block
(when (re-search-forward
(concat org-babel-result-regexp
- "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
+ "[ \t]" (regexp-quote name) "[ \t]*[\n\f\v\r]") nil t)
(when (and (string= "name" (downcase (match-string 1)))
(or (beginning-of-line 1)
(looking-at org-babel-src-block-regexp)
(defun org-agenda-bulk-mark-regexp (regexp)
"Mark entries match REGEXP."
(interactive "sMark entries matching regexp: ")
- (let (entries-marked)
+ (let ((entries-marked 0))
(save-excursion
(goto-char (point-min))
(goto-char (next-single-property-change (point) 'txt))
(while (re-search-forward regexp nil t)
(when (string-match regexp (get-text-property (point) 'txt))
- (setq entries-marked (+ entries-marked 1))
+ (setq entries-marked (1+ entries-marked))
(call-interactively 'org-agenda-bulk-mark))))
(if (not entries-marked)
(message "No entry matching this regexp."))))
(progn (goto-char (match-end 1)) (insert ", "))
(bibtex-make-field "keywords" t t))
(insert (mapconcat #'identity tags ", ")))
- (bibtex-reformat) (buffer-string)))))))
+ (buffer-string)))))))
(defun org-bibtex-ask (field)
(unless (assoc field org-bibtex-fields)
(defun org-bibtex-export-to-kill-ring ()
"Export current headline to kill ring as bibtex entry."
(interactive)
- (kill-new (org-bibtex-headline)))
+ (let ((result (org-bibtex-headline)))
+ (kill-new result) result))
(defun org-bibtex-search (string)
"Search for bibliographical entries in agenda files.
;; equally indented than BEG-CELL's cdr. Also, store ending
;; position of items in END-LST-2.
(catch 'exit
- (while t
- (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
+ (while t
+ (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
(org-get-indentation))))
- (cond
- ((>= (point) lim-down)
+ (cond
+ ((>= (point) lim-down)
;; At downward limit: this is de facto the end of the
;; list. Save point as an ending position, and jump to
;; part 3.
- (throw 'exit
+ (throw 'exit
(push (cons 0 (funcall end-before-blank)) end-lst-2)))
;; At a verbatim block, move to its end. Point is at bol
;; and 'org-example property is set by whole lines:
(defun org-list-swap-items (beg-A beg-B struct)
"Swap item starting at BEG-A with item starting at BEG-B in STRUCT.
-Blank lines at the end of items are left in place. Return the
-new structure after the changes.
+
+Blank lines at the end of items are left in place. Item
+visibility is preserved. Return the new structure after the
+changes.
Assume BEG-A is lesser than BEG-B and that BEG-A and BEG-B belong
to the same sub-list.
(body-B (buffer-substring beg-B end-B-no-blank))
(between-A-no-blank-and-B (buffer-substring end-A-no-blank beg-B))
(sub-A (cons beg-A (org-list-get-subtree beg-A struct)))
- (sub-B (cons beg-B (org-list-get-subtree beg-B struct))))
+ (sub-B (cons beg-B (org-list-get-subtree beg-B struct)))
+ ;; Store overlays responsible for visibility status. We
+ ;; also need to store their boundaries as they will be
+ ;; removed from buffer.
+ (overlays (cons
+ (mapcar (lambda (ov)
+ (list ov (overlay-start ov) (overlay-end ov)))
+ (overlays-in beg-A end-A))
+ (mapcar (lambda (ov)
+ (list ov (overlay-start ov) (overlay-end ov)))
+ (overlays-in beg-B end-B)))))
;; 1. Move effectively items in buffer.
(goto-char beg-A)
(delete-region beg-A end-B-no-blank)
(setcar e (+ pos (- size-B size-A)))
(setcar (nthcdr 6 e) (+ end-e (- size-B size-A))))))))
struct)
- (sort struct (lambda (e1 e2) (< (car e1) (car e2)))))))
+ (setq struct (sort struct (lambda (e1 e2) (< (car e1) (car e2)))))
+ ;; Restore visibility status, by moving overlays to their new
+ ;; position.
+ (mapc (lambda (ov)
+ (move-overlay
+ (car ov)
+ (+ (nth 1 ov) (- (+ beg-B (- size-B size-A)) beg-A))
+ (+ (nth 2 ov) (- (+ beg-B (- size-B size-A)) beg-A))))
+ (car overlays))
+ (mapc (lambda (ov)
+ (move-overlay (car ov)
+ (+ (nth 1 ov) (- beg-A beg-B))
+ (+ (nth 2 ov) (- beg-A beg-B))))
+ (cdr overlays))
+ ;; Return structure.
+ struct)))
(defun org-list-separating-blank-lines-number (pos struct prevs)
"Return number of blank lines that should separate items in list.
to another item in the same list as ITEM, and will move the
latter just before the former.
-If DEST is `begin' \(respectively `end'\), ITEM will be moved at
-the beginning \(respectively end\) of the list it belongs to.
+If DEST is `begin' (respectively `end'), ITEM will be moved at
+the beginning (respectively end) of the list it belongs to.
If DEST is a string like \"N\", where N is an integer, ITEM will
be moved at the Nth position in the list.
If DEST is `delete', ITEM will be deleted.
+Visibility of item is preserved.
+
This function returns, destructively, the new list structure."
(let* ((prevs (org-list-prevs-alist struct))
(item-end (org-list-get-item-end item struct))
(org-list-get-last-item item struct prevs))
(point-at-eol)))))
(t dest)))
- (org-M-RET-may-split-line nil))
+ (org-M-RET-may-split-line nil)
+ ;; Store visibility.
+ (visibility (overlays-in item item-end)))
(cond
((eq dest 'delete) (org-list-delete-item item struct))
((eq dest 'kill)
(+ end shift)))))))
moved-items))
(lambda (e1 e2) (< (car e1) (car e2))))))
- ;; 2. Eventually delete extra copy of the item and clean marker.
- (prog1
- (org-list-delete-item (marker-position item) struct)
+ ;; 2. Restore visibility.
+ (mapc (lambda (ov)
+ (move-overlay ov
+ (+ (overlay-start ov) (- (point) item))
+ (+ (overlay-end ov) (- (point) item))))
+ visibility)
+ ;; 3. Eventually delete extra copy of the item and clean marker.
+ (prog1 (org-list-delete-item (marker-position item) struct)
(move-marker item nil)))
(t struct))))
:type 'alist)
(defcustom org-protocol-protocol-alist nil
- "* Register custom handlers for org-protocol.
+ "Register custom handlers for org-protocol.
Each element of this list must be of the form:
(looking-at org-table-auto-recalculate-regexp))
(org-table-recalculate) t))
-(defvar org-table-modes)
+(defvar org-tbl-calc-modes) ;; Dynamically bound in `org-table-eval-formula'
(defsubst org-set-calc-mode (var &optional value)
(if (stringp var)
(setq var (assoc var '(("D" calc-angle-mode deg)
("F" calc-prefer-frac t)
("S" calc-symbolic-mode t)))
value (nth 2 var) var (nth 1 var)))
- (if (memq var org-table-modes)
- (setcar (cdr (memq var org-table-modes)) value)
- (cons var (cons value org-table-modes)))
- org-table-modes)
+ (if (memq var org-tbl-calc-modes)
+ (setcar (cdr (memq var org-tbl-calc-modes)) value)
+ (cons var (cons value org-tbl-calc-modes)))
+ org-tbl-calc-modes)
(defun org-table-eval-formula (&optional arg equation
suppress-align suppress-const
equation
(org-table-get-formula equation (equal arg '(4)))))
(n0 (org-table-current-column))
- (modes (copy-sequence org-calc-default-modes))
+ (org-tbl-calc-modes (copy-sequence org-calc-default-modes))
(numbers nil) ; was a variable, now fixed default
(keep-empty nil)
n form form0 formrpl formrg bw fmt x ev orig c lispp literal
(setq c (string-to-char (match-string 1 fmt))
n (string-to-number (match-string 2 fmt)))
(if (= c ?p)
- (setq modes (org-set-calc-mode 'calc-internal-prec n))
- (setq modes (org-set-calc-mode
- 'calc-float-format
- (list (cdr (assoc c '((?n . float) (?f . fix)
- (?s . sci) (?e . eng))))
- n))))
+ (setq org-tbl-calc-modes (org-set-calc-mode 'calc-internal-prec n))
+ (setq org-tbl-calc-modes
+ (org-set-calc-mode
+ 'calc-float-format
+ (list (cdr (assoc c '((?n . float) (?f . fix)
+ (?s . sci) (?e . eng))))
+ n))))
(setq fmt (replace-match "" t t fmt)))
(if (string-match "T" fmt)
(setq duration t numbers t
(setq keep-empty t
fmt (replace-match "" t t fmt)))
(while (string-match "[DRFS]" fmt)
- (setq modes (org-set-calc-mode (match-string 0 fmt)))
+ (setq org-tbl-calc-modes (org-set-calc-mode (match-string 0 fmt)))
(setq fmt (replace-match "" t t fmt)))
(unless (string-match "\\S-" fmt)
(setq fmt nil))))
duration-output-format) ev))
(or (fboundp 'calc-eval)
(error "Calc does not seem to be installed, and is needed to evaluate the formula"))
- (setq ev (calc-eval (cons form modes) (if numbers 'num))
+ (setq ev (calc-eval (cons form org-tbl-calc-modes) (if numbers 'num))
ev (if duration (org-table-time-seconds-to-string
(string-to-number ev)
duration-output-format) ev)))
"Convert a number of seconds to a time string.
If OUTPUT-FORMAT is non-nil, return a number of days, hours,
minutes or seconds."
- (cond ((eq output-format 'days)
- (format "%.3f" (/ (float secs) 86400)))
- ((eq output-format 'hours)
- (format "%.2f" (/ (float secs) 3600)))
- ((eq output-format 'minutes)
- (format "%.1f" (/ (float secs) 60)))
- ((eq output-format 'seconds)
- (format "%d" secs))
- (t (org-format-seconds "%.2h:%.2m:%.2s" secs))))
+ (let* ((secs0 (abs secs))
+ (res
+ (cond ((eq output-format 'days)
+ (format "%.3f" (/ (float secs0) 86400)))
+ ((eq output-format 'hours)
+ (format "%.2f" (/ (float secs0) 3600)))
+ ((eq output-format 'minutes)
+ (format "%.1f" (/ (float secs0) 60)))
+ ((eq output-format 'seconds)
+ (format "%d" secs0))
+ (t (org-format-seconds "%.2h:%.2m:%.2s" secs0)))))
+ (if (< secs 0) (concat "-" res) res)))
(defun org-table-fedit-convert-buffer (function)
"Convert all references in this buffer, using FUNCTION."
;; Maintainer: Bastien Guerry <bzg at gnu dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 7.8.09
+;; Version: 7.8.10
;;
;; This file is part of GNU Emacs.
;;
;;; Version
-(defconst org-version "7.8.09"
+(defconst org-version "7.8.10"
"The version number of the file org.el.")
;;;###autoload
"\\|" org-clock-string "\\)\\)?"
" *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?[]>]\\|<%%([^\r\n>]*>\\)")
org-planning-or-clock-line-re
- (concat "\\(?:^[ \t]*\\(" org-scheduled-string
- "\\|" org-deadline-string
- "\\|" org-closed-string "\\|" org-clock-string
- "\\)\\>\\)")
+ (concat "^[ \t]*\\("
+ org-scheduled-string "\\|"
+ org-deadline-string "\\|"
+ org-closed-string "\\|"
+ org-clock-string "\\)")
org-all-time-keywords
(mapcar (lambda (w) (substring w 0 -1))
(list org-scheduled-string org-deadline-string
(when org-pretty-entities
(catch 'match
(while (re-search-forward
- "\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|[^[:alpha:]\n]\\)"
+ "\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
limit t)
(if (and (not (org-in-indented-comment-line))
(setq ee (org-entity-get (match-string 1)))
(= (length (nth 6 ee)) 1))
- (progn
+ (let*
+ ((end (if (equal (match-string 2) "{}")
+ (match-end 2)
+ (match-end 1))))
(add-text-properties
- (match-beginning 0) (match-end 1)
+ (match-beginning 0) end
(list 'font-lock-fontified t))
- (compose-region (match-beginning 0) (match-end 1)
+ (compose-region (match-beginning 0) end
(nth 6 ee) nil)
(backward-char 1)
(throw 'match t))))
(defun org-cycle-internal-global ()
"Do the global cycling action."
- (cond
- ((and (eq last-command this-command)
- (eq org-cycle-global-status 'overview))
- ;; We just created the overview - now do table of contents
- ;; This can be slow in very large buffers, so indicate action
- (run-hook-with-args 'org-pre-cycle-hook 'contents)
- (message "CONTENTS...")
- (org-content)
- (message "CONTENTS...done")
- (setq org-cycle-global-status 'contents)
- (run-hook-with-args 'org-cycle-hook 'contents))
-
- ((and (eq last-command this-command)
- (eq org-cycle-global-status 'contents))
- ;; We just showed the table of contents - now show everything
- (run-hook-with-args 'org-pre-cycle-hook 'all)
- (show-all)
- (message "SHOW ALL")
- (setq org-cycle-global-status 'all)
- (run-hook-with-args 'org-cycle-hook 'all))
+ ;; Hack to avoid display of messages for .org attachments in Gnus
+ (let ((ga (string-match "\\*fontification" (buffer-name))))
+ (cond
+ ((and (eq last-command this-command)
+ (eq org-cycle-global-status 'overview))
+ ;; We just created the overview - now do table of contents
+ ;; This can be slow in very large buffers, so indicate action
+ (run-hook-with-args 'org-pre-cycle-hook 'contents)
+ (unless ga (message "CONTENTS..."))
+ (org-content)
+ (unless ga (message "CONTENTS...done"))
+ (setq org-cycle-global-status 'contents)
+ (run-hook-with-args 'org-cycle-hook 'contents))
+
+ ((and (eq last-command this-command)
+ (eq org-cycle-global-status 'contents))
+ ;; We just showed the table of contents - now show everything
+ (run-hook-with-args 'org-pre-cycle-hook 'all)
+ (show-all)
+ (unless ga (message "SHOW ALL"))
+ (setq org-cycle-global-status 'all)
+ (run-hook-with-args 'org-cycle-hook 'all))
- (t
- ;; Default action: go to overview
- (run-hook-with-args 'org-pre-cycle-hook 'overview)
- (org-overview)
- (message "OVERVIEW")
- (setq org-cycle-global-status 'overview)
- (run-hook-with-args 'org-cycle-hook 'overview))))
+ (t
+ ;; Default action: go to overview
+ (run-hook-with-args 'org-pre-cycle-hook 'overview)
+ (org-overview)
+ (unless ga (message "OVERVIEW"))
+ (setq org-cycle-global-status 'overview)
+ (run-hook-with-args 'org-cycle-hook 'overview)))))
(defun org-cycle-internal-local ()
"Do the local cycling action."
;;; Link abbreviations
(defun org-link-expand-abbrev (link)
- "Apply replacements as defined in `org-link-abbrev-alist."
+ "Apply replacements as defined in `org-link-abbrev-alist'."
(if (string-match "^\\([^:]*\\)\\(::?\\(.*\\)\\)?$" link)
(let* ((key (match-string 1 link))
(as (or (assoc key org-link-abbrev-alist-local)
(string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s))
(progn
(setq s (funcall org-link-translation-function
- (match-string 1) (match-string 2)))
+ (match-string 1 s) (match-string 2 s)))
(concat (car s) ":" (cdr s)))
s))
" *\\(\\<\\("
(mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
(org-re
- "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$")))
+ (if todo-only
+ "\\>\\)\\)[ \t]+\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$"
+ "\\>\\)\\)? *\\([^ ].*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))))
(props (list 'face 'default
'done-face 'org-agenda-done
'undone-face 'default