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

This commit is contained in:
Dan Davison 2010-04-27 15:03:24 -04:00
commit 77731fbe55
7 changed files with 122 additions and 39 deletions

View File

@ -1,3 +1,31 @@
2010-04-27 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-goto): Push a mark before changing
the position.
* org-footnote.el (org-footnote): New group.
(org-footnote-section)
(org-footnote-tag-for-non-org-mode-files): Fix typos.
* org-list.el (org-end-of-item-text-before-children): Also do
the right thing at the end of a file.
* org.el (org-set-packages-alist, org-get-packages-alist): New
function.
(org-export-latex-default-packages-alist)
(org-export-latex-packages-alist): Add extra flag to
each package, indicating if it should be used for snippets.
(org-create-formula-image): Add the snippet argument.
(org-splice-latex-header): New argument SNIPPET-P, pass it
through to `org-latex-packages-to-string'.
(org-latex-packages-to-string): New argument SNIPPET-P.
* org-latex.el (org-export-latex-make-header): Add the snippet
argument.
* org-docbook.el (org-export-as-docbook): Implement ordered
lists starting at some offset.
2010-04-26 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-link-types, org-open-at-point): Add doi links.

View File

@ -6082,6 +6082,7 @@ and by additional input from the age of a schedules or deadline entry."
(pos (marker-position marker)))
(switch-to-buffer-other-window buffer)
(widen)
(push-mark)
(goto-char pos)
(when (org-mode-p)
(org-show-context 'agenda)

View File

@ -533,7 +533,7 @@ publishing directory."
table-buffer table-orig-buffer
ind item-type starter didclose
rpl path attr caption label desc descp desc1 desc2 link
fnc item-tag
fnc item-tag initial-number
footref-seen footnote-list
id-file
)
@ -998,7 +998,11 @@ publishing directory."
starter (if (match-beginning 2)
(substring (match-string 2 line) 0 -1))
line (substring line (match-beginning 5))
item-tag nil)
item-tag nil
initial-number nil)
(if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line)
(setq initial-number (match-string 1 line)
line (replace-match "" t t line)))
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
(setq item-type "d"
item-tag (match-string 1 line)
@ -1031,7 +1035,18 @@ publishing directory."
(org-export-docbook-close-para-maybe)
(insert (cond
((equal item-type "u") "<itemizedlist>\n<listitem>\n")
((equal item-type "o") "<orderedlist>\n<listitem>\n")
((equal item-type "o")
;; Check for a specific start number. If it
;; is specified, we use the ``override''
;; attribute of element <listitem> to pass the
;; info to DocBook. We could also use the
;; ``startingnumber'' attribute of element
;; <orderedlist>, but the former works on both
;; DocBook 5.0 and prior versions.
(if initial-number
(format "<orderedlist>\n<listitem override=\"%s\">\n"
initial-number)
"<orderedlist>\n<listitem>\n"))
((equal item-type "d")
(format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
;; For DocBook, we need to open a para right after tag

View File

@ -65,6 +65,11 @@
(org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
"Regular expression matching the definition of a footnote.")
(defgroup org-footnote nil
"Footnotes in Org-mode."
:tag "Org Footnote"
:group 'org)
(defcustom org-footnote-section "Footnotes"
"Outline heading containing footnote definitions before export.
This can be nil, to place footnotes locally at the end of the current
@ -75,7 +80,7 @@ automatically, i.e. when creating the footnote, and when sorting the notes.
However, by hand you may place definitions *anywhere*.
If this is a string, during export, all subtrees starting with this
heading will be removed after extracting footnote definitions."
:group 'org-footnotes
:group 'org-footnote
:type '(choice
(string :tag "Collect footnotes under heading")
(const :tag "Define footnotes locally" nil)))
@ -87,7 +92,7 @@ as in Org-mode. Outside Org-mode, new footnotes are always placed at
the end of the file. When you normalize the notes, any line containing
only this tag will be removed, a new one will be inserted at the end
of the file, followed by the collected and normalized footnotes."
:group 'org-footnotes
:group 'org-footnote
:type 'string)
(defcustom org-footnote-define-inline nil

View File

@ -1147,7 +1147,7 @@ OPT-PLIST is the options plist for current buffer."
(org-splice-latex-header
(org-export-apply-macros-in-string org-export-latex-header)
org-export-latex-default-packages-alist
org-export-latex-packages-alist
org-export-latex-packages-alist nil
(org-export-apply-macros-in-string
(plist-get opt-plist :latex-header-extra)))
;; append another special variable

View File

@ -605,8 +605,9 @@ Assumes that the cursor is in the first ine of an item."
(min (save-excursion (org-end-of-item) (point))
(save-excursion
(goto-char (point-at-eol))
(re-search-forward (concat "^" (org-item-re t)) nil t)
(match-beginning 0)))))
(if (re-search-forward (concat "^" (org-item-re t)) nil 'move)
(match-beginning 0)
(point-max))))))
(defun org-next-item ()
"Move to the beginning of the next item in the current plain list.

View File

@ -2302,7 +2302,7 @@ a double prefix argument to a time-stamp command like `C-c .' or `C-c !',
and by using a prefix arg to `S-up/down' to specify the exact number
of minutes to shift."
:group 'org-time
:get '(lambda (var) ; Make sure all entries have 5 elements
:get '(lambda (var) ; Make sure both elements are there
(if (integerp (default-value var))
(list (default-value var) 5)
(default-value var)))
@ -2958,25 +2958,42 @@ will be appended."
(defvar org-format-latex-header-extra nil)
(defun org-set-packages-alist (var val)
"Set the packages alist and make sure it has 3 elements per entry."
(set var (mapcar (lambda (x)
(if (and (consp x) (= (length x) 2))
(list (car x) (nth 1 x) t)
x))
val)))
(defun org-get-packages-alist (var)
"Get the packages alist and make sure it has 3 elements per entry."
(mapcar (lambda (x)
(if (and (consp x) (= (length x) 2))
(list (car x) (nth 1 x) t)
x))
(default-value var)))
;; The following variables are defined here because is it also used
;; when formatting latex fragments. Originally it was part of the
;; LaTeX exporter, which is why the name includes "export".
(defcustom org-export-latex-default-packages-alist
'(("AUTO" "inputenc")
("T1" "fontenc")
("" "fixltx2e")
("" "graphicx")
("" "longtable")
("" "float")
("" "wrapfig")
("" "soul")
("" "t1enc")
("" "textcomp")
("" "marvosym")
("" "wasysym")
("" "latexsym")
("" "amssymb")
("" "hyperref")
'(("AUTO" "inputenc" t)
("T1" "fontenc" t)
("" "fixltx2e" nil)
("" "graphicx" t)
("" "longtable" nil)
("" "float" nil)
("" "wrapfig" nil)
("" "soul" t)
("" "t1enc" t)
("" "textcomp" t)
("" "marvosym" t)
("" "wasysym" t)
("" "latexsym" t)
("" "amssymb" t)
("" "hyperref" nil)
"\\tolerance=1000"
)
"Alist of default packages to be inserted in the header.
@ -2997,31 +3014,42 @@ to function properly.
Therefore you should not modify this variable unless you know what you
are doing. The one reason to change it anyway is that you might be loading
some other package that conflicts with one of the default packages.
Each cell is of the format \( \"options\" \"package\" \)."
Each cell is of the format \( \"options\" \"package\" snippet-flag\).
If SNIPPET-FLAG is t, the package also needs to be included when
compiling LaTeX snippets into images for inclusion into HTML."
:group 'org-export-latex
:set 'org-set-packages-alist
:get 'org-get-packages-alist
:type '(repeat
(choice
(string :tag "A line of LaTeX")
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")))))
(string :tag "package")
(boolean :tag "Snippet"))
(string :tag "A line of LaTeX"))))
(defcustom org-export-latex-packages-alist nil
"Alist of packages to be inserted in every LaTeX the header.
These will be inserted after `org-export-latex-default-packages-alist'.
Each cell is of the format \( \"options\" \"package\" \).
Make sure that you only lis packages here which:
Each cell is of the format \( \"options\" \"package\" snippet-flag \).
SNIPPET-FLAG, when t, indicates that this package is also needed when
turning LaTeX snippets into images for inclusion into HTML.
Make sure that you only list packages here which:
- you want in every file
- do not conflict with the default packages in
`org-export-latex-default-packages-alist'
- do not conflict with the setup in `org-format-latex-header'."
:group 'org-export-latex
:set 'org-set-packages-alist
:get 'org-get-packages-alist
:type '(repeat
(choice
(string :tag "A line of LaTeX")
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")))))
(string :tag "package")
(boolean :tag "Snippet"))
(string :tag "A line of LaTeX"))))
(defgroup org-appearance nil
"Settings for Org-mode appearance."
@ -15332,7 +15360,7 @@ Some of the options can be changed using the variable
(insert (org-splice-latex-header
org-format-latex-header
org-export-latex-default-packages-alist
org-export-latex-packages-alist
org-export-latex-packages-alist t
org-format-latex-header-extra))
(insert "\n\\begin{document}\n" string "\n\\end{document}\n")
(require 'org-latex)
@ -15366,7 +15394,7 @@ Some of the options can be changed using the variable
(delete-file (concat texfilebase e)))
pngfile))))
(defun org-splice-latex-header (tpl def-pkg pkg &optional extra)
(defun org-splice-latex-header (tpl def-pkg pkg snippets-p &optional extra)
"Fill a LaTeX header template TPL.
In the template, the following place holders will be recognized:
@ -15381,19 +15409,22 @@ For backward compatibility, if both the positive and the negative place
holder is missing, the positive one (without the \"NO-\") will be
assumed to be present at the end of the template.
DEF-PKG and PKG are assumed to be alists of options/packagename lists.
EXTRA is a string."
EXTRA is a string.
SNIPPETS-P indicates if this is run to create snippet images for HTML."
(let (rpl (end ""))
(if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
(setq rpl (if (or (match-end 1) (not def-pkg))
"" (org-latex-packages-to-string def-pkg t))
"" (org-latex-packages-to-string def-pkg snippets-p t))
tpl (replace-match rpl t t tpl))
(if def-pkg (setq end (org-latex-packages-to-string def-pkg))))
(if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p))))
(if (string-match "\\[\\(NO-\\)?PACKAGES\\][ \t]*\n?" tpl)
(setq rpl (if (or (match-end 1) (not pkg))
"" (org-latex-packages-to-string pkg t))
"" (org-latex-packages-to-string pkg snippets-p t))
tpl (replace-match rpl t t tpl))
(if pkg (setq end (concat end "\n" (org-latex-packages-to-string pkg)))))
(if pkg (setq end
(concat end "\n"
(org-latex-packages-to-string pkg snippets-p)))))
(if (string-match "\\[\\(NO-\\)?EXTRA\\][ \t]*\n?" tpl)
(setq rpl (if (or (match-end 1) (not extra))
@ -15406,11 +15437,13 @@ EXTRA is a string."
(concat tpl "\n" end)
tpl)))
(defun org-latex-packages-to-string (pkg &optional newline)
(defun org-latex-packages-to-string (pkg &optional snippets-p newline)
"Turn an alist of packages into a string with the \\usepackage macros."
(setq pkg (mapconcat (lambda(p)
(cond
((stringp p) p)
((and snippets-p (>= (length p) 3) (not (nth 2 p)))
(format "%% Package %s omitted" (cadr p)))
((equal "" (car p))
(format "\\usepackage{%s}" (cadr p)))
(t