Mercurial > emacs
diff lisp/org/org-exp.el @ 99501:e3acb52d33e1
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-yank): Make any prefix force normal yanking.
Suppress folding if text would be swallowed into a folded
subtree.
(org-yank-folded-subtrees, org-yank): Docstring updates.
* org-agenda.el (org-agenda-compare-effort): Treat no effort
defined as 0.
* org-exp.el (org-export-language-setup): Add Catalan and
Esperanto language entries.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-refile): Allow refiling of entire regions.
* org-clock.el (org-clock-time%): New function.
* org.el (org-entry-get, org-entry-delete): Use safer regexps to
retrieve property values.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-list): Handle the value `only' of
org-agenda-show-log'.
(org-agenda-log-mode): Interpret a double prefix arg.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-html-footnotes-section): New variable.
(org-export-as-html): Use `org-export-html-footnotes-section' to
insert the footnotes.
(org-export-language-setup): Add "Footnotes" to language words.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-yank): Fix bug when not inserting a subtree.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org-vm.el (org-vm-follow-link): Call `vm-preview-current-message'
instead of `vm-beginning-of-message'.
* org.el (org-make-link-regexps): Make sure that links to gnus can
contain brackets.
2008-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org-attach.el (org-attach-dir): Remove duplicate ID creation
code.
* org-id.el (org-id-new): Use `org-trim' to extract the uuid from
shell output.
* org.el (org-link-abbrev-alist): Improve customization type.
* org-attach.el (org-attach-expand-link, org-attach-expand): New
functions.
* org-agenda.el (org-agenda-get-progress): Renamed from
`org-get-closed'. Implement searching for state changes as well.
(org-agenda-log-mode-items): New option.
(org-agenda-log-mode): New option prefix argument, interpreted as
request to show all possible progress info.
(org-agenda-get-day-entries): Call `org-get-progress' instead of
`org-get-closed'.
(org-agenda-set-mode-name): Handle the more complex log mode
settings.
(org-get-closed): New alias, pointing to `org-get-progress'.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-file-apps-defaults-gnu)
(org-file-apps-defaults-macosx)
(org-file-apps-defaults-windowsnt): Add an entry defining the
system command.
(org-file-apps): Allow `system' as key and value.
(org-open-at-point): Explain the effect of a double prefix arg.
(org-open-file): If the argument `in-emacs' is (16),
i.e. corresponding to a double prefix argument, try to open the
file externally.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-insert-link): Abbreviate absolute files names in
links. Also, fix a bug in which the double C-u prefix would not
be honored.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-insert-heading): If buffer does not end with a
newline, add one if necessary to insert headline correctly.
* org-exp.el (org-export-as-html): Make sure that <hr/> is between
paragraphs, not inside.
* org.el (org-todo): Quote
`org-agenda-headline-snapshot-before-repeat'.
* org-exp.el (org-export-as-html): Fully process link descriptions.
(org-export-html-format-desc): New function.
(org-export-as-html): Collect footnotes into the correct basket.
(org-html-protect): No longer protect quotations marks here, this
goes wrong.
* org-agenda.el (org-agenda-remove-marked-text): Bind variable
BEG.
* org-compat.el (org-fit-window-to-buffer): New function (not
really, a preliminary and incomplete version was present earlier,
but not used).
* org.el (org-fast-todo-selection, org-fast-tag-selection): Use
`org-fit-window-to-buffer'.
* org-exp.el (org-export): Use `org-fit-window-to-buffer'.
* org-agenda.el (org-agenda-get-restriction-and-command)
(org-fit-agenda-window, org-agenda-convert-date): Use
`org-fit-window-to-buffer'.
* org-exp.el (org-export-as-html): Process href links through
`org-export-html-format-href'.
(org-export-html-format-href): New function.
* org-agenda.el (org-agenda-todo): Update only the current
headline if this is a repeated TODO, marked done for today.
(org-agenda-change-all-lines): New argument JUST-THIS, to change
only the current line.
* org.el (org-todo): Take a snapshot of the headline if the
repeater might change it.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org-publish.el (org-publish-find-title): Remove buffers visited
only for extracting the title.
* org-exp.el (org-export-html-style)
(org-export-html-style-default): Mark style definitions as
unparsed CDATA.
* org-publish.el (org-publish-validate-link): Function
re-introduced.
2008-11-12 Charles Sebold <csebold@gmail.com>
* org-plot.el (org-plot/add-options-to-plist): Supports timefmt
property.
(org-plot-quote-timestamp-field): New function.
(org-plot-quote-tsv-field): Call timestamp field function when
necessary rather than just quoting as a string.
(org-plot/gnuplot-to-data): Pass in timefmt property.
(org-plot/gnuplot-script): Supports timefmt property.
(org-plot/gnuplot): Checks for timestamp column before checking
for text index column.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-insert-heading): Improve behavior with hidden subtrees.
* org-publish.el (org-publish-org-index): Create a section in the
index file.
(org-publish-org-index): Stop linking to directories.
* org.el (org-emphasis-alist): Use span instead of <u> to
underline text.
* org-exp.el (org-export-as-html): Make sure <p> is closed before
<pre> sections.
2008-11-12 Sebastian Rose <sebastian_rose@gmx.de>
* org-jsinfo.el (org-infojs-template): Remove language attribute
from script tag.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org-agenda.el (org-agenda-remove-marked-text): New function.
(org-agenda-mark-filtered-text)
(org-agenda-unmark-filtered-text): New functions.
(org-write-agenda): Remove fltered text.
* org.el (org-make-tags-matcher): Give access to TODO "property"
without speed penalty.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-link-frame-setup): Add `org-gnus-no-new-news' as an
option.
(org-store-link-props): Make sure adding to the plist works
correctly.
* org-gnus.el (org-gnus-no-new-news): New function.
(org-gnus-follow-link): Allow the article ID to be a message-id,
in addition to allowing article numbers. Message IDs make much
more roubust links.
(org-gnus-store-link): Use message-id to create link.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-emphasize): Reverse the selection array.
(org-emphasis-alist): Set <code> tags for the verbatim
environment.
* org-remember.el (org-remember-handler): Fix bug with
prefix-related changing of the note storage target.
* org-exp.el (org-print-icalendar-entries): Make the exported
priorities compatible with RFC 2445.
* org-clock.el (org-clock-save): Insert time stamp without
dependence on time-stamp.el.
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org.el ("saveplace"): If saveplace puts point into an invisible
location, make it visible.
(org-make-tags-matcher): Allow inactive time stamps in time
comparisons.
(org-yank-adjusted-subtrees): New option.
(org-yank): Incorporate adjusting trees.
(org-paste-subtree): New argument FOR-YANK which will cause
insertion at point without backing up over white lines, and leave
point at the end of the inserted text. Also if the cursor is
at the beginning of a headline, use the same level or the inserted
tree.
* org-publish.el (org-publish-get-base-files-1): Deal correctly
with broken symlinks
2008-11-12 Carsten Dominik <dominik@science.uva.nl>
* org-exp.el (org-export-select-tags, org-get-current-options):
Fix typo.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 12 Nov 2008 08:01:06 +0000 |
parents | 8fa7ef477c04 |
children | 621e15919df0 |
line wrap: on
line diff
--- a/lisp/org/org-exp.el Wed Nov 12 07:58:27 2008 +0000 +++ b/lisp/org/org-exp.el Wed Nov 12 08:01:06 2008 +0000 @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.10c +;; Version: 6.12a ;; ;; This file is part of GNU Emacs. ;; @@ -70,7 +70,7 @@ If any such tag is found in a buffer, all trees that do not carry one of these tags will be deleted before export. Inside trees that are selected like this, you can still deselect a -subtree by tagging it with one of the `org-export-excude-tags'." +subtree by tagging it with one of the `org-export-exclude-tags'." :group 'org-export-general :type '(repeat (string :tag "Tag"))) @@ -98,18 +98,24 @@ :type 'boolean) (defcustom org-export-language-setup - '(("en" "Author" "Date" "Table of Contents") - ("cs" "Autor" "Datum" "Obsah") - ("da" "Ophavsmand" "Dato" "Indhold") - ("de" "Autor" "Datum" "Inhaltsverzeichnis") - ("es" "Autor" "Fecha" "\xcdndice") - ("fr" "Auteur" "Date" "Table des mati\xe8res") - ("it" "Autore" "Data" "Indice") - ("nl" "Auteur" "Datum" "Inhoudsopgave") - ("no" "Forfatter" "Dato" "Innhold") - ("nb" "Forfatter" "Dato" "Innhold") ;; nb = Norsk (bokm.l) - ("nn" "Forfattar" "Dato" "Innhald") ;; nn = Norsk (nynorsk) - ("sv" "F\xf6rfattarens" "Datum" "Inneh\xe5ll")) + '(("en" "Author" "Date" "Table of Contents" "Footnotes") + ("ca" "Autor" "Data" "Índex" "Peus de pàgina") + ("cs" "Autor" "Datum" "Obsah" "Pozn\xe1mky pod carou") + ("da" "Ophavsmand" "Dato" "Indhold" "Fodnoter") + ("de" "Autor" "Datum" "Inhaltsverzeichnis" "Fußnoten") + ("eo" "Aŭtoro" "Dato" "Enhavo" "Piednotoj") + ("es" "Autor" "Fecha" "Índice" "Pies de página") + ("fi" "Tekijä" "Päivämäärä" "Sisällysluettelo" "Alaviitteet") + ("fr" "Auteur" "Date" "Table des matières" "Notes de bas de page") + ("hu" "Szerzõ" "Dátum" "Tartalomjegyzék" "Lábjegyzet") + ("is" "Höfundur" "Dagsetning" "Efnisyfirlit" "Aftanmálsgreinar") + ("it" "Autore" "Data" "Indice" "Note a piè di pagina") + ("nl" "Auteur" "Datum" "Inhoudsopgave" "Voetnoten") + ("no" "Forfatter" "Dato" "Innhold" "Fotnoter") + ("nb" "Forfatter" "Dato" "Innhold" "Fotnoter") ;; nb = Norsk (bokm.l) + ("nn" "Forfattar" "Dato" "Innhald" "Fotnotar") ;; nn = Norsk (nynorsk) + ("pl" "Autor" "Data" "Spis treści" "Przypis") + ("sv" "Författare" "Datum" "Innehåll" "Fotnoter")) "Terms used in export text, translated to different languages. Use the variable `org-export-default-language' to set the language, or use the +OPTION lines for a per-file setting." @@ -119,7 +125,8 @@ (string :tag "HTML language tag") (string :tag "Author") (string :tag "Date") - (string :tag "Table of Contents")))) + (string :tag "Table of Contents") + (string :tag "Footnotes")))) (defcustom org-export-default-language "en" "The default language of HTML export, as a string. @@ -303,6 +310,19 @@ :group 'org-export-translation :type 'boolean) +(defcustom org-export-html-footnotes-section "<div id=\"footnotes\"> +<h2 class=\"footnotes\">%s: </h2> +<div id=\"footnotes-text\"> +%s +</div> +</div>" + "Format for the footnotes section. +Should contain a two instances of %s. The first will be replaced with the +language-specific word for \"Footnotes\", the second one will be replaced +by the footnotes themselves." + :group 'org-export-html + :type 'string) + (defcustom org-export-with-sub-superscripts t "Non-nil means, interpret \"_\" and \"^\" for export. When this option is turned on, you can use TeX-like syntax for sub- and @@ -492,6 +512,7 @@ (defconst org-export-html-style-default "<style type=\"text/css\"> + <![CDATA[ html { font-family: Times, serif; font-size: 12pt; } .title { text-align: center; } .todo { color: red; } @@ -518,11 +539,23 @@ 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 -`org-export-html-style-extra' to add to this style.") +`org-export-html-style-extra' to add to this style. If you wish to not +have the default style included, customize the variable +`org-export-html-style-include-default'.") + +(defcustom org-export-html-style-include-default t + "Non-nil means, include the default style in exported HTML files. +The actualy style is defined in `org-export-html-style-default' and should +not be modified. Use the variables `org-export-html-style' to add +your own style information." + :group 'org-export-html + :type 'boolean) +;;;###autoload +(put 'org-export-html-style 'safe-local-variable 'booleanp) (defcustom org-export-html-style "" "Org-wide style definitions for exported HTML files. @@ -535,11 +568,13 @@ For example, a valid value would be: <style type=\"text/css\"> + <![CDATA[ p { font-weight: normal; color: gray; } h1 { color: black; } .title { text-align: center; } .todo, .timestamp-kwd { color: red; } .done { color: green; } + ]]> </style> If you'd like to refer to en external style file, use something like @@ -812,6 +847,7 @@ (: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) @@ -1046,9 +1082,8 @@ (delete-other-windows) (with-output-to-temp-buffer "*Org Export/Publishing Help*" (princ help)) - (if (fboundp 'fit-window-to-buffer) - (fit-window-to-buffer (get-buffer-window - "*Org Export/Publishing Help*"))) + (org-fit-window-to-buffer (get-buffer-window + "*Org Export/Publishing Help*")) (message "Select command: ") (setq r1 (read-char-exclusive))) (setq r2 (if (< r1 27) (+ r1 96) r1)) @@ -2597,7 +2632,7 @@ #+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 %s #+EXPORT_SELECT_TAGS: %s -#+EXPORT_EXCUDE_TAGS: %s +#+EXPORT_EXCLUDE_TAGS: %s #+LINK_UP: %s #+LINK_HOME: %s #+CATEGORY: %s @@ -2764,6 +2799,7 @@ rtn))) (defvar html-table-tag nil) ; dynamically scoped into this. +(defvar org-par-open nil) ;;;###autoload (defun org-export-as-html (arg &optional hidden ext-plist to-buffer body-only pub-dir) @@ -2802,8 +2838,8 @@ (org-combine-plists (org-default-export-plist) ext-plist (org-infile-export-plist)))) - - (style (concat org-export-html-style-default + (style (concat (if (plist-get opt-plist :style-include-default) + org-export-html-style-default) (plist-get opt-plist :style) (plist-get opt-plist :style-extra))) (html-extension (plist-get opt-plist :html-extension)) @@ -2915,6 +2951,7 @@ ind item-type starter didclose rpl path attr desc descp desc1 desc2 link snumber fnc item-tag + footnotes ) (let ((inhibit-read-only t)) @@ -3085,6 +3122,7 @@ (string-match "^[ \t]*:\\(.*\\)" line)) (when (not infixed) (setq infixed t) + (org-close-par-maybe) (insert "<pre class=\"example\">\n")) (insert (org-html-protect (match-string 1 line)) "\n") (when (or (not lines) @@ -3112,7 +3150,9 @@ ;; Horizontal line (when (string-match "^[ \t]*-\\{5,\\}[ \t]*$" line) - (insert "\n<hr/>\n") + (if org-par-open + (insert "\n</p>\n<hr/>\n<p>\n") + (insert "\n<hr/>\n")) (throw 'nextline nil)) ;; Blockquotes and verse @@ -3202,7 +3242,9 @@ "<a href=\"#" (org-solidify-link-text (save-match-data (org-link-unescape path)) nil) - "\"" attr ">" desc "</a>"))) + "\"" attr ">" + (org-export-html-format-desc desc) + "</a>"))) ((member type '("http" "https")) ;; standard URL, just check if we need to inline an image (if (and (or (eq t org-export-html-inline-images) @@ -3210,12 +3252,19 @@ (org-file-image-p path)) (setq rpl (concat "<img src=\"" type ":" path "\"" attr "/>")) (setq link (concat type ":" path)) - (setq rpl (concat "<a href=\"" link "\"" attr ">" - desc "</a>")))) + (setq rpl (concat "<a href=\"" + (org-export-html-format-href link) + "\"" attr ">" + (org-export-html-format-desc desc) + "</a>")))) ((member type '("ftp" "mailto" "news")) ;; standard URL (setq link (concat type ":" path)) - (setq rpl (concat "<a href=\"" link "\"" attr ">" desc "</a>"))) + (setq rpl (concat "<a href=\"" + (org-export-html-format-href link) + "\"" attr ">" + (org-export-html-format-desc desc) + "</a>"))) ((functionp (setq fnc (nth 2 (assoc type org-link-protocols)))) ;; The link protocol has a function for format the link @@ -3261,7 +3310,8 @@ (not descp)))) (concat "<img src=\"" thefile "\"" attr "/>") (concat "<a href=\"" thefile "\"" attr ">" - desc "</a>"))) + (org-export-html-format-desc desc) + "</a>"))) (if (not valid) (setq rpl desc)))) (t @@ -3322,6 +3372,7 @@ head-count) ;; QUOTES (when (string-match quote-re line) + (org-close-par-maybe) (insert "<pre>") (setq inquote t))) @@ -3415,12 +3466,17 @@ ;; Is this the start of a footnote? (when org-export-with-footnotes + (when (and (boundp 'footnote-section-tag-regexp) + (string-match (concat "^" footnote-section-tag-regexp) + line)) + ;; ignore this line + (throw 'nextline nil)) (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line) (org-close-par-maybe) (let ((n (match-string 1 line))) - (setq line (replace-match - (format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line)) - (setq line (concat line "</p>"))))) + (setq org-par-open t + line (replace-match + (format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line))))) ;; Check if the line break needs to be conserved (cond @@ -3432,7 +3488,9 @@ (insert line "\n"))))) ;; Properly close all local lists and other lists - (when inquote (insert "</pre>\n")) + (when inquote + (insert "</pre>\n") + (org-open-par)) (when in-local-list ;; Close any local lists before inserting a new header line (while local-list-type @@ -3447,6 +3505,16 @@ ;; the </div> to close the last text-... div. (insert "</div>\n") + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "<p class=\"footnote\">[^\000]*?\\(</p>\\|\\'\\)" nil t) + (push (match-string 0) footnotes) + (replace-match "" t t))) + (when footnotes + (insert (format org-export-html-footnotes-section + (or (nth 4 lang-words) "Footnotes") + (mapconcat 'identity (nreverse footnotes) "\n")) + "\n")) (unless body-only (when (plist-get opt-plist :auto-postamble) (insert "<div id=\"postamble\">") @@ -3525,6 +3593,21 @@ (kill-buffer (current-buffer))) (current-buffer))))) +(defun org-export-html-format-href (s) + "Make sure the S is valid as a href reference in an XHTML document." + (save-match-data + (let ((start 0)) + (while (string-match "&" s start) + (setq start (+ (match-beginning 0) 3) + s (replace-match "&" t t s))))) + s) + +(defun org-export-html-format-desc (s) + "Make sure the S is valid as a description in a link." + (if s + (save-match-data + (org-html-do-expand s)) + s)) (defvar org-table-colgroup-info nil) (defun org-format-table-ascii (lines) @@ -3882,7 +3965,10 @@ (while (string-match "<" s) (setq s (replace-match "<" t t s))) (while (string-match ">" s) - (setq s (replace-match ">" t t s)))) + (setq s (replace-match ">" t t s))) +; (while (string-match "\"" s) +; (setq s (replace-match """ t t s))) + ) s) (defun org-export-cleanup-toc-line (s) @@ -4037,7 +4123,6 @@ (setq s (1+ s)))) string)) -(defvar org-par-open nil) (defun org-open-par () "Insert <p>, but first close previous paragraph if any." (org-close-par-maybe) @@ -4384,9 +4469,9 @@ hd (concat (substring hd 0 (match-beginning 1)) (substring hd (match-end 1)))) (setq pri org-default-priority)) - (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri)) - (- org-lowest-priority org-highest-priority)))))) - + (setq pri (floor (- 9 (* 8. (/ (float (- org-lowest-priority pri)) + (- org-lowest-priority org-highest-priority)))))) + (princ (format "BEGIN:VTODO UID: %s %s