[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/org org-agenda.el org-archive.el org...
From: |
Carsten Dominik |
Subject: |
[Emacs-diffs] emacs/lisp/org org-agenda.el org-archive.el org... |
Date: |
Sun, 07 Dec 2008 18:36:09 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Carsten Dominik <cdominik> 08/12/07 18:36:08
Modified files:
lisp/org : org-agenda.el org-archive.el org-attach.el
org-bbdb.el org-bibtex.el org-clock.el
org-colview.el org-compat.el org-exp.el
org-export-latex.el org-faces.el org-gnus.el
org-id.el org-info.el org-irc.el org-jsinfo.el
org-list.el org-mac-message.el org-macs.el
org-mew.el org-mhe.el org-mouse.el org-plot.el
org-publish.el org-remember.el org-rmail.el
org-table.el org-vm.el org-wl.el org.el
Log message:
2008-12-07 Carsten Dominik <address@hidden>
* org-id.el (org-id-locations-file): Wrap file name with
`convert-standard-filename'.
(org-id-files): New variable.
(org-id-use-hash): New option.
(org-id-update-id-locations): Also search in all files current
listed in `org-id-files'. Convert the resulting alist to a hash
if the user customation says so.
(org-id-locations-save): Handle he case if `org-id-locations'
is a
hash.
(org-id-locations-load): Convert the alist to a hash.
(org-id-add-location): Handle the hast case.
(kill-emacs-hook): Make sure id locations are saved when Emacs
is
exited.
(org-id-hash-to-alist, org-id-alist-to-hash)
(org-id-paste-tracker): New functions.
2008-12-07 Carsten Dominik <address@hidden>
* org-agenda.el (org-agenda-goto-calendar): Remove duplicate let
bindings of calendar variables.
* org-table.el (org-table-find-row-type): Renamed from
`org-find-row-type'.
(org-table-rewrite-old-row-references): Renamed from
`org-rewrite-old-row-references'.
(org-table-shift-refpart): Renamed from `org-shift-refpart'.
(org-table-cleanup-narrow-column-properties): Renamed from
`org-cleanup-narrow-column-properties'.
2008-12-07 Carsten Dominik <address@hidden>
* org-table.el (org-find-row-type): New arguments DESC and
CLINE,
for better error messages.
(org-table-get-descriptor-line): Supply the new arguments to
`org-find-row-type'.
(org-table-error-on-row-ref-crossing-hline): New option.
* org.el (org-target-link-regexp): Make buffer-local.
(org-move-subtree-down): Fix bug with trees at beginning of
buffer.
2008-12-07 Carsten Dominik <address@hidden>
* org-faces.el (org-set-tag-faces): New function.
(org-tags-special-faces-re): New variable.
* org.el (org-font-lock-add-tag-faces, org-get-tag-face): New
functions.
* org-faces.el (org-tag-faces): New option.
(org-tag): Mention `org-tag-faces' in the docstring.
2008-12-07 Carsten Dominik <address@hidden>
* org-exp.el (org-export-html-style-default): Implement new
quoting.
* org-jsinfo.el (org-infojs-template): Implement new quoting.
* org-w3m.el (w3m-minor-mode-hook): Also add the special copy
command to the `w3m-minor-mode-map'.
* org-archive.el (org-archive-to-archive-sibling): Protect
`this-command' to avoid appending kills during archiving.
* org-exp.el (org-export-with-priority): New variable.
(org-export-add-options-to-plist): Use `org-export-plist-vars'
instead of internal list of strings and properties.
(org-print-icalendar-entries): Retrieve the location property
with
inheritance.
2008-12-07 Carsten Dominik <address@hidden>
* org-exp.el (org-export-with-todo-keywords): New option.
(org-export-plist-vars): Include also the keys for the #+OPTIONS
line.
(org-default-export-plist, org-export-add-options-to-plist)
(org-export-as-ascii, org-export-as-html): Use the new structure
of `org-export-plist-vars'.
* org.el (org-map-entries): Return all values.
2008-12-07 Carsten Dominik <address@hidden>
* org.el (org-matcher-time): Recognize more special values.
* org-gnus.el (fboundp): Fix defvaralias for XEmacs.
2008-12-07 Carsten Dominik <address@hidden>
* org.el (org-tags-exclude-from-inheritance): New option.
(org-tag-inherit-p, org-remove-uniherited-tags): Respect
`org-tags-exclude-from-inheritance'.
* org-agenda.el (org-agenda-show-inherited-tags): New option.
(org-format-agenda-item): Add inherited tags to the agenda line
string, and make sure that properties are kept when downcasing
the
tags list.
(org-agenda-add-inherited-tags): New function.
(org-downcase-keep-props): New function.
* org.el (org-scan-tags): Mark inherited tags with a text
property.
(org-get-tags-at): Mark inherited tags with a text property.
(org-add-prop-inherited): New function.
* org-agenda.el (org-agenda-add-inherited-tags): New function.
(org-agenda-show-inherited-tags): New option.
2008-12-07 Carsten Dominik <address@hidden>
* org.el (org-modules): Add org-w3m to the default modules.
* org-table.el (orgtbl-self-insert-command): Make S-SPC work in
orgtbl-mode.
(orgtabl-create-or-convert-from-region): New command.
* org-exp.el (org-export-as-ascii): Remove the handling of
targets.
(org-export-ascii-preprocess): Handle targets already in this
function.
2008-12-07 Carsten Dominik <address@hidden>
* org-timer.el (org-timer-start-time): Define this variable.
(org-timer-item): Make argument optional.
* org-list.el (org-insert-item): Automatically insert a timer
item
if the current list is a timer list.
* org-timer.el: New file.
* org-publish.el (org-publish-org-index): Only exclude the index
file in the main directory from being added to the site-map.
(org-publish-get-project-from-filename): If the current project
is
a component, start publishing from the parent project.
2008-12-07 Carsten Dominik <address@hidden>
* org-table.el (orgtbl-ret): Fix RET at beginning-of-buffer.
* org-publish.el (org-publish-org-index): Improve removal of
temporary buffers.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-agenda.el?cvsroot=emacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-archive.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-attach.el?cvsroot=emacs&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-bbdb.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-bibtex.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-clock.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-colview.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-compat.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-exp.el?cvsroot=emacs&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-export-latex.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-faces.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-gnus.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-id.el?cvsroot=emacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-info.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-irc.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-jsinfo.el?cvsroot=emacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-list.el?cvsroot=emacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mac-message.el?cvsroot=emacs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-macs.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mew.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mhe.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-mouse.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-plot.el?cvsroot=emacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-publish.el?cvsroot=emacs&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-remember.el?cvsroot=emacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-rmail.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-table.el?cvsroot=emacs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-vm.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org-wl.el?cvsroot=emacs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/org/org.el?cvsroot=emacs&r1=1.27&r2=1.28
Patches:
Index: org-agenda.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-agenda.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- org-agenda.el 24 Nov 2008 12:16:13 -0000 1.15
+++ org-agenda.el 7 Dec 2008 18:36:02 -0000 1.16
@@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -945,6 +945,10 @@
(integer :tag "Minutes")
(const :tag "No default duration")))
+(defcustom org-agenda-show-inherited-tags t
+ "Non-nil means, show inherited tags in each agenda line."
+ :group 'org-agenda-line-format
+ :type 'boolean)
(defcustom org-agenda-remove-tags nil
"Non-nil means, remove the tags from the headline copy in the agenda.
@@ -3737,6 +3741,9 @@
(save-match-data
;; Diary entries sometimes have extra whitespace at the beginning
(if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt)))
+ (when org-agenda-show-inherited-tags
+ ;; Fix the tags part in txt
+ (setq txt (org-agenda-add-inherited-tags txt tags)))
(let* ((category (or category
org-category
(if buffer-file-name
@@ -3836,7 +3843,8 @@
;; And finally add the text properties
(org-add-props rtn nil
- 'org-category (downcase category) 'tags (mapcar 'downcase tags)
+ 'org-category (downcase category)
+ 'tags (mapcar 'org-downcase-keep-props tags)
'org-highest-priority org-highest-priority
'org-lowest-priority org-lowest-priority
'prefix-length (- (length rtn) (length txt))
@@ -3849,6 +3857,34 @@
'extra extra
'dotime dotime))))
+(defun org-agenda-add-inherited-tags (txt tags)
+ "Remove tags string from TXT, and add complete list of tags.
+The new list includes inherited tags. If any inherited tags are present,
+a double colon separates inherited tags from local tags."
+ (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt)
+ (setq txt (substring txt 0 (match-beginning 0))))
+ (when tags
+ (let ((have-i (get-text-property 0 'inherited (car tags)))
+ i)
+ (setq txt (concat txt " :"
+ (mapconcat
+ (lambda (x)
+ (setq i (get-text-property 0 'inherited x))
+ (if (and have-i (not i))
+ (progn
+ (setq have-i nil)
+ (concat ":" x))
+ x))
+ tags ":")
+ (if have-i "::" ":")))))
+ txt)
+
+(defun org-downcase-keep-props (s)
+ (let ((props (text-properties-at 0 s)))
+ (setq s (downcase s))
+ (add-text-properties 0 (length s) props s)
+ s))
+
(defvar org-agenda-sorting-strategy) ;; because the def is in a let form
(defvar org-agenda-sorting-strategy-selected nil)
@@ -5101,7 +5137,9 @@
(goto-char (match-beginning 1))
(insert (org-add-props
(make-string (max 1 (- c (current-column))) ?\ )
- (text-properties-at (point))))))))
+ (text-properties-at (point)))))
+ (goto-char (point-min))
+ (org-font-lock-add-tag-faces (point-max)))))
(defun org-agenda-priority-up ()
"Increase the priority of line at point, also in Org-mode file."
@@ -5512,8 +5550,6 @@
(calendar-view-holidays-initially-flag nil)
(calendar-view-diary-initially-flag nil)
(view-calendar-holidays-initially nil)
- (calendar-view-diary-initially-flag nil)
- (calendar-view-holidays-initially-flag nil)
(view-diary-entries-initially nil))
(calendar)
(calendar-goto-date date)))
Index: org-archive.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-archive.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-archive.el 24 Nov 2008 12:16:14 -0000 1.12
+++ org-archive.el 7 Dec 2008 18:36:03 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -345,7 +345,7 @@
(org-end-of-subtree t t)
(save-excursion
(goto-char pos)
- (org-cut-subtree))
+ (let ((this-command this-command)) (org-cut-subtree)))
(org-paste-subtree (org-get-valid-level level 1))
(org-set-property
"ARCHIVE_TIME"
Index: org-attach.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-attach.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- org-attach.el 24 Nov 2008 12:16:14 -0000 1.6
+++ org-attach.el 7 Dec 2008 18:36:03 -0000 1.7
@@ -4,7 +4,7 @@
;; Author: John Wiegley <address@hidden>
;; Keywords: org data task
-;; Version: 6.13a
+;; Version: 6.14
;; This file is part of GNU Emacs.
;;
Index: org-bbdb.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-bbdb.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-bbdb.el 24 Nov 2008 12:16:15 -0000 1.12
+++ org-bbdb.el 7 Dec 2008 18:36:03 -0000 1.13
@@ -6,7 +6,7 @@
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-bibtex.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-bibtex.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-bibtex.el 24 Nov 2008 12:16:15 -0000 1.11
+++ org-bibtex.el 7 Dec 2008 18:36:04 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Bastien Guerry <bzg at altern dot org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
;; Keywords: org, wp, remember
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-clock.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-clock.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-clock.el 24 Nov 2008 12:16:16 -0000 1.12
+++ org-clock.el 7 Dec 2008 18:36:04 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -118,7 +118,8 @@
(const :tag "Clock and history" t)
(const :tag "No persistence" nil)))
-(defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el"
+(defcustom org-clock-persist-file (convert-standard-filename
+ "~/.emacs.d/org-clock-save.el")
"File to save clock data to"
:group 'org-clock
:type 'string)
Index: org-colview.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-colview.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-colview.el 24 Nov 2008 12:16:16 -0000 1.11
+++ org-colview.el 7 Dec 2008 18:36:04 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-compat.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-compat.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-compat.el 24 Nov 2008 12:16:16 -0000 1.11
+++ org-compat.el 7 Dec 2008 18:36:04 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-exp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-exp.el,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- org-exp.el 24 Nov 2008 12:16:16 -0000 1.14
+++ org-exp.el 7 Dec 2008 18:36:05 -0000 1.15
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -204,6 +204,18 @@
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-with-todo-keywords t
+ "Non-nil means, include TODO keywords in export.
+When nil, remove all these keywords from the export."
+ :group 'org-export-general
+ :type 'boolean)
+
+(defcustom org-export-with-priority nil
+ "Non-nil means, include priority cookies in export.
+When nil, remove priority cookies for export."
+ :group 'org-export-general
+ :type 'boolean)
+
(defcustom org-export-preserve-breaks nil
"Non-nil means, preserve all line breaks when exporting.
Normally, in HTML output paragraphs will be reformatted. In ASCII
@@ -512,7 +524,7 @@
(defconst org-export-html-style-default
"<style type=\"text/css\">
- <![CDATA[
+ <!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
@@ -539,7 +551,7 @@
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
- ]]>
+ /*]]>*/-->
</style>"
"The default style specification for exported HTML files.
Please use the variables `org-export-html-style' and
@@ -821,57 +833,67 @@
(defvar org-current-export-dir nil) ; dynamically scoped parameter
(defconst org-export-plist-vars
- '((:link-up . org-export-html-link-up)
- (:link-home . org-export-html-link-home)
- (:language . org-export-default-language)
- (:customtime . org-display-custom-times)
- (:headline-levels . org-export-headline-levels)
- (:section-numbers . org-export-with-section-numbers)
- (:section-number-format . org-export-section-number-format)
- (:table-of-contents . org-export-with-toc)
- (:preserve-breaks . org-export-preserve-breaks)
- (:archived-trees . org-export-with-archived-trees)
- (:emphasize . org-export-with-emphasize)
- (:sub-superscript . org-export-with-sub-superscripts)
- (:special-strings . org-export-with-special-strings)
- (:footnotes . org-export-with-footnotes)
- (:drawers . org-export-with-drawers)
- (:tags . org-export-with-tags)
- (:TeX-macros . org-export-with-TeX-macros)
- (:LaTeX-fragments . org-export-with-LaTeX-fragments)
- (:skip-before-1st-heading . org-export-skip-text-before-1st-heading)
- (:fixed-width . org-export-with-fixed-width)
- (:timestamps . org-export-with-timestamps)
- (:author-info . org-export-author-info)
- (:creator-info . org-export-creator-info)
- (:time-stamp-file . org-export-time-stamp-file)
- (:tables . org-export-with-tables)
- (:table-auto-headline . org-export-highlight-first-table-line)
- (:style-include-default . org-export-html-style-include-default)
- (:style . org-export-html-style)
- (:style-extra . org-export-html-style-extra)
- (:agenda-style . org-agenda-export-html-style)
- (:convert-org-links . org-export-html-link-org-files-as-html)
- (:inline-images . org-export-html-inline-images)
- (:html-extension . org-export-html-extension)
- (:html-table-tag . org-export-html-table-tag)
- (:expand-quoted-html . org-export-html-expand)
- (:timestamp . org-export-html-with-timestamp)
- (:publishing-directory . org-export-publishing-directory)
- (:preamble . org-export-html-preamble)
- (:postamble . org-export-html-postamble)
- (:auto-preamble . org-export-html-auto-preamble)
- (:auto-postamble . org-export-html-auto-postamble)
- (:author . user-full-name)
- (:email . user-mail-address)
- (:select-tags . org-export-select-tags)
- (:exclude-tags . org-export-exclude-tags)))
+ '((:link-up nil org-export-html-link-up)
+ (:link-home nil org-export-html-link-home)
+ (:language nil org-export-default-language)
+ (:customtime nil org-display-custom-times)
+ (:headline-levels "H" org-export-headline-levels)
+ (:section-numbers "num" org-export-with-section-numbers)
+ (:section-number-format nil org-export-section-number-format)
+ (:table-of-contents "toc" org-export-with-toc)
+ (:preserve-breaks "\\n" org-export-preserve-breaks)
+ (:archived-trees nil org-export-with-archived-trees)
+ (:emphasize "*" org-export-with-emphasize)
+ (:sub-superscript "^" org-export-with-sub-superscripts)
+ (:special-strings "-" org-export-with-special-strings)
+ (:footnotes "f" org-export-with-footnotes)
+ (:drawers "d" org-export-with-drawers)
+ (:tags "tags" org-export-with-tags)
+ (:todo-keywords "todo" org-export-with-todo-keywords)
+ (:priority "pri" org-export-with-priority)
+ (:TeX-macros "TeX" org-export-with-TeX-macros)
+ (:LaTeX-fragments "LaTeX" org-export-with-LaTeX-fragments)
+ (:skip-before-1st-heading "skip"
org-export-skip-text-before-1st-heading)
+ (:fixed-width ":" org-export-with-fixed-width)
+ (:timestamps "<" org-export-with-timestamps)
+ (:author-info "author" org-export-author-info)
+ (:creator-info "creator" org-export-creator-info)
+ (:time-stamp-file "timestamp" org-export-time-stamp-file)
+ (:tables "|" org-export-with-tables)
+ (:table-auto-headline nil
org-export-highlight-first-table-line)
+ (:style-include-default nil
org-export-html-style-include-default)
+ (:style nil org-export-html-style)
+ (:style-extra nil org-export-html-style-extra)
+ (:agenda-style nil org-agenda-export-html-style)
+ (:convert-org-links nil
org-export-html-link-org-files-as-html)
+ (:inline-images nil org-export-html-inline-images)
+ (:html-extension nil org-export-html-extension)
+ (:html-table-tag nil org-export-html-table-tag)
+ (:expand-quoted-html "@" org-export-html-expand)
+ (:timestamp nil org-export-html-with-timestamp)
+ (:publishing-directory nil org-export-publishing-directory)
+ (:preamble nil org-export-html-preamble)
+ (:postamble nil org-export-html-postamble)
+ (:auto-preamble nil org-export-html-auto-preamble)
+ (:auto-postamble nil org-export-html-auto-postamble)
+ (:author nil user-full-name)
+ (:email nil user-mail-address)
+ (:select-tags nil org-export-select-tags)
+ (:exclude-tags nil org-export-exclude-tags))
+ "List of properties that represent export/publishing variables.
+Each element is a list of 3 items:
+1. The property that is used internally, and also for org-publish-project-alist
+2. The string that can be used in the OPTION lines to set this option,
+ or nil if this option cannot be changed in this way
+3. The customization variable that sets the default for this option."
+
+)
(defun org-default-export-plist ()
"Return the property list with default settings for the export variables."
(let ((l org-export-plist-vars) rtn e)
(while (setq e (pop l))
- (setq rtn (cons (car e) (cons (symbol-value (cdr e)) rtn))))
+ (setq rtn (cons (car e) (cons (symbol-value (nth 2 e)) rtn))))
rtn))
(defvar org-export-inbuffer-options-extra nil
@@ -964,31 +986,13 @@
"Parse an OPTONS line and set values in the property list P."
(let (o)
(when options
- (let ((op '(("H" . :headline-levels)
- ("num" . :section-numbers)
- ("toc" . :table-of-contents)
- ("\\n" . :preserve-breaks)
- ("@" . :expand-quoted-html)
- (":" . :fixed-width)
- ("|" . :tables)
- ("^" . :sub-superscript)
- ("-" . :special-strings)
- ("f" . :footnotes)
- ("d" . :drawers)
- ("tags" . :tags)
- ("*" . :emphasize)
- ("TeX" . :TeX-macros)
- ("LaTeX" . :LaTeX-fragments)
- ("skip" . :skip-before-1st-heading)
- ("author" . :author-info)
- ("creator" . :creator-info)
- ("timestamp" . :time-stamp-file)))
- o)
+ (let ((op org-export-plist-vars) a)
(while (setq o (pop op))
- (if (string-match (concat (regexp-quote (car o))
+ (if (and (nth 1 o)
+ (string-match (concat (regexp-quote (nth 1 o))
":\\([^ \t\n\r;,.]*\\)")
- options)
- (setq p (plist-put p (cdr o)
+ options))
+ (setq p (plist-put p (car o)
(car (read-from-string
(match-string 1 options))))))))))
p)
@@ -1462,6 +1466,9 @@
;; Handle source code snippets
(org-export-replace-src-segments)
+ ;; Find all headings and compute the targets for them
+ (setq target-alist (org-export-define-heading-targets target-alist))
+
;; Get rid of drawers
(org-export-remove-or-extract-drawers drawers
(plist-get parameters :drawers))
@@ -1480,8 +1487,8 @@
;; Get rid of archived trees
(org-export-remove-archived-trees archived-trees)
- ;; Find all headings and compute the targets for them
- (setq target-alist (org-export-define-heading-targets target-alist))
+ ;; Remove todo-keywords before exporting, if the user has requested so
+ (org-export-remove-headline-metadata parameters)
;; Find targets in comments and move them out of comments,
;; but mark them as targets that should be invisible
@@ -1506,7 +1513,6 @@
;; Remove comment environment and comment subtrees
(org-export-remove-comment-blocks-and-subtrees)
-
;; Find matches for radio targets and turn them into internal links
(org-export-mark-radio-links)
@@ -1564,9 +1570,13 @@
The new targets are added to TARGET-ALIST, which is also returned."
(goto-char (point-min))
(org-init-section-numbers)
- (let ((re (concat "^" org-outline-regexp))
+ (let ((re (concat "^" org-outline-regexp
+ "\\| [ \t]*:ID:[ \t]*\\([^ \t\r\n]+\\)"))
level target)
(while (re-search-forward re nil t)
+ (if (match-end 1)
+ (push (cons (org-match-string-no-properties 1)
+ target) target-alist)
(setq level (org-reduced-level
(save-excursion (goto-char (point-at-bol))
(org-outline-level))))
@@ -1575,7 +1585,7 @@
(push (cons target target) target-alist)
(add-text-properties
(point-at-bol) (point-at-eol)
- (list 'target target))))
+ (list 'target target)))))
target-alist)
(defun org-export-handle-invisible-targets (target-alist)
@@ -1604,9 +1614,11 @@
target-alist)
(defun org-export-target-internal-links (target-alist)
- "Find all internal links and assign target to them.
+ "Find all internal links and assign targets to them.
If a link has a fuzzy match (i.e. not a *dedicated* target match),
-let the link point to the corresponding section."
+let the link point to the corresponding section.
+This function also handles the id links, if they have a match in
+the current file."
(goto-char (point-min))
(while (re-search-forward org-bracket-link-regexp nil t)
(org-if-unprotected
@@ -1618,6 +1630,8 @@
(target
(cond
((cdr (assoc slink target-alist)))
+ ((and (string-match "^id:" link)
+ (cdr (assoc (substring link 3) target-alist))))
((string-match org-link-types-re link) nil)
((or (file-name-absolute-p link)
(string-match "^\\." link))
@@ -1735,6 +1749,24 @@
b (org-end-of-subtree t))
(if (> b a) (delete-region a b)))))))
+(defun org-export-remove-headline-metadata (opts)
+ "Remove meta data from the headline, according to user options."
+ (let ((re org-complex-heading-regexp)
+ (todo (plist-get opts :todo-keywords))
+ (tags (plist-get opts :tags))
+ (pri (plist-get opts :priority))
+ rpl)
+ (when (or (not todo) (not tags) (not pri))
+ ;; OK, something needs to be removed
+ (setq rpl (concat "\\1"
+ (if todo " \\2" "")
+ (if pri " \\3" "")
+ " \\4"
+ (if tags " \\5" "")))
+ (goto-char (point-min))
+ (while (re-search-forward re nil t)
+ (replace-match rpl t nil)))))
+
(defun org-export-protect-quoted-subtrees ()
"Mark quoted subtrees with the protection property."
(let ((re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>")))
@@ -2278,6 +2310,9 @@
:skip-before-1st-heading
(plist-get opt-plist :skip-before-1st-heading)
:drawers (plist-get opt-plist :drawers)
+ :tags (plist-get opt-plist :tags)
+ :priority (plist-get opt-plist :priority)
+ :todo-keywords (plist-get opt-plist :todo-keywords)
:verbatim-multiline t
:select-tags (plist-get opt-plist :select-tags)
:exclude-tags (plist-get opt-plist :exclude-tags)
@@ -2307,7 +2342,7 @@
;; create local variables for all options, to make sure all called
;; functions get the correct information
(mapc (lambda (x)
- (set (make-local-variable (cdr x))
+ (set (make-local-variable (nth 2 x))
(plist-get opt-plist (car x))))
org-export-plist-vars)
(org-set-local 'org-odd-levels-only odd)
@@ -2397,10 +2432,7 @@
(while (setq line (pop lines))
;; Remove the quoted HTML tags.
(setq line (org-html-expand-for-ascii line))
- ;; Remove targets
- (while (string-match "<<<?[^<>]*>>>?[ \t]*\n?" line)
- (setq line (replace-match "" t t line)))
- ;; Replace internal links
+ ;; Replace links with the description when possible
(while (string-match org-bracket-link-regexp line)
(setq line (replace-match
(if (match-end 3) "[\\3]" "[\\1]")
@@ -2483,13 +2515,18 @@
(defun org-export-ascii-preprocess ()
"Do extra work for ASCII export"
+ ;; Put quotes around verbatim text
(goto-char (point-min))
(while (re-search-forward org-verbatim-re nil t)
(goto-char (match-end 2))
(backward-delete-char 1) (insert "'")
(goto-char (match-beginning 2))
(delete-char 1) (insert "`")
- (goto-char (match-end 2))))
+ (goto-char (match-end 2)))
+ (goto-char (point-min))
+ ;; Remove target markers
+ (while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
+ (replace-match "\\1\\2")))
(defun org-search-todo-below (line lines level)
"Search the subtree below LINE for any TODO entries."
@@ -2643,7 +2680,7 @@
#+EMAIL: %s
#+DATE: %s
#+LANGUAGE: %s
-#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s
TeX:%s LaTeX:%s skip:%s d:%s tags:%s
+#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s
TeX:%s LaTeX:%s skip:%s d:%s todo:%s pri:%s tags:%s
%s
#+EXPORT_SELECT_TAGS: %s
#+EXPORT_EXCLUDE_TAGS: %s
@@ -2678,6 +2715,8 @@
org-export-with-LaTeX-fragments
org-export-skip-text-before-1st-heading
org-export-with-drawers
+ org-export-with-todo-keywords
+ org-export-with-priority
org-export-with-tags
(if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "")
(mapconcat 'identity org-export-select-tags " ")
@@ -2951,6 +2990,9 @@
:skip-before-1st-heading
(plist-get opt-plist :skip-before-1st-heading)
:drawers (plist-get opt-plist :drawers)
+ :todo-keywords (plist-get opt-plist :todo-keywords)
+ :tags (plist-get opt-plist :tags)
+ :priority (plist-get opt-plist :priority)
:archived-trees
(plist-get opt-plist :archived-trees)
:select-tags (plist-get opt-plist :select-tags)
@@ -3002,7 +3044,7 @@
;; create local variables for all options, to make sure all called
;; functions get the correct information
(mapc (lambda (x)
- (set (make-local-variable (cdr x))
+ (set (make-local-variable (nth 2 x))
(plist-get opt-plist (car x))))
org-export-plist-vars)
(setq umax (if arg (prefix-numeric-value arg)
@@ -4356,7 +4398,7 @@
(and org-icalendar-include-body (org-get-entry)))
t org-icalendar-include-body)
location (org-icalendar-cleanup-string
- (org-entry-get nil "LOCATION"))
+ (org-entry-get nil "LOCATION" 'selective))
uid (if org-icalendar-store-UID
(org-id-get-create)
(or (org-id-get) (org-id-new)))
@@ -4478,7 +4520,7 @@
(and org-icalendar-include-body (org-get-entry)))
t org-icalendar-include-body)
location (org-icalendar-cleanup-string
- (org-entry-get nil "LOCATION"))
+ (org-entry-get nil "LOCATION" 'selective))
due (and (member 'todo-due org-icalendar-use-deadline)
(org-entry-get nil "DEADLINE"))
start (and (member 'todo-start org-icalendar-use-scheduled)
Index: org-export-latex.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-export-latex.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-export-latex.el 24 Nov 2008 12:16:18 -0000 1.11
+++ org-export-latex.el 7 Dec 2008 18:36:05 -0000 1.12
@@ -4,7 +4,7 @@
;;
;; Emacs Lisp Archive Entry
;; Filename: org-export-latex.el
-;; Version: 6.13a
+;; Version: 6.14
;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: org, wp, tex
@@ -423,6 +423,9 @@
region :emph-multiline t
:for-LaTeX t
:comments nil
+ :tags (plist-get opt-plist :tags)
+ :priority (plist-get opt-plist :priority)
+ :todo-keywords (plist-get opt-plist :todo-keywords)
:add-text (if (eq to-buffer 'string) nil text)
:skip-before-1st-heading skip
:select-tags (plist-get opt-plist :select-tags)
Index: org-faces.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-faces.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-faces.el 24 Nov 2008 12:16:18 -0000 1.12
+++ org-faces.el 7 Dec 2008 18:36:05 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -269,7 +269,9 @@
(defface org-tag
'((t (:bold t)))
- "Face for tags."
+ "Default face for tags.
+Note that the variable `org-tag-faces' can be used to overrule this face for
+specific tags."
:group 'org-faces)
(defface org-todo ; font-lock-warning-face
@@ -313,6 +315,31 @@
(string :tag "keyword")
(sexp :tag "face"))))
+(defvar org-tags-special-faces-re nil)
+(defun org-set-tag-faces (var value)
+ (set var value)
+ (if (not value)
+ (setq org-tags-special-faces-re nil)
+ (setq org-tags-special-faces-re
+ (concat ":\\(" (mapconcat 'car value "\\|") "\\):"))))
+
+(defcustom org-tag-faces nil
+ "Faces for specific tags.
+This is a list of cons cells, with tags in the car and faces in the cdr.
+The face can be a symbol, or a property list of attributes,
+like (:foreground \"blue\" :weight bold :underline t).
+If you set this variable through customize, it will immediately be effective
+in new buffers and in modified lines.
+If you set it with Lisp, a restart of Emacs is required to activate the
+changes."
+ :group 'org-faces
+ :group 'org-tags
+ :set 'org-set-tag-faces
+ :type '(repeat
+ (cons
+ (string :tag "Tag")
+ (sexp :tag "Face"))))
+
(defface org-table ;; originally copied from font-lock-function-name-face
(org-compatible-face nil
'((((class color) (min-colors 88) (background light)) (:foreground
"Blue1"))
Index: org-gnus.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-gnus.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-gnus.el 24 Nov 2008 12:16:18 -0000 1.11
+++ org-gnus.el 7 Dec 2008 18:36:05 -0000 1.12
@@ -6,7 +6,7 @@
;; Tassilo Horn <tassilo at member dot fsf dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -39,8 +39,7 @@
;; Customization variables
(when (fboundp 'defvaralias)
- (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links
- "Deprecated name for `org-gnus-prefer-web-links'."))
+ (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links))
(defcustom org-gnus-prefer-web-links nil
"Non-nil means, `org-store-link' will create web links to Google groups.
@@ -140,6 +139,7 @@
(setq desc (org-email-link-description)
link (org-gnus-article-link group newsgroups message-id
x-no-archive))
(org-add-link-props :link link :description desc)
+ (gnus-summary-toggle-header -1)
link))))
(defun org-gnus-open (path)
Index: org-id.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-id.el,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- org-id.el 24 Nov 2008 12:16:18 -0000 1.10
+++ org-id.el 7 Dec 2008 18:36:05 -0000 1.11
@@ -1,10 +1,10 @@
-;;; org-id.el --- Global identifier for Org-mode entries
+;;; org-id.el --- Global identifiers for Org-mode entries
;; Copyright (C) 2008 Free Software Foundation, Inc.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -116,17 +116,42 @@
:group 'org-id
:type 'boolean)
+(defcustom org-id-track-globally t
+ "Non-nil means, track ID's trhough files, so that links work globally.
+This work by maintaining a hash table for ID's and writing this table
+to disk when exiting Emacs. Because of this, it works best if you use
+a single Emacs process, not many.
+
+When nil, ID's are not tracked. Links to ID's will still work within
+a buffer, but not if the entry is located in another file.
+ID's can still be used if the entry with the id is in the same file as
+the link."
+ :group 'org-id
+ :type 'boolean)
+
(defcustom org-id-locations-file (convert-standard-filename
- "~/.org-id-locations")
- "The file for remembering the last ID number generated."
+ "~/.emacs.d/.org-id-locations")
+ "The file for remembering in which file an ID was defined.
+This variable is only relevant when `org-id-track-globally' is set."
:group 'org-id
:type 'file)
(defvar org-id-locations nil
- "List of files with ID's in those files.")
+ "List of files with ID's in those files.
+Depending on `org-id-use-hash' this can also be a hash table mapping ID's
+to files.")
+
+(defvar org-id-files nil
+ "List of files that contain ID's.")
(defcustom org-id-extra-files 'org-agenda-text-search-extra-files
- "Files to be searched for ID's, besides the agenda files."
+ "Files to be searched for ID's, besides the agenda files.
+When Org reparses files to remake the list of files and ID's it is tracking,
+it will normally scan the agenda files, the archives related to agenda files,
+any files that are listed as ID containing in the current register, and
+any Org-mode files currently visited by Emacs.
+You can list additional files here.
+This variable is only relevant when `org-id-track-globally' is set."
:group 'org-id
:type
'(choice
@@ -134,6 +159,14 @@
(repeat :tag "List of files"
(file))))
+(defcustom org-id-search-archives t
+ "Non-nil means, search also the archive files of agenda files for entries.
+This is a possibility to reduce overhead, but it measn that entries moved
+to the archives can no longer be found by ID.
+This variable is only relevant when `org-id-track-globally' is set."
+ :group 'org-id
+ :type 'boolean)
+
;;; The API functions
;;;###autoload
@@ -202,7 +235,7 @@
(defun org-id-goto (id)
"Switch to the buffer containing the entry with id ID.
Move the cursor to that entry in that buffer."
- (interactive)
+ (interactive "sID: ")
(let ((m (org-id-find id 'marker)))
(unless m
(error "Cannot find entry with ID \"%s\"" id))
@@ -326,17 +359,41 @@
;; Storing ID locations (files)
-(defun org-id-update-id-locations ()
+(defun org-id-update-id-locations (&optional files check)
"Scan relevant files for ID's.
-Store the relation between files and corresponding ID's."
+Store the relation between files and corresponding ID's.
+This will scan all agenda files, all associated archives, and all
+files currently mentioned in `org-id-locations'.
+When FILES is given, scan these files instead."
(interactive)
- (let ((files (append (org-agenda-files)
+ (if (not org-id-track-globally)
+ (error "Please turn on `org-id-track-globally' if you want to track
id's.")
+ (let ((files
+ (or files
+ (append
+ ;; Agenda files and all associated archives
+ (org-agenda-files t org-id-search-archives)
+ ;; Explicit extra files
(if (symbolp org-id-extra-files)
(symbol-value org-id-extra-files)
- org-id-extra-files)))
+ org-id-extra-files)
+ ;; Files associated with live org-mode buffers
+ (delq nil
+ (mapcar (lambda (b)
+ (with-current-buffer b
+ (and (org-mode-p) (buffer-file-name))))
+ (buffer-list)))
+ ;; All files known to have id's
+ org-id-files)))
org-agenda-new-buffers
- file ids reg found id)
+ file nfiles tfile ids reg found id seen (ndup 0))
+ (setq nfiles (length files))
(while (setq file (pop files))
+ (message "Finding ID locations (%d/%d files): %s"
+ (- nfiles (length files)) nfiles file)
+ (setq tfile (file-truename file))
+ (when (and (file-exists-p file) (not (member tfile seen)))
+ (push tfile seen)
(setq ids nil)
(with-current-buffer (org-get-agenda-file-buffer file)
(save-excursion
@@ -347,23 +404,37 @@
nil t)
(setq id (org-match-string-no-properties 1))
(if (member id found)
- (error "Duplicate ID \"%s\"" id))
+ (progn
+ (message "Duplicate ID \"%s\"" id)
+ (setq ndup (1+ ndup)))
(push id found)
- (push id ids))
- (push (cons file ids) reg)))))
+ (push id ids)))
+ (push (cons (abbreviate-file-name file) ids) reg))))))
(org-release-buffers org-agenda-new-buffers)
(setq org-agenda-new-buffers nil)
(setq org-id-locations reg)
- (org-id-locations-save)))
+ (setq org-id-files (mapcar 'car org-id-locations))
+ (org-id-locations-save) ;; this function can also handle the alist form
+ ;; now convert to a hash
+ (setq org-id-locations (org-id-alist-to-hash org-id-locations))
+ (if (> ndup 0)
+ (message "WARNING: %d duplicate ID's found, check *Messages* buffer"
ndup)
+ (message "%d unique files scanned for ID's" (length org-id-files)))
+ org-id-locations)))
(defun org-id-locations-save ()
"Save `org-id-locations' in `org-id-locations-file'."
+ (when org-id-track-globally
+ (let ((out (if (hash-table-p org-id-locations)
+ (org-id-hash-to-alist org-id-locations)
+ org-id-locations)))
(with-temp-file org-id-locations-file
- (print org-id-locations (current-buffer))))
+ (print out (current-buffer))))))
(defun org-id-locations-load ()
"Read the data from `org-id-locations-file'."
(setq org-id-locations nil)
+ (when org-id-track-globally
(with-temp-buffer
(condition-case nil
(progn
@@ -372,31 +443,69 @@
(setq org-id-locations (read (current-buffer))))
(error
(message "Could not read org-id-values from %s. Setting it to nil."
- org-id-locations-file)))))
+ org-id-locations-file))))
+ (setq org-id-files (mapcar 'car org-id-locations))
+ (setq org-id-locations (org-id-alist-to-hash org-id-locations))))
(defun org-id-add-location (id file)
"Add the ID with location FILE to the database of ID loations."
- (when (and id file) ; don't error when called from a buffer with no file
+ ;; Only if global tracking is on, and when the buffer has a file
+ (when (and org-id-track-globally id file)
(unless org-id-locations (org-id-locations-load))
- (catch 'exit
- (let ((locs org-id-locations) list)
- (while (setq list (pop locs))
- (when (equal (file-truename file) (file-truename (car list)))
- (setcdr list (cons id (cdr list)))
- (throw 'exit t))))
- (push (list file id) org-id-locations))
- (org-id-locations-save)))
+ (puthash id (abbreviate-file-name file) org-id-locations)
+ (add-to-list 'org-id-files (abbreviate-file-name file))))
+
+(add-hook 'kill-emacs-hook 'org-id-locations-save)
+
+(defun org-id-hash-to-alist (hash)
+ "Turn an org-id hash into an alist, so that it can be written to a file."
+ (let (res x)
+ (maphash
+ (lambda (k v)
+ (if (setq x (member v res))
+ (push k (cdr x))
+ (push (list v k) res)))
+ hash)
+ res))
+
+(defun org-id-alist-to-hash (list)
+ "Turn an org-id location list into a hash table."
+ (let ((res (make-hash-table
+ :test 'equal
+ :size (apply '+ (mapcar 'length list))))
+ f i)
+ (mapc
+ (lambda (x)
+ (setq f (car x))
+ (mapc (lambda (i) (puthash i f res)) (cdr x)))
+ list)
+ res))
+
+(defun org-id-paste-tracker (txt &optional buffer-or-file)
+ "Update any ID's in TXT and assign BUFFER-OR-FILE to them."
+ (when org-id-track-globally
+ (save-match-data
+ (setq buffer-or-file (or buffer-or-file (current-buffer)))
+ (when (bufferp buffer-or-file)
+ (setq buffer-or-file (or (buffer-base-buffer buffer-or-file)
+ buffer-or-file))
+ (setq buffer-or-file (buffer-file-name buffer-or-file)))
+ (when buffer-or-file
+ (let ((fname (abbreviate-file-name buffer-or-file))
+ (s 0))
+ (while (string-match "^[ \t]*:ID:[ \t]+\\([^ \t\n\r]+\\)" txt s)
+ (setq s (match-end 0))
+ (org-id-add-location (match-string 1 txt) fname)))))))
;; Finding entries with specified id
(defun org-id-find-id-file (id)
"Query the id database for the file in which this ID is located."
(unless org-id-locations (org-id-locations-load))
- (catch 'found
- (mapc (lambda (x) (if (member id (cdr x))
- (throw 'found (car x))))
- org-id-locations)
- nil))
+ (or (gethash id org-id-locations)
+ ;; ball back on current buffer
+ (buffer-file-name (or (buffer-base-buffer (current-buffer))
+ (current-buffer)))))
(defun org-id-find-id-in-file (id file &optional markerp)
"Return the position of the entry ID in FILE.
@@ -415,8 +524,35 @@
(move-marker (make-marker) pos buf)
(cons file pos))))))))
+;; id link type
+
+;; Calling the following function is hard-coded into `org-store-link',
+;; so we do have to add it to `org-store-link-functions'.
+
+(defun org-id-store-link ()
+ "Store a link to the current entry, using it's ID."
+ (interactive)
+ (let* ((link (org-make-link "id:" (org-id-get-create)))
+ (desc (save-excursion
+ (org-back-to-heading t)
+ (or (and (looking-at org-complex-heading-regexp)
+ (if (match-end 4) (match-string 4) (match-string 0)))
+ link))))
+ (org-store-link-props :link link :description desc :type "id")
+ link))
+
+(defun org-id-open (id)
+ "Go to the entry with id ID."
+ (org-mark-ring-push)
+ (switch-to-buffer-other-window (current-buffer))
+ (org-id-goto id))
+
+(org-add-link-type "id" 'org-id-open)
+
(provide 'org-id)
;;; org-id.el ends here
;; arch-tag: e5abaca4-e16f-4b25-832a-540cfb63a712
+
+
Index: org-info.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-info.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-info.el 24 Nov 2008 12:16:18 -0000 1.12
+++ org-info.el 7 Dec 2008 18:36:05 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-irc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-irc.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-irc.el 24 Nov 2008 12:16:19 -0000 1.12
+++ org-irc.el 7 Dec 2008 18:36:05 -0000 1.13
@@ -4,7 +4,7 @@
;;
;; Author: Philip Jackson <address@hidden>
;; Keywords: erc, irc, link, org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-jsinfo.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-jsinfo.el,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- org-jsinfo.el 24 Nov 2008 12:16:19 -0000 1.10
+++ org-jsinfo.el 7 Dec 2008 18:36:06 -0000 1.11
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -106,10 +106,10 @@
(defcustom org-infojs-template
"<script type=\"text/javascript\" src=\"%SCRIPT_PATH\"></script>
<script type=\"text/javascript\" >
-/* <![CDATA[ */
+<!--/*--><![CDATA[/*><!--*/
%MANAGER_OPTIONS
org_html_manager.setup(); // activate after the parameterd are set
-/* ]]> */
+/*]]>*/-->
</script>"
"The template for the export style additions when org-info.js is used.
Option settings will replace the %MANAGER-OPTIONS cookie."
Index: org-list.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-list.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- org-list.el 24 Nov 2008 12:16:19 -0000 1.7
+++ org-list.el 7 Dec 2008 18:36:06 -0000 1.8
@@ -6,7 +6,7 @@
;; Bastien Guerry <bzg AT altern DOT org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -45,6 +45,7 @@
(declare-function org-skip-whitespace "org" ())
(declare-function org-trim "org" (s))
(declare-function org-get-indentation "org" (&optional line))
+(declare-function org-timer-item "org-timer" (&optional arg))
(defgroup org-plain-lists nil
"Options concerning plain lists in Org-mode."
@@ -185,12 +186,19 @@
(descp (save-excursion (goto-char (match-beginning 0))
(beginning-of-line 1)
(save-match-data
- (looking-at "[ \t]*.*? ::"))))
+ (and (looking-at "[ \t]*\\(.*?\\) ::")
+ (match-string 1)))))
+ (timerp (and descp
+ (save-match-data
+ (string-match "^[-+*][ \t]+[0-9]+:[0-9]+:[0-9]+$"
+ descp))))
(eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
(match-end 0)))
(blank (cdr (assq 'plain-list-item org-blank-before-new-entry)))
pos)
(if descp (setq checkbox nil))
+ (if timerp
+ (progn (org-timer-item) t)
(cond
((and (org-at-item-p) (<= (point) eow))
;; before the bullet
@@ -213,7 +221,7 @@
(unless (= (point) pos) (just-one-space) (backward-delete-char 1)))
(org-maybe-renumber-ordered-list)
(and checkbox (org-update-checkbox-count-maybe))
- t))
+ t)))
;;; Checkboxes
Index: org-mac-message.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mac-message.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- org-mac-message.el 24 Nov 2008 12:16:19 -0000 1.13
+++ org-mac-message.el 7 Dec 2008 18:36:06 -0000 1.14
@@ -3,7 +3,7 @@
;; Copyright (C) 2008 Free Software Foundation, Inc.
;; Author: John Wiegley <address@hidden>
-;; Version: 6.13a
+;; Version: 6.14
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.
Index: org-macs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-macs.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-macs.el 24 Nov 2008 12:16:20 -0000 1.12
+++ org-macs.el 7 Dec 2008 18:36:06 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-mew.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mew.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-mew.el 24 Nov 2008 12:16:20 -0000 1.12
+++ org-mew.el 7 Dec 2008 18:36:06 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;; This file is part of GNU Emacs.
Index: org-mhe.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mhe.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-mhe.el 24 Nov 2008 12:16:20 -0000 1.11
+++ org-mhe.el 7 Dec 2008 18:36:06 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-mouse.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-mouse.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-mouse.el 24 Nov 2008 12:16:20 -0000 1.12
+++ org-mouse.el 7 Dec 2008 18:36:06 -0000 1.13
@@ -4,7 +4,7 @@
;;
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-plot.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-plot.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- org-plot.el 24 Nov 2008 12:16:20 -0000 1.7
+++ org-plot.el 7 Dec 2008 18:36:06 -0000 1.8
@@ -5,7 +5,7 @@
;; Author: Eric Schulte <schulte dot eric at gmail dot com>
;; Keywords: tables, plotting
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-publish.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-publish.el,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- org-publish.el 24 Nov 2008 12:16:21 -0000 1.17
+++ org-publish.el 7 Dec 2008 18:36:06 -0000 1.18
@@ -4,7 +4,7 @@
;; Author: David O'Toole <address@hidden>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: hypermedia, outlines, wp
-;; Version: 6.13a
+;; Version: 6.14
;; This file is part of GNU Emacs.
;;
@@ -471,6 +471,9 @@
"Return the project FILENAME belongs."
(let* ((project-name (cdr (assoc (expand-file-name filename)
org-publish-files-alist))))
+ (dolist (prj org-publish-project-alist)
+ (if (member project-name (plist-get (cdr prj) :components))
+ (setq project-name (car prj))))
(assoc project-name org-publish-project-alist)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -619,20 +622,20 @@
(concat "Index for project " (car project))))
(index-style (or (plist-get project-plist :index-style)
'tree))
- (index-buffer (find-buffer-visiting index-filename))
+ (visiting (find-buffer-visiting index-filename))
(ifn (file-name-nondirectory index-filename))
- file)
- ;; if buffer is already open, kill it to prevent error message
- (if index-buffer
- (kill-buffer index-buffer))
- (with-temp-buffer
+ file index-buffer)
+ (with-current-buffer (setq index-buffer
+ (or visiting (find-file index-filename)))
+ (erase-buffer)
(insert (concat "#+TITLE: " index-title "\n\n"))
(while (setq file (pop files))
(let ((fn (file-name-nondirectory file))
(link (file-relative-name file dir))
(oldlocal localdir))
;; index shouldn't index itself
- (unless (string= fn ifn)
+ (unless (equal (file-truename index-filename)
+ (file-truename file))
(if (eq index-style 'list)
(message "Generating list-style index for %s" index-title)
(message "Generating tree-style index for %s" index-title)
@@ -662,10 +665,9 @@
;; This is common to 'flat and 'tree
(insert (concat indent-str " + [[file:" link "]["
(org-publish-find-title file)
- "]]\n"))
- )))
- (write-file index-filename)
- (kill-buffer (current-buffer)))))
+ "]]\n")))))
+ (save-buffer))
+ (or visiting (kill-buffer index-buffer))))
(defun org-publish-find-title (file)
"Find the title of file in project."
Index: org-remember.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-remember.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- org-remember.el 24 Nov 2008 12:16:21 -0000 1.12
+++ org-remember.el 7 Dec 2008 18:36:07 -0000 1.13
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-rmail.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-rmail.el 24 Nov 2008 12:16:21 -0000 1.11
+++ org-rmail.el 7 Dec 2008 18:36:07 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-table.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-table.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- org-table.el 24 Nov 2008 12:16:21 -0000 1.13
+++ org-table.el 7 Dec 2008 18:36:07 -0000 1.14
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -244,6 +244,14 @@
:group 'org-table-calculation
:type 'boolean)
+(defcustom org-table-error-on-row-ref-crossing-hline t
+ "Non-nil means, a relative row reference that tries to cross a hline errors.
+When nil, the reference will silently be to the field just next to the hline.
+Coming from below, it will be the field below the hline, coming from
+above, it will be the field above the hline."
+ :group 'org-table
+ :type 'boolean)
+
(defgroup org-table-import-export nil
"Options concerning table import and export in Org-mode."
:tag "Org Table Import Export"
@@ -2114,7 +2122,7 @@
lispp (and (> (length form) 2)(equal (substring form 0 2) "'(")))
(if (and lispp literal) (setq lispp 'literal))
;; Check for old vertical references
- (setq form (org-rewrite-old-row-references form))
+ (setq form (org-table-rewrite-old-row-references form))
;; Insert complex ranges
(while (and (string-match org-table-range-regexp form)
(> (length (match-string 0 form)) 1))
@@ -2288,26 +2296,32 @@
(if (and (not hn) on (not odir))
(error "should never happen");;(aref org-table-dlines on)
(if (and hn (> hn 0))
- (setq i (org-find-row-type table i 'hline (equal hdir "-") nil hn)))
+ (setq i (org-table-find-row-type table i 'hline (equal hdir "-")
+ nil hn cline desc)))
(if on
- (setq i (org-find-row-type table i 'dline (equal odir "-") rel on)))
+ (setq i (org-table-find-row-type table i 'dline (equal odir "-")
+ rel on cline desc)))
(+ bline i)))))
-(defun org-find-row-type (table i type backwards relative n)
+(defun org-table-find-row-type (table i type backwards relative n cline desc)
+ "FIXME: Needs more documentation."
(let ((l (length table)))
(while (> n 0)
(while (and (setq i (+ i (if backwards -1 1)))
(>= i 0) (< i l)
(not (eq (aref table i) type))
(if (and relative (eq (aref table i) 'hline))
- (progn (setq i (- i (if backwards -1 1)) n 1) nil)
+ (if org-table-error-on-row-ref-crossing-hline
+ (error "Row descriptor %s used in line %d crosses
hline" desc cline)
+ (progn (setq i (- i (if backwards -1 1)) n 1) nil))
t)))
(setq n (1- n)))
(if (or (< i 0) (>= i l))
- (error "Row descriptor leads outside table")
+ (error "Row descriptor %s used in line %d leads outside table"
+ desc cline)
i)))
-(defun org-rewrite-old-row-references (s)
+(defun org-table-rewrite-old-row-references (s)
(if (string-match "&[-+0-9I]" s)
(error "Formula contains old &row reference, please rewrite using
@-syntax")
s))
@@ -2746,10 +2760,10 @@
(or (match-end n) (error "Cannot shift reference in this direction"))
(goto-char (match-beginning n))
(and (looking-at (regexp-quote (match-string n)))
- (replace-match (org-shift-refpart (match-string 0) decr hline)
+ (replace-match (org-table-shift-refpart (match-string 0) decr hline)
t t)))
-(defun org-shift-refpart (ref &optional decr hline)
+(defun org-table-shift-refpart (ref &optional decr hline)
"Shift a refrence part REF.
If DECR is set, decrease the references row/column, else increase.
If HLINE is set, this may be a hline reference, it certainly is not
@@ -3238,7 +3252,7 @@
(easy-menu-add orgtbl-mode-menu)
(run-hooks 'orgtbl-mode-hook))
(setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
- (org-cleanup-narrow-column-properties)
+ (org-table-cleanup-narrow-column-properties)
(org-remove-from-invisibility-spec '(org-cwidth))
(remove-hook 'before-change-functions 'org-before-change-function t)
(when (fboundp 'font-lock-remove-keywords)
@@ -3247,7 +3261,7 @@
(easy-menu-remove orgtbl-mode-menu)
(force-mode-line-update 'all))))
-(defun org-cleanup-narrow-column-properties ()
+(defun org-table-cleanup-narrow-column-properties ()
"Remove all properties related to narrow-column invisibility."
(let ((s 1))
(while (setq s (text-property-any s (point-max)
@@ -3323,7 +3337,6 @@
'("\C-c'" org-table-edit-formulas)
'("\C-c`" org-table-edit-field)
'("\C-c*" org-table-recalculate)
- '("\C-c|" org-table-create-or-convert-from-region)
'("\C-c^" org-table-sort-lines)
'([(control ?#)] org-table-rotate-recalc-marks)))
elt key fun cmd)
@@ -3357,6 +3370,8 @@
[(meta return)] "\M-\C-m"))
(org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c)
+ (org-defkey orgtbl-mode-map "\C-c|" 'orgtbl-create-or-convert-from-region)
+
(when orgtbl-optimized
;; If the user wants maximum table support, we need to hijack
;; some standard editing functions
@@ -3367,6 +3382,9 @@
(org-defkey orgtbl-mode-map "|" 'org-force-self-insert))
(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
'("OrgTbl"
+ ["Create or convert" org-table-create-or-convert-from-region
+ :active (not (org-at-table-p)) :keys "C-c |" ]
+ "--"
["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
@@ -3451,6 +3469,16 @@
(t (let (orgtbl-mode)
(call-interactively (key-binding "\C-c\C-c")))))))
+(defun orgtbl-create-or-convert-from-region (arg)
+ "Create table or convert region to table, if no conflicting binding.
+This installs the table binding `C-c |', but only if there is no
+conflicting binding to this key outside orgtbl-mode."
+ (interactive "P")
+ (let* (orgtbl-mode (cmd (key-binding "\C-c|")))
+ (if cmd
+ (call-interactively cmd)
+ (call-interactively 'org-table-create-or-convert-from-region))))
+
(defun orgtbl-tab (arg)
"Justification and field motion for `orgtbl-mode'."
(interactive "P")
@@ -3461,8 +3489,10 @@
(defun orgtbl-ret ()
"Justification and field motion for `orgtbl-mode'."
(interactive)
+ (if (bobp)
+ (newline)
(org-table-justify-field-maybe)
- (org-table-next-row))
+ (org-table-next-row)))
(defun orgtbl-self-insert-command (N)
"Like `self-insert-command', use overwrite-mode for whitespace in tables.
@@ -3491,11 +3521,12 @@
(setq org-table-may-need-update t)
(let (orgtbl-mode a)
(call-interactively
- (key-binding
+ (or (key-binding
(or (and (listp function-key-map)
(setq a (assoc last-input-event function-key-map))
(cdr a))
- (vector last-input-event)))))))
+ (vector last-input-event)))
+ 'self-insert-command)))))
(defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$"
"Regular expression matching exponentials as produced by calc.")
Index: org-vm.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-vm.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-vm.el 24 Nov 2008 12:16:22 -0000 1.11
+++ org-vm.el 7 Dec 2008 18:36:07 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org-wl.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org-wl.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- org-wl.el 24 Nov 2008 12:16:22 -0000 1.11
+++ org-wl.el 7 Dec 2008 18:36:07 -0000 1.12
@@ -5,7 +5,7 @@
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
Index: org.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/org/org.el,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- org.el 24 Nov 2008 12:16:23 -0000 1.27
+++ org.el 7 Dec 2008 18:36:07 -0000 1.28
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.13a
+;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
@@ -92,7 +92,7 @@
;;; Version
-(defconst org-version "6.13a"
+(defconst org-version "6.14"
"The version number of the file org.el.")
(defun org-version (&optional here)
@@ -143,7 +143,7 @@
(let ((a (member 'org-infojs org-modules)))
(and a (setcar a 'org-jsinfo))))
-(defcustom org-modules '(org-bbdb org-bibtex org-gnus org-info org-jsinfo
org-irc org-mew org-mhe org-rmail org-vm org-wl)
+(defcustom org-modules '(org-bbdb org-bibtex org-gnus org-info org-jsinfo
org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl)
"Modules that should always be loaded together with org.el.
If a description starts with <C>, the file is not part of Emacs
and loading it will require that you have downloaded and properly installed
@@ -172,6 +172,7 @@
(const :tag " rmail: Links to RMAIL folders/messages"
org-rmail)
(const :tag " vm: Links to VM folders/messages" org-vm)
(const :tag " wl: Links to Wanderlust
folders/messages" org-wl)
+ (const :tag " w3m: Special cut/past from w3m to Org."
org-w3m)
(const :tag " mouse: Additional mouse support" org-mouse)
(const :tag "C annotate-file: Annotate a file with org syntax"
org-annotate-file)
@@ -955,6 +956,40 @@
:group 'org-link-store
:type 'regexp)
+(defcustom org-link-to-org-use-id 'create-if-interactive
+ "Non-nil means, storing a link to an Org file will use entry ID's.
+
+Note that before this variable is even considered, org-id must be loaded,
+to please customize `org-modules' and turn it on.
+
+The variable can have the following values:
+
+t Create an ID if needed to make a link to the current entry.
+
+create-if-interactive
+ If `org-store-link' is called directly (interactively, as a user
+ command), do create an ID to support the link. But when doing the
+ job for remember, only use the ID if it already exists. The
+ purpose of this setting is to avoid proliferation of unwanted
+ ID's, just because you happen to be in an Org file when you
+ call `org-remember' that automatically and preemptively
+ creates a link. If you do want to get an ID link in a remember
+ template to an entry not having an ID, create it first by
+ explicitly creating a link to it, using `C-c C-l' first.
+
+use-existing
+ Use existing ID, do not create one.
+
+nil Never use an ID to make a link, instead link using a text search for
+ the headline text."
+ :group 'org-link-store
+ :type '(choice
+ (const :tag "Create ID to make link" t)
+ (const :tag "Create if string link interactively"
+ 'create-if-interactive)
+ (const :tag "Only use existing" 'use-existing)
+ (const :tag "Do not use ID to create link" nil)))
+
(defcustom org-context-in-file-links t
"Non-nil means, file links from `org-store-link' contain context.
A search string will be added to the file name with :: as separator and
@@ -1881,13 +1916,16 @@
(defcustom org-use-tag-inheritance t
"Non-nil means, tags in levels apply also for sublevels.
When nil, only the tags directly given in a specific line apply there.
-If this option is t, a match early-on in a tree can lead to a large
-number of matches in the subtree. If you only want to see the first
-match in a tree during a search, check out the variable
-`org-tags-match-list-sublevels'.
-
This may also be a list of tags that should be inherited, or a regexp that
-matches tags that should be inherited."
+matches tags that should be inherited. Additional control is possible
+with the variable `org-tags-exclude-from-inheritance' which gives an
+explicit list of tags to be excluded from inheritance., even if the value of
+`org-use-tag-inheritance' would select it for inheritance.
+
+If this option is t, a match early-on in a tree can lead to a large
+number of matches in the subtree when constructing the agenda or creating
+a sparse tree. If you only want to see the first match in a tree during
+a search, check out the variable `org-tags-match-list-sublevels'."
:group 'org-tags
:type '(choice
(const :tag "Not" nil)
@@ -1895,9 +1933,18 @@
(repeat :tag "Specific tags" (string :tag "Tag"))
(regexp :tag "Tags matched by regexp")))
+(defcustom org-tags-exclude-from-inheritance nil
+ "List of tags that should never be inherited.
+This is a way to exclude a few tags from inheritance. For way to do
+the opposite, to actively allow inheritance for selected tags,
+see the variable `org-use-tag-inheritance'."
+ :group 'org-tags
+ :type '(repeat (string :tag "Tag")))
+
(defun org-tag-inherit-p (tag)
"Check if TAG is one that should be inherited."
(cond
+ ((member tag org-tags-exclude-from-inheritance) nil)
((eq org-use-tag-inheritance t) t)
((not org-use-tag-inheritance) nil)
((stringp org-use-tag-inheritance)
@@ -1917,7 +1964,11 @@
As a special case, if the tag search is restricted to TODO items, the
value of this variable is ignored and sublevels are always checked, to
-make sure all corresponding TODO items find their way into the list."
+make sure all corresponding TODO items find their way into the list.
+
+This variable is semi-obsolete and probably should always be true. It
+is better to limit inheritance to certain tags using the variables
+`org-use-tag-inheritanc'e and `org-tags-exclude-from-inheritance'."
:group 'org-tags
:type 'boolean)
@@ -2353,7 +2404,7 @@
:group 'org)
(defcustom org-completion-use-ido nil
- "Non-ni means, use ido completion wherever possible."
+ "Non-nil means, use ido completion wherever possible."
:group 'org-completion
:type 'boolean)
@@ -2640,6 +2691,17 @@
(when (org-match-line "#\\+BEGIN: clocktable\\>")
(org-clocktable-shift dir n)))
+;; Autoload org-timer.el
+
+;(declare-function org-timer "org-timer")
+
+(eval-and-compile
+ (org-autoload
+ "org-timer"
+ '(org-timer-start org-timer org-timer-item
+ org-timer-change-times-in-region)))
+
+
;; Autoload archiving code
;; The stuff that is needed for cycling and tags has to be defined here.
@@ -2778,11 +2840,12 @@
;; Autoload ID code
+(declare-function org-id-store-link "org-id")
(org-autoload "org-id"
'(org-id-get-create org-id-new org-id-copy org-id-get
org-id-get-with-outline-path-completion
org-id-get-with-outline-drilling
- org-id-goto org-id-find))
+ org-id-goto org-id-find org-id-store-link))
;;; Variables for pre-computed regular expressions, all buffer local
@@ -3693,6 +3756,7 @@
(defvar org-target-link-regexp nil
"Regular expression matching radio targets in plain text.")
+(make-variable-buffer-local 'org-target-link-regexp)
(defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>"
"Regular expression matching a link target.")
(defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>"
@@ -3915,6 +3979,8 @@
nil)
;; Priorities
(list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t))
+ ;; Tags
+ '(org-font-lock-add-tag-faces)
;; Special keywords
(list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
(list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword
t))
@@ -3974,6 +4040,22 @@
(and (member kwd org-done-keywords) 'org-done)
'org-todo))
+(defun org-font-lock-add-tag-faces (limit)
+ "Add the special tag faces."
+ (when (and org-tag-faces org-tags-special-faces-re)
+ (while (re-search-forward org-tags-special-faces-re limit t)
+ (add-text-properties (match-beginning 1) (match-end 1)
+ (list 'face (org-get-tag-face 1)
+ 'font-lock-fontified t))
+ (backward-char 1))))
+
+(defun org-get-tag-face (kwd)
+ "Get the right face for a TODO keyword KWD.
+If KWD is a number, get the corresponding match group."
+ (if (numberp kwd) (setq kwd (match-string kwd)))
+ (or (cdr (assoc kwd org-tag-faces))
+ 'org-tag))
+
(defun org-unfontify-region (beg end &optional maybe_loudly)
"Remove fontification and activation overlays from links."
(font-lock-default-unfontify-region beg end)
@@ -5060,8 +5142,8 @@
(setq txt (buffer-substring beg end))
(org-save-markers-in-region beg end)
(delete-region beg end)
- (outline-flag-region (1- beg) beg nil)
- (outline-flag-region (1- (point)) (point) nil)
+ (or (= beg (point-min)) (outline-flag-region (1- beg) beg nil))
+ (or (bobp) (outline-flag-region (1- (point)) (point) nil))
(let ((bbb (point)))
(insert-before-markers txt)
(org-reinstall-markers-in-region bbb)
@@ -5221,6 +5303,7 @@
(beginning-of-line 1)
(unless for-yank (org-back-over-empty-lines))
(setq beg (point))
+ (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
(insert-before-markers txt)
(unless (string-match "\n\\'" txt) (insert "\n"))
(setq newend (point))
@@ -6094,7 +6177,6 @@
(setcdr (assoc type org-link-protocols) (list follow export))
(push (list type follow export) org-link-protocols)))
-
;;;###autoload
(defun org-store-link (arg)
"\\<org-mode-map>Store an org-link to the current location.
@@ -6155,14 +6237,34 @@
link (org-make-link cpltxt)))
((and buffer-file-name (org-mode-p))
+ (cond
+ ((org-in-regexp "<<\\(.*?\\)>>")
+ (setq cpltxt
+ (concat "file:"
+ (abbreviate-file-name buffer-file-name)
+ "::" (match-string 1))
+ link (org-make-link cpltxt)))
+ ((and (featurep 'org-id)
+ (or (eq org-link-to-org-use-id t)
+ (and (eq org-link-to-org-use-id 'create-if-interactive)
+ (interactive-p))
+ (and org-link-to-org-use-id
+ (condition-case nil
+ (org-entry-get nil "ID")
+ (error nil)))))
+ ;; We can make a link using the ID.
+ (setq link (condition-case nil
+ (org-id-store-link)
+ (error
+ ;; probably before first headling, link to file only
+ (concat "file:"
+ (abbreviate-file-name buffer-file-name))))))
+ (t
;; Just link to current headline
(setq cpltxt (concat "file:"
(abbreviate-file-name buffer-file-name)))
;; Add a context search string
(when (org-xor org-context-in-file-links arg)
- ;; Check if we are on a target
- (if (org-in-regexp "<<\\(.*?\\)>>")
- (setq cpltxt (concat cpltxt "::" (match-string 1)))
(setq txt (cond
((org-on-heading-p) nil)
((org-region-active-p)
@@ -6174,10 +6276,10 @@
(condition-case nil
(org-make-org-heading-search-string txt)
(error "")))
- desc "NONE"))))
+ desc "NONE")))
(if (string-match "::\\'" cpltxt)
(setq cpltxt (substring cpltxt 0 -2)))
- (setq link (org-make-link cpltxt)))
+ (setq link (org-make-link cpltxt)))))
((buffer-file-name (buffer-base-buffer))
;; Just link to this file here.
@@ -9026,8 +9128,14 @@
;; compile tags for current headline
(setq tags-list
(if org-use-tag-inheritance
- (apply 'append (mapcar 'cdr tags-alist))
+ (apply 'append (mapcar 'cdr (reverse tags-alist)))
tags))
+ (when org-use-tag-inheritance
+ (setcdr (car tags-alist)
+ (mapcar (lambda (x)
+ (setq x (copy-sequence x))
+ (org-add-prop-inherited x))
+ (cdar tags-alist))))
(when (and tags org-use-tag-inheritance
(not (eq t org-use-tag-inheritance)))
;; selective inheritance, remove uninherited ones
@@ -9083,15 +9191,22 @@
(defun org-remove-uniherited-tags (tags)
"Remove all tags that are not inherited from the list TAGS."
(cond
- ((eq org-use-tag-inheritance t) tags)
+ ((eq org-use-tag-inheritance t)
+ (if org-tags-exclude-from-inheritance
+ (org-delete-all org-tags-exclude-from-inheritance tags)
+ tags))
((not org-use-tag-inheritance) nil)
((stringp org-use-tag-inheritance)
(delq nil (mapcar
- (lambda (x) (if (string-match org-use-tag-inheritance x) x nil))
+ (lambda (x)
+ (if (and (string-match org-use-tag-inheritance x)
+ (not (member x org-tags-exclude-from-inheritance)))
+ x nil))
tags)))
((listp org-use-tag-inheritance)
(delq nil (mapcar
- (lambda (x) (if (member x org-use-tag-inheritance) x nil))
+ (lambda (x)
+ (if (member x org-use-tag-inheritance) x nil))
tags)))))
(defvar todo-only) ;; dynamically scoped
@@ -9301,12 +9416,20 @@
(append '(0 0 0) (nthcdr 3 (decode-time))))))
(defun org-matcher-time (s)
+ "Interprete a time comparison value."
+ (save-match-data
(cond
((string= s "<now>") (float-time))
((string= s "<today>") (org-time-today))
((string= s "<tomorrow>") (+ 86400.0 (org-time-today)))
((string= s "<yesterday>") (- (org-time-today) 86400.0))
- (t (org-2ft s))))
+ ((string-match "^<\\([-+][0-9]+\\)\\([dwmy]\\)>$" s)
+ (+ (org-time-today)
+ (* (string-to-number (match-string 1 s))
+ (cdr (assoc (match-string 2 s)
+ '(("d" . 86400.0) ("w" . 604800.0)
+ ("m" . 2678400.0) ("y" . 31557600.0)))))))
+ (t (org-2ft s)))))
(defun org-match-any-p (re list)
"Does re match any element of list?"
@@ -9348,6 +9471,8 @@
(when (looking-at (org-re
"[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
(setq ltags (org-split-string
(org-match-string-no-properties 1) ":"))
+ (when parent
+ (setq ltags (mapcar 'org-add-prop-inherited ltags)))
(setq tags (append
(if parent
(org-remove-uniherited-tags ltags)
@@ -9360,6 +9485,10 @@
(error nil)))))
(append (org-remove-uniherited-tags org-file-tags) tags))))
+(defun org-add-prop-inherited (s)
+ (add-text-properties 0 (length s) '(inherited t) s)
+ s)
+
(defun org-toggle-tag (tag &optional onoff)
"Toggle the tag TAG for the current line.
If ONOFF is `on' or `off', don't toggle but set to this state."
@@ -9842,7 +9971,7 @@
(org-agenda-skip-function
(car (org-delete-all '(comment archive) skip)))
(org-tags-match-list-sublevels t)
- matcher pos file
+ matcher pos file res
org-todo-keywords-for-agenda
org-done-keywords-for-agenda
org-todo-keyword-alist-for-agenda
@@ -9851,7 +9980,7 @@
(cond
((eq match t) (setq matcher t))
((eq match nil) (setq matcher t))
- (t (setq matcher (if match (org-make-tags-matcher match) t))))
+ (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
(when (eq scope 'tree)
(org-back-to-heading t)
@@ -9884,7 +10013,8 @@
(save-restriction
(widen)
(goto-char (point-min))
- (org-scan-tags func matcher))))))))
+ (setq res (append res (org-scan-tags func matcher)))))))
+ res)))
;;;; Properties
@@ -10484,6 +10614,7 @@
IDENT can be a string, a symbol or a number, this function will search for
the string representation of it.
Return the position where this entry starts, or nil if there is no such entry."
+ (interactive "sID: ")
(let ((id (cond
((stringp ident) ident)
((symbol-name ident) (symbol-name ident))
@@ -12418,6 +12549,10 @@
(org-defkey org-mode-map "\C-c\C-xp" 'org-set-property)
(org-defkey org-mode-map "\C-c\C-xi" 'org-insert-columns-dblock)
+(org-defkey org-mode-map "\C-c\C-x." 'org-timer)
+(org-defkey org-mode-map "\C-c\C-x-" 'org-timer-item)
+(org-defkey org-mode-map "\C-c\C-x0" 'org-timer-start)
+
(define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)
(when (featurep 'xemacs)
@@ -13191,7 +13326,11 @@
:style radio :selected org-display-custom-times]
"--"
["Goto Calendar" org-goto-calendar t]
- ["Date from Calendar" org-date-from-calendar t])
+ ["Date from Calendar" org-date-from-calendar t]
+ "--"
+ ["Start/restart timer" org-timer-start t]
+ ["Insert timer string" org-timer t]
+ ["Insert timer item" org-timer-item t])
("Logging work"
["Clock in" org-clock-in t]
["Clock out" org-clock-out t]
- [Emacs-diffs] emacs/lisp/org org-agenda.el org-archive.el org...,
Carsten Dominik <=