aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/org/ChangeLog119
-rw-r--r--lisp/org/org-agenda.el93
-rw-r--r--lisp/org/org-archive.el2
-rw-r--r--lisp/org/org-bbdb.el2
-rw-r--r--lisp/org/org-bibtex.el2
-rw-r--r--lisp/org/org-clock.el31
-rw-r--r--lisp/org/org-colview.el16
-rw-r--r--lisp/org/org-compat.el2
-rw-r--r--lisp/org/org-exp.el330
-rw-r--r--lisp/org/org-export-latex.el23
-rw-r--r--lisp/org/org-faces.el2
-rw-r--r--lisp/org/org-gnus.el2
-rw-r--r--lisp/org/org-id.el2
-rw-r--r--lisp/org/org-info.el2
-rw-r--r--lisp/org/org-irc.el2
-rw-r--r--lisp/org/org-jsinfo.el2
-rw-r--r--lisp/org/org-mac-message.el2
-rw-r--r--lisp/org/org-macs.el2
-rw-r--r--lisp/org/org-mew.el2
-rw-r--r--lisp/org/org-mhe.el2
-rw-r--r--lisp/org/org-mouse.el2
-rw-r--r--lisp/org/org-publish.el92
-rw-r--r--lisp/org/org-remember.el2
-rw-r--r--lisp/org/org-rmail.el2
-rw-r--r--lisp/org/org-table.el43
-rw-r--r--lisp/org/org-vm.el2
-rw-r--r--lisp/org/org-wl.el2
-rw-r--r--lisp/org/org.el214
28 files changed, 739 insertions, 260 deletions
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 5b633cc9211..ca55cd320eb 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,122 @@
12008-07-24 Carsten Dominik <dominik@science.uva.nl>
2
3 * org-exp.el (org-export-region-as-html, org-export-as-html): Make
4 sure that calls from `org-export-region-as-html' do not do the
5 special check for a subtree.
6
7 * org-agenda.el (org-batch-store-agenda-views): Fix parsing bug.
8
9 * org.el (org-open-file): Use
10 `org-open-directory-means-index-dot-org'.
11 (org-open-directory-means-index-dot-org): New option.
12
13 * org.el (org-make-link-string): Remove link attributes from
14 description.
15 (org-open-at-point): Remove link attributes bevore using the path.
16
17 * org-exp.el (org-export-as-html): Handle link attributes.
18
19 * org.el (org-extract-attributes, org-attributes-to-string): New functions.
20
21 * org-table.el (org-table-to-lisp): New function.
22
23 * org.el (org-narrow-to-subtree): Do not include the final newline
24 into the narrowed region.
25
26 * org-agenda.el (org-agenda-custom-commands-local-options): Fixed
27 bug with user-define skipping condition.
28
29 * org-agenda.el (org-agenda-get-restriction-and-command): Fixed typo.
30
31 * org-exp.el (org-export-html-style-default): Automatic overflow
32 handling for pre fields.
33 (org-export-as-ascii, org-export-as-html): Change default format
34 for time stamp.
35
36 * org-table.el (org-table-export): Offer completion for translator
37 functions, and do not require a heading above the table.
38
39 * org.el (org-renumber-ordered-list, org-beginning-of-item-list):
40 Cater for the case of a list starting in the first line of the
41 buffer.
42
43 * org-publish.el (org-publish-find-title): Bug fix.
44 (org-publish-org-index): Implement new :index-style option.
45
46 * org-publish.el (org-publish-timestamp-filename): Use
47 SHA1-encoded file names in the timestamp directory.
48
49 * org-publish.el (org-publish-needed-p): Be verbose about files
50 published and files skipped.
51
52 * org-exp.el (org-export-preprocess-string): Swap link
53 normalization and inernal link targeting.
54
55 * org-publish.el (org-publish-needed-p): Create timestamp
56 directory when it does not exist.
57
58 * org-clock.el (org-clock-out-when-done): Doc fix.
59
60 * org.el (org-agenda-skip-unavailable-files): Doc fix.
61
62 * org-exp.el (org-export-remove-comment-blocks-and-subtrees):
63 Ignore case when searching for the COMMENT cookie at export time.
64
65 * org-exp.el (org-get-file-contents)
66 (org-get-and-remove-property): New functions.
67 (org-export-handle-include-files): Handle the new prefix options.
68 (org-export-as-html): Fix the verse environment.
69
70 * org.el (org-time=, org-time<, org-time<=, org-time>)
71 (org-time>=, org-time<>, org-2ft): New functions.
72 (org-op-to-function): Also provide for the time testing fucntions.
73
74 * org-exp.el (org-export-html-style-default): New constant.
75
76 * org-exp.el (org-export-html-style-extra): New variable.
77 (org-export-splice-style): New function.
78
79 * org-exp.el (org-export-plist-vars, org-export-as-html):
80 Implement `org-export-creator-info'.
81 (org-export-creator-info): New option.
82
83 * org.el (org-clock-drawer-start-re, org-clock-drawer-end-re)
84 (org-property-drawer-re, org-clock-drawer-re): New constants.
85
86 * org-exp.el (org-icalendar-use-deadline)
87 (org-icalendar-use-scheduled): New options.
88 (org-icalendar-include-todo): Default changed to t.
89 (org-print-icalendar-entries): Implement better utilization of
90 scheduling and deadline time stamps.
91 (org-export-target-internal-links, org-export-as-html): Allow file
92 lines without the "file:" prefix if the file path is an absolute
93 path or starts with ".".
94
95 * org-clock.el (org-clocktable-shift): Also undertand yesterday,
96 lastweek etc.
97 (org-clock-special-range): Also undertand yesterday, lastweek etc.
98
99 * org.el (org-agenda-skip-archived-trees): Docstring now
100 discourages using this.
101 (org-scan-tags): Check for org-agenda-archives-mode.
102 (org-map-entries): Make sure org-agenda-archives-mode is nil.
103 (org-agenda-files): Functionality of second arg changed.
104
105 * org-agenda.el (org-agenda-archives-mode): New variable
106 (org-write-agenda, org-prepare-agenda, org-agenda-list)
107 (org-search-view, org-todo-list, org-tags-view)
108 (org-agenda-list-stuck-projects): Call `org-agenda-files' with
109 `ifmode' argument.
110 (org-agenda-quit): Reset the archives mode.
111 (org-agenda-archives-mode): New command.
112 (org-agenda-set-mode-name): Include archives info.
113
114 * org.el (org-paste-subtree): Make sure the yanked headline is
115 visible if it was yanked at a visible point.
116 (org-move-item-up): Fix the bug with moving white space at the end
117 of the item.
118 (org-show-empty-lines-in-parent): New function.
119
12008-07-19 Juri Linkov <juri@jurta.org> 1202008-07-19 Juri Linkov <juri@jurta.org>
2 121
3 * org.el (narrow-map): Bind `org-narrow-to-subtree' to "s" on the 122 * org.el (narrow-map): Bind `org-narrow-to-subtree' to "s" on the
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 32efe5d8413..23cda508a9a 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.05a 9;; Version: 6.06a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -211,9 +211,8 @@ you can \"misuse\" it to also add other text to the header. However,
211 (const :tag "no deadline" 'notdeadline)))))) 211 (const :tag "no deadline" 'notdeadline))))))
212 (list :tag "Non-standard skipping condition" 212 (list :tag "Non-standard skipping condition"
213 :value (org-agenda-skip-function) 213 :value (org-agenda-skip-function)
214 (list 214 (const org-agenda-skip-function)
215 (const org-agenda-skip-function) 215 (sexp :tag "Function or form (quoted!)"))))
216 (sexp :tag "Function or form (quoted!)")))))
217 "Selection of examples for agenda command settings. 216 "Selection of examples for agenda command settings.
218This will be spliced into the custom type of 217This will be spliced into the custom type of
219`org-agenda-custom-commands'.") 218`org-agenda-custom-commands'.")
@@ -392,6 +391,13 @@ or `C-c a #' to produce the list."
392 :tag "Org Agenda Skip" 391 :tag "Org Agenda Skip"
393 :group 'org-agenda) 392 :group 'org-agenda)
394 393
394(defvar org-agenda-archives-mode nil
395 "Non-nil means, the agenda will include archived items.
396If this is the symbol `trees', trees in the selected agenda scope
397that are marked with the ARCHIVE tag will be included anyway. When this is
398t, also all archive files associated with the current selection of agenda
399files will be included.")
400
395(defcustom org-agenda-skip-comment-trees t 401(defcustom org-agenda-skip-comment-trees t
396 "Non-nil means, skip trees that start with teh COMMENT keyword. 402 "Non-nil means, skip trees that start with teh COMMENT keyword.
397When nil, these trees are also scand by agenda commands." 403When nil, these trees are also scand by agenda commands."
@@ -1105,6 +1111,7 @@ The following commands are available:
1105(org-defkey org-agenda-mode-map "f" 'org-agenda-follow-mode) 1111(org-defkey org-agenda-mode-map "f" 'org-agenda-follow-mode)
1106(org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode) 1112(org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode)
1107(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode) 1113(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
1114(org-defkey org-agenda-mode-map "v" 'org-agenda-archives-mode)
1108(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary) 1115(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
1109(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid) 1116(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
1110(org-defkey org-agenda-mode-map "r" 'org-agenda-redo) 1117(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
@@ -1234,14 +1241,25 @@ The following commands are available:
1234 ["Year View" org-agenda-year-view :active (org-agenda-check-type nil 'agenda) 1241 ["Year View" org-agenda-year-view :active (org-agenda-check-type nil 'agenda)
1235 :style radio :selected (member org-agenda-ndays '(365 366))] 1242 :style radio :selected (member org-agenda-ndays '(365 366))]
1236 "--" 1243 "--"
1237 ["Show Logbook entries" org-agenda-log-mode
1238 :style toggle :selected org-agenda-show-log :active (org-agenda-check-type nil 'agenda 'timeline)]
1239 ["Show clock report" org-agenda-clockreport-mode
1240 :style toggle :selected org-agenda-clockreport-mode :active (org-agenda-check-type nil 'agenda)]
1241 ["Include Diary" org-agenda-toggle-diary 1244 ["Include Diary" org-agenda-toggle-diary
1242 :style toggle :selected org-agenda-include-diary :active (org-agenda-check-type nil 'agenda)] 1245 :style toggle :selected org-agenda-include-diary
1246 :active (org-agenda-check-type nil 'agenda)]
1243 ["Use Time Grid" org-agenda-toggle-time-grid 1247 ["Use Time Grid" org-agenda-toggle-time-grid
1244 :style toggle :selected org-agenda-use-time-grid :active (org-agenda-check-type nil 'agenda)]) 1248 :style toggle :selected org-agenda-use-time-grid
1249 :active (org-agenda-check-type nil 'agenda)]
1250 "--"
1251 ["Show clock report" org-agenda-clockreport-mode
1252 :style toggle :selected org-agenda-clockreport-mode
1253 :active (org-agenda-check-type nil 'agenda)]
1254 "--"
1255 ["Show Logbook entries" org-agenda-log-mode
1256 :style toggle :selected org-agenda-show-log
1257 :active (org-agenda-check-type nil 'agenda 'timeline)]
1258 ["Include archived trees" org-agenda-archives-mode
1259 :style toggle :selected org-agenda-archives-mode :active t]
1260 ["Include archive files" (org-agenda-archives-mode t)
1261 :style toggle :selected (eq org-agenda-archives-mode t) :active t
1262 :keys "C-u v"])
1245 ["Write view to file" org-write-agenda t] 1263 ["Write view to file" org-write-agenda t]
1246 ["Rebuild buffer" org-agenda-redo t] 1264 ["Rebuild buffer" org-agenda-redo t]
1247 ["Save all Org-mode Buffers" org-save-all-org-buffers t] 1265 ["Save all Org-mode Buffers" org-save-all-org-buffers t]
@@ -1475,7 +1493,7 @@ Pressing `<' twice means to restrict to the current subtree or region
1475 (insert (eval-when-compile 1493 (insert (eval-when-compile
1476 (let ((header 1494 (let ((header
1477" 1495"
1478Press key for an agenda command: < Buffer,subtree/region restriction 1496Press key for an agenda command: < Buffer, subtree/region restriction
1479-------------------------------- > Remove restriction 1497-------------------------------- > Remove restriction
1480a Agenda for current week or day e Export agenda views 1498a Agenda for current week or day e Export agenda views
1481t List of all TODO entries T Entries with special TODO kwd 1499t List of all TODO entries T Entries with special TODO kwd
@@ -1790,7 +1808,7 @@ so the export commands can easily use it."
1790 (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands)) 1808 (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands))
1791 (pop-up-frames nil) 1809 (pop-up-frames nil)
1792 (dir default-directory) 1810 (dir default-directory)
1793 pars cmd thiscmdkey files opts) 1811 pars cmd thiscmdkey files opts cmd-or-set)
1794 (while parameters 1812 (while parameters
1795 (push (list (pop parameters) (if parameters (pop parameters))) pars)) 1813 (push (list (pop parameters) (if parameters (pop parameters))) pars))
1796 (setq pars (reverse pars)) 1814 (setq pars (reverse pars))
@@ -1798,8 +1816,9 @@ so the export commands can easily use it."
1798 (while cmds 1816 (while cmds
1799 (setq cmd (pop cmds) 1817 (setq cmd (pop cmds)
1800 thiscmdkey (car cmd) 1818 thiscmdkey (car cmd)
1801 opts (nth 4 cmd) 1819 cmd-or-set (nth 2 cmd)
1802 files (nth 5 cmd)) 1820 opts (nth (if (listp cmd-or-set) 3 4) cmd)
1821 files (nth (if (listp cmd-or-set) 4 5) cmd))
1803 (if (stringp files) (setq files (list files))) 1822 (if (stringp files) (setq files (list files)))
1804 (when files 1823 (when files
1805 (eval (list 'let (append org-agenda-exporter-settings opts pars) 1824 (eval (list 'let (append org-agenda-exporter-settings opts pars)
@@ -1855,7 +1874,8 @@ higher priority settings."
1855 (org-agenda-collect-markers))) 1874 (org-agenda-collect-markers)))
1856 (org-icalendar-verify-function 'org-check-agenda-marker-table) 1875 (org-icalendar-verify-function 'org-check-agenda-marker-table)
1857 (org-combined-agenda-icalendar-file file)) 1876 (org-combined-agenda-icalendar-file file))
1858 (apply 'org-export-icalendar 'combine (org-agenda-files)))) 1877 (apply 'org-export-icalendar 'combine
1878 (org-agenda-files nil 'ifmode))))
1859 (t 1879 (t
1860 (let ((bs (buffer-string))) 1880 (let ((bs (buffer-string)))
1861 (find-file file) 1881 (find-file file)
@@ -1937,7 +1957,7 @@ higher priority settings."
1937 (org-agenda-reset-markers) 1957 (org-agenda-reset-markers)
1938 (setq org-agenda-contributing-files nil) 1958 (setq org-agenda-contributing-files nil)
1939 (setq org-agenda-columns-active nil) 1959 (setq org-agenda-columns-active nil)
1940 (org-prepare-agenda-buffers (org-agenda-files)) 1960 (org-prepare-agenda-buffers (org-agenda-files nil 'ifmode))
1941 (setq org-todo-keywords-for-agenda 1961 (setq org-todo-keywords-for-agenda
1942 (org-uniquify org-todo-keywords-for-agenda)) 1962 (org-uniquify org-todo-keywords-for-agenda))
1943 (setq org-done-keywords-for-agenda 1963 (setq org-done-keywords-for-agenda
@@ -2032,7 +2052,7 @@ it is through options in org-agenda-custom-commands.")
2032Also moves point to the end of the skipped region, so that search can 2052Also moves point to the end of the skipped region, so that search can
2033continue from there." 2053continue from there."
2034 (let ((p (point-at-bol)) to fp) 2054 (let ((p (point-at-bol)) to fp)
2035 (and org-agenda-skip-archived-trees 2055 (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
2036 (get-text-property p :org-archived) 2056 (get-text-property p :org-archived)
2037 (org-end-of-subtree t) 2057 (org-end-of-subtree t)
2038 (throw :skip t)) 2058 (throw :skip t))
@@ -2255,7 +2275,7 @@ given in `org-agenda-start-on-weekday'."
2255 (let* ((org-agenda-start-on-weekday 2275 (let* ((org-agenda-start-on-weekday
2256 (if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays))) 2276 (if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays)))
2257 org-agenda-start-on-weekday nil)) 2277 org-agenda-start-on-weekday nil))
2258 (thefiles (org-agenda-files)) 2278 (thefiles (org-agenda-files nil 'ifmode))
2259 (files thefiles) 2279 (files thefiles)
2260 (today (time-to-days 2280 (today (time-to-days
2261 (time-subtract (current-time) 2281 (time-subtract (current-time)
@@ -2373,7 +2393,7 @@ given in `org-agenda-start-on-weekday'."
2373 (put-text-property s (1- (point)) 'day d) 2393 (put-text-property s (1- (point)) 'day d)
2374 (put-text-property s (1- (point)) 'org-day-cnt day-cnt)))) 2394 (put-text-property s (1- (point)) 'org-day-cnt day-cnt))))
2375 (when (and org-agenda-clockreport-mode clocktable-start) 2395 (when (and org-agenda-clockreport-mode clocktable-start)
2376 (let ((org-agenda-files (org-agenda-files)) 2396 (let ((org-agenda-files (org-agenda-files nil 'ifmode))
2377 ;; the above line is to ensure the restricted range! 2397 ;; the above line is to ensure the restricted range!
2378 (p org-agenda-clockreport-parameter-plist) 2398 (p org-agenda-clockreport-parameter-plist)
2379 tbl) 2399 tbl)
@@ -2502,7 +2522,7 @@ in `org-agenda-text-search-extra-files'."
2502 (setq regexp (pop regexps+)) 2522 (setq regexp (pop regexps+))
2503 (if hdl-only (setq regexp (concat "^" org-outline-regexp ".*?" 2523 (if hdl-only (setq regexp (concat "^" org-outline-regexp ".*?"
2504 regexp)))) 2524 regexp))))
2505 (setq files (org-agenda-files)) 2525 (setq files (org-agenda-files nil 'ifmode))
2506 (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives) 2526 (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
2507 (pop org-agenda-text-search-extra-files) 2527 (pop org-agenda-text-search-extra-files)
2508 (setq files (org-add-archive-files files))) 2528 (setq files (org-add-archive-files files)))
@@ -2633,7 +2653,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
2633 (org-set-local 'org-last-arg arg) 2653 (org-set-local 'org-last-arg arg)
2634 (setq org-agenda-redo-command 2654 (setq org-agenda-redo-command
2635 '(org-todo-list (or current-prefix-arg org-last-arg))) 2655 '(org-todo-list (or current-prefix-arg org-last-arg)))
2636 (setq files (org-agenda-files) 2656 (setq files (org-agenda-files nil 'ifmode)
2637 rtnall nil) 2657 rtnall nil)
2638 (while (setq file (pop files)) 2658 (while (setq file (pop files))
2639 (catch 'nextfile 2659 (catch 'nextfile
@@ -2690,7 +2710,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
2690 (setq org-agenda-redo-command 2710 (setq org-agenda-redo-command
2691 (list 'org-tags-view (list 'quote todo-only) 2711 (list 'org-tags-view (list 'quote todo-only)
2692 (list 'if 'current-prefix-arg nil 'org-agenda-query-string))) 2712 (list 'if 'current-prefix-arg nil 'org-agenda-query-string)))
2693 (setq files (org-agenda-files) 2713 (setq files (org-agenda-files nil 'ifmode)
2694 rtnall nil) 2714 rtnall nil)
2695 (while (setq file (pop files)) 2715 (while (setq file (pop files))
2696 (catch 'nextfile 2716 (catch 'nextfile
@@ -2827,7 +2847,8 @@ MATCH is being ignored."
2827 (todo (nth 1 org-stuck-projects)) 2847 (todo (nth 1 org-stuck-projects))
2828 (todo-wds (if (member "*" todo) 2848 (todo-wds (if (member "*" todo)
2829 (progn 2849 (progn
2830 (org-prepare-agenda-buffers (org-agenda-files)) 2850 (org-prepare-agenda-buffers (org-agenda-files
2851 nil 'ifmode))
2831 (org-delete-all 2852 (org-delete-all
2832 org-done-keywords-for-agenda 2853 org-done-keywords-for-agenda
2833 (copy-sequence org-todo-keywords-for-agenda))) 2854 (copy-sequence org-todo-keywords-for-agenda)))
@@ -4002,7 +4023,8 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
4002 (if (not (one-window-p)) (delete-window)) 4023 (if (not (one-window-p)) (delete-window))
4003 (kill-buffer buf) 4024 (kill-buffer buf)
4004 (org-agenda-reset-markers) 4025 (org-agenda-reset-markers)
4005 (org-columns-remove-overlays)) 4026 (org-columns-remove-overlays)
4027 (setq org-agenda-archives-mode nil))
4006 ;; Maybe restore the pre-agenda window configuration. 4028 ;; Maybe restore the pre-agenda window configuration.
4007 (and org-agenda-restore-windows-after-quit 4029 (and org-agenda-restore-windows-after-quit
4008 (not (eq org-agenda-window-setup 'other-frame)) 4030 (not (eq org-agenda-window-setup 'other-frame))
@@ -4340,6 +4362,24 @@ so that the date SD will be in that range."
4340 (message "Log mode is %s" 4362 (message "Log mode is %s"
4341 (if org-agenda-show-log "on" "off"))) 4363 (if org-agenda-show-log "on" "off")))
4342 4364
4365(defun org-agenda-archives-mode (&optional with-files)
4366 "Toggle log mode in an agenda buffer."
4367 (interactive "P")
4368 (setq org-agenda-archives-mode
4369 (if with-files t (if org-agenda-archives-mode nil 'trees)))
4370 (org-agenda-set-mode-name)
4371 (org-agenda-redo)
4372 (message
4373 "%s"
4374 (cond
4375 ((eq org-agenda-archives-mode nil)
4376 "No archives are included")
4377 ((eq org-agenda-archives-mode 'trees)
4378 (format "Trees with :%s: tag are included" org-archive-tag))
4379 ((eq org-agenda-archives-mode t)
4380 (format "Trees with :%s: tag and all active archive files are included"
4381 org-archive-tag)))))
4382
4343(defun org-agenda-toggle-diary () 4383(defun org-agenda-toggle-diary ()
4344 "Toggle diary inclusion in an agenda buffer." 4384 "Toggle diary inclusion in an agenda buffer."
4345 (interactive) 4385 (interactive)
@@ -4370,6 +4410,11 @@ so that the date SD will be in that range."
4370 (if org-agenda-include-diary " Diary" "") 4410 (if org-agenda-include-diary " Diary" "")
4371 (if org-agenda-use-time-grid " Grid" "") 4411 (if org-agenda-use-time-grid " Grid" "")
4372 (if org-agenda-show-log " Log" "") 4412 (if org-agenda-show-log " Log" "")
4413 (if org-agenda-archives-mode
4414 (if (eq org-agenda-archives-mode t)
4415 " Archives"
4416 (format " :%s:" org-archive-tag))
4417 "")
4373 (if org-agenda-clockreport-mode " Clock" ""))) 4418 (if org-agenda-clockreport-mode " Clock" "")))
4374 (force-mode-line-update)) 4419 (force-mode-line-update))
4375 4420
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 3d7d06f3453..0ddac74d883 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index 4dd6b2332c4..fb913a09f43 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -6,7 +6,7 @@
6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> 6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.05a 9;; Version: 6.06a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index e314f452e9f..0fe619d5bc7 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -5,7 +5,7 @@
5;; Author: Bastien Guerry <bzg at altern dot org> 5;; Author: Bastien Guerry <bzg at altern dot org>
6;; Carsten Dominik <carsten dot dominik at gmail dot com> 6;; Carsten Dominik <carsten dot dominik at gmail dot com>
7;; Keywords: org, wp, remember 7;; Keywords: org, wp, remember
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 44d8840482a..6caf8393f94 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -54,8 +54,8 @@ reaches or exceeds this number, a drawer will be created."
54 (integer :tag "When at least N clock entries"))) 54 (integer :tag "When at least N clock entries")))
55 55
56(defcustom org-clock-out-when-done t 56(defcustom org-clock-out-when-done t
57 "When t, the clock will be stopped when the relevant entry is marked DONE. 57 "When non-nil, the clock will be stopped when the relevant entry is marked DONE.
58When nil, clock will keep running until stopped explicitly with 58A nil value means, clock will keep running until stopped explicitly with
59`C-c C-x C-o', or until the clock is started in a different item." 59`C-c C-x C-o', or until the clock is started in a different item."
60 :group 'org-clock 60 :group 'org-clock
61 :type 'boolean) 61 :type 'boolean)
@@ -136,7 +136,7 @@ of a different task.")
136 "Select a task that recently was associated with clocking." 136 "Select a task that recently was associated with clocking."
137 (interactive) 137 (interactive)
138 (let (sel-list rpl file task (i 0) s) 138 (let (sel-list rpl file task (i 0) s)
139 (save-window-excursion 139 (save-window-excursion
140 (org-switch-to-buffer-other-window 140 (org-switch-to-buffer-other-window
141 (get-buffer-create "*Clock Task Select*")) 141 (get-buffer-create "*Clock Task Select*"))
142 (erase-buffer) 142 (erase-buffer)
@@ -190,7 +190,7 @@ of a different task.")
190 (when (and cat task) 190 (when (and cat task)
191 (insert (format "[%c] %-15s %s\n" i cat task)) 191 (insert (format "[%c] %-15s %s\n" i cat task))
192 (cons i marker))))) 192 (cons i marker)))))
193 193
194(defun org-update-mode-line () 194(defun org-update-mode-line ()
195 (let* ((delta (- (time-to-seconds (current-time)) 195 (let* ((delta (- (time-to-seconds (current-time))
196 (time-to-seconds org-clock-start-time))) 196 (time-to-seconds org-clock-start-time)))
@@ -207,7 +207,7 @@ of a different task.")
207(defun org-clock-in (&optional select) 207(defun org-clock-in (&optional select)
208 "Start the clock on the current item. 208 "Start the clock on the current item.
209If necessary, clock-out of the currently active clock. 209If necessary, clock-out of the currently active clock.
210With prefix arg SELECT, offer a list of recently clocked ta sks to 210With prefix arg SELECT, offer a list of recently clocked tasks to
211clock into. When SELECT is `C-u C-u', clock into the current task and mark 211clock into. When SELECT is `C-u C-u', clock into the current task and mark
212is as the default task, a special task that will always be offered in 212is as the default task, a special task that will always be offered in
213the clocking selection, associated with the letter `d'." 213the clocking selection, associated with the letter `d'."
@@ -226,13 +226,13 @@ the clocking selection, associated with the letter `d'."
226 (marker-position org-clock-marker) 226 (marker-position org-clock-marker)
227 (marker-buffer org-clock-marker)) 227 (marker-buffer org-clock-marker))
228 (org-clock-out t)) 228 (org-clock-out t))
229 229
230 (when (equal select '(16)) 230 (when (equal select '(16))
231 ;; Mark as default clocking task 231 ;; Mark as default clocking task
232 (save-excursion 232 (save-excursion
233 (org-back-to-heading t) 233 (org-back-to-heading t)
234 (move-marker org-clock-default-task (point)))) 234 (move-marker org-clock-default-task (point))))
235 235
236 (setq target-pos (point)) ;; we want to clock in at this location 236 (setq target-pos (point)) ;; we want to clock in at this location
237 (save-excursion 237 (save-excursion
238 (when (and selected-task (marker-buffer selected-task)) 238 (when (and selected-task (marker-buffer selected-task))
@@ -261,7 +261,7 @@ the clocking selection, associated with the letter `d'."
261 (setq org-clock-heading "???"))) 261 (setq org-clock-heading "???")))
262 (setq org-clock-heading (propertize org-clock-heading 'face nil)) 262 (setq org-clock-heading (propertize org-clock-heading 'face nil))
263 (org-clock-find-position) 263 (org-clock-find-position)
264 264
265 (insert "\n") (backward-char 1) 265 (insert "\n") (backward-char 1)
266 (indent-relative) 266 (indent-relative)
267 (insert org-clock-string " ") 267 (insert org-clock-string " ")
@@ -638,7 +638,7 @@ the returned times will be formatted strings."
638 ((string-match "\\([-+][0-9]+\\)$" skey) 638 ((string-match "\\([-+][0-9]+\\)$" skey)
639 (setq shift (string-to-number (match-string 1 skey)) 639 (setq shift (string-to-number (match-string 1 skey))
640 key (intern (substring skey 0 (match-beginning 1)))))) 640 key (intern (substring skey 0 (match-beginning 1))))))
641 (unless shift 641 (when (= shift 0)
642 (cond ((eq key 'yesterday) (setq key 'today shift -1)) 642 (cond ((eq key 'yesterday) (setq key 'today shift -1))
643 ((eq key 'lastweek) (setq key 'week shift -1)) 643 ((eq key 'lastweek) (setq key 'week shift -1))
644 ((eq key 'lastmonth) (setq key 'month shift -1)) 644 ((eq key 'lastmonth) (setq key 'month shift -1))
@@ -690,6 +690,11 @@ the currently selected interval size."
690 (s (match-string 1)) 690 (s (match-string 1))
691 block shift ins y mw d date wp m) 691 block shift ins y mw d date wp m)
692 (cond 692 (cond
693 ((equal s "yesterday") (setq s "today-1"))
694 ((equal s "lastweek") (setq s "thisweek-1"))
695 ((equal s "lastmonth") (setq s "thismonth-1"))
696 ((equal s "lastyear") (setq s "thisyear-1")))
697 (cond
693 ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s) 698 ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s)
694 (setq block (match-string 1 s) 699 (setq block (match-string 1 s)
695 shift (if (match-end 2) 700 shift (if (match-end 2)
@@ -735,9 +740,9 @@ the currently selected interval size."
735 (ins (make-marker)) 740 (ins (make-marker))
736 (total-time nil) 741 (total-time nil)
737 (scope (plist-get params :scope)) 742 (scope (plist-get params :scope))
738 (tostring (plist-get params :tostring)) 743 (tostring (plist-get params :tostring))
739 (multifile (plist-get params :multifile)) 744 (multifile (plist-get params :multifile))
740 (header (plist-get params :header)) 745 (header (plist-get params :header))
741 (maxlevel (or (plist-get params :maxlevel) 3)) 746 (maxlevel (or (plist-get params :maxlevel) 3))
742 (step (plist-get params :step)) 747 (step (plist-get params :step))
743 (emph (plist-get params :emphasize)) 748 (emph (plist-get params :emphasize))
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 95a5aa3fccf..ef7bb690862 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -1013,13 +1013,13 @@ of fields."
1013 (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled)) 1013 (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
1014 (n (length title)) row tbl) 1014 (n (length title)) row tbl)
1015 (goto-char (point-min)) 1015 (goto-char (point-min))
1016 (while (and (re-search-forward "^\\(\\*+\\) " nil t) 1016 (while (re-search-forward "^\\(\\*+\\) " nil t)
1017 (or (null maxlevel) 1017 (when (and (or (null maxlevel)
1018 (>= maxlevel 1018 (>= maxlevel
1019 (if org-odd-levels-only 1019 (if org-odd-levels-only
1020 (/ (1+ (length (match-string 1))) 2) 1020 (/ (1+ (length (match-string 1))) 2)
1021 (length (match-string 1)))))) 1021 (length (match-string 1)))))
1022 (when (get-char-property (match-beginning 0) 'org-columns-key) 1022 (get-char-property (match-beginning 0) 'org-columns-key))
1023 (setq row nil) 1023 (setq row nil)
1024 (loop for i from 0 to (1- n) do 1024 (loop for i from 0 to (1- n) do
1025 (push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified) 1025 (push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index bc21429cb37..0ba1dcc75b3 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 0ebcdbbfb89..cf02d1808da 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -209,6 +209,12 @@ e.g. \"author-info:nil\"."
209 :group 'org-export-general 209 :group 'org-export-general
210 :type 'boolean) 210 :type 'boolean)
211 211
212(defcustom org-export-creator-info t
213 "Non-nil means, the postamle should contain a creator sentence.
214This sentence is \"HTML generated by org-mode XX in emacs XXX\"."
215 :group 'org-export-general
216 :type 'boolean)
217
212(defcustom org-export-time-stamp-file t 218(defcustom org-export-time-stamp-file t
213 "Non-nil means, insert a time stamp into the exported file. 219 "Non-nil means, insert a time stamp into the exported file.
214The time stamp shows when the file was created. 220The time stamp shows when the file was created.
@@ -466,57 +472,69 @@ Org-mode file."
466 :group 'org-export-html 472 :group 'org-export-html
467 :type '(string :tag "File or URL")) 473 :type '(string :tag "File or URL"))
468 474
469(defcustom org-export-html-style 475(defconst org-export-html-style-default
470"<style type=\"text/css\"> 476"<style type=\"text/css\">
471 html { 477 html { font-family: Times, serif; font-size: 12pt; }
472 font-family: Times, serif; 478 .title { text-align: center; }
473 font-size: 12pt; 479 .todo { color: red; }
474 } 480 .done { color: green; }
475 .title { text-align: center; } 481 .tag { background-color:lightblue; font-weight:normal }
476 .todo { color: red; } 482 .target { }
477 .done { color: green; }
478 .timestamp { color: grey } 483 .timestamp { color: grey }
479 .timestamp-kwd { color: CadetBlue } 484 .timestamp-kwd { color: CadetBlue }
480 .tag { background-color:lightblue; font-weight:normal } 485 p.verse { margin-left: 3% }
481 .target { }
482 pre { 486 pre {
483 border: 1pt solid #AEBDCC; 487 border: 1pt solid #AEBDCC;
484 background-color: #F3F5F7; 488 background-color: #F3F5F7;
485 padding: 5pt; 489 padding: 5pt;
486 font-family: courier, monospace; 490 font-family: courier, monospace;
487 font-size: 90%; 491 font-size: 90%;
492 overflow:auto;
488 } 493 }
489 table { border-collapse: collapse; } 494 table { border-collapse: collapse; }
490 td, th { 495 td, th { vertical-align: top; }
491 vertical-align: top;
492 <!--border: 1pt solid #ADB9CC;-->
493 }
494 dt { font-weight: bold; } 496 dt { font-weight: bold; }
495</style>" 497</style>"
496 "The default style specification for exported HTML files. 498 "The default style specification for exported HTML files.
497Since there are different ways of setting style information, this variable 499Please use the variables `org-export-html-style' and
498needs to contain the full HTML structure to provide a style, including the 500`org-export-html-style-extra' to add to this style.")
499surrounding HTML tags. The style specifications should include definitions 501
500for new classes todo, done, title, and deadline. For example, valid values 502(defcustom org-export-html-style ""
501would be: 503 "Org-wide style definitions for exported HTML files.
504
505This variable needs to contain the full HTML structure to provide a style,
506including the surrounding HTML tags. If you set the value of this variable,
507you should consider to include definitions for the following classes:
508 title, todo, done, timestamp, timestamp-kwd, tag, target.
509
510For example, a valid value would be:
502 511
503 <style type=\"text/css\"> 512 <style type=\"text/css\">
504 p { font-weight: normal; color: gray; } 513 p { font-weight: normal; color: gray; }
505 h1 { color: black; } 514 h1 { color: black; }
506 .title { text-align: center; } 515 .title { text-align: center; }
507 .todo, .deadline { color: red; } 516 .todo, .timestamp-kwd { color: red; }
508 .done { color: green; } 517 .done { color: green; }
509 </style> 518 </style>
510 519
511or, if you want to keep the style in a file, 520If you'd like to refer to en external style file, use something like
512 521
513 <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\"> 522 <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
514 523
515As the value of this option simply gets inserted into the HTML <head> header, 524As the value of this option simply gets inserted into the HTML <head> header,
516you can \"misuse\" it to add arbitrary text to the header." 525you can \"misuse\" it to add arbitrary text to the header.
526See also the variable `org-export-html-style-extra'."
517 :group 'org-export-html 527 :group 'org-export-html
518 :type 'string) 528 :type 'string)
519 529
530(defcustom org-export-html-style-extra ""
531 "Additional style information for HTML export.
532The value of this variable is inserted into the HTML buffer right after
533the value of `org-export-html-style'. Use this variable for per-file
534settings of style information, and do not forget to surround the style
535settings with <style>...</style> tags."
536 :group 'org-export-html
537 :type 'string)
520 538
521(defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n" 539(defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
522 "Format for typesetting the document title in HTML export." 540 "Format for typesetting the document title in HTML export."
@@ -625,6 +643,46 @@ The file name should be absolute, the file will be overwritten without warning."
625 :group 'org-export-icalendar 643 :group 'org-export-icalendar
626 :type 'file) 644 :type 'file)
627 645
646(defcustom org-icalendar-combined-name "OrgMode"
647 "Calendar name for the combined iCalendar representing all agenda files."
648 :group 'org-export-icalendar
649 :type 'string)
650
651(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
652 "Contexts where iCalendar export should use a deadline time stamp.
653This is a list with several symbols in it. Valid symbol are:
654
655event-if-todo Deadlines in TODO entries become calendar events.
656event-if-not-todo Deadlines in non-TODO entries become calendar events.
657todo-due Use deadlines in TODO entries as due-dates"
658 :group 'org-export-icalendar
659 :type '(set :greedy t
660 (const :tag "Deadlines in non-TODO entries become events"
661 event-if-not-todo)
662 (const :tag "Deadline in TODO entries become events"
663 event-if-todo)
664 (const :tag "Deadlines in TODO entries become due-dates"
665 todo-due)))
666
667(defcustom org-icalendar-use-scheduled '(todo-start)
668 "Contexts where iCalendar export should use a scheduling time stamp.
669This is a list with several symbols in it. Valid symbol are:
670
671event-if-todo Scheduling time stamps in TODO entries become an event.
672event-if-not-todo Scheduling time stamps in non-TODO entries become an event.
673todo-start Scheduling time stamps in TODO entries become start date.
674 Some calendar applications show TODO entries only after
675 that date."
676 :group 'org-export-icalendar
677 :type '(set :greedy t
678 (const :tag
679 "SCHEDULED timestamps in non-TODO entries become events"
680 event-if-not-todo)
681 (const :tag "SCHEDULED timestamps in TODO entries become events"
682 event-if-todo)
683 (const :tag "SCHEDULED in TODO entries become start date"
684 todo-start)))
685
628(defcustom org-icalendar-include-todo nil 686(defcustom org-icalendar-include-todo nil
629 "Non-nil means, export to iCalendar files should also cover TODO items." 687 "Non-nil means, export to iCalendar files should also cover TODO items."
630 :group 'org-export-icalendar 688 :group 'org-export-icalendar
@@ -650,11 +708,6 @@ The text will be inserted into the DESCRIPTION field."
650 (const :tag "Everything" t) 708 (const :tag "Everything" t)
651 (integer :tag "Max characters"))) 709 (integer :tag "Max characters")))
652 710
653(defcustom org-icalendar-combined-name "OrgMode"
654 "Calendar name for the combined iCalendar representing all agenda files."
655 :group 'org-export-icalendar
656 :type 'string)
657
658(defcustom org-icalendar-store-UID nil 711(defcustom org-icalendar-store-UID nil
659 "Non-nil means, store any created UIDs in properties. 712 "Non-nil means, store any created UIDs in properties.
660The iCalendar standard requires that all entries have a unique identifyer. 713The iCalendar standard requires that all entries have a unique identifyer.
@@ -709,10 +762,12 @@ or if they are only using it locally."
709 (:fixed-width . org-export-with-fixed-width) 762 (:fixed-width . org-export-with-fixed-width)
710 (:timestamps . org-export-with-timestamps) 763 (:timestamps . org-export-with-timestamps)
711 (:author-info . org-export-author-info) 764 (:author-info . org-export-author-info)
765 (:creator-info . org-export-creator-info)
712 (:time-stamp-file . org-export-time-stamp-file) 766 (:time-stamp-file . org-export-time-stamp-file)
713 (:tables . org-export-with-tables) 767 (:tables . org-export-with-tables)
714 (:table-auto-headline . org-export-highlight-first-table-line) 768 (:table-auto-headline . org-export-highlight-first-table-line)
715 (:style . org-export-html-style) 769 (:style . org-export-html-style)
770 (:style-extra . org-export-html-style-extra)
716 (:agenda-style . org-agenda-export-html-style) 771 (:agenda-style . org-agenda-export-html-style)
717 (:convert-org-links . org-export-html-link-org-files-as-html) 772 (:convert-org-links . org-export-html-link-org-files-as-html)
718 (:inline-images . org-export-html-inline-images) 773 (:inline-images . org-export-html-inline-images)
@@ -1361,15 +1416,15 @@ on this string to produce the exported version."
1361 ;; Find all links that contain a newline and put them into a single line 1416 ;; Find all links that contain a newline and put them into a single line
1362 (org-export-concatenate-multiline-links) 1417 (org-export-concatenate-multiline-links)
1363 1418
1419 ;; Normalize links: Convert angle and plain links into bracket links
1420 ;; and expand link abbreviations
1421 (org-export-normalize-links)
1422
1364 ;; Find all internal links. If they have a fuzzy match (i.e. not 1423 ;; Find all internal links. If they have a fuzzy match (i.e. not
1365 ;; a *dedicated* target match, let the link point to the 1424 ;; a *dedicated* target match, let the link point to the
1366 ;; corresponding section. 1425 ;; corresponding section.
1367 (org-export-target-internal-links target-alist) 1426 (org-export-target-internal-links target-alist)
1368 1427
1369 ;; Normalize links: Convert angle and plain links into bracket links
1370 ;; and expand link abbreviations
1371 (org-export-normalize-links)
1372
1373 ;; Find multiline emphasis and put them into single line 1428 ;; Find multiline emphasis and put them into single line
1374 (when (plist-get parameters :emph-multiline) 1429 (when (plist-get parameters :emph-multiline)
1375 (org-export-concatenate-multiline-emphasis)) 1430 (org-export-concatenate-multiline-emphasis))
@@ -1380,10 +1435,12 @@ on this string to produce the exported version."
1380 1435
1381(defun org-export-kill-licensed-text () 1436(defun org-export-kill-licensed-text ()
1382 "Remove all text that is marked with a :org-license-to-kill property." 1437 "Remove all text that is marked with a :org-license-to-kill property."
1383 (let (p) 1438 (let (p q)
1384 (while (setq p (text-property-any (point-min) (point-max) 1439 (while (setq p (text-property-any (point-min) (point-max)
1385 :org-license-to-kill t)) 1440 :org-license-to-kill t))
1386 (delete-region p (next-single-property-change p :org-license-to-kill))))) 1441 (delete-region
1442 p (or (next-single-property-change p :org-license-to-kill)
1443 (point-max))))))
1387 1444
1388(defun org-export-define-heading-targets (target-alist) 1445(defun org-export-define-heading-targets (target-alist)
1389 "Find all headings and define the targets for them. 1446 "Find all headings and define the targets for them.
@@ -1437,20 +1494,25 @@ let the link point to the corresponding section."
1437 (slink (org-solidify-link-text link)) 1494 (slink (org-solidify-link-text link))
1438 found props pos 1495 found props pos
1439 (target 1496 (target
1440 (or (cdr (assoc slink target-alist)) 1497 (cond
1441 (save-excursion 1498 ((cdr (assoc slink target-alist)))
1442 (unless (string-match org-link-types-re link) 1499 ((string-match org-link-types-re link) nil)
1443 (setq found (condition-case nil (org-link-search link) 1500 ((or (file-name-absolute-p link)
1444 (error nil))) 1501 (string-match "^\\." link))
1445 (when (and found 1502 nil)
1446 (or (org-on-heading-p) 1503 (t
1447 (not (eq found 'dedicated)))) 1504 (save-excursion
1448 (or (get-text-property (point) 'target) 1505 (setq found (condition-case nil (org-link-search link)
1449 (get-text-property 1506 (error nil)))
1450 (max (point-min) 1507 (when (and found
1451 (1- (previous-single-property-change 1508 (or (org-on-heading-p)
1452 (point) 'target))) 1509 (not (eq found 'dedicated))))
1453 'target)))))))) 1510 (or (get-text-property (point) 'target)
1511 (get-text-property
1512 (max (point-min)
1513 (1- (previous-single-property-change
1514 (point) 'target)))
1515 'target))))))))
1454 (when target 1516 (when target
1455 (set-match-data md) 1517 (set-match-data md)
1456 (goto-char (match-beginning 1)) 1518 (goto-char (match-beginning 1))
@@ -1577,7 +1639,8 @@ These special cookies will later be interpreted by the backend."
1577 1639
1578(defun org-export-remove-comment-blocks-and-subtrees () 1640(defun org-export-remove-comment-blocks-and-subtrees ()
1579 "Remove the comment environment, and also commented subtrees." 1641 "Remove the comment environment, and also commented subtrees."
1580 (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))) 1642 (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
1643 (case-fold-search nil))
1581 ;; Remove comment environment 1644 ;; Remove comment environment
1582 (goto-char (point-min)) 1645 (goto-char (point-min))
1583 (while (re-search-forward 1646 (while (re-search-forward
@@ -1653,6 +1716,7 @@ When it is nil, all comments will be removed."
1653 (replace-match s t t)))) 1716 (replace-match s t t))))
1654 (goto-char (point-min)) 1717 (goto-char (point-min))
1655 (while (re-search-forward org-bracket-link-regexp nil t) 1718 (while (re-search-forward org-bracket-link-regexp nil t)
1719 (goto-char (1- (match-end 0)))
1656 (org-if-unprotected 1720 (org-if-unprotected
1657 (let* ((xx (save-match-data 1721 (let* ((xx (save-match-data
1658 (org-link-expand-abbrev (match-string 1)))) 1722 (org-link-expand-abbrev (match-string 1))))
@@ -1835,10 +1899,12 @@ TYPE must be a string, any of:
1835(defun org-export-handle-include-files () 1899(defun org-export-handle-include-files ()
1836 "Include the contents of include files, with proper formatting." 1900 "Include the contents of include files, with proper formatting."
1837 (let ((case-fold-search t) 1901 (let ((case-fold-search t)
1838 params file markup lang start end) 1902 params file markup lang start end prefix prefix1)
1839 (goto-char (point-min)) 1903 (goto-char (point-min))
1840 (while (re-search-forward "^#\\+INCLUDE:?[ \t]+\\(.*\\)" nil t) 1904 (while (re-search-forward "^#\\+INCLUDE:?[ \t]+\\(.*\\)" nil t)
1841 (setq params (read (concat "(" (match-string 1) ")")) 1905 (setq params (read (concat "(" (match-string 1) ")"))
1906 prefix (org-get-and-remove-property 'params :prefix)
1907 prefix1 (org-get-and-remove-property 'params :prefix1)
1842 file (org-symname-or-string (pop params)) 1908 file (org-symname-or-string (pop params))
1843 markup (org-symname-or-string (pop params)) 1909 markup (org-symname-or-string (pop params))
1844 lang (org-symname-or-string (pop params))) 1910 lang (org-symname-or-string (pop params)))
@@ -1854,17 +1920,45 @@ TYPE must be a string, any of:
1854 (setq start (format "#+begin_%s\n" markup) 1920 (setq start (format "#+begin_%s\n" markup)
1855 end (format "#+end_%s" markup)))) 1921 end (format "#+end_%s" markup))))
1856 (insert (or start "")) 1922 (insert (or start ""))
1857 (forward-char (nth 1 (insert-file-contents (expand-file-name file)))) 1923 (insert (org-get-file-contents (expand-file-name file) prefix prefix1))
1858 (or (bolp) (newline)) 1924 (or (bolp) (newline))
1859 (insert (or end "")))))) 1925 (insert (or end ""))))))
1860 1926
1927(defun org-get-file-contents (file &optional prefix prefix1)
1928 "Get the contents of FILE and return them as a string.
1929If PREFIX is a string, prepend it to each line. If PREFIX1
1930is a string, prepend it to the first line instead of PREFIX."
1931 (with-temp-buffer
1932 (insert-file-contents file)
1933 (when (or prefix prefix1)
1934 (goto-char (point-min))
1935 (while (not (eobp))
1936 (insert (or prefix1 prefix))
1937 (setq prefix1 nil)
1938 (beginning-of-line 2)))
1939 (buffer-string)))
1940
1941(defun org-get-and-remove-property (listvar prop)
1942 "Check if the value of LISTVAR contains PROP as a property.
1943If yes, return the value of that property (i.e. the element following
1944in the list) and remove property and value from the list in LISTVAR."
1945 (let ((list (symbol-value listvar)) m v)
1946 (when (setq m (member prop list))
1947 (setq v (nth 1 m))
1948 (if (equal (car list) prop)
1949 (set listvar (cddr list))
1950 (setcdr (nthcdr (- (length list) (length m) 1) list)
1951 (cddr m))
1952 (set listvar list)))
1953 v))
1954
1861(defun org-symname-or-string (s) 1955(defun org-symname-or-string (s)
1862 (if (symbolp s) 1956 (if (symbolp s)
1863 (if s (symbol-name s) s) 1957 (if s (symbol-name s) s)
1864 s)) 1958 s))
1865 1959
1866;;; Fontification of code 1960;;; Fontification of code
1867;; Currently only for th HTML backend, but who knows.... 1961;; Currently only for the HTML backend, but who knows....
1868(defun org-export-replace-src-segments () 1962(defun org-export-replace-src-segments ()
1869 "Replace source code segments with special code for export." 1963 "Replace source code segments with special code for export."
1870 (let ((case-fold-search t) 1964 (let ((case-fold-search t)
@@ -1915,8 +2009,9 @@ backends, it converts the segment into an EXAMPLE segment."
1915 (org-export-htmlize-region-for-paste 2009 (org-export-htmlize-region-for-paste
1916 (point-min) (point-max))))) 2010 (point-min) (point-max)))))
1917 (if (string-match "<pre\\([^>]*\\)>\n?" htmltext) 2011 (if (string-match "<pre\\([^>]*\\)>\n?" htmltext)
1918 (setq htmltext (replace-match "<pre class=\"src\">" 2012 (setq htmltext (replace-match
1919 t t htmltext))) 2013 (format "<pre class=\"src src-%s\">" lang)
2014 t t htmltext)))
1920 (concat "#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n")))) 2015 (concat "#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n"))))
1921 (t 2016 (t
1922 ;; This is not HTML, so just make it an example. 2017 ;; This is not HTML, so just make it an example.
@@ -2053,7 +2148,7 @@ underlined headlines. The default is 3."
2053 ((and date (string-match "%" date)) 2148 ((and date (string-match "%" date))
2054 (setq date (format-time-string date))) 2149 (setq date (format-time-string date)))
2055 (date) 2150 (date)
2056 (t (setq date (format-time-string "%Y/%m/%d %X")))) 2151 (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
2057 2152
2058 (if (and date org-export-time-stamp-file) 2153 (if (and date org-export-time-stamp-file)
2059 (insert (concat (nth 2 lang-words) ": " date"\n"))) 2154 (insert (concat (nth 2 lang-words) ": " date"\n")))
@@ -2516,12 +2611,13 @@ in a window. A non-interactive call will only return the buffer."
2516 (when (interactive-p) 2611 (when (interactive-p)
2517 (setq buffer "*Org HTML Export*")) 2612 (setq buffer "*Org HTML Export*"))
2518 (let ((transient-mark-mode t) (zmacs-regions t) 2613 (let ((transient-mark-mode t) (zmacs-regions t)
2519 rtn) 2614 ext-plist rtn)
2615 (setq ext-plist (plist-put ext-plist :ignore-subree-p t))
2520 (goto-char end) 2616 (goto-char end)
2521 (set-mark (point)) ;; to activate the region 2617 (set-mark (point)) ;; to activate the region
2522 (goto-char beg) 2618 (goto-char beg)
2523 (setq rtn (org-export-as-html 2619 (setq rtn (org-export-as-html
2524 nil nil nil 2620 nil nil ext-plist
2525 buffer body-only)) 2621 buffer body-only))
2526 (if (fboundp 'deactivate-mark) (deactivate-mark)) 2622 (if (fboundp 'deactivate-mark) (deactivate-mark))
2527 (if (and (interactive-p) (bufferp rtn)) 2623 (if (and (interactive-p) (bufferp rtn))
@@ -2568,7 +2664,9 @@ PUB-DIR is set, use this as the publishing directory."
2568 ext-plist 2664 ext-plist
2569 (org-infile-export-plist)))) 2665 (org-infile-export-plist))))
2570 2666
2571 (style (plist-get opt-plist :style)) 2667 (style (concat org-export-html-style-default
2668 (plist-get opt-plist :style)
2669 (plist-get opt-plist :style-extra)))
2572 (html-extension (plist-get opt-plist :html-extension)) 2670 (html-extension (plist-get opt-plist :html-extension))
2573 (link-validate (plist-get opt-plist :link-validation-function)) 2671 (link-validate (plist-get opt-plist :link-validation-function))
2574 valid thetoc have-headings first-heading-pos 2672 valid thetoc have-headings first-heading-pos
@@ -2577,11 +2675,13 @@ PUB-DIR is set, use this as the publishing directory."
2577 (rbeg (and region-p (region-beginning))) 2675 (rbeg (and region-p (region-beginning)))
2578 (rend (and region-p (region-end))) 2676 (rend (and region-p (region-end)))
2579 (subtree-p 2677 (subtree-p
2580 (when region-p 2678 (if (plist-get opt-plist :ignore-subree-p)
2581 (save-excursion 2679 nil
2582 (goto-char rbeg) 2680 (when region-p
2583 (and (org-at-heading-p) 2681 (save-excursion
2584 (>= (org-end-of-subtree t t) rend))))) 2682 (goto-char rbeg)
2683 (and (org-at-heading-p)
2684 (>= (org-end-of-subtree t t) rend))))))
2585 (opt-plist (if subtree-p 2685 (opt-plist (if subtree-p
2586 (org-export-add-subtree-options opt-plist rbeg) 2686 (org-export-add-subtree-options opt-plist rbeg)
2587 opt-plist)) 2687 opt-plist))
@@ -2629,6 +2729,7 @@ PUB-DIR is set, use this as the publishing directory."
2629 (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)")) 2729 (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
2630 (inquote nil) 2730 (inquote nil)
2631 (infixed nil) 2731 (infixed nil)
2732 (inverse nil)
2632 (in-local-list nil) 2733 (in-local-list nil)
2633 (local-list-type nil) 2734 (local-list-type nil)
2634 (local-list-indent nil) 2735 (local-list-indent nil)
@@ -2671,7 +2772,7 @@ PUB-DIR is set, use this as the publishing directory."
2671 table-open type 2772 table-open type
2672 table-buffer table-orig-buffer 2773 table-buffer table-orig-buffer
2673 ind item-type starter didclose 2774 ind item-type starter didclose
2674 rpl path desc descp desc1 desc2 link 2775 rpl path attr desc descp desc1 desc2 link
2675 snumber fnc item-tag 2776 snumber fnc item-tag
2676 ) 2777 )
2677 2778
@@ -2690,7 +2791,7 @@ PUB-DIR is set, use this as the publishing directory."
2690 ((and date (string-match "%" date)) 2791 ((and date (string-match "%" date))
2691 (setq date (format-time-string date))) 2792 (setq date (format-time-string date)))
2692 (date) 2793 (date)
2693 (t (setq date (format-time-string "%Y/%m/%d %X")))) 2794 (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
2694 2795
2695 ;; Get the language-dependent settings 2796 ;; Get the language-dependent settings
2696 (setq lang-words (or (assoc language org-export-language-setup) 2797 (setq lang-words (or (assoc language org-export-language-setup)
@@ -2836,12 +2937,12 @@ lang=\"%s\" xml:lang=\"%s\">
2836 (insert (org-html-protect line) "\n") 2937 (insert (org-html-protect line) "\n")
2837 (throw 'nextline nil)) 2938 (throw 'nextline nil))
2838 2939
2839 ;; verbatim lines 2940 ;; Fixed-width, verbatim lines (examples)
2840 (when (and org-export-with-fixed-width 2941 (when (and org-export-with-fixed-width
2841 (string-match "^[ \t]*:\\(.*\\)" line)) 2942 (string-match "^[ \t]*:\\(.*\\)" line))
2842 (when (not infixed) 2943 (when (not infixed)
2843 (setq infixed t) 2944 (setq infixed t)
2844 (insert "<pre>\n")) 2945 (insert "<pre class=\"example\">\n"))
2845 (insert (org-html-protect (match-string 1 line)) "\n") 2946 (insert (org-html-protect (match-string 1 line)) "\n")
2846 (when (or (not lines) 2947 (when (or (not lines)
2847 (not (string-match "^[ \t]*\\(:.*\\)" 2948 (not (string-match "^[ \t]*\\(:.*\\)"
@@ -2879,11 +2980,20 @@ lang=\"%s\" xml:lang=\"%s\">
2879 (insert "</p>\n</blockquote>\n") 2980 (insert "</p>\n</blockquote>\n")
2880 (throw 'nextline nil)) 2981 (throw 'nextline nil))
2881 (when (equal "ORG-VERSE-START" line) 2982 (when (equal "ORG-VERSE-START" line)
2882 (insert "<verse>\n<p>\n") 2983 (insert "\n<p class=\"verse\">\n")
2984 (setq inverse t)
2883 (throw 'nextline nil)) 2985 (throw 'nextline nil))
2884 (when (equal "ORG-VERSE-END" line) 2986 (when (equal "ORG-VERSE-END" line)
2885 (insert "</p>\n</verse>\n") 2987 (insert "</p>\n")
2988 (setq inverse nil)
2886 (throw 'nextline nil)) 2989 (throw 'nextline nil))
2990 (when inverse
2991 (setq i (org-get-string-indentation line))
2992 (if (> i 0)
2993 (setq line (concat (mapconcat 'identity
2994 (make-list (* 2 i) "\\nbsp") "")
2995 " " (org-trim line))))
2996 (setq line (concat line " \\\\")))
2887 2997
2888 ;; make targets to anchors 2998 ;; make targets to anchors
2889 (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line) 2999 (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line)
@@ -2919,8 +3029,18 @@ lang=\"%s\" xml:lang=\"%s\">
2919 (setq start 0) 3029 (setq start 0)
2920 (while (string-match org-bracket-link-analytic-regexp line start) 3030 (while (string-match org-bracket-link-analytic-regexp line start)
2921 (setq start (match-beginning 0)) 3031 (setq start (match-beginning 0))
2922 (setq type (if (match-end 2) (match-string 2 line) "internal")) 3032 (setq path (save-match-data (org-link-unescape
2923 (setq path (match-string 3 line)) 3033 (match-string 3 line))))
3034 (setq type (cond
3035 ((match-end 2) (match-string 2 line))
3036 ((save-match-data
3037 (or (file-name-absolute-p path)
3038 (string-match "^\\.\\.?/" path)))
3039 "file")
3040 (t "internal")))
3041 (setq path (org-extract-attributes path))
3042 (setq attr (org-attributes-to-string
3043 (get-text-property 0 'org-attributes path)))
2924 (setq desc1 (if (match-end 5) (match-string 5 line)) 3044 (setq desc1 (if (match-end 5) (match-string 5 line))
2925 desc2 (if (match-end 2) (concat type ":" path) path) 3045 desc2 (if (match-end 2) (concat type ":" path) path)
2926 descp (and desc1 (not (equal desc1 desc2))) 3046 descp (and desc1 (not (equal desc1 desc2)))
@@ -2939,19 +3059,27 @@ lang=\"%s\" xml:lang=\"%s\">
2939 "<a href=\"#" 3059 "<a href=\"#"
2940 (org-solidify-link-text 3060 (org-solidify-link-text
2941 (save-match-data (org-link-unescape path)) nil) 3061 (save-match-data (org-link-unescape path)) nil)
2942 "\">" desc "</a>"))) 3062 "\"" attr ">" desc "</a>")))
2943 ((member type '("http" "https")) 3063 ((member type '("http" "https"))
2944 ;; standard URL, just check if we need to inline an image 3064 ;; standard URL, just check if we need to inline an image
2945 (if (and (or (eq t org-export-html-inline-images) 3065 (if (and (or (eq t org-export-html-inline-images)
2946 (and org-export-html-inline-images (not descp))) 3066 (and org-export-html-inline-images (not descp)))
2947 (org-file-image-p path)) 3067 (org-file-image-p path))
2948 (setq rpl (concat "<img src=\"" type ":" path "\"/>")) 3068 (setq rpl (concat "<img src=\"" type ":" path "\"" attr "/>"))
2949 (setq link (concat type ":" path)) 3069 (setq link (concat type ":" path))
2950 (setq rpl (concat "<a href=\"" link "\">" desc "</a>")))) 3070 (setq rpl (concat "<a href=\"" link "\"" attr ">"
3071 desc "</a>"))))
2951 ((member type '("ftp" "mailto" "news")) 3072 ((member type '("ftp" "mailto" "news"))
2952 ;; standard URL 3073 ;; standard URL
2953 (setq link (concat type ":" path)) 3074 (setq link (concat type ":" path))
2954 (setq rpl (concat "<a href=\"" link "\">" desc "</a>"))) 3075 (setq rpl (concat "<a href=\"" link "\">" desc "</a>")))
3076
3077 ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
3078 ;; The link protocol has a function for format the link
3079 (setq rpl
3080 (save-match-data
3081 (funcall fnc (org-link-unescape path) desc1 'html))))
3082
2955 ((string= type "file") 3083 ((string= type "file")
2956 ;; FILE link 3084 ;; FILE link
2957 (let* ((filename path) 3085 (let* ((filename path)
@@ -2988,15 +3116,11 @@ lang=\"%s\" xml:lang=\"%s\">
2988 (or (eq t org-export-html-inline-images) 3116 (or (eq t org-export-html-inline-images)
2989 (and org-export-html-inline-images 3117 (and org-export-html-inline-images
2990 (not descp)))) 3118 (not descp))))
2991 (concat "<img src=\"" thefile "\"/>") 3119 (concat "<img src=\"" thefile "\"" attr "/>")
2992 (concat "<a href=\"" thefile "\">" desc "</a>"))) 3120 (concat "<a href=\"" thefile "\"" attr ">"
3121 desc "</a>")))
2993 (if (not valid) (setq rpl desc)))) 3122 (if (not valid) (setq rpl desc))))
2994 3123
2995 ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
2996 (setq rpl
2997 (save-match-data
2998 (funcall fnc (org-link-unescape path) desc1 'html))))
2999
3000 (t 3124 (t
3001 ;; just publish the path, as default 3125 ;; just publish the path, as default
3002 (setq rpl (concat "<i>&lt;" type ":" 3126 (setq rpl (concat "<i>&lt;" type ":"
@@ -3199,8 +3323,9 @@ lang=\"%s\" xml:lang=\"%s\">
3199 (insert "<p class=\"date\"> " 3323 (insert "<p class=\"date\"> "
3200 (nth 2 lang-words) ": " 3324 (nth 2 lang-words) ": "
3201 date "</p>\n")) 3325 date "</p>\n"))
3202 (insert (format "<p>HTML generated by org-mode %s in emacs %s<\p>\n" 3326 (when org-export-creator-info
3203 org-version emacs-major-version)) 3327 (insert (format "<p>HTML generated by org-mode %s in emacs %s<\p>\n"
3328 org-version emacs-major-version)))
3204 (insert "</div>")) 3329 (insert "</div>"))
3205 3330
3206 (if org-export-html-with-timestamp 3331 (if org-export-html-with-timestamp
@@ -3256,6 +3381,7 @@ lang=\"%s\" xml:lang=\"%s\">
3256 (kill-buffer (current-buffer))) 3381 (kill-buffer (current-buffer)))
3257 (current-buffer))))) 3382 (current-buffer)))))
3258 3383
3384
3259(defvar org-table-colgroup-info nil) 3385(defvar org-table-colgroup-info nil)
3260(defun org-format-table-ascii (lines) 3386(defun org-format-table-ascii (lines)
3261 "Format a table for ascii export." 3387 "Format a table for ascii export."
@@ -3516,6 +3642,16 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
3516 (set-buffer " org-tmp2 ") 3642 (set-buffer " org-tmp2 ")
3517 (buffer-substring (point-min) (point-max)))) 3643 (buffer-substring (point-min) (point-max))))
3518 3644
3645(defun org-export-splice-style (style extra)
3646 "Splice EXTRA into STYLE, just before \"</style>\"."
3647 (if (and (stringp extra)
3648 (string-match "\\S-" extra)
3649 (string-match "</style>" style))
3650 (concat (substring style 0 (match-beginning 0))
3651 "\n" extra "\n"
3652 (substring style (match-beginning 0)))
3653 style))
3654
3519(defun org-html-handle-time-stamps (s) 3655(defun org-html-handle-time-stamps (s)
3520 "Format time stamps in string S, or remove them." 3656 "Format time stamps in string S, or remove them."
3521 (catch 'exit 3657 (catch 'exit
@@ -3932,7 +4068,7 @@ When COMBINE is non nil, add the category to each line."
3932 (format-time-string (cdr org-time-stamp-formats) (current-time)) 4068 (format-time-string (cdr org-time-stamp-formats) (current-time))
3933 "DTSTART")) 4069 "DTSTART"))
3934 hd ts ts2 state status (inc t) pos b sexp rrule 4070 hd ts ts2 state status (inc t) pos b sexp rrule
3935 scheduledp deadlinep prefix 4071 scheduledp deadlinep todo prefix due start
3936 tmp pri category entry location summary desc uid 4072 tmp pri category entry location summary desc uid
3937 (sexp-buffer (get-buffer-create "*ical-tmp*"))) 4073 (sexp-buffer (get-buffer-create "*ical-tmp*")))
3938 (org-refresh-category-properties) 4074 (org-refresh-category-properties)
@@ -3981,8 +4117,21 @@ When COMBINE is non nil, add the category to each line."
3981 ts) 4117 ts)
3982 deadlinep (string-match org-deadline-regexp tmp) 4118 deadlinep (string-match org-deadline-regexp tmp)
3983 scheduledp (string-match org-scheduled-regexp tmp) 4119 scheduledp (string-match org-scheduled-regexp tmp)
4120 todo (org-get-todo-state)
3984 ;; donep (org-entry-is-done-p) 4121 ;; donep (org-entry-is-done-p)
3985 )) 4122 ))
4123 (when (and
4124 deadlinep
4125 (if todo
4126 (not (memq 'event-if-todo org-icalendar-use-deadline))
4127 (not (memq 'event-if-not-todo org-icalendar-use-deadline))))
4128 (throw :skip t))
4129 (when (and
4130 scheduledp
4131 (if todo
4132 (not (memq 'event-if-todo org-icalendar-use-scheduled))
4133 (not (memq 'event-if-not-todo org-icalendar-use-scheduled))))
4134 (throw :skip t))
3986 (setq prefix (if deadlinep "DL-" (if scheduledp "SC-" "TS-"))) 4135 (setq prefix (if deadlinep "DL-" (if scheduledp "SC-" "TS-")))
3987 (if (or (string-match org-tr-regexp hd) 4136 (if (or (string-match org-tr-regexp hd)
3988 (string-match org-ts-regexp hd)) 4137 (string-match org-ts-regexp hd))
@@ -4070,9 +4219,16 @@ END:VEVENT\n"
4070 t org-icalendar-include-body) 4219 t org-icalendar-include-body)
4071 location (org-icalendar-cleanup-string 4220 location (org-icalendar-cleanup-string
4072 (org-entry-get nil "LOCATION")) 4221 (org-entry-get nil "LOCATION"))
4222 due (and (member 'todo-due org-icalendar-use-deadline)
4223 (org-entry-get nil "DEADLINE"))
4224 start (and (member 'todo-start org-icalendar-use-scheduled)
4225 (org-entry-get nil "SCHEDULED"))
4073 uid (if org-icalendar-store-UID 4226 uid (if org-icalendar-store-UID
4074 (org-id-get-create) 4227 (org-id-get-create)
4075 (or (org-id-get) (org-id-new)))) 4228 (or (org-id-get) (org-id-new))))
4229 (and due (setq due (org-ical-ts-to-string due "DUE")))
4230 (and start (setq start (org-ical-ts-to-string start "DTSTART")))
4231
4076 (if (string-match org-bracket-link-regexp hd) 4232 (if (string-match org-bracket-link-regexp hd)
4077 (setq hd (replace-match (if (match-end 3) (match-string 3 hd) 4233 (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
4078 (match-string 1 hd)) 4234 (match-string 1 hd))
@@ -4088,19 +4244,20 @@ END:VEVENT\n"
4088 (princ (format "BEGIN:VTODO 4244 (princ (format "BEGIN:VTODO
4089UID: %s 4245UID: %s
4090%s 4246%s
4091SUMMARY:%s%s%s 4247SUMMARY:%s%s%s%s
4092CATEGORIES:%s 4248CATEGORIES:%s
4093SEQUENCE:1 4249SEQUENCE:1
4094PRIORITY:%d 4250PRIORITY:%d
4095STATUS:%s 4251STATUS:%s
4096END:VTODO\n" 4252END:VTODO\n"
4097 (concat prefix uid) 4253 (concat prefix uid)
4098 dts 4254 (or start dts)
4099 (or summary hd) 4255 (or summary hd)
4100 (if (and location (string-match "\\S-" location)) 4256 (if (and location (string-match "\\S-" location))
4101 (concat "\nLOCATION: " location) "") 4257 (concat "\nLOCATION: " location) "")
4102 (if (and desc (string-match "\\S-" desc)) 4258 (if (and desc (string-match "\\S-" desc))
4103 (concat "\nDESCRIPTION: " desc) "") 4259 (concat "\nDESCRIPTION: " desc) "")
4260 (if due (concat "\n" due) "")
4104 category 4261 category
4105 pri status))))))))) 4262 pri status)))))))))
4106 4263
@@ -4269,4 +4426,3 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
4269;; arch-tag: 65985fe9-095c-49c7-a7b6-cb4ee15c0a95 4426;; arch-tag: 65985fe9-095c-49c7-a7b6-cb4ee15c0a95
4270 4427
4271;;; org-exp.el ends here 4428;;; org-exp.el ends here
4272
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el
index 11354fcd501..b17bc02d0c6 100644
--- a/lisp/org/org-export-latex.el
+++ b/lisp/org/org-export-latex.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-export-latex.el 6;; Filename: org-export-latex.el
7;; Version: 6.05a 7;; Version: 6.06a
8;; Author: Bastien Guerry <bzg AT altern DOT org> 8;; Author: Bastien Guerry <bzg AT altern DOT org>
9;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 9;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
10;; Keywords: org, wp, tex 10;; Keywords: org, wp, tex
@@ -762,11 +762,22 @@ org-protect property."
762 (replace-match "") 762 (replace-match "")
763 (replace-match (format "\\texttt{%s}" (match-string 0)) t t))) 763 (replace-match (format "\\texttt{%s}" (match-string 0)) t t)))
764 ;; convert tags 764 ;; convert tags
765 (when (re-search-forward "\\(:[a-zA-Z0-9]+\\)+:" nil t) 765 (when (re-search-forward "\\(:[a-zA-Z0-9_@]+\\)+:" nil t)
766 (if (or (not org-export-with-tags) 766 (if (or (not org-export-with-tags)
767 (plist-get remove-list :tags)) 767 (plist-get remove-list :tags))
768 (replace-match "") 768 (replace-match "")
769 (replace-match (format "\\texttt{%s}" (match-string 0)) t t))))) 769 (replace-match
770 (org-export-latex-protect-string
771 (format "\\texttt{%s}" (save-match-data
772 (org-quote-chars (match-string 0)))))
773 t t)))))
774
775(defun org-quote-chars (s)
776 (let ((start 0))
777 (while (string-match "_" s start)
778 (setq start (+ 2 (match-beginning 0))
779 s (replace-match "\\_" t t s))))
780 s)
770 781
771(defun org-export-latex-fontify-headline (string) 782(defun org-export-latex-fontify-headline (string)
772 "Fontify special words in string." 783 "Fontify special words in string."
@@ -777,10 +788,10 @@ org-protect property."
777 (goto-char (point-min)) 788 (goto-char (point-min))
778 (when (plist-get org-export-latex-options-plist :emphasize) 789 (when (plist-get org-export-latex-options-plist :emphasize)
779 (org-export-latex-fontify)) 790 (org-export-latex-fontify))
780 (org-export-latex-special-chars
781 (plist-get org-export-latex-options-plist :sub-superscript))
782 (org-export-latex-keywords-maybe 791 (org-export-latex-keywords-maybe
783 org-export-latex-remove-from-headlines) 792 org-export-latex-remove-from-headlines)
793 (org-export-latex-special-chars
794 (plist-get org-export-latex-options-plist :sub-superscript))
784 (org-export-latex-links) 795 (org-export-latex-links)
785 (org-trim (buffer-substring-no-properties (point-min) (point-max))))) 796 (org-trim (buffer-substring-no-properties (point-min) (point-max)))))
786 797
@@ -1051,7 +1062,7 @@ Regexps are those from `org-export-latex-special-string-regexps'."
1051 (let* ((re-radio org-export-latex-all-targets-re) 1062 (let* ((re-radio org-export-latex-all-targets-re)
1052 (remove (list (match-beginning 0) (match-end 0))) 1063 (remove (list (match-beginning 0) (match-end 0)))
1053 (type (match-string 2)) 1064 (type (match-string 2))
1054 (raw-path (match-string 3)) 1065 (raw-path (org-extract-attributes (match-string 3)))
1055 (full-raw-path (concat (match-string 1) raw-path)) 1066 (full-raw-path (concat (match-string 1) raw-path))
1056 (desc (match-string 5)) 1067 (desc (match-string 5))
1057 imgp radiop 1068 imgp radiop
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 102bec9db05..2e6f9c24c98 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index e006f854e3d..9702f41a614 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index c818ec0b802..fef64915cf4 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -4,7 +4,7 @@
4;; Author: Carsten Dominik <carsten at orgmode dot org> 4;; Author: Carsten Dominik <carsten at orgmode dot org>
5;; Keywords: outlines, hypermedia, calendar, wp 5;; Keywords: outlines, hypermedia, calendar, wp
6;; Homepage: http://orgmode.org 6;; Homepage: http://orgmode.org
7;; Version: 6.05a 7;; Version: 6.06a
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index a81eaa793da..e574605efea 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index 16a677c7ba2..13844f08a2b 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Philip Jackson <emacs@shellarchive.co.uk> 5;; Author: Philip Jackson <emacs@shellarchive.co.uk>
6;; Keywords: erc, irc, link, org 6;; Keywords: erc, irc, link, org
7;; Version: 6.05a 7;; Version: 6.06a
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el
index 337886c057c..6766a9d0144 100644
--- a/lisp/org/org-jsinfo.el
+++ b/lisp/org/org-jsinfo.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index 8f1607ffc47..aef009d12cd 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2008 Free Software Foundation, Inc. 3;; Copyright (C) 2008 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Version: 6.05a 6;; Version: 6.06a
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 3434c57ec7b..b3cdc060201 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el
index 655e344e4ff..fe9f7413c59 100644
--- a/lisp/org/org-mew.el
+++ b/lisp/org/org-mew.el
@@ -5,7 +5,7 @@
5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el
index 66f1bcc31a8..0f84d02d14a 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -5,7 +5,7 @@
5;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> 5;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 623afac29fc..a098fc4cefc 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com> 5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
6;; Maintainer: Carsten Dominik <carsten at orgmode dot org> 6;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
7;; Version: 6.05a 7;; Version: 6.06a
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 65c49e7b9c9..f239aa2ca08 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -4,7 +4,7 @@
4;; Author: David O'Toole <dto@gnu.org> 4;; Author: David O'Toole <dto@gnu.org>
5;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 5;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
6;; Keywords: hypermedia, outlines, wp 6;; Keywords: hypermedia, outlines, wp
7;; Version: 6.05a 7;; Version: 6.06a
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
@@ -263,7 +263,12 @@ index of files or summary page for a given project.
263 :index-function Plugin function to use for generation of index. 263 :index-function Plugin function to use for generation of index.
264 Defaults to `org-publish-org-index', which 264 Defaults to `org-publish-org-index', which
265 generates a plain list of links to all files 265 generates a plain list of links to all files
266 in the project." 266 in the project.
267 :index-style Can be `list' (index is just an itemized list
268 of the titles of the files involved) or
269 `tree' (the directory structure of the source
270 files is reflected in the index). Defaults to
271 `tree'."
267 :group 'org-publish 272 :group 'org-publish
268 :type 'alist) 273 :type 'alist)
269 274
@@ -297,24 +302,29 @@ If functions in this hook modify the buffer, it will be saved."
297 302
298(defun org-publish-timestamp-filename (filename) 303(defun org-publish-timestamp-filename (filename)
299 "Return path to timestamp file for filename FILENAME." 304 "Return path to timestamp file for filename FILENAME."
300 (while (string-match 305 (concat (file-name-as-directory org-publish-timestamp-directory)
301 (if (eq system-type 'windows-nt) "~\\|/\\|:" "~\\|/") filename) 306 "X" (if (fboundp 'sha1) (sha1 filename) (md5 filename))))
302 (setq filename (replace-match "_" nil t filename)))
303 (concat org-publish-timestamp-directory filename ".timestamp"))
304 307
305(defun org-publish-needed-p (filename) 308(defun org-publish-needed-p (filename)
306 "Return `t' if FILENAME should be published." 309 "Return `t' if FILENAME should be published."
307 (if org-publish-use-timestamps-flag 310 (let ((rtn
308 (if (file-exists-p org-publish-timestamp-directory) 311 (if org-publish-use-timestamps-flag
309 ;; first handle possible wrong timestamp directory 312 (if (file-exists-p org-publish-timestamp-directory)
310 (if (not (file-directory-p org-publish-timestamp-directory)) 313 ;; first handle possible wrong timestamp directory
311 (error "Org publish timestamp: %s is not a directory" 314 (if (not (file-directory-p org-publish-timestamp-directory))
312 org-publish-timestamp-directory) 315 (error "Org publish timestamp: %s is not a directory"
313 ;; there is a timestamp, check if FILENAME is newer 316 org-publish-timestamp-directory)
314 (file-newer-than-file-p 317 ;; there is a timestamp, check if FILENAME is newer
315 filename (org-publish-timestamp-filename filename)))) 318 (file-newer-than-file-p
316 ;; don't use timestamps, always return t 319 filename (org-publish-timestamp-filename filename)))
317 t)) 320 (make-directory org-publish-timestamp-directory)
321 t)
322 ;; don't use timestamps, always return t
323 t)))
324 (if rtn
325 (message "Publishing file %s" filename)
326 (message "Skipping unmodified file %s" filename))
327 rtn))
318 328
319(defun org-publish-update-timestamp (filename) 329(defun org-publish-update-timestamp (filename)
320 "Update publishing timestamp for file FILENAME. 330 "Update publishing timestamp for file FILENAME.
@@ -602,6 +612,8 @@ Default for INDEX-FILENAME is 'index.org'."
602 (index-filename (concat dir (or index-filename "index.org"))) 612 (index-filename (concat dir (or index-filename "index.org")))
603 (index-title (or (plist-get project-plist :index-title) 613 (index-title (or (plist-get project-plist :index-title)
604 (concat "Index for project " (car project)))) 614 (concat "Index for project " (car project))))
615 (index-style (or (plist-get project-plist :index-style)
616 'tree))
605 (index-buffer (find-buffer-visiting index-filename)) 617 (index-buffer (find-buffer-visiting index-filename))
606 (ifn (file-name-nondirectory index-filename)) 618 (ifn (file-name-nondirectory index-filename))
607 file) 619 file)
@@ -616,25 +628,32 @@ Default for INDEX-FILENAME is 'index.org'."
616 (oldlocal localdir)) 628 (oldlocal localdir))
617 ;; index shouldn't index itself 629 ;; index shouldn't index itself
618 (unless (string= fn ifn) 630 (unless (string= fn ifn)
619 (setq localdir (concat (file-name-as-directory dir) 631 (if (eq index-style 'list)
620 (file-name-directory link))) 632 (message "Generating list-style index for %s" index-title)
621 (unless (string= localdir oldlocal) 633 (message "Generating tree-style index for %s" index-title)
622 (if (string= localdir dir) 634 (setq localdir (concat (file-name-as-directory dir)
623 (setq indent-str (make-string 2 ?\ )) 635 (file-name-directory link)))
624 (let ((subdirs 636 (unless (string= localdir oldlocal)
625 (split-string 637 (if (string= localdir dir)
626 (directory-file-name 638 (setq indent-str (make-string 2 ?\ ))
627 (file-name-directory 639 (let ((subdirs
628 (file-relative-name localdir dir))) "/")) 640 (split-string
629 (subdir "")) 641 (directory-file-name
630 (setq indent-str (make-string 2 ?\ )) 642 (file-name-directory
631 (dolist (d subdirs) 643 (file-relative-name localdir dir))) "/"))
632 (setq subdir (concat subdir d "/")) 644 (subdir ""))
633 (insert (concat indent-str " + [[file:" subdir "][" d "/]]\n")) 645 (setq indent-str (make-string 2 ?\ ))
634 (setq indent-str (make-string (+ (length indent-str) 2) ?\ )))))) 646 (dolist (d subdirs)
647 (setq subdir (concat subdir d "/"))
648 (insert (concat indent-str " + [[file:"
649 subdir "][" d "/]]\n"))
650 (setq indent-str (make-string
651 (+ (length indent-str) 2) ?\ )))))))
652 ;; This is common to 'flat and 'tree
635 (insert (concat indent-str " + [[file:" link "][" 653 (insert (concat indent-str " + [[file:" link "]["
636 (file-name-sans-extension fn) 654 (org-publish-find-title file)
637 "]]\n"))))) 655 "]]\n"))
656 )))
638 (write-file index-filename) 657 (write-file index-filename)
639 (kill-buffer (current-buffer))))) 658 (kill-buffer (current-buffer)))))
640 659
@@ -648,7 +667,8 @@ Default for INDEX-FILENAME is 'index.org'."
648 (and (not 667 (and (not
649 (plist-get opt-plist :skip-before-1st-heading)) 668 (plist-get opt-plist :skip-before-1st-heading))
650 (org-export-grab-title-from-buffer)) 669 (org-export-grab-title-from-buffer))
651 (file-name-sans-extension file))))) 670 (file-name-nondirectory (file-name-sans-extension file))))))
671
652 672
653;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 673;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
654;;; Interactive publishing functions 674;;; Interactive publishing functions
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index a97fd647337..2bbb20ef0e6 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index 337909f3af7..d54dfdddd30 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 7050ecaabac..68963032ff2 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -445,8 +445,14 @@ property, locally or anywhere up in the hierarchy."
445 (let* ((beg (org-table-begin)) 445 (let* ((beg (org-table-begin))
446 (end (org-table-end)) 446 (end (org-table-end))
447 (txt (buffer-substring-no-properties beg end)) 447 (txt (buffer-substring-no-properties beg end))
448 (file (or file (org-entry-get beg "TABLE_EXPORT_FILE" t))) 448 (file (or file
449 (format (or format (org-entry-get beg "TABLE_EXPORT_FORMAT" t))) 449 (condition-case nil
450 (org-entry-get beg "TABLE_EXPORT_FILE" t)
451 (error nil))))
452 (format (or format
453 (condition-case nil
454 (org-entry-get beg "TABLE_EXPORT_FORMAT" t)
455 (error nil))))
450 buf deffmt-readable) 456 buf deffmt-readable)
451 (unless file 457 (unless file
452 (setq file (read-file-name "Export table to: ")) 458 (setq file (read-file-name "Export table to: "))
@@ -464,8 +470,13 @@ property, locally or anywhere up in the hierarchy."
464 (setq deffmt-readable (replace-match "\\t" t t deffmt-readable))) 470 (setq deffmt-readable (replace-match "\\t" t t deffmt-readable)))
465 (while (string-match "\n" deffmt-readable) 471 (while (string-match "\n" deffmt-readable)
466 (setq deffmt-readable (replace-match "\\n" t t deffmt-readable))) 472 (setq deffmt-readable (replace-match "\\n" t t deffmt-readable)))
467 (setq format (read-string "Format: " deffmt-readable))) 473 (setq format (org-completing-read
468 474 "Format: "
475 '("orgtbl-to-tsv" "orgtbl-to-csv"
476 "orgtbl-to-latex" "orgtbl-to-html"
477 "orgtbl-to-generic" "orgtbl-to-texinfo"
478 "orgtbl-to-orgtbl") nil nil
479 deffmt-readable)))
469 (if (string-match "\\([^ \t\r\n]+\\)\\( +.*\\)?" format) 480 (if (string-match "\\([^ \t\r\n]+\\)\\( +.*\\)?" format)
470 (let* ((transform (intern (match-string 1 format))) 481 (let* ((transform (intern (match-string 1 format)))
471 (params (if (match-end 2) 482 (params (if (match-end 2)
@@ -1864,7 +1875,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
1864 (string-match "^[a-zA-Z][a-zA-Z0-9]*$" field)) 1875 (string-match "^[a-zA-Z][a-zA-Z0-9]*$" field))
1865 (push (cons field v) org-table-local-parameters) 1876 (push (cons field v) org-table-local-parameters)
1866 (push (list field line col) org-table-named-field-locations)))) 1877 (push (list field line col) org-table-named-field-locations))))
1867 ;; Analyze the line types 1878 ;; Analyse the line types
1868 (goto-char beg) 1879 (goto-char beg)
1869 (setq org-table-current-begin-line (org-current-line) 1880 (setq org-table-current-begin-line (org-current-line)
1870 org-table-current-begin-pos (point) 1881 org-table-current-begin-pos (point)
@@ -3541,6 +3552,26 @@ a radio table."
3541 (delete-region beg (point)))) 3552 (delete-region beg (point))))
3542 (insert txt "\n"))) 3553 (insert txt "\n")))
3543 3554
3555(defun org-table-to-lisp (&optional txt)
3556 "Convert the table at point to a Lisp structure.
3557The structure will be a list. Each item is either the symbol `hline'
3558for a horizontal separator line, or a list of field values as strings.
3559The table is taken from the parameter TXT, or from the buffer at point."
3560 (unless txt
3561 (unless (org-at-table-p)
3562 (error "No table at point")))
3563 (let* ((txt (or txt
3564 (buffer-substring-no-properties (org-table-begin)
3565 (org-table-end))))
3566 (lines (org-split-string txt "[ \t]*\n[ \t]*")))
3567
3568 (mapcar
3569 (lambda (x)
3570 (if (string-match org-table-hline-regexp x)
3571 'hline
3572 (org-split-string (org-trim x) "\\s-*|\\s-*")))
3573 lines)))
3574
3544(defun orgtbl-send-table (&optional maybe) 3575(defun orgtbl-send-table (&optional maybe)
3545 "Send a tranformed version of this table to the receiver position. 3576 "Send a tranformed version of this table to the receiver position.
3546With argument MAYBE, fail quietly if no transformation is defined for 3577With argument MAYBE, fail quietly if no transformation is defined for
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el
index 032881e3eea..6f5e3aaded1 100644
--- a/lisp/org/org-vm.el
+++ b/lisp/org/org-vm.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el
index 56ad2123972..433343ca29d 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -5,7 +5,7 @@
5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org.el b/lisp/org/org.el
index b7d13f7cfb0..40515683075 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.05a 8;; Version: 6.06a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -91,7 +91,7 @@
91 91
92;;; Version 92;;; Version
93 93
94(defconst org-version "6.05a" 94(defconst org-version "6.06a"
95 "The version number of the file org.el.") 95 "The version number of the file org.el.")
96 96
97(defun org-version (&optional here) 97(defun org-version (&optional here)
@@ -1062,6 +1062,13 @@ When nil, an error will be generated."
1062 :group 'org-link-follow 1062 :group 'org-link-follow
1063 :type 'boolean) 1063 :type 'boolean)
1064 1064
1065(defcustom org-open-directory-means-index-dot-org nil
1066 "Non-nil means, a link to a directory really means to index.org.
1067When nil, following a directory link will run dired or open a finder/explorer
1068window on that directory."
1069 :group 'org-link-follow
1070 :type 'boolean)
1071
1065(defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s") 1072(defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
1066 "Function and arguments to call for following mailto links. 1073 "Function and arguments to call for following mailto links.
1067This is a list with the first element being a lisp function, and the 1074This is a list with the first element being a lisp function, and the
@@ -2573,7 +2580,9 @@ get the proper fontification."
2573 2580
2574(defcustom org-agenda-skip-archived-trees t 2581(defcustom org-agenda-skip-archived-trees t
2575 "Non-nil means, the agenda will skip any items located in archived trees. 2582 "Non-nil means, the agenda will skip any items located in archived trees.
2576An archived tree is a tree marked with the tag ARCHIVE." 2583An archived tree is a tree marked with the tag ARCHIVE. The use of this
2584variable is no longer recommended, you should leave it at the value t.
2585Instead, use the key `v' to cycle the archives-mode in the agenda."
2577 :group 'org-archive 2586 :group 'org-archive
2578 :group 'org-agenda-skip 2587 :group 'org-agenda-skip
2579 :type 'boolean) 2588 :type 'boolean)
@@ -4206,6 +4215,12 @@ are at least `org-cycle-separator-lines' empty lines before the headeline."
4206 (= (match-end 0) (point-max))) 4215 (= (match-end 0) (point-max)))
4207 (outline-flag-region (point) (match-end 0) nil)))) 4216 (outline-flag-region (point) (match-end 0) nil))))
4208 4217
4218(defun org-show-empty-lines-in-parent ()
4219 "Move to the parent and re-show empty lines before visible headlines."
4220 (save-excursion
4221 (let ((context (if (org-up-heading-safe) 'children 'overview)))
4222 (org-cycle-show-empty-lines context))))
4223
4209(defun org-cycle-hide-drawers (state) 4224(defun org-cycle-hide-drawers (state)
4210 "Re-hide all drawers after a visibility state change." 4225 "Re-hide all drawers after a visibility state change."
4211 (when (and (org-mode-p) 4226 (when (and (org-mode-p)
@@ -4895,6 +4910,7 @@ is signaled in this case."
4895 (insert (make-string (- ne-ins ne-beg) ?\n))) 4910 (insert (make-string (- ne-ins ne-beg) ?\n)))
4896 (move-marker ins-point nil) 4911 (move-marker ins-point nil)
4897 (org-compact-display-after-subtree-move) 4912 (org-compact-display-after-subtree-move)
4913 (org-show-empty-lines-in-parent)
4898 (unless folded 4914 (unless folded
4899 (org-show-entry) 4915 (org-show-entry)
4900 (show-children) 4916 (show-children)
@@ -4974,7 +4990,8 @@ If optional TREE is given, use this text instead of the kill ring."
4974 (error "%s" 4990 (error "%s"
4975 (substitute-command-keys 4991 (substitute-command-keys
4976 "The kill is not a (set of) tree(s) - please use \\[yank] to yank anyway"))) 4992 "The kill is not a (set of) tree(s) - please use \\[yank] to yank anyway")))
4977 (let* ((txt (or tree (and kill-ring (current-kill 0)))) 4993 (let* ((visp (not (org-invisible-p)))
4994 (txt (or tree (and kill-ring (current-kill 0))))
4978 (^re (concat "^\\(" outline-regexp "\\)")) 4995 (^re (concat "^\\(" outline-regexp "\\)"))
4979 (re (concat "\\(" outline-regexp "\\)")) 4996 (re (concat "\\(" outline-regexp "\\)"))
4980 (^re_ (concat "\\(\\*+\\)[ \t]*")) 4997 (^re_ (concat "\\(\\*+\\)[ \t]*"))
@@ -5028,6 +5045,8 @@ If optional TREE is given, use this text instead of the kill ring."
5028 (goto-char beg) 5045 (goto-char beg)
5029 (skip-chars-forward " \t\n\r") 5046 (skip-chars-forward " \t\n\r")
5030 (setq beg (point)) 5047 (setq beg (point))
5048 (if (and (org-invisible-p) visp)
5049 (save-excursion (outline-show-heading)))
5031 ;; Shift if necessary 5050 ;; Shift if necessary
5032 (unless (= shift 0) 5051 (unless (= shift 0)
5033 (save-restriction 5052 (save-restriction
@@ -5109,7 +5128,7 @@ If yes, remember the marker and the distance to BEG."
5109 (save-match-data 5128 (save-match-data
5110 (narrow-to-region 5129 (narrow-to-region
5111 (progn (org-back-to-heading) (point)) 5130 (progn (org-back-to-heading) (point))
5112 (progn (org-end-of-subtree t t) (point)))))) 5131 (progn (org-end-of-subtree t) (point))))))
5113 5132
5114 5133
5115;;; Outline Sorting 5134;;; Outline Sorting
@@ -5908,6 +5927,7 @@ so this really moves item trees."
5908 (setq beg (point))) 5927 (setq beg (point)))
5909 (goto-char beg0) 5928 (goto-char beg0)
5910 (org-end-of-item) 5929 (org-end-of-item)
5930 (org-back-over-empty-lines)
5911 (setq end (point)) 5931 (setq end (point))
5912 (goto-char beg0) 5932 (goto-char beg0)
5913 (catch 'exit 5933 (catch 'exit
@@ -5923,7 +5943,7 @@ so this really moves item trees."
5923 (throw 'exit t))))) 5943 (throw 'exit t)))))
5924 (condition-case nil 5944 (condition-case nil
5925 (org-beginning-of-item) 5945 (org-beginning-of-item)
5926 (error (goto-char beg) 5946 (error (goto-char beg0)
5927 (error "Cannot move this item further up"))) 5947 (error "Cannot move this item further up")))
5928 (setq ind1 (org-get-indentation)) 5948 (setq ind1 (org-get-indentation))
5929 (if (and (org-at-item-p) (= ind ind1)) 5949 (if (and (org-at-item-p) (= ind ind1))
@@ -6021,9 +6041,10 @@ with something like \"1.\" or \"2)\"."
6021 (buffer-substring (point-at-bol) (match-beginning 3)))) 6041 (buffer-substring (point-at-bol) (match-beginning 3))))
6022 ;; (term (substring (match-string 3) -1)) 6042 ;; (term (substring (match-string 3) -1))
6023 ind1 (n (1- arg)) 6043 ind1 (n (1- arg))
6024 fmt) 6044 fmt bob)
6025 ;; find where this list begins 6045 ;; find where this list begins
6026 (org-beginning-of-item-list) 6046 (org-beginning-of-item-list)
6047 (setq bobp (bobp))
6027 (looking-at "[ \t]*[0-9]+\\([.)]\\)") 6048 (looking-at "[ \t]*[0-9]+\\([.)]\\)")
6028 (setq fmt (concat "%d" (match-string 1))) 6049 (setq fmt (concat "%d" (match-string 1)))
6029 (beginning-of-line 0) 6050 (beginning-of-line 0)
@@ -6031,7 +6052,7 @@ with something like \"1.\" or \"2)\"."
6031 (catch 'exit 6052 (catch 'exit
6032 (while t 6053 (while t
6033 (catch 'next 6054 (catch 'next
6034 (beginning-of-line 2) 6055 (if bobp (setq bobp nil) (beginning-of-line 2))
6035 (if (eobp) (throw 'exit nil)) 6056 (if (eobp) (throw 'exit nil))
6036 (if (looking-at "[ \t]*$") (throw 'next nil)) 6057 (if (looking-at "[ \t]*$") (throw 'next nil))
6037 (skip-chars-forward " \t") (setq ind1 (current-column)) 6058 (skip-chars-forward " \t") (setq ind1 (current-column))
@@ -6097,7 +6118,8 @@ I.e. to the first item in this list."
6097 (if (or (< ind1 ind) 6118 (if (or (< ind1 ind)
6098 (and (= ind1 ind) 6119 (and (= ind1 ind)
6099 (not (org-at-item-p))) 6120 (not (org-at-item-p)))
6100 (bobp)) 6121 (and (= (point-at-bol) (point-min))
6122 (setq pos (point-min))))
6101 (throw 'exit t) 6123 (throw 'exit t)
6102 (when (org-at-item-p) (setq pos (point-at-bol))))))) 6124 (when (org-at-item-p) (setq pos (point-at-bol)))))))
6103 (goto-char pos))) 6125 (goto-char pos)))
@@ -6733,7 +6755,7 @@ according to FMT (default from `org-email-link-description-format')."
6733 (setq description nil)) 6755 (setq description nil))
6734 (when (and (not description) 6756 (when (and (not description)
6735 (not (equal link (org-link-escape link)))) 6757 (not (equal link (org-link-escape link))))
6736 (setq description link)) 6758 (setq description (org-extract-attributes link)))
6737 (concat "[[" (org-link-escape link) "]" 6759 (concat "[[" (org-link-escape link) "]"
6738 (if description (concat "[" description "]") "") 6760 (if description (concat "[" description "]") "")
6739 "]")) 6761 "]"))
@@ -7006,6 +7028,27 @@ used as the link location instead of reading one interactively."
7006 (org-defkey minibuffer-local-completion-map " " 'self-insert-command) 7028 (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
7007 (apply 'completing-read args))) 7029 (apply 'completing-read args)))
7008 7030
7031(defun org-extract-attributes (s)
7032 "Extract the attributes cookie from a string and set as text property."
7033 (let (a attr (start 0))
7034 (save-match-data
7035 (when (string-match "{{\\([^}]+\\)}}$" s)
7036 (setq a (match-string 1 s) s (substring s 0 (match-beginning 0)))
7037 (while (string-match "\\([a-zA-Z]+\\)=\"\\([^\"]*\\)\"" a start)
7038 (setq key (match-string 1 a) value (match-string 2 a)
7039 start (match-end 0)
7040 attr (plist-put attr (intern key) value))))
7041 (org-add-props s nil 'org-attributes attr))
7042 s))
7043
7044(defun org-attributes-to-string (plist)
7045 "Format a property list into an HTML attribute list."
7046 (let ((s "") key value)
7047 (while plist
7048 (setq key (pop plist) value (pop plist))
7049 (setq s (concat s " "(symbol-name key) "=\"" value "\"")))
7050 s))
7051
7009;;; Opening/following a link 7052;;; Opening/following a link
7010 7053
7011(defvar org-link-search-failed nil) 7054(defvar org-link-search-failed nil)
@@ -7106,13 +7149,18 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
7106 (save-excursion 7149 (save-excursion
7107 (skip-chars-forward "^]\n\r") 7150 (skip-chars-forward "^]\n\r")
7108 (when (org-in-regexp org-bracket-link-regexp) 7151 (when (org-in-regexp org-bracket-link-regexp)
7109 (setq link (org-link-unescape (org-match-string-no-properties 1))) 7152 (setq link (org-extract-attributes
7153 (org-link-unescape (org-match-string-no-properties 1))))
7110 (while (string-match " *\n *" link) 7154 (while (string-match " *\n *" link)
7111 (setq link (replace-match " " t t link))) 7155 (setq link (replace-match " " t t link)))
7112 (setq link (org-link-expand-abbrev link)) 7156 (setq link (org-link-expand-abbrev link))
7113 (if (string-match org-link-re-with-space2 link) 7157 (cond
7114 (setq type (match-string 1 link) path (match-string 2 link)) 7158 ((or (file-name-absolute-p link)
7115 (setq type "thisfile" path link)) 7159 (string-match "^\\.\\.?/" link))
7160 (setq type "file" path link))
7161 ((string-match org-link-re-with-space2 link)
7162 (setq type (match-string 1 link) path (match-string 2 link)))
7163 (t (setq type "thisfile" path link)))
7116 (throw 'match t))) 7164 (throw 'match t)))
7117 7165
7118 (when (get-text-property (point) 'org-linked-text) 7166 (when (get-text-property (point) 'org-linked-text)
@@ -7530,6 +7578,9 @@ If the file does not exist, an error is thrown."
7530 (apps (append org-file-apps (org-default-apps))) 7578 (apps (append org-file-apps (org-default-apps)))
7531 (remp (and (assq 'remote apps) (org-file-remote-p file))) 7579 (remp (and (assq 'remote apps) (org-file-remote-p file)))
7532 (dirp (if remp nil (file-directory-p file))) 7580 (dirp (if remp nil (file-directory-p file)))
7581 (file (if (and dirp org-open-directory-means-index-dot-org)
7582 (concat (file-name-as-directory file) "index.org")
7583 file))
7533 (dfile (downcase file)) 7584 (dfile (downcase file))
7534 (old-buffer (current-buffer)) 7585 (old-buffer (current-buffer))
7535 (old-pos (point)) 7586 (old-pos (point))
@@ -8586,7 +8637,7 @@ Returns the new TODO keyword, or nil if no state change should occur."
8586 nil))) 8637 nil)))
8587 8638
8588(defun org-get-repeat () 8639(defun org-get-repeat ()
8589 "Check if tere is a deadline/schedule with repeater in this entry." 8640 "Check if there is a deadline/schedule with repeater in this entry."
8590 (save-match-data 8641 (save-match-data
8591 (save-excursion 8642 (save-excursion
8592 (org-back-to-heading t) 8643 (org-back-to-heading t)
@@ -9196,6 +9247,7 @@ ACTION can be `set', `up', `down', or a character."
9196 9247
9197;;;; Tags 9248;;;; Tags
9198 9249
9250(defvar org-agenda-archives-mode)
9199(defun org-scan-tags (action matcher &optional todo-only) 9251(defun org-scan-tags (action matcher &optional todo-only)
9200 "Scan headline tags with inheritance and produce output ACTION. 9252 "Scan headline tags with inheritance and produce output ACTION.
9201 9253
@@ -9211,9 +9263,9 @@ only lines with a TODO keyword are included in the output."
9211 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") 9263 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
9212 (org-re 9264 (org-re
9213 "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$"))) 9265 "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")))
9214 (props (list 'face nil 9266 (props (list 'face 'default
9215 'done-face 'org-done 9267 'done-face 'org-done
9216 'undone-face nil 9268 'undone-face 'default
9217 'mouse-face 'highlight 9269 'mouse-face 'highlight
9218 'org-not-done-regexp org-not-done-regexp 9270 'org-not-done-regexp org-not-done-regexp
9219 'org-todo-regexp org-todo-regexp 9271 'org-todo-regexp org-todo-regexp
@@ -9265,8 +9317,11 @@ only lines with a TODO keyword are included in the output."
9265 (org-remove-uniherited-tags (cdar tags-alist)))) 9317 (org-remove-uniherited-tags (cdar tags-alist))))
9266 (when (and (or (not todo-only) (member todo org-not-done-keywords)) 9318 (when (and (or (not todo-only) (member todo org-not-done-keywords))
9267 (eval matcher) 9319 (eval matcher)
9268 (or (not org-agenda-skip-archived-trees) 9320 (or
9269 (not (member org-archive-tag tags-list)))) 9321 (not (member org-archive-tag tags-list))
9322 ;; we have an archive tag, should we use this anyway?
9323 (or (not org-agenda-skip-archived-trees)
9324 (and (eq action 'agenda) org-agenda-archives-mode))))
9270 (unless (eq action 'sparse-tree) (org-agenda-skip)) 9325 (unless (eq action 'sparse-tree) (org-agenda-skip))
9271 9326
9272 ;; select this headline 9327 ;; select this headline
@@ -9420,8 +9475,10 @@ also TODO lines."
9420 cat-p (equal pn "CATEGORY") 9475 cat-p (equal pn "CATEGORY")
9421 re-p (equal (string-to-char pv) ?{) 9476 re-p (equal (string-to-char pv) ?{)
9422 str-p (equal (string-to-char pv) ?\") 9477 str-p (equal (string-to-char pv) ?\")
9478 time-p (save-match-data (string-match "^\"<.*>\"$" pv))
9423 pv (if (or re-p str-p) (substring pv 1 -1) pv)) 9479 pv (if (or re-p str-p) (substring pv 1 -1) pv))
9424 (setq po (org-op-to-function po str-p)) 9480 (if time-p (setq pv (org-matcher-time pv)))
9481 (setq po (org-op-to-function po (if time-p 'time str-p)))
9425 (if (equal pn "CATEGORY") 9482 (if (equal pn "CATEGORY")
9426 (setq gv '(get-text-property (point) 'org-category)) 9483 (setq gv '(get-text-property (point) 'org-category))
9427 (setq gv `(org-cached-entry-get nil ,pn))) 9484 (setq gv `(org-cached-entry-get nil ,pn)))
@@ -9476,21 +9533,46 @@ also TODO lines."
9476 (cons match0 matcher))) 9533 (cons match0 matcher)))
9477 9534
9478(defun org-op-to-function (op &optional stringp) 9535(defun org-op-to-function (op &optional stringp)
9536 "Turn an operator into the appropriate function."
9479 (setq op 9537 (setq op
9480 (cond 9538 (cond
9481 ((equal op "<" ) '(< string< )) 9539 ((equal op "<" ) '(< string< org-time<))
9482 ((equal op ">" ) '(> org-string> )) 9540 ((equal op ">" ) '(> org-string> org-time>))
9483 ((member op '("<=" "=<")) '(<= org-string<= )) 9541 ((member op '("<=" "=<")) '(<= org-string<= org-time<=))
9484 ((member op '(">=" "=>")) '(>= org-string>= )) 9542 ((member op '(">=" "=>")) '(>= org-string>= org-time>=))
9485 ((member op '("=" "==")) '(= string= )) 9543 ((member op '("=" "==")) '(= string= org-time=))
9486 ((member op '("<>" "!=")) '(org<> org-string<> )))) 9544 ((member op '("<>" "!=")) '(org<> org-string<> org-time<>))))
9487 (nth (if stringp 1 0) op)) 9545 (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op))
9488 9546
9489(defun org<> (a b) (not (= a b))) 9547(defun org<> (a b) (not (= a b)))
9490(defun org-string<= (a b) (or (string= a b) (string< a b))) 9548(defun org-string<= (a b) (or (string= a b) (string< a b)))
9491(defun org-string>= (a b) (not (string< a b))) 9549(defun org-string>= (a b) (not (string< a b)))
9492(defun org-string> (a b) (and (not (string= a b)) (not (string< a b)))) 9550(defun org-string> (a b) (and (not (string= a b)) (not (string< a b))))
9493(defun org-string<> (a b) (not (string= a b))) 9551(defun org-string<> (a b) (not (string= a b)))
9552(defun org-time= (a b) (= (org-2ft a) (org-2ft b)))
9553(defun org-time< (a b) (< (org-2ft a) (org-2ft b)))
9554(defun org-time<= (a b) (<= (org-2ft a) (org-2ft b)))
9555(defun org-time> (a b) (> (org-2ft a) (org-2ft b)))
9556(defun org-time>= (a b) (>= (org-2ft a) (org-2ft b)))
9557(defun org-time<> (a b) (org<> (org-2ft a) (org-2ft b)))
9558(defun org-2ft (s)
9559 "Convert S to a floating point time.
9560If S is already a number, just return it. If it is a string, parse
9561it as a time string and apply `float-time' to it. f S is nil, just return 0."
9562 (cond
9563 ((numberp s) s)
9564 ((stringp s)
9565 (condition-case nil
9566 (float-time (apply 'encode-time (org-parse-time-string s)))
9567 (error 0.)))
9568 (t 0.)))
9569
9570(defun org-matcher-time (s)
9571 (cond
9572 ((equal s "<now>") (float-time))
9573 ((equal s "<today>")
9574 (float-time (append '(0 0 0) (nthcdr 3 (decode-time)))))
9575 (t (org-2ft s))))
9494 9576
9495(defun org-match-any-p (re list) 9577(defun org-match-any-p (re list)
9496 "Does re match any element of list?" 9578 "Does re match any element of list?"
@@ -9998,7 +10080,8 @@ the scanner. The following items can be given here:
9998 the the function returns t, FUNC will not be called for that 10080 the the function returns t, FUNC will not be called for that
9999 entry and search will continue from the point where the 10081 entry and search will continue from the point where the
10000 function leaves it." 10082 function leaves it."
10001 (let* ((org-agenda-skip-archived-trees (memq 'archive skip)) 10083 (let* ((org-agenda-archives-mode nil) ; just to make sure
10084 (org-agenda-skip-archived-trees (memq 'archive skip))
10002 (org-agenda-skip-comment-trees (memq 'comment skip)) 10085 (org-agenda-skip-comment-trees (memq 'comment skip))
10003 (org-agenda-skip-function 10086 (org-agenda-skip-function
10004 (car (org-delete-all '(comment archive) skip))) 10087 (car (org-delete-all '(comment archive) skip)))
@@ -10009,12 +10092,12 @@ the scanner. The following items can be given here:
10009 ((eq match t) (setq matcher t)) 10092 ((eq match t) (setq matcher t))
10010 ((eq match nil) (setq matcher t)) 10093 ((eq match nil) (setq matcher t))
10011 (t (setq matcher (if match (org-make-tags-matcher match) t)))) 10094 (t (setq matcher (if match (org-make-tags-matcher match) t))))
10012 10095
10013 (when (eq scope 'tree) 10096 (when (eq scope 'tree)
10014 (org-back-to-heading t) 10097 (org-back-to-heading t)
10015 (org-narrow-to-subtree) 10098 (org-narrow-to-subtree)
10016 (setq scope nil)) 10099 (setq scope nil))
10017 10100
10018 (if (not scope) 10101 (if (not scope)
10019 (progn 10102 (progn
10020 (org-prepare-agenda-buffers 10103 (org-prepare-agenda-buffers
@@ -10069,6 +10152,22 @@ Being in this list makes sure that they are offered for completion.")
10069(defconst org-property-end-re "^[ \t]*:END:[ \t]*$" 10152(defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
10070 "Regular expression matching the first line of a property drawer.") 10153 "Regular expression matching the first line of a property drawer.")
10071 10154
10155(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$"
10156 "Regular expression matching the first line of a property drawer.")
10157
10158(defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$"
10159 "Regular expression matching the first line of a property drawer.")
10160
10161(defconst org-property-drawer-re
10162 (concat "\\(" org-property-start-re "\\)[^\000]*\\("
10163 org-property-end-re "\\)\n?")
10164 "Matches an entire property drawer.")
10165
10166(defconst org-clock-drawer-re
10167 (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*\\("
10168 org-property-end-re "\\)\n?")
10169 "Matches an entire clock drawer.")
10170
10072(defun org-property-action () 10171(defun org-property-action ()
10073 "Do an action on properties." 10172 "Do an action on properties."
10074 (interactive) 10173 (interactive)
@@ -11475,7 +11574,7 @@ When SHOW-ALL is nil, only return the current occurence of a time stamp."
11475 date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn))) 11574 date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn)))
11476 n2 (calendar-absolute-from-gregorian date2))) 11575 n2 (calendar-absolute-from-gregorian date2)))
11477 ((eq dw 'month) 11576 ((eq dw 'month)
11478 ;; approx number of month between the tow dates 11577 ;; approx number of month between the two dates
11479 (setq nmonths (floor (/ (- cday sday) 30.436875))) 11578 (setq nmonths (floor (/ (- cday sday) 30.436875)))
11480 ;; How often does dn fit in there? 11579 ;; How often does dn fit in there?
11481 (setq d (nth 1 start) m (car start) y (nth 2 start) 11580 (setq d (nth 1 start) m (car start) y (nth 2 start)
@@ -11489,12 +11588,11 @@ When SHOW-ALL is nil, only return the current occurence of a time stamp."
11489 (setq m2 (+ m dn) y2 y) 11588 (setq m2 (+ m dn) y2 y)
11490 (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12))) 11589 (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
11491 (setq n2 (calendar-absolute-from-gregorian (list m2 d y2))) 11590 (setq n2 (calendar-absolute-from-gregorian (list m2 d y2)))
11492 (while (< n2 cday) 11591 (while (<= n2 cday)
11493 (setq n1 n2 m m2 y y2) 11592 (setq n1 n2 m m2 y y2)
11494 (setq m2 (+ m dn) y2 y) 11593 (setq m2 (+ m dn) y2 y)
11495 (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12))) 11594 (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
11496 (setq n2 (calendar-absolute-from-gregorian (list m2 d y2)))))) 11595 (setq n2 (calendar-absolute-from-gregorian (list m2 d y2))))))
11497
11498 (if show-all 11596 (if show-all
11499 (cond 11597 (cond
11500 ((eq prefer 'past) n1) 11598 ((eq prefer 'past) n1)
@@ -11828,14 +11926,13 @@ If TMP is non-nil, don't include temporary buffers."
11828 (buffer-list))) 11926 (buffer-list)))
11829 (delete nil blist))) 11927 (delete nil blist)))
11830 11928
11831(defun org-agenda-files (&optional unrestricted ext) 11929(defun org-agenda-files (&optional unrestricted archives)
11832 "Get the list of agenda files. 11930 "Get the list of agenda files.
11833Optional UNRESTRICTED means return the full list even if a restriction 11931Optional UNRESTRICTED means return the full list even if a restriction
11834is currently in place. 11932is currently in place.
11835When EXT is non-nil, try to add all files that are created by adding EXT 11933When ARCHIVES is t, include all archive files hat are really being
11836to the file nemes. Basically, this is a way to add the archive files 11934used by the agenda files. If ARCHIVE is `ifmode', do this only if
11837to the list, by setting EXT to \"_archive\" If EXT is non-nil, but not 11935`org-agenda-archives-mode' is t."
11838a string, \"_archive\" will be used."
11839 (let ((files 11936 (let ((files
11840 (cond 11937 (cond
11841 ((and (not unrestricted) (get 'org-agenda-files 'org-restrict))) 11938 ((and (not unrestricted) (get 'org-agenda-files 'org-restrict)))
@@ -11855,16 +11952,9 @@ a string, \"_archive\" will be used."
11855 (lambda (file) 11952 (lambda (file)
11856 (and (file-readable-p file) file))) 11953 (and (file-readable-p file) file)))
11857 files)))) 11954 files))))
11858 (when ext 11955 (when (or (eq archives t)
11859 (setq ext (if (and (stringp ext) (string-match "\\S-" ext)) 11956 (and (eq archives 'ifmode) (eq org-agenda-archives-mode t)))
11860 ext "_archive")) 11957 (setq files (org-add-archive-files files)))
11861 (setq files (apply 'append
11862 (mapcar
11863 (lambda (f)
11864 (if (file-exists-p (concat f ext))
11865 (list f (concat f ext))
11866 (list f)))
11867 files))))
11868 files)) 11958 files))
11869 11959
11870(defun org-edit-agenda-file-list () 11960(defun org-edit-agenda-file-list ()
@@ -12327,13 +12417,15 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
12327 (cd dir)) 12417 (cd dir))
12328 (if (not (file-exists-p dvifile)) 12418 (if (not (file-exists-p dvifile))
12329 (progn (message "Failed to create dvi file from %s" texfile) nil) 12419 (progn (message "Failed to create dvi file from %s" texfile) nil)
12330 (call-process "dvipng" nil nil nil 12420 (condition-case nil
12331 "-E" "-fg" fg "-bg" bg 12421 (call-process "dvipng" nil nil nil
12332 "-D" dpi 12422 "-E" "-fg" fg "-bg" bg
12333 ;;"-x" scale "-y" scale 12423 "-D" dpi
12334 "-T" "tight" 12424 ;;"-x" scale "-y" scale
12335 "-o" pngfile 12425 "-T" "tight"
12336 dvifile) 12426 "-o" pngfile
12427 dvifile)
12428 (error nil))
12337 (if (not (file-exists-p pngfile)) 12429 (if (not (file-exists-p pngfile))
12338 (progn (message "Failed to create png file from %s" texfile) nil) 12430 (progn (message "Failed to create png file from %s" texfile) nil)
12339 ;; Use the requested file name and clean up 12431 ;; Use the requested file name and clean up
@@ -12427,7 +12519,9 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
12427 12519
12428(org-defkey org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up. 12520(org-defkey org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up.
12429(org-defkey org-mode-map "\C-c\C-r" 'org-reveal) 12521(org-defkey org-mode-map "\C-c\C-r" 'org-reveal)
12430(org-defkey narrow-map "s" 'org-narrow-to-subtree) 12522(if (boundp 'narrow-map)
12523 (org-defkey narrow-map "s" 'org-narrow-to-subtree)
12524 (org-defkey org-mode-map "\C-xns" 'org-narrow-to-subtree))
12431(org-defkey org-mode-map "\C-c$" 'org-archive-subtree) 12525(org-defkey org-mode-map "\C-c$" 'org-archive-subtree)
12432(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree) 12526(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree)
12433(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag) 12527(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
@@ -13220,9 +13314,6 @@ See the individual commands for more information."
13220 ["Cycling opens ARCHIVE trees" 13314 ["Cycling opens ARCHIVE trees"
13221 (setq org-cycle-open-archived-trees (not org-cycle-open-archived-trees)) 13315 (setq org-cycle-open-archived-trees (not org-cycle-open-archived-trees))
13222 :style toggle :selected org-cycle-open-archived-trees] 13316 :style toggle :selected org-cycle-open-archived-trees]
13223 ["Agenda includes ARCHIVE trees"
13224 (setq org-agenda-skip-archived-trees (not org-agenda-skip-archived-trees))
13225 :style toggle :selected (not org-agenda-skip-archived-trees)]
13226 "--" 13317 "--"
13227 ["Move Subtree to Archive" org-advertized-archive-subtree t] 13318 ["Move Subtree to Archive" org-advertized-archive-subtree t]
13228 ; ["Check and Move Children" (org-archive-subtree '(4)) 13319 ; ["Check and Move Children" (org-archive-subtree '(4))
@@ -14390,7 +14481,9 @@ Show the heading too, if it is currently invisible."
14390(eval-after-load "imenu" 14481(eval-after-load "imenu"
14391 '(progn 14482 '(progn
14392 (add-hook 'imenu-after-jump-hook 14483 (add-hook 'imenu-after-jump-hook
14393 (lambda () (org-show-context 'org-goto))))) 14484 (lambda ()
14485 (if (eq major-mode 'org-mode)
14486 (org-show-context 'org-goto))))))
14394 14487
14395;; Speedbar support 14488;; Speedbar support
14396 14489
@@ -14513,4 +14606,3 @@ Still experimental, may disappear in the future."
14513;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 14606;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
14514 14607
14515;;; org.el ends here 14608;;; org.el ends here
14516