# HG changeset patch
# User Carsten Dominik
# Date 1216907996 0
# Node ID 60149c69603373ea7c4ef3f7bc4a4d8d81e8df23
# Parent fa6516860909fd3a8264a2d49230568358cd6edb
2008-07-24 Carsten Dominik
* org-exp.el (org-export-region-as-html, org-export-as-html): Make
sure that calls from `org-export-region-as-html' do not do the
special check for a subtree.
* org-agenda.el (org-batch-store-agenda-views): Fix parsing bug.
* org.el (org-open-file): Use
`org-open-directory-means-index-dot-org'.
(org-open-directory-means-index-dot-org): New option.
* org.el (org-make-link-string): Remove link attributes from
description.
(org-open-at-point): Remove link attributes bevore using the path.
* org-exp.el (org-export-as-html): Handle link attributes.
* org.el (org-extract-attributes, org-attributes-to-string): New functions.
* org-table.el (org-table-to-lisp): New function.
* org.el (org-narrow-to-subtree): Do not include the final newline
into the narrowed region.
* org-agenda.el (org-agenda-custom-commands-local-options): Fixed
bug with user-define skipping condition.
* org-agenda.el (org-agenda-get-restriction-and-command): Fixed typo.
* org-exp.el (org-export-html-style-default): Automatic overflow
handling for pre fields.
(org-export-as-ascii, org-export-as-html): Change default format
for time stamp.
* org-table.el (org-table-export): Offer completion for translator
functions, and do not require a heading above the table.
* org.el (org-renumber-ordered-list, org-beginning-of-item-list):
Cater for the case of a list starting in the first line of the
buffer.
* org-publish.el (org-publish-find-title): Bug fix.
(org-publish-org-index): Implement new :index-style option.
* org-publish.el (org-publish-timestamp-filename): Use
SHA1-encoded file names in the timestamp directory.
* org-publish.el (org-publish-needed-p): Be verbose about files
published and files skipped.
* org-exp.el (org-export-preprocess-string): Swap link
normalization and inernal link targeting.
* org-publish.el (org-publish-needed-p): Create timestamp
directory when it does not exist.
* org-clock.el (org-clock-out-when-done): Doc fix.
* org.el (org-agenda-skip-unavailable-files): Doc fix.
* org-exp.el (org-export-remove-comment-blocks-and-subtrees):
Ignore case when searching for the COMMENT cookie at export time.
* org-exp.el (org-get-file-contents)
(org-get-and-remove-property): New functions.
(org-export-handle-include-files): Handle the new prefix options.
(org-export-as-html): Fix the verse environment.
* org.el (org-time=, org-time<, org-time<=, org-time>)
(org-time>=, org-time<>, org-2ft): New functions.
(org-op-to-function): Also provide for the time testing fucntions.
* org-exp.el (org-export-html-style-default): New constant.
* org-exp.el (org-export-html-style-extra): New variable.
(org-export-splice-style): New function.
* org-exp.el (org-export-plist-vars, org-export-as-html):
Implement `org-export-creator-info'.
(org-export-creator-info): New option.
* org.el (org-clock-drawer-start-re, org-clock-drawer-end-re)
(org-property-drawer-re, org-clock-drawer-re): New constants.
* org-exp.el (org-icalendar-use-deadline)
(org-icalendar-use-scheduled): New options.
(org-icalendar-include-todo): Default changed to t.
(org-print-icalendar-entries): Implement better utilization of
scheduling and deadline time stamps.
(org-export-target-internal-links, org-export-as-html): Allow file
lines without the "file:" prefix if the file path is an absolute
path or starts with ".".
* org-clock.el (org-clocktable-shift): Also undertand yesterday,
lastweek etc.
(org-clock-special-range): Also undertand yesterday, lastweek etc.
* org.el (org-agenda-skip-archived-trees): Docstring now
discourages using this.
(org-scan-tags): Check for org-agenda-archives-mode.
(org-map-entries): Make sure org-agenda-archives-mode is nil.
(org-agenda-files): Functionality of second arg changed.
* org-agenda.el (org-agenda-archives-mode): New variable
(org-write-agenda, org-prepare-agenda, org-agenda-list)
(org-search-view, org-todo-list, org-tags-view)
(org-agenda-list-stuck-projects): Call `org-agenda-files' with
`ifmode' argument.
(org-agenda-quit): Reset the archives mode.
(org-agenda-archives-mode): New command.
(org-agenda-set-mode-name): Include archives info.
* org.el (org-paste-subtree): Make sure the yanked headline is
visible if it was yanked at a visible point.
(org-move-item-up): Fix the bug with moving white space at the end
of the item.
(org-show-empty-lines-in-parent): New function.
diff -r fa6516860909 -r 60149c696033 lisp/org/ChangeLog
--- a/lisp/org/ChangeLog Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/ChangeLog Thu Jul 24 13:59:56 2008 +0000
@@ -1,3 +1,122 @@
+2008-07-24 Carsten Dominik
+
+ * org-exp.el (org-export-region-as-html, org-export-as-html): Make
+ sure that calls from `org-export-region-as-html' do not do the
+ special check for a subtree.
+
+ * org-agenda.el (org-batch-store-agenda-views): Fix parsing bug.
+
+ * org.el (org-open-file): Use
+ `org-open-directory-means-index-dot-org'.
+ (org-open-directory-means-index-dot-org): New option.
+
+ * org.el (org-make-link-string): Remove link attributes from
+ description.
+ (org-open-at-point): Remove link attributes bevore using the path.
+
+ * org-exp.el (org-export-as-html): Handle link attributes.
+
+ * org.el (org-extract-attributes, org-attributes-to-string): New functions.
+
+ * org-table.el (org-table-to-lisp): New function.
+
+ * org.el (org-narrow-to-subtree): Do not include the final newline
+ into the narrowed region.
+
+ * org-agenda.el (org-agenda-custom-commands-local-options): Fixed
+ bug with user-define skipping condition.
+
+ * org-agenda.el (org-agenda-get-restriction-and-command): Fixed typo.
+
+ * org-exp.el (org-export-html-style-default): Automatic overflow
+ handling for pre fields.
+ (org-export-as-ascii, org-export-as-html): Change default format
+ for time stamp.
+
+ * org-table.el (org-table-export): Offer completion for translator
+ functions, and do not require a heading above the table.
+
+ * org.el (org-renumber-ordered-list, org-beginning-of-item-list):
+ Cater for the case of a list starting in the first line of the
+ buffer.
+
+ * org-publish.el (org-publish-find-title): Bug fix.
+ (org-publish-org-index): Implement new :index-style option.
+
+ * org-publish.el (org-publish-timestamp-filename): Use
+ SHA1-encoded file names in the timestamp directory.
+
+ * org-publish.el (org-publish-needed-p): Be verbose about files
+ published and files skipped.
+
+ * org-exp.el (org-export-preprocess-string): Swap link
+ normalization and inernal link targeting.
+
+ * org-publish.el (org-publish-needed-p): Create timestamp
+ directory when it does not exist.
+
+ * org-clock.el (org-clock-out-when-done): Doc fix.
+
+ * org.el (org-agenda-skip-unavailable-files): Doc fix.
+
+ * org-exp.el (org-export-remove-comment-blocks-and-subtrees):
+ Ignore case when searching for the COMMENT cookie at export time.
+
+ * org-exp.el (org-get-file-contents)
+ (org-get-and-remove-property): New functions.
+ (org-export-handle-include-files): Handle the new prefix options.
+ (org-export-as-html): Fix the verse environment.
+
+ * org.el (org-time=, org-time<, org-time<=, org-time>)
+ (org-time>=, org-time<>, org-2ft): New functions.
+ (org-op-to-function): Also provide for the time testing fucntions.
+
+ * org-exp.el (org-export-html-style-default): New constant.
+
+ * org-exp.el (org-export-html-style-extra): New variable.
+ (org-export-splice-style): New function.
+
+ * org-exp.el (org-export-plist-vars, org-export-as-html):
+ Implement `org-export-creator-info'.
+ (org-export-creator-info): New option.
+
+ * org.el (org-clock-drawer-start-re, org-clock-drawer-end-re)
+ (org-property-drawer-re, org-clock-drawer-re): New constants.
+
+ * org-exp.el (org-icalendar-use-deadline)
+ (org-icalendar-use-scheduled): New options.
+ (org-icalendar-include-todo): Default changed to t.
+ (org-print-icalendar-entries): Implement better utilization of
+ scheduling and deadline time stamps.
+ (org-export-target-internal-links, org-export-as-html): Allow file
+ lines without the "file:" prefix if the file path is an absolute
+ path or starts with ".".
+
+ * org-clock.el (org-clocktable-shift): Also undertand yesterday,
+ lastweek etc.
+ (org-clock-special-range): Also undertand yesterday, lastweek etc.
+
+ * org.el (org-agenda-skip-archived-trees): Docstring now
+ discourages using this.
+ (org-scan-tags): Check for org-agenda-archives-mode.
+ (org-map-entries): Make sure org-agenda-archives-mode is nil.
+ (org-agenda-files): Functionality of second arg changed.
+
+ * org-agenda.el (org-agenda-archives-mode): New variable
+ (org-write-agenda, org-prepare-agenda, org-agenda-list)
+ (org-search-view, org-todo-list, org-tags-view)
+ (org-agenda-list-stuck-projects): Call `org-agenda-files' with
+ `ifmode' argument.
+ (org-agenda-quit): Reset the archives mode.
+ (org-agenda-archives-mode): New command.
+ (org-agenda-set-mode-name): Include archives info.
+
+ * org.el (org-paste-subtree): Make sure the yanked headline is
+ visible if it was yanked at a visible point.
+ (org-move-item-up): Fix the bug with moving white space at the end
+ of the item.
+ (org-show-empty-lines-in-parent): New function.
+
2008-07-19 Juri Linkov
* org.el (narrow-map): Bind `org-narrow-to-subtree' to "s" on the
diff -r fa6516860909 -r 60149c696033 lisp/org/org-agenda.el
--- a/lisp/org/org-agenda.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-agenda.el Thu Jul 24 13:59:56 2008 +0000
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
@@ -211,9 +211,8 @@
(const :tag "no deadline" 'notdeadline))))))
(list :tag "Non-standard skipping condition"
:value (org-agenda-skip-function)
- (list
- (const org-agenda-skip-function)
- (sexp :tag "Function or form (quoted!)")))))
+ (const org-agenda-skip-function)
+ (sexp :tag "Function or form (quoted!)"))))
"Selection of examples for agenda command settings.
This will be spliced into the custom type of
`org-agenda-custom-commands'.")
@@ -392,6 +391,13 @@
:tag "Org Agenda Skip"
:group 'org-agenda)
+(defvar org-agenda-archives-mode nil
+ "Non-nil means, the agenda will include archived items.
+If this is the symbol `trees', trees in the selected agenda scope
+that are marked with the ARCHIVE tag will be included anyway. When this is
+t, also all archive files associated with the current selection of agenda
+files will be included.")
+
(defcustom org-agenda-skip-comment-trees t
"Non-nil means, skip trees that start with teh COMMENT keyword.
When nil, these trees are also scand by agenda commands."
@@ -1105,6 +1111,7 @@
(org-defkey org-agenda-mode-map "f" 'org-agenda-follow-mode)
(org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode)
(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
+(org-defkey org-agenda-mode-map "v" 'org-agenda-archives-mode)
(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
@@ -1234,14 +1241,25 @@
["Year View" org-agenda-year-view :active (org-agenda-check-type nil 'agenda)
:style radio :selected (member org-agenda-ndays '(365 366))]
"--"
- ["Show Logbook entries" org-agenda-log-mode
- :style toggle :selected org-agenda-show-log :active (org-agenda-check-type nil 'agenda 'timeline)]
+ ["Include Diary" org-agenda-toggle-diary
+ :style toggle :selected org-agenda-include-diary
+ :active (org-agenda-check-type nil 'agenda)]
+ ["Use Time Grid" org-agenda-toggle-time-grid
+ :style toggle :selected org-agenda-use-time-grid
+ :active (org-agenda-check-type nil 'agenda)]
+ "--"
["Show clock report" org-agenda-clockreport-mode
- :style toggle :selected org-agenda-clockreport-mode :active (org-agenda-check-type nil 'agenda)]
- ["Include Diary" org-agenda-toggle-diary
- :style toggle :selected org-agenda-include-diary :active (org-agenda-check-type nil 'agenda)]
- ["Use Time Grid" org-agenda-toggle-time-grid
- :style toggle :selected org-agenda-use-time-grid :active (org-agenda-check-type nil 'agenda)])
+ :style toggle :selected org-agenda-clockreport-mode
+ :active (org-agenda-check-type nil 'agenda)]
+ "--"
+ ["Show Logbook entries" org-agenda-log-mode
+ :style toggle :selected org-agenda-show-log
+ :active (org-agenda-check-type nil 'agenda 'timeline)]
+ ["Include archived trees" org-agenda-archives-mode
+ :style toggle :selected org-agenda-archives-mode :active t]
+ ["Include archive files" (org-agenda-archives-mode t)
+ :style toggle :selected (eq org-agenda-archives-mode t) :active t
+ :keys "C-u v"])
["Write view to file" org-write-agenda t]
["Rebuild buffer" org-agenda-redo t]
["Save all Org-mode Buffers" org-save-all-org-buffers t]
@@ -1475,7 +1493,7 @@
(insert (eval-when-compile
(let ((header
"
-Press key for an agenda command: < Buffer,subtree/region restriction
+Press key for an agenda command: < Buffer, subtree/region restriction
-------------------------------- > Remove restriction
a Agenda for current week or day e Export agenda views
t List of all TODO entries T Entries with special TODO kwd
@@ -1790,7 +1808,7 @@
(let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands))
(pop-up-frames nil)
(dir default-directory)
- pars cmd thiscmdkey files opts)
+ pars cmd thiscmdkey files opts cmd-or-set)
(while parameters
(push (list (pop parameters) (if parameters (pop parameters))) pars))
(setq pars (reverse pars))
@@ -1798,8 +1816,9 @@
(while cmds
(setq cmd (pop cmds)
thiscmdkey (car cmd)
- opts (nth 4 cmd)
- files (nth 5 cmd))
+ cmd-or-set (nth 2 cmd)
+ opts (nth (if (listp cmd-or-set) 3 4) cmd)
+ files (nth (if (listp cmd-or-set) 4 5) cmd))
(if (stringp files) (setq files (list files)))
(when files
(eval (list 'let (append org-agenda-exporter-settings opts pars)
@@ -1855,7 +1874,8 @@
(org-agenda-collect-markers)))
(org-icalendar-verify-function 'org-check-agenda-marker-table)
(org-combined-agenda-icalendar-file file))
- (apply 'org-export-icalendar 'combine (org-agenda-files))))
+ (apply 'org-export-icalendar 'combine
+ (org-agenda-files nil 'ifmode))))
(t
(let ((bs (buffer-string)))
(find-file file)
@@ -1937,7 +1957,7 @@
(org-agenda-reset-markers)
(setq org-agenda-contributing-files nil)
(setq org-agenda-columns-active nil)
- (org-prepare-agenda-buffers (org-agenda-files))
+ (org-prepare-agenda-buffers (org-agenda-files nil 'ifmode))
(setq org-todo-keywords-for-agenda
(org-uniquify org-todo-keywords-for-agenda))
(setq org-done-keywords-for-agenda
@@ -2032,7 +2052,7 @@
Also moves point to the end of the skipped region, so that search can
continue from there."
(let ((p (point-at-bol)) to fp)
- (and org-agenda-skip-archived-trees
+ (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))
@@ -2255,7 +2275,7 @@
(let* ((org-agenda-start-on-weekday
(if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays)))
org-agenda-start-on-weekday nil))
- (thefiles (org-agenda-files))
+ (thefiles (org-agenda-files nil 'ifmode))
(files thefiles)
(today (time-to-days
(time-subtract (current-time)
@@ -2373,7 +2393,7 @@
(put-text-property s (1- (point)) 'day d)
(put-text-property s (1- (point)) 'org-day-cnt day-cnt))))
(when (and org-agenda-clockreport-mode clocktable-start)
- (let ((org-agenda-files (org-agenda-files))
+ (let ((org-agenda-files (org-agenda-files nil 'ifmode))
;; the above line is to ensure the restricted range!
(p org-agenda-clockreport-parameter-plist)
tbl)
@@ -2502,7 +2522,7 @@
(setq regexp (pop regexps+))
(if hdl-only (setq regexp (concat "^" org-outline-regexp ".*?"
regexp))))
- (setq files (org-agenda-files))
+ (setq files (org-agenda-files nil 'ifmode))
(when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
(pop org-agenda-text-search-extra-files)
(setq files (org-add-archive-files files)))
@@ -2633,7 +2653,7 @@
(org-set-local 'org-last-arg arg)
(setq org-agenda-redo-command
'(org-todo-list (or current-prefix-arg org-last-arg)))
- (setq files (org-agenda-files)
+ (setq files (org-agenda-files nil 'ifmode)
rtnall nil)
(while (setq file (pop files))
(catch 'nextfile
@@ -2690,7 +2710,7 @@
(setq org-agenda-redo-command
(list 'org-tags-view (list 'quote todo-only)
(list 'if 'current-prefix-arg nil 'org-agenda-query-string)))
- (setq files (org-agenda-files)
+ (setq files (org-agenda-files nil 'ifmode)
rtnall nil)
(while (setq file (pop files))
(catch 'nextfile
@@ -2827,7 +2847,8 @@
(todo (nth 1 org-stuck-projects))
(todo-wds (if (member "*" todo)
(progn
- (org-prepare-agenda-buffers (org-agenda-files))
+ (org-prepare-agenda-buffers (org-agenda-files
+ nil 'ifmode))
(org-delete-all
org-done-keywords-for-agenda
(copy-sequence org-todo-keywords-for-agenda)))
@@ -4002,7 +4023,8 @@
(if (not (one-window-p)) (delete-window))
(kill-buffer buf)
(org-agenda-reset-markers)
- (org-columns-remove-overlays))
+ (org-columns-remove-overlays)
+ (setq org-agenda-archives-mode nil))
;; Maybe restore the pre-agenda window configuration.
(and org-agenda-restore-windows-after-quit
(not (eq org-agenda-window-setup 'other-frame))
@@ -4340,6 +4362,24 @@
(message "Log mode is %s"
(if org-agenda-show-log "on" "off")))
+(defun org-agenda-archives-mode (&optional with-files)
+ "Toggle log mode in an agenda buffer."
+ (interactive "P")
+ (setq org-agenda-archives-mode
+ (if with-files t (if org-agenda-archives-mode nil 'trees)))
+ (org-agenda-set-mode-name)
+ (org-agenda-redo)
+ (message
+ "%s"
+ (cond
+ ((eq org-agenda-archives-mode nil)
+ "No archives are included")
+ ((eq org-agenda-archives-mode 'trees)
+ (format "Trees with :%s: tag are included" org-archive-tag))
+ ((eq org-agenda-archives-mode t)
+ (format "Trees with :%s: tag and all active archive files are included"
+ org-archive-tag)))))
+
(defun org-agenda-toggle-diary ()
"Toggle diary inclusion in an agenda buffer."
(interactive)
@@ -4370,6 +4410,11 @@
(if org-agenda-include-diary " Diary" "")
(if org-agenda-use-time-grid " Grid" "")
(if org-agenda-show-log " Log" "")
+ (if org-agenda-archives-mode
+ (if (eq org-agenda-archives-mode t)
+ " Archives"
+ (format " :%s:" org-archive-tag))
+ "")
(if org-agenda-clockreport-mode " Clock" "")))
(force-mode-line-update))
diff -r fa6516860909 -r 60149c696033 lisp/org/org-archive.el
--- a/lisp/org/org-archive.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-archive.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
diff -r fa6516860909 -r 60149c696033 lisp/org/org-bbdb.el
--- a/lisp/org/org-bbdb.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-bbdb.el Thu Jul 24 13:59:56 2008 +0000
@@ -6,7 +6,7 @@
;; Thomas Baumann
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
diff -r fa6516860909 -r 60149c696033 lisp/org/org-bibtex.el
--- a/lisp/org/org-bibtex.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-bibtex.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Bastien Guerry
;; Carsten Dominik
;; Keywords: org, wp, remember
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
diff -r fa6516860909 -r 60149c696033 lisp/org/org-clock.el
--- a/lisp/org/org-clock.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-clock.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
@@ -54,8 +54,8 @@
(integer :tag "When at least N clock entries")))
(defcustom org-clock-out-when-done t
- "When t, the clock will be stopped when the relevant entry is marked DONE.
-When nil, clock will keep running until stopped explicitly with
+ "When non-nil, the clock will be stopped when the relevant entry is marked DONE.
+A nil value means, clock will keep running until stopped explicitly with
`C-c C-x C-o', or until the clock is started in a different item."
:group 'org-clock
:type 'boolean)
@@ -136,7 +136,7 @@
"Select a task that recently was associated with clocking."
(interactive)
(let (sel-list rpl file task (i 0) s)
- (save-window-excursion
+ (save-window-excursion
(org-switch-to-buffer-other-window
(get-buffer-create "*Clock Task Select*"))
(erase-buffer)
@@ -190,7 +190,7 @@
(when (and cat task)
(insert (format "[%c] %-15s %s\n" i cat task))
(cons i marker)))))
-
+
(defun org-update-mode-line ()
(let* ((delta (- (time-to-seconds (current-time))
(time-to-seconds org-clock-start-time)))
@@ -207,7 +207,7 @@
(defun org-clock-in (&optional select)
"Start the clock on the current item.
If necessary, clock-out of the currently active clock.
-With prefix arg SELECT, offer a list of recently clocked ta sks to
+With prefix arg SELECT, offer a list of recently clocked tasks to
clock into. When SELECT is `C-u C-u', clock into the current task and mark
is as the default task, a special task that will always be offered in
the clocking selection, associated with the letter `d'."
@@ -226,13 +226,13 @@
(marker-position org-clock-marker)
(marker-buffer org-clock-marker))
(org-clock-out t))
-
+
(when (equal select '(16))
;; Mark as default clocking task
(save-excursion
(org-back-to-heading t)
(move-marker org-clock-default-task (point))))
-
+
(setq target-pos (point)) ;; we want to clock in at this location
(save-excursion
(when (and selected-task (marker-buffer selected-task))
@@ -261,7 +261,7 @@
(setq org-clock-heading "???")))
(setq org-clock-heading (propertize org-clock-heading 'face nil))
(org-clock-find-position)
-
+
(insert "\n") (backward-char 1)
(indent-relative)
(insert org-clock-string " ")
@@ -638,7 +638,7 @@
((string-match "\\([-+][0-9]+\\)$" skey)
(setq shift (string-to-number (match-string 1 skey))
key (intern (substring skey 0 (match-beginning 1))))))
- (unless shift
+ (when (= shift 0)
(cond ((eq key 'yesterday) (setq key 'today shift -1))
((eq key 'lastweek) (setq key 'week shift -1))
((eq key 'lastmonth) (setq key 'month shift -1))
@@ -690,6 +690,11 @@
(s (match-string 1))
block shift ins y mw d date wp m)
(cond
+ ((equal s "yesterday") (setq s "today-1"))
+ ((equal s "lastweek") (setq s "thisweek-1"))
+ ((equal s "lastmonth") (setq s "thismonth-1"))
+ ((equal s "lastyear") (setq s "thisyear-1")))
+ (cond
((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s)
(setq block (match-string 1 s)
shift (if (match-end 2)
@@ -735,9 +740,9 @@
(ins (make-marker))
(total-time nil)
(scope (plist-get params :scope))
- (tostring (plist-get params :tostring))
- (multifile (plist-get params :multifile))
- (header (plist-get params :header))
+ (tostring (plist-get params :tostring))
+ (multifile (plist-get params :multifile))
+ (header (plist-get params :header))
(maxlevel (or (plist-get params :maxlevel) 3))
(step (plist-get params :step))
(emph (plist-get params :emphasize))
diff -r fa6516860909 -r 60149c696033 lisp/org/org-colview.el
--- a/lisp/org/org-colview.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-colview.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
@@ -1013,13 +1013,13 @@
(let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
(n (length title)) row tbl)
(goto-char (point-min))
- (while (and (re-search-forward "^\\(\\*+\\) " nil t)
- (or (null maxlevel)
- (>= maxlevel
- (if org-odd-levels-only
- (/ (1+ (length (match-string 1))) 2)
- (length (match-string 1))))))
- (when (get-char-property (match-beginning 0) 'org-columns-key)
+ (while (re-search-forward "^\\(\\*+\\) " nil t)
+ (when (and (or (null maxlevel)
+ (>= maxlevel
+ (if org-odd-levels-only
+ (/ (1+ (length (match-string 1))) 2)
+ (length (match-string 1)))))
+ (get-char-property (match-beginning 0) 'org-columns-key))
(setq row nil)
(loop for i from 0 to (1- n) do
(push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
diff -r fa6516860909 -r 60149c696033 lisp/org/org-compat.el
--- a/lisp/org/org-compat.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-compat.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
diff -r fa6516860909 -r 60149c696033 lisp/org/org-exp.el
--- a/lisp/org/org-exp.el Thu Jul 24 13:00:20 2008 +0000
+++ b/lisp/org/org-exp.el Thu Jul 24 13:59:56 2008 +0000
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.05a
+;; Version: 6.06a
;;
;; This file is part of GNU Emacs.
;;
@@ -209,6 +209,12 @@
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-creator-info t
+ "Non-nil means, the postamle should contain a creator sentence.
+This sentence is \"HTML generated by org-mode XX in emacs XXX\"."
+ :group 'org-export-general
+ :type 'boolean)
+
(defcustom org-export-time-stamp-file t
"Non-nil means, insert a time stamp into the exported file.
The time stamp shows when the file was created.
@@ -466,57 +472,69 @@
:group 'org-export-html
:type '(string :tag "File or URL"))
-(defcustom org-export-html-style
+(defconst org-export-html-style-default
""
"The default style specification for exported HTML files.
-Since there are different ways of setting style information, this variable
-needs to contain the full HTML structure to provide a style, including the
-surrounding HTML tags. The style specifications should include definitions
-for new classes todo, done, title, and deadline. For example, valid values
-would be:
+Please use the variables `org-export-html-style' and
+`org-export-html-style-extra' to add to this style.")
+
+(defcustom org-export-html-style ""
+ "Org-wide style definitions for exported HTML files.
+
+This variable needs to contain the full HTML structure to provide a style,
+including the surrounding HTML tags. If you set the value of this variable,
+you should consider to include definitions for the following classes:
+ title, todo, done, timestamp, timestamp-kwd, tag, target.
+
+For example, a valid value would be:
-or, if you want to keep the style in a file,
+If you'd like to refer to en external style file, use something like
As the value of this option simply gets inserted into the HTML header,
-you can \"misuse\" it to add arbitrary text to the header."
+you can \"misuse\" it to add arbitrary text to the header.
+See also the variable `org-export-html-style-extra'."
:group 'org-export-html
:type 'string)
+(defcustom org-export-html-style-extra ""
+ "Additional style information for HTML export.
+The value of this variable is inserted into the HTML buffer right after
+the value of `org-export-html-style'. Use this variable for per-file
+settings of style information, and do not forget to surround the style
+settings with tags."
+ :group 'org-export-html
+ :type 'string)
(defcustom org-export-html-title-format "
%s
\n"
"Format for typesetting the document title in HTML export."
@@ -625,6 +643,46 @@
:group 'org-export-icalendar
:type 'file)
+(defcustom org-icalendar-combined-name "OrgMode"
+ "Calendar name for the combined iCalendar representing all agenda files."
+ :group 'org-export-icalendar
+ :type 'string)
+
+(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
+ "Contexts where iCalendar export should use a deadline time stamp.
+This is a list with several symbols in it. Valid symbol are:
+
+event-if-todo Deadlines in TODO entries become calendar events.
+event-if-not-todo Deadlines in non-TODO entries become calendar events.
+todo-due Use deadlines in TODO entries as due-dates"
+ :group 'org-export-icalendar
+ :type '(set :greedy t
+ (const :tag "Deadlines in non-TODO entries become events"
+ event-if-not-todo)
+ (const :tag "Deadline in TODO entries become events"
+ event-if-todo)
+ (const :tag "Deadlines in TODO entries become due-dates"
+ todo-due)))
+
+(defcustom org-icalendar-use-scheduled '(todo-start)
+ "Contexts where iCalendar export should use a scheduling time stamp.
+This is a list with several symbols in it. Valid symbol are:
+
+event-if-todo Scheduling time stamps in TODO entries become an event.
+event-if-not-todo Scheduling time stamps in non-TODO entries become an event.
+todo-start Scheduling time stamps in TODO entries become start date.
+ Some calendar applications show TODO entries only after
+ that date."
+ :group 'org-export-icalendar
+ :type '(set :greedy t
+ (const :tag
+ "SCHEDULED timestamps in non-TODO entries become events"
+ event-if-not-todo)
+ (const :tag "SCHEDULED timestamps in TODO entries become events"
+ event-if-todo)
+ (const :tag "SCHEDULED in TODO entries become start date"
+ todo-start)))
+
(defcustom org-icalendar-include-todo nil
"Non-nil means, export to iCalendar files should also cover TODO items."
:group 'org-export-icalendar
@@ -650,11 +708,6 @@
(const :tag "Everything" t)
(integer :tag "Max characters")))
-(defcustom org-icalendar-combined-name "OrgMode"
- "Calendar name for the combined iCalendar representing all agenda files."
- :group 'org-export-icalendar
- :type 'string)
-
(defcustom org-icalendar-store-UID nil
"Non-nil means, store any created UIDs in properties.
The iCalendar standard requires that all entries have a unique identifyer.
@@ -709,10 +762,12 @@
(:fixed-width . org-export-with-fixed-width)
(:timestamps . org-export-with-timestamps)
(:author-info . org-export-author-info)
+ (:creator-info . org-export-creator-info)
(:time-stamp-file . org-export-time-stamp-file)
(:tables . org-export-with-tables)
(:table-auto-headline . org-export-highlight-first-table-line)
(:style . org-export-html-style)
+ (:style-extra . org-export-html-style-extra)
(:agenda-style . org-agenda-export-html-style)
(:convert-org-links . org-export-html-link-org-files-as-html)
(:inline-images . org-export-html-inline-images)
@@ -1361,15 +1416,15 @@
;; Find all links that contain a newline and put them into a single line
(org-export-concatenate-multiline-links)
+ ;; Normalize links: Convert angle and plain links into bracket links
+ ;; and expand link abbreviations
+ (org-export-normalize-links)
+
;; Find all internal links. If they have a fuzzy match (i.e. not
;; a *dedicated* target match, let the link point to the
;; corresponding section.
(org-export-target-internal-links target-alist)
- ;; Normalize links: Convert angle and plain links into bracket links
- ;; and expand link abbreviations
- (org-export-normalize-links)
-
;; Find multiline emphasis and put them into single line
(when (plist-get parameters :emph-multiline)
(org-export-concatenate-multiline-emphasis))
@@ -1380,10 +1435,12 @@
(defun org-export-kill-licensed-text ()
"Remove all text that is marked with a :org-license-to-kill property."
- (let (p)
+ (let (p q)
(while (setq p (text-property-any (point-min) (point-max)
:org-license-to-kill t))
- (delete-region p (next-single-property-change p :org-license-to-kill)))))
+ (delete-region
+ p (or (next-single-property-change p :org-license-to-kill)
+ (point-max))))))
(defun org-export-define-heading-targets (target-alist)
"Find all headings and define the targets for them.
@@ -1437,20 +1494,25 @@
(slink (org-solidify-link-text link))
found props pos
(target
- (or (cdr (assoc slink target-alist))
- (save-excursion
- (unless (string-match org-link-types-re link)
- (setq found (condition-case nil (org-link-search link)
- (error nil)))
- (when (and found
- (or (org-on-heading-p)
- (not (eq found 'dedicated))))
- (or (get-text-property (point) 'target)
- (get-text-property
- (max (point-min)
- (1- (previous-single-property-change
- (point) 'target)))
- 'target))))))))
+ (cond
+ ((cdr (assoc slink target-alist)))
+ ((string-match org-link-types-re link) nil)
+ ((or (file-name-absolute-p link)
+ (string-match "^\\." link))
+ nil)
+ (t
+ (save-excursion
+ (setq found (condition-case nil (org-link-search link)
+ (error nil)))
+ (when (and found
+ (or (org-on-heading-p)
+ (not (eq found 'dedicated))))
+ (or (get-text-property (point) 'target)
+ (get-text-property
+ (max (point-min)
+ (1- (previous-single-property-change
+ (point) 'target)))
+ 'target))))))))
(when target
(set-match-data md)
(goto-char (match-beginning 1))
@@ -1577,7 +1639,8 @@
(defun org-export-remove-comment-blocks-and-subtrees ()
"Remove the comment environment, and also commented subtrees."
- (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>")))
+ (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
+ (case-fold-search nil))
;; Remove comment environment
(goto-char (point-min))
(while (re-search-forward
@@ -1653,6 +1716,7 @@
(replace-match s t t))))
(goto-char (point-min))
(while (re-search-forward org-bracket-link-regexp nil t)
+ (goto-char (1- (match-end 0)))
(org-if-unprotected
(let* ((xx (save-match-data
(org-link-expand-abbrev (match-string 1))))
@@ -1835,10 +1899,12 @@
(defun org-export-handle-include-files ()
"Include the contents of include files, with proper formatting."
(let ((case-fold-search t)
- params file markup lang start end)
+ params file markup lang start end prefix prefix1)
(goto-char (point-min))
(while (re-search-forward "^#\\+INCLUDE:?[ \t]+\\(.*\\)" nil t)
(setq params (read (concat "(" (match-string 1) ")"))
+ prefix (org-get-and-remove-property 'params :prefix)
+ prefix1 (org-get-and-remove-property 'params :prefix1)
file (org-symname-or-string (pop params))
markup (org-symname-or-string (pop params))
lang (org-symname-or-string (pop params)))
@@ -1854,17 +1920,45 @@
(setq start (format "#+begin_%s\n" markup)
end (format "#+end_%s" markup))))
(insert (or start ""))
- (forward-char (nth 1 (insert-file-contents (expand-file-name file))))
+ (insert (org-get-file-contents (expand-file-name file) prefix prefix1))
(or (bolp) (newline))
(insert (or end ""))))))
+(defun org-get-file-contents (file &optional prefix prefix1)
+ "Get the contents of FILE and return them as a string.
+If PREFIX is a string, prepend it to each line. If PREFIX1
+is a string, prepend it to the first line instead of PREFIX."
+ (with-temp-buffer
+ (insert-file-contents file)
+ (when (or prefix prefix1)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (insert (or prefix1 prefix))
+ (setq prefix1 nil)
+ (beginning-of-line 2)))
+ (buffer-string)))
+
+(defun org-get-and-remove-property (listvar prop)
+ "Check if the value of LISTVAR contains PROP as a property.
+If yes, return the value of that property (i.e. the element following
+in the list) and remove property and value from the list in LISTVAR."
+ (let ((list (symbol-value listvar)) m v)
+ (when (setq m (member prop list))
+ (setq v (nth 1 m))
+ (if (equal (car list) prop)
+ (set listvar (cddr list))
+ (setcdr (nthcdr (- (length list) (length m) 1) list)
+ (cddr m))
+ (set listvar list)))
+ v))
+
(defun org-symname-or-string (s)
(if (symbolp s)
(if s (symbol-name s) s)
s))
;;; Fontification of code
-;; Currently only for th HTML backend, but who knows....
+;; Currently only for the HTML backend, but who knows....
(defun org-export-replace-src-segments ()
"Replace source code segments with special code for export."
(let ((case-fold-search t)
@@ -1915,8 +2009,9 @@
(org-export-htmlize-region-for-paste
(point-min) (point-max)))))
(if (string-match "