Merge branch 'master' of git://repo.or.cz/org-mode
This commit is contained in:
commit
77731fbe55
|
@ -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>
|
2010-04-26 Carsten Dominik <carsten.dominik@gmail.com>
|
||||||
|
|
||||||
* org.el (org-link-types, org-open-at-point): Add doi links.
|
* org.el (org-link-types, org-open-at-point): Add doi links.
|
||||||
|
|
|
@ -6082,6 +6082,7 @@ and by additional input from the age of a schedules or deadline entry."
|
||||||
(pos (marker-position marker)))
|
(pos (marker-position marker)))
|
||||||
(switch-to-buffer-other-window buffer)
|
(switch-to-buffer-other-window buffer)
|
||||||
(widen)
|
(widen)
|
||||||
|
(push-mark)
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
(when (org-mode-p)
|
(when (org-mode-p)
|
||||||
(org-show-context 'agenda)
|
(org-show-context 'agenda)
|
||||||
|
|
|
@ -533,7 +533,7 @@ publishing directory."
|
||||||
table-buffer table-orig-buffer
|
table-buffer table-orig-buffer
|
||||||
ind item-type starter didclose
|
ind item-type starter didclose
|
||||||
rpl path attr caption label desc descp desc1 desc2 link
|
rpl path attr caption label desc descp desc1 desc2 link
|
||||||
fnc item-tag
|
fnc item-tag initial-number
|
||||||
footref-seen footnote-list
|
footref-seen footnote-list
|
||||||
id-file
|
id-file
|
||||||
)
|
)
|
||||||
|
@ -998,7 +998,11 @@ publishing directory."
|
||||||
starter (if (match-beginning 2)
|
starter (if (match-beginning 2)
|
||||||
(substring (match-string 2 line) 0 -1))
|
(substring (match-string 2 line) 0 -1))
|
||||||
line (substring line (match-beginning 5))
|
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))
|
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
|
||||||
(setq item-type "d"
|
(setq item-type "d"
|
||||||
item-tag (match-string 1 line)
|
item-tag (match-string 1 line)
|
||||||
|
@ -1031,7 +1035,18 @@ publishing directory."
|
||||||
(org-export-docbook-close-para-maybe)
|
(org-export-docbook-close-para-maybe)
|
||||||
(insert (cond
|
(insert (cond
|
||||||
((equal item-type "u") "<itemizedlist>\n<listitem>\n")
|
((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")
|
((equal item-type "d")
|
||||||
(format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
|
(format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
|
||||||
;; For DocBook, we need to open a para right after tag
|
;; For DocBook, we need to open a para right after tag
|
||||||
|
|
|
@ -65,6 +65,11 @@
|
||||||
(org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
|
(org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
|
||||||
"Regular expression matching the definition of a footnote.")
|
"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"
|
(defcustom org-footnote-section "Footnotes"
|
||||||
"Outline heading containing footnote definitions before export.
|
"Outline heading containing footnote definitions before export.
|
||||||
This can be nil, to place footnotes locally at the end of the current
|
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*.
|
However, by hand you may place definitions *anywhere*.
|
||||||
If this is a string, during export, all subtrees starting with this
|
If this is a string, during export, all subtrees starting with this
|
||||||
heading will be removed after extracting footnote definitions."
|
heading will be removed after extracting footnote definitions."
|
||||||
:group 'org-footnotes
|
:group 'org-footnote
|
||||||
:type '(choice
|
:type '(choice
|
||||||
(string :tag "Collect footnotes under heading")
|
(string :tag "Collect footnotes under heading")
|
||||||
(const :tag "Define footnotes locally" nil)))
|
(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
|
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
|
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."
|
of the file, followed by the collected and normalized footnotes."
|
||||||
:group 'org-footnotes
|
:group 'org-footnote
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
(defcustom org-footnote-define-inline nil
|
(defcustom org-footnote-define-inline nil
|
||||||
|
|
|
@ -1147,7 +1147,7 @@ OPT-PLIST is the options plist for current buffer."
|
||||||
(org-splice-latex-header
|
(org-splice-latex-header
|
||||||
(org-export-apply-macros-in-string org-export-latex-header)
|
(org-export-apply-macros-in-string org-export-latex-header)
|
||||||
org-export-latex-default-packages-alist
|
org-export-latex-default-packages-alist
|
||||||
org-export-latex-packages-alist
|
org-export-latex-packages-alist nil
|
||||||
(org-export-apply-macros-in-string
|
(org-export-apply-macros-in-string
|
||||||
(plist-get opt-plist :latex-header-extra)))
|
(plist-get opt-plist :latex-header-extra)))
|
||||||
;; append another special variable
|
;; append another special variable
|
||||||
|
|
|
@ -605,8 +605,9 @@ Assumes that the cursor is in the first ine of an item."
|
||||||
(min (save-excursion (org-end-of-item) (point))
|
(min (save-excursion (org-end-of-item) (point))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-at-eol))
|
(goto-char (point-at-eol))
|
||||||
(re-search-forward (concat "^" (org-item-re t)) nil t)
|
(if (re-search-forward (concat "^" (org-item-re t)) nil 'move)
|
||||||
(match-beginning 0)))))
|
(match-beginning 0)
|
||||||
|
(point-max))))))
|
||||||
|
|
||||||
(defun org-next-item ()
|
(defun org-next-item ()
|
||||||
"Move to the beginning of the next item in the current plain list.
|
"Move to the beginning of the next item in the current plain list.
|
||||||
|
|
95
lisp/org.el
95
lisp/org.el
|
@ -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
|
and by using a prefix arg to `S-up/down' to specify the exact number
|
||||||
of minutes to shift."
|
of minutes to shift."
|
||||||
:group 'org-time
|
: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))
|
(if (integerp (default-value var))
|
||||||
(list (default-value var) 5)
|
(list (default-value var) 5)
|
||||||
(default-value var)))
|
(default-value var)))
|
||||||
|
@ -2958,25 +2958,42 @@ will be appended."
|
||||||
|
|
||||||
(defvar org-format-latex-header-extra nil)
|
(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
|
;; The following variables are defined here because is it also used
|
||||||
;; when formatting latex fragments. Originally it was part of the
|
;; when formatting latex fragments. Originally it was part of the
|
||||||
;; LaTeX exporter, which is why the name includes "export".
|
;; LaTeX exporter, which is why the name includes "export".
|
||||||
(defcustom org-export-latex-default-packages-alist
|
(defcustom org-export-latex-default-packages-alist
|
||||||
'(("AUTO" "inputenc")
|
'(("AUTO" "inputenc" t)
|
||||||
("T1" "fontenc")
|
("T1" "fontenc" t)
|
||||||
("" "fixltx2e")
|
("" "fixltx2e" nil)
|
||||||
("" "graphicx")
|
("" "graphicx" t)
|
||||||
("" "longtable")
|
("" "longtable" nil)
|
||||||
("" "float")
|
("" "float" nil)
|
||||||
("" "wrapfig")
|
("" "wrapfig" nil)
|
||||||
("" "soul")
|
("" "soul" t)
|
||||||
("" "t1enc")
|
("" "t1enc" t)
|
||||||
("" "textcomp")
|
("" "textcomp" t)
|
||||||
("" "marvosym")
|
("" "marvosym" t)
|
||||||
("" "wasysym")
|
("" "wasysym" t)
|
||||||
("" "latexsym")
|
("" "latexsym" t)
|
||||||
("" "amssymb")
|
("" "amssymb" t)
|
||||||
("" "hyperref")
|
("" "hyperref" nil)
|
||||||
"\\tolerance=1000"
|
"\\tolerance=1000"
|
||||||
)
|
)
|
||||||
"Alist of default packages to be inserted in the header.
|
"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
|
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
|
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.
|
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
|
:group 'org-export-latex
|
||||||
|
:set 'org-set-packages-alist
|
||||||
|
:get 'org-get-packages-alist
|
||||||
:type '(repeat
|
:type '(repeat
|
||||||
(choice
|
(choice
|
||||||
(string :tag "A line of LaTeX")
|
|
||||||
(list :tag "options/package pair"
|
(list :tag "options/package pair"
|
||||||
(string :tag "options")
|
(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
|
(defcustom org-export-latex-packages-alist nil
|
||||||
"Alist of packages to be inserted in every LaTeX the header.
|
"Alist of packages to be inserted in every LaTeX the header.
|
||||||
These will be inserted after `org-export-latex-default-packages-alist'.
|
These will be inserted after `org-export-latex-default-packages-alist'.
|
||||||
Each cell is of the format \( \"options\" \"package\" \).
|
Each cell is of the format \( \"options\" \"package\" snippet-flag \).
|
||||||
Make sure that you only lis packages here which:
|
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
|
- you want in every file
|
||||||
- do not conflict with the default packages in
|
- do not conflict with the default packages in
|
||||||
`org-export-latex-default-packages-alist'
|
`org-export-latex-default-packages-alist'
|
||||||
- do not conflict with the setup in `org-format-latex-header'."
|
- do not conflict with the setup in `org-format-latex-header'."
|
||||||
:group 'org-export-latex
|
:group 'org-export-latex
|
||||||
|
:set 'org-set-packages-alist
|
||||||
|
:get 'org-get-packages-alist
|
||||||
:type '(repeat
|
:type '(repeat
|
||||||
(choice
|
(choice
|
||||||
(string :tag "A line of LaTeX")
|
|
||||||
(list :tag "options/package pair"
|
(list :tag "options/package pair"
|
||||||
(string :tag "options")
|
(string :tag "options")
|
||||||
(string :tag "package")))))
|
(string :tag "package")
|
||||||
|
(boolean :tag "Snippet"))
|
||||||
|
(string :tag "A line of LaTeX"))))
|
||||||
|
|
||||||
|
|
||||||
(defgroup org-appearance nil
|
(defgroup org-appearance nil
|
||||||
"Settings for Org-mode appearance."
|
"Settings for Org-mode appearance."
|
||||||
|
@ -15332,7 +15360,7 @@ Some of the options can be changed using the variable
|
||||||
(insert (org-splice-latex-header
|
(insert (org-splice-latex-header
|
||||||
org-format-latex-header
|
org-format-latex-header
|
||||||
org-export-latex-default-packages-alist
|
org-export-latex-default-packages-alist
|
||||||
org-export-latex-packages-alist
|
org-export-latex-packages-alist t
|
||||||
org-format-latex-header-extra))
|
org-format-latex-header-extra))
|
||||||
(insert "\n\\begin{document}\n" string "\n\\end{document}\n")
|
(insert "\n\\begin{document}\n" string "\n\\end{document}\n")
|
||||||
(require 'org-latex)
|
(require 'org-latex)
|
||||||
|
@ -15366,7 +15394,7 @@ Some of the options can be changed using the variable
|
||||||
(delete-file (concat texfilebase e)))
|
(delete-file (concat texfilebase e)))
|
||||||
pngfile))))
|
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.
|
"Fill a LaTeX header template TPL.
|
||||||
In the template, the following place holders will be recognized:
|
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
|
holder is missing, the positive one (without the \"NO-\") will be
|
||||||
assumed to be present at the end of the template.
|
assumed to be present at the end of the template.
|
||||||
DEF-PKG and PKG are assumed to be alists of options/packagename lists.
|
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 ""))
|
(let (rpl (end ""))
|
||||||
(if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
|
(if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
|
||||||
(setq rpl (if (or (match-end 1) (not def-pkg))
|
(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))
|
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)
|
(if (string-match "\\[\\(NO-\\)?PACKAGES\\][ \t]*\n?" tpl)
|
||||||
(setq rpl (if (or (match-end 1) (not pkg))
|
(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))
|
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)
|
(if (string-match "\\[\\(NO-\\)?EXTRA\\][ \t]*\n?" tpl)
|
||||||
(setq rpl (if (or (match-end 1) (not extra))
|
(setq rpl (if (or (match-end 1) (not extra))
|
||||||
|
@ -15406,11 +15437,13 @@ EXTRA is a string."
|
||||||
(concat tpl "\n" end)
|
(concat tpl "\n" end)
|
||||||
tpl)))
|
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."
|
"Turn an alist of packages into a string with the \\usepackage macros."
|
||||||
(setq pkg (mapconcat (lambda(p)
|
(setq pkg (mapconcat (lambda(p)
|
||||||
(cond
|
(cond
|
||||||
((stringp p) p)
|
((stringp p) p)
|
||||||
|
((and snippets-p (>= (length p) 3) (not (nth 2 p)))
|
||||||
|
(format "%% Package %s omitted" (cadr p)))
|
||||||
((equal "" (car p))
|
((equal "" (car p))
|
||||||
(format "\\usepackage{%s}" (cadr p)))
|
(format "\\usepackage{%s}" (cadr p)))
|
||||||
(t
|
(t
|
||||||
|
|
Loading…
Reference in New Issue