comparison lisp/org/org-exp.el @ 98644:e1cc41b9282d

2008-10-12 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-edit-fixed-width-region): Exclude final newline from picture area. * org-export-latex.el (org-export-latex-subcontent): Add labels to sections, to make internal links work. (org-export-latex-fontify-headline): Do not remove all text properties, to make sure that target properties survive this process. * org-exp.el (org-export-preprocess-string): Change sequence of modifications, to make sure links are prepared before the LaTeX conversions do happen. * org-attach.el (org-attach-delete-all): Renamed from `org-attch-delete'. Add a security query before deleting the entire directory. New optional argument FORCE can overrule the security query. (org-attach-delete-one): New command. * org-attach.el (org-attach-file-list): Fix bug with directory. * org.el (org-apps-regexp-alist): New function. (org-file-apps): Add auto-mode to the default value. (org-open-file): Use the new structure of org-file-apps. * org-attach.el (org-attach): Support the new keys. (org-attach-method): New option. * org-bbdb.el (org-bbdb-anniversaries): Fix but with 29 Feb/1 March. * org.el (org-remove-uniherited-tags): Fix reverse interpretation of the list value o `org-use-tag-inheritance'. * org-attach.el (org-attach-auto-tag): New option. (org-attach-tag, org-attach-untag): New functions. (org-attach-attach, org-attach-new, org-attach-sync): Call `org-attach-tag'. (org-attach-delete): Call `org-attach-untag'. * org-attach.el: New file. * org-table.el (orgtbl-self-insert-command): Make this work for the keypad as well. * org.el (org-add-log-setup): Limit searc for drawers to entry text, not to subtree. * org-clock.el (org-clock-heading-for-remember): New variable. (org-clock-in): Set `org-clock-heading-for-remember'. 2008-10-12 James TD Smith <ahktenzero@mohorovi.cc> * org-remember.el (org-remember-apply-template): Add new expansions: %k, %K for currently clocked task and a link to the currently clocked task, and %< to file notes in the currently clocked task. 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org-export-latex.el (org-export-latex-make-header): Also insert the content of the property :latex-header-extra. * org-exp.el (org-infile-export-plist): Put the content of #+LATEX_HEADER: into the property :latex-header-extra. * org-colview.el (org-columns-get-format-and-top-level): Remove resetting the marker. * org-colview-xemacs.el (org-columns-get-format-and-top-level): Remove resetting the marker. * org.el (org-entry-property-inherited-from): Improve docstring. (org-entry-get-with-inheritance): Reset marker before starting the search. * org-exp.el (org-infile-export-plist): Allow multiple STYLE lines. * org.el (org-entry-get-multivalued-property) (org-entry-protect-space, org-entry-restore-space): New functions. (org-file-apps-defaults-macosx): Let postscript files be opened by preview. (org-time-stamp-inactive): Call `org-time-stamp'. (org-time-stamp): New argument `inactive'. Also edit inacive stamps. Convert time stamp type. (org-open-file): Interpret the `default' value for the `command' in `org-file-apps'. * org-id.el (org-id-int-to-b36-one-digit) (org-id-b36-to-int-one-digit, org-id-int-to-b36) (org-id-b36-to-int, org-id-time-to-b36): Modified from b62 to b36. * org-id.el (org-id-reverse-string): New function. (org-id-new): Use `org-id-reverse-string' to make sure the beginning chars of the ID are mutating fast. This allows to use a directory structure to spread things better. (org-id-prefix): Changed default to nil. * org-list.el (org-move-item-down, org-move-item-up): Remember and restore the column of the cursor position. * org-remember.el (org-remember-apply-template): Remove properties from `initial'. * org-wl.el (org-wl-open): Remove useless call to `wl-thread-open-all'. * org-remember.el (org-remember-handler): Fix bug with `bottom' location. * org-bbdb.el (org-bbdb-anniversaries): Require bbdb in `org-bbdb-anniversaries'. * org.el (org-get-next-sibling, org-forward-same-level): New functions, similar to the outline versions, but invisible headings are OK. 2008-10-12 Bastien Guerry <bzg@altern.org> * org.el (org-auto-repeat-maybe): Insert a space between the timestamp's type and the timestamp itself. 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org-table.el (org-table-sum): Do not format the result with %g, it does rounding when there are too many digits. * org.el (org-map-entries): Protect the keyword-selecting variables. 2008-10-12 Bastien Guerry <bzg@altern.org> * org-agenda.el (org-agenda-to-appt): Make sure the function check against all agenda files. 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org-list.el: New file, aggregating list functions from org.el and org-export-latex.el. * org.el (org-edit-src-region-extra): New option. * org-agenda.el (org-agenda-to-appt): Fix bug with appointment time before 1am. 2008-10-12 Bastien Guerry <bzg@altern.org> * org-export-latex.el (org-export-latex-keywords-maybe): Bug fix. 2008-10-12 James TA Smith <ahktenzero@mohorovi.cc> * org-plot.el (org-plot/gnuplot): Make tables starting with a hline work correctly. (org-plot/gnuplot-script): Put commas at the end of each script line. * org.el (org-get-refile-targets): Replace links with their descriptions (org-imenu-get-tree): Replace links with their descriptions. * org-remember.el (org-remember-apply-template): Add a new expansion for adding properties to remember items. * org.el (org-add-log-setup): Skip over drawers (properties, clocks etc) when adding notes. * org-agenda.el (org-agenda-get-closed): show durations of clocked items as well as the start and end times. * org-compat.el (org-get-x-clipboard-compat): Add a compat function for fetching the X clipboard on XEmacs and GNU Emacs 21. * org-remember.el (org-get-x-clipboard): Use the compat function to get clipboard values when x-selection-value is unavailable. Use substring-no-properties instead of set-text-properties to remove text properties from the clipboard value. * lisp/org-clock.el (org-update-mode-line): Support limiting the modeline clock string, and display the full todo value in the tooltip. Set a local keymap so mouse-3 on the clock string goes to the currently clocked task. (org-clock-string-limit): Add a custom value for the maximum length of the clock string in the modeline. (org-clock-mode-map): Add a keymap for the modeline string 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org-compat.el (org-propertize): New function. 2008-10-12 Bastien Guerry <bzg@altern.org> * org-export-latex.el (org-export-latex-tables): protect exported tables from further special chars conversion. (org-export-latex-preprocess): Preserve LaTeX environments. (org-list-parse-list): Parse descriptive lists. (org-list-to-generic, org-list-to-latex, org-list-to-html) (org-list-to-texinfo): Export descriptive lists. (org-quote-chars): Remove. (org-export-latex-keywords-maybe): Use `replace-regexp-in-string'. (org-export-latex-list-beginning-re): Rename to `org-list-beginning-re' (org-list-item-begin): Rename to `org-list-item-beginning' 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org.el (org-refile): Allow refiling to the last entry in the buffer. (org-get-tags-at): Fix bug when inheritance is turned off. * org.el (org-indent-line-function): No longer check for src regions, this is too much overhead. * org-agenda.el (org-agenda-highlight-todo): Fix bugs with keyword matching. * org.el (org-scan-tags): Make sure that tags matching is not case sensitive. TODO keyword matching is case sensitive, however, to avoid confusion with similar words that are not meant to be keywords. * org.el (org-get-local-tags-at): New function. (org-get-local-tags): New function. * org-exp.el (org-export-get-categories): New function. * org-agenda.el (org-sorting-choice) (org-agenda-sorting-strategy, org-agenda-get-todos) (org-agenda-get-timestamps, org-agenda-get-deadlines) (org-agenda-get-scheduled, org-agenda-get-blocks) (org-entries-lessp): Implement sorting by TODO state. (org-cmp-todo-state): New defsubst. * org-colview.el (org-colview-construct-allowed-dates): New function. (org-columns-next-allowed-value): Use `org-colview-construct-allowed-dates'. * org-colview-xemacs.el (org-colview-construct-allowed-dates): New function. (org-columns-next-allowed-value): Use `org-colview-construct-allowed-dates'. * org.el (org-protect-slash): New function. (org-get-refile-targets): Use `org-protect-slash'. * org-agenda.el (org-global-tags-completion-table): New variable. * org-exp.el (org-export-handle-export-tags): New function. (org-export-preprocess-string): Call `org-export-handle-export-tags'. * org-plot.el: New file. * org-publish.el (org-publish-expand-components): Function removed. (org-publish-expand-projects): Allow components to have components. * org.el (org-indent-line-function): Do not indent in regions that are external source code. (org-yank-and-fold-if-subtree): New function. * org-agenda.el (org-agenda-todayp): New function. (org-agenda-get-deadlines, org-agenda-get-scheduled): Use `org-agenda-todayp'. * org.el (org-insert-heading-respect-content) (org-insert-todo-heading-respect-content): New commands. (org-insert-heading-respect-content): New option. (org-insert-heading): Respect `org-insert-heading-respect-content'. * org-clock.el (org-clock-find-position): Make sure the note after the clock line gets moved into the new clock drawer. * org-id.el (org-id-new): New option. * org-table.el (org-table-copy-down): Avoid overflow during increment. Use prefix argument 0 to temporarily disable the increment. * org-exp.el (org-export-as-html): Do not turn on the major mode if the buffer will be killed anyway. (org-get-current-options): Exclude the #+TEXT field. (org-export-as-html): Make sure text before the first headline is a paragraph. * org-publish.el (org-publish-org-to): Tell the exporter that this buffer will be killed, so it is not necessary to do major mode initialization. * org-archive.el (org-archive-to-archive-sibling): Show empty lines after folding the archive sibling. * org.el (org-log-note-extra): New variable. 2008-10-12 Bastien Guerry <bzg@altern.org> * org.el (org-additional-option-like-keywords): Added keywords for the _QUOTE, _VERSE and _SRC environments. * org-export-latex.el (org-export-latex-preprocess): Fix bug when exporting _QUOTE and _VERSE environments. 2008-10-12 Carsten Dominik <dominik@science.uva.nl> * org-agenda.el (org-agenda-filter-by-tag): New command. * org-exp.el (org-get-current-options): Remove angular brackets from the date entry. * org.el (org-edit-fixed-width-region): New function. (org-edit-fixed-width-region): Also try `org-edit-fixed-width-region'. (org-edit-fixed-width-region-mode): New option. (org-activate-code): Only interprete lines starting with colon plus a space as example lines. * org-remember.el (org-remember-templates): Add nil instead of empty strings to fix the length of remember templates. * org-table.el (org-calc-default-modes): Fix the time format for calc, from 12 hour to 24 hour clock. * org-agenda.el (org-agenda-get-deadlines) (org-agenda-get-scheduled): Avoid `time-of-day' extraction for entries that are pre-warnings of deadlines or reminders. * org.el (org-sort-entries-or-items): Make numeric and alpha comparisons ignore any TODO keyword and priority cookie. * org-remember.el (org-remember-handler): Reinterpretation of the prefix argument. * org-agenda.el (org-agenda-get-scheduled): Use new `org-scheduled' face. * org-faces.el (org-scheduled): New face. * org-wl.el (org-wl-open): Remove incorrect declaration. * org-gnus.el (org-gnus-store-link): Support for :to information in gnus links. * org-exp.el (org-export-as-html): Fixed typo in creator information. (org-export-protect-examples): New parameter indent. Insert extra spaces only when this parameter is specified. (org-export-preprocess-string): Call `org-export-protect-examples' with an indentation parameter when exporting to ASCII. * org-remember.el (org-remember-templates) (org-remember-apply-template): Allow the file component to be a function. * org.el (org-goto-local-search-headings): Renamed from `org-goto-local-search-forward-headings'. Added the possibility to search backwards. * org-export-latex.el (org-export-latex): New customization group. * org-agenda.el (org-write-agenda): Erase buffer for txt export. * org-exp.el (org-html-do-expand): Allow {} to terminate tex macro * org.el (org-buffer-list): Select buffers based on major mode, not on file name. * org-agenda.el (org-agenda-align-tags): Fix bug with malformed face property. * org-colview.el (org-columns-display-here): Use `org-columns-modify-value-for-display-function'. * org-colview-xemacs.el (org-columns-display-here): Use `org-columns-modify-value-for-display-function'. * org.el (org-columns-modify-value-for-display-function): New option. * org-publish.el (org-publish-file): Make sure the directory match for the publishing directory works correctly. * org-agenda.el (org-agenda-execute-calendar-command) (org-agenda-diary-entry): Additional optional argument.
author Carsten Dominik <dominik@science.uva.nl>
date Sun, 12 Oct 2008 06:12:44 +0000
parents 9da424c0c9c9
children 8fa7ef477c04
comparison
equal deleted inserted replaced
98643:fd13ced7b1d5 98644:e1cc41b9282d
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4 4
5 ;; Author: Carsten Dominik <carsten at orgmode dot org> 5 ;; Author: Carsten Dominik <carsten at orgmode dot org>
6 ;; Keywords: outlines, hypermedia, calendar, wp 6 ;; Keywords: outlines, hypermedia, calendar, wp
7 ;; Homepage: http://orgmode.org 7 ;; Homepage: http://orgmode.org
8 ;; Version: 6.06b 8 ;; Version: 6.09a
9 ;; 9 ;;
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 ;; 11 ;;
12 ;; GNU Emacs is free software: you can redistribute it and/or modify 12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
61 61
62 If this option is t, the double prefix can be used to exceptionally 62 If this option is t, the double prefix can be used to exceptionally
63 force an export command into the current process." 63 force an export command into the current process."
64 :group 'org-export-general 64 :group 'org-export-general
65 :type 'boolean) 65 :type 'boolean)
66
67
68 (defcustom org-export-select-tags '("export")
69 "Tags that select a tree for export.
70 If any such tag is found in a buffer, all trees that do not carry one
71 of these tags will be deleted before export.
72 Inside trees that are selected like this, you can still deselect a
73 subtree by tagging it with one of the `org-export-excude-tags'."
74 :group 'org-export-general
75 :type '(repeat (string :tag "Tag")))
76
77 (defcustom org-export-exclude-tags '("noexport")
78 "Tags that exclude a tree from export.
79 All trees carrying any of these tags will be excluded from export.
80 This is without contition, so even subtrees inside that carry one of the
81 `org-export-select-tags' will be removed."
82 :group 'org-export-general
83 :type '(repeat (string :tag "Tag")))
66 84
67 (defcustom org-export-with-special-strings t 85 (defcustom org-export-with-special-strings t
68 "Non-nil means, interpret \"\-\", \"--\" and \"---\" for export. 86 "Non-nil means, interpret \"\-\", \"--\" and \"---\" for export.
69 When this option is turned on, these strings will be exported as: 87 When this option is turned on, these strings will be exported as:
70 88
492 overflow:auto; 510 overflow:auto;
493 } 511 }
494 table { border-collapse: collapse; } 512 table { border-collapse: collapse; }
495 td, th { vertical-align: top; } 513 td, th { vertical-align: top; }
496 dt { font-weight: bold; } 514 dt { font-weight: bold; }
515
516 .org-info-js_info-navigation { border-style:none; }
517 #org-info-js_console-label { font-size:10px; font-weight:bold;
518 white-space:nowrap; }
519 .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
520 font-weight:bold; }
521
497 </style>" 522 </style>"
498 "The default style specification for exported HTML files. 523 "The default style specification for exported HTML files.
499 Please use the variables `org-export-html-style' and 524 Please use the variables `org-export-html-style' and
500 `org-export-html-style-extra' to add to this style.") 525 `org-export-html-style-extra' to add to this style.")
501 526
537 settings with <style>...</style> tags." 562 settings with <style>...</style> tags."
538 :group 'org-export-html 563 :group 'org-export-html
539 :type 'string) 564 :type 'string)
540 ;;;###autoload 565 ;;;###autoload
541 (put 'org-export-html-style-extra 'safe-local-variable 'stringp) 566 (put 'org-export-html-style-extra 'safe-local-variable 'stringp)
567
542 568
543 (defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n" 569 (defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
544 "Format for typesetting the document title in HTML export." 570 "Format for typesetting the document title in HTML export."
545 :group 'org-export-html 571 :group 'org-export-html
546 :type 'string) 572 :type 'string)
685 (const :tag "SCHEDULED timestamps in TODO entries become events" 711 (const :tag "SCHEDULED timestamps in TODO entries become events"
686 event-if-todo) 712 event-if-todo)
687 (const :tag "SCHEDULED in TODO entries become start date" 713 (const :tag "SCHEDULED in TODO entries become start date"
688 todo-start))) 714 todo-start)))
689 715
716 (defcustom org-icalendar-categories '(local-tags category)
717 "Items that should be entered into the categories field.
718 This is a list of symbols, the following are valid:
719
720 category The Org-mode category of the current file or tree
721 todo-state The todo state, if any
722 local-tags The tags, defined in the current line
723 all-tags All tags, including inherited ones."
724 :group 'org-export-icalendar
725 :type '(repeat
726 (choice
727 (const :tag "The file or tree category" category)
728 (const :tag "The TODO state" todo-state)
729 (const :tag "Tags defined in current line" local-tags)
730 (const :tag "All tags, including inherited ones" all-tags))))
731
690 (defcustom org-icalendar-include-todo nil 732 (defcustom org-icalendar-include-todo nil
691 "Non-nil means, export to iCalendar files should also cover TODO items." 733 "Non-nil means, export to iCalendar files should also cover TODO items."
692 :group 'org-export-icalendar 734 :group 'org-export-icalendar
693 :type '(choice 735 :type '(choice
694 (const :tag "None" nil) 736 (const :tag "None" nil)
731 ;;; Variables, constants, and parameter plists 773 ;;; Variables, constants, and parameter plists
732 774
733 (defconst org-level-max 20) 775 (defconst org-level-max 20)
734 776
735 (defvar org-export-html-preamble nil 777 (defvar org-export-html-preamble nil
736 "Preamble, to be inserted just after <body>. Set by publishing functions.") 778 "Preamble, to be inserted just before <body>. Set by publishing functions.")
737 (defvar org-export-html-postamble nil 779 (defvar org-export-html-postamble nil
738 "Preamble, to be inserted just before </body>. Set by publishing functions.") 780 "Preamble, to be inserted just after </body>. Set by publishing functions.")
739 (defvar org-export-html-auto-preamble t 781 (defvar org-export-html-auto-preamble t
740 "Should default preamble be inserted? Set by publishing functions.") 782 "Should default preamble be inserted? Set by publishing functions.")
741 (defvar org-export-html-auto-postamble t 783 (defvar org-export-html-auto-postamble t
742 "Should default postamble be inserted? Set by publishing functions.") 784 "Should default postamble be inserted? Set by publishing functions.")
743 (defvar org-current-export-file nil) ; dynamically scoped parameter 785 (defvar org-current-export-file nil) ; dynamically scoped parameter
783 (:preamble . org-export-html-preamble) 825 (:preamble . org-export-html-preamble)
784 (:postamble . org-export-html-postamble) 826 (:postamble . org-export-html-postamble)
785 (:auto-preamble . org-export-html-auto-preamble) 827 (:auto-preamble . org-export-html-auto-preamble)
786 (:auto-postamble . org-export-html-auto-postamble) 828 (:auto-postamble . org-export-html-auto-postamble)
787 (:author . user-full-name) 829 (:author . user-full-name)
788 (:email . user-mail-address))) 830 (:email . user-mail-address)
831 (:select-tags . org-export-select-tags)
832 (:exclude-tags . org-export-exclude-tags)))
789 833
790 (defun org-default-export-plist () 834 (defun org-default-export-plist ()
791 "Return the property list with default settings for the export variables." 835 "Return the property list with default settings for the export variables."
792 (let ((l org-export-plist-vars) rtn e) 836 (let ((l org-export-plist-vars) rtn e)
793 (while (setq e (pop l)) 837 (while (setq e (pop l))
819 (widen) 863 (widen)
820 (goto-char (point-min)) 864 (goto-char (point-min))
821 (let ((re (org-make-options-regexp 865 (let ((re (org-make-options-regexp
822 (append 866 (append
823 '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE" 867 '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
824 "LINK_UP" "LINK_HOME" "SETUPFILE") 868 "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER"
869 "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS")
825 (mapcar 'car org-export-inbuffer-options-extra)))) 870 (mapcar 'car org-export-inbuffer-options-extra))))
826 p key val text options js-up js-main js-css js-opt a pr 871 p key val text options js-up js-main js-css js-opt a pr style
872 latex-header
827 ext-setup-or-nil setup-contents (start 0)) 873 ext-setup-or-nil setup-contents (start 0))
828 (while (or (and ext-setup-or-nil 874 (while (or (and ext-setup-or-nil
829 (string-match re ext-setup-or-nil start) 875 (string-match re ext-setup-or-nil start)
830 (setq start (match-end 0))) 876 (setq start (match-end 0)))
831 (and (setq ext-setup-or-nil nil start 0) 877 (and (setq ext-setup-or-nil nil start 0)
839 ((string-equal key "TITLE") (setq p (plist-put p :title val))) 885 ((string-equal key "TITLE") (setq p (plist-put p :title val)))
840 ((string-equal key "AUTHOR")(setq p (plist-put p :author val))) 886 ((string-equal key "AUTHOR")(setq p (plist-put p :author val)))
841 ((string-equal key "EMAIL") (setq p (plist-put p :email val))) 887 ((string-equal key "EMAIL") (setq p (plist-put p :email val)))
842 ((string-equal key "DATE") (setq p (plist-put p :date val))) 888 ((string-equal key "DATE") (setq p (plist-put p :date val)))
843 ((string-equal key "LANGUAGE") (setq p (plist-put p :language val))) 889 ((string-equal key "LANGUAGE") (setq p (plist-put p :language val)))
890 ((string-equal key "STYLE")
891 (setq style (concat style "\n" val)))
892 ((string-equal key "LATEX_HEADER")
893 (setq latex-header (concat latex-header "\n" val)))
844 ((string-equal key "TEXT") 894 ((string-equal key "TEXT")
845 (setq text (if text (concat text "\n" val) val))) 895 (setq text (if text (concat text "\n" val) val)))
846 ((string-equal key "OPTIONS") 896 ((string-equal key "OPTIONS")
847 (setq options (concat val " " options))) 897 (setq options (concat val " " options)))
848 ((string-equal key "LINK_UP") 898 ((string-equal key "LINK_UP")
849 (setq p (plist-put p :link-up val))) 899 (setq p (plist-put p :link-up val)))
850 ((string-equal key "LINK_HOME") 900 ((string-equal key "LINK_HOME")
851 (setq p (plist-put p :link-home val))) 901 (setq p (plist-put p :link-home val)))
902 ((string-equal key "EXPORT_SELECT_TAGS")
903 (setq p (plist-put p :select-tags (org-split-string val))))
904 ((string-equal key "EXPORT_EXCLUDE_TAGS")
905 (setq p (plist-put p :exclude-tags (org-split-string val))))
852 ((equal key "SETUPFILE") 906 ((equal key "SETUPFILE")
853 (setq setup-contents (org-file-contents 907 (setq setup-contents (org-file-contents
854 (expand-file-name 908 (expand-file-name
855 (org-remove-double-quotes 909 (org-remove-double-quotes
856 (org-trim val))) 910 (org-trim val)))
860 (setq ext-setup-or-nil 914 (setq ext-setup-or-nil
861 (concat (substring ext-setup-or-nil 0 start) 915 (concat (substring ext-setup-or-nil 0 start)
862 "\n" setup-contents "\n" 916 "\n" setup-contents "\n"
863 (substring ext-setup-or-nil start))))))) 917 (substring ext-setup-or-nil start)))))))
864 (setq p (plist-put p :text text)) 918 (setq p (plist-put p :text text))
919 (when style (setq p (plist-put p :style-extra style)))
920 (when latex-header
921 (setq p (plist-put p :latex-header-extra (substring latex-header 1))))
865 (when options 922 (when options
866 (setq p (org-export-add-options-to-plist p options))) 923 (setq p (org-export-add-options-to-plist p options)))
867 p)))) 924 p))))
868 925
869 (defun org-export-add-options-to-plist (p options) 926 (defun org-export-add-options-to-plist (p options)
1343 1400
1344 (let ((org-inhibit-startup t)) (org-mode)) 1401 (let ((org-inhibit-startup t)) (org-mode))
1345 (setq case-fold-search t) 1402 (setq case-fold-search t)
1346 (untabify (point-min) (point-max)) 1403 (untabify (point-min) (point-max))
1347 1404
1348 ;; Handle incude files 1405 ;; Handle include files
1349 (org-export-handle-include-files) 1406 (org-export-handle-include-files)
1350 1407
1408 ;; Get rid of excluded trees
1409 (org-export-handle-export-tags (plist-get parameters :select-tags)
1410 (plist-get parameters :exclude-tags))
1411
1351 ;; Handle source code snippets 1412 ;; Handle source code snippets
1352 (org-export-replace-src-segments) 1413 (org-export-replace-src-segments)
1353 1414
1354 ;; Get rid of drawers 1415 ;; Get rid of drawers
1355 (org-export-remove-or-extract-drawers drawers 1416 (org-export-remove-or-extract-drawers drawers
1375 ;; Find targets in comments and move them out of comments, 1436 ;; Find targets in comments and move them out of comments,
1376 ;; but mark them as targets that should be invisible 1437 ;; but mark them as targets that should be invisible
1377 (setq target-alist (org-export-handle-invisible-targets target-alist)) 1438 (setq target-alist (org-export-handle-invisible-targets target-alist))
1378 1439
1379 ;; Protect examples 1440 ;; Protect examples
1380 (org-export-protect-examples) 1441 (org-export-protect-examples (if asciip 'indent nil))
1381 1442
1382 ;; Protect backend specific stuff, throw away the others. 1443 ;; Protect backend specific stuff, throw away the others.
1383 (org-export-select-backend-specific-text 1444 (org-export-select-backend-specific-text
1384 (cond (htmlp 'html) (latexp 'latex) (asciip 'ascii))) 1445 (cond (htmlp 'html) (latexp 'latex) (asciip 'ascii)))
1385 1446
1392 ;; Blockquotes and verse 1453 ;; Blockquotes and verse
1393 (org-export-mark-blockquote-and-verse) 1454 (org-export-mark-blockquote-and-verse)
1394 1455
1395 ;; Remove comment environment and comment subtrees 1456 ;; Remove comment environment and comment subtrees
1396 (org-export-remove-comment-blocks-and-subtrees) 1457 (org-export-remove-comment-blocks-and-subtrees)
1458
1459
1460 ;; Find matches for radio targets and turn them into internal links
1461 (org-export-mark-radio-links)
1462
1463 ;; Find all links that contain a newline and put them into a single line
1464 (org-export-concatenate-multiline-links)
1465
1466 ;; Normalize links: Convert angle and plain links into bracket links
1467 ;; and expand link abbreviations
1468 (org-export-normalize-links)
1469
1470 ;; Find all internal links. If they have a fuzzy match (i.e. not
1471 ;; a *dedicated* target match, let the link point to the
1472 ;; corresponding section.
1473 (org-export-target-internal-links target-alist)
1474
1475 ;; Find multiline emphasis and put them into single line
1476 (when (plist-get parameters :emph-multiline)
1477 (org-export-concatenate-multiline-emphasis))
1397 1478
1398 ;; Remove special table lines 1479 ;; Remove special table lines
1399 (when org-export-table-remove-special-lines 1480 (when org-export-table-remove-special-lines
1400 (org-export-remove-special-table-lines)) 1481 (org-export-remove-special-table-lines))
1401 1482
1413 (org-export-html-preprocess parameters)) 1494 (org-export-html-preprocess parameters))
1414 1495
1415 ;; Remove or replace comments 1496 ;; Remove or replace comments
1416 (org-export-handle-comments (plist-get parameters :comments)) 1497 (org-export-handle-comments (plist-get parameters :comments))
1417 1498
1418 ;; Find matches for radio targets and turn them into internal links
1419 (org-export-mark-radio-links)
1420
1421 ;; Find all links that contain a newline and put them into a single line
1422 (org-export-concatenate-multiline-links)
1423
1424 ;; Normalize links: Convert angle and plain links into bracket links
1425 ;; and expand link abbreviations
1426 (org-export-normalize-links)
1427
1428 ;; Find all internal links. If they have a fuzzy match (i.e. not
1429 ;; a *dedicated* target match, let the link point to the
1430 ;; corresponding section.
1431 (org-export-target-internal-links target-alist)
1432
1433 ;; Find multiline emphasis and put them into single line
1434 (when (plist-get parameters :emph-multiline)
1435 (org-export-concatenate-multiline-emphasis))
1436 1499
1437 (setq rtn (buffer-string))) 1500 (setq rtn (buffer-string)))
1438 (kill-buffer " org-mode-tmp") 1501 (kill-buffer " org-mode-tmp")
1439 rtn)) 1502 rtn))
1440 1503
1543 "\\|") 1606 "\\|")
1544 "\\):[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n"))) 1607 "\\):[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n")))
1545 (while (re-search-forward re nil t) 1608 (while (re-search-forward re nil t)
1546 (replace-match ""))))) 1609 (replace-match "")))))
1547 1610
1611 (defun org-export-handle-export-tags (select-tags exclude-tags)
1612 "Modify the buffer, honoring SELECT-TAGS and EXCLUDE-TAGS.
1613 Both arguments are lists of tags.
1614 If any of SELECT-TAGS is found, all trees not marked by a SELECT-TAG
1615 will be removed.
1616 After that, all subtrees that are marked by EXCLUDE-TAGS will be
1617 removed as well."
1618 (remove-text-properties (point-min) (point-max) '(:org-delete t))
1619 (let* ((re-sel (concat ":\\(" (mapconcat 'regexp-quote
1620 select-tags "\\|")
1621 "\\):"))
1622 (re-excl (concat ":\\(" (mapconcat 'regexp-quote
1623 exclude-tags "\\|")
1624 "\\):"))
1625 beg end cont)
1626 (goto-char (point-min))
1627 (when (and select-tags
1628 (re-search-forward
1629 (concat "^\\*+[ \t].*" re-sel "[^ \t\n]*[ \t]*$") nil t))
1630 ;; At least one tree is marked for export, this means
1631 ;; all the unmarked stuff needs to go.
1632 ;; Dig out the trees that should be exported
1633 (goto-char (point-min))
1634 (outline-next-heading)
1635 (setq beg (point))
1636 (put-text-property beg (point-max) :org-delete t)
1637 (while (re-search-forward re-sel nil t)
1638 (when (org-on-heading-p)
1639 (org-back-to-heading)
1640 (remove-text-properties
1641 (max (1- (point)) (point-min))
1642 (setq cont (save-excursion (org-end-of-subtree t t)))
1643 '(:org-delete t))
1644 (while (and (org-up-heading-safe)
1645 (get-text-property (point) :org-delete))
1646 (remove-text-properties (max (1- (point)) (point-min))
1647 (point-at-eol) '(:org-delete t)))
1648 (goto-char cont))))
1649 ;; Remove the trees explicitly marked for noexport
1650 (when exclude-tags
1651 (goto-char (point-min))
1652 (while (re-search-forward re-excl nil t)
1653 (when (org-at-heading-p)
1654 (org-back-to-heading t)
1655 (setq beg (point))
1656 (org-end-of-subtree t)
1657 (delete-region beg (point)))))
1658 ;; Remove everything that is now still marked for deletion
1659 (goto-char (point-min))
1660 (while (setq beg (text-property-any (point-min) (point-max) :org-delete t))
1661 (setq end (or (next-single-property-change beg :org-delete)
1662 (point-max)))
1663 (delete-region beg end))))
1664
1548 (defun org-export-remove-archived-trees (export-archived-trees) 1665 (defun org-export-remove-archived-trees (export-archived-trees)
1549 "Remove archived trees. 1666 "Remove archived trees.
1550 When EXPORT-ARCHIVED-TREES is `headline;, only the headline will be exported. 1667 When EXPORT-ARCHIVED-TREES is `headline;, only the headline will be exported.
1551 When it is t, the entire archived tree will be exported. 1668 When it is t, the entire archived tree will be exported.
1552 When it is nil the entire tree including the headline will be removed 1669 When it is nil the entire tree including the headline will be removed
1580 (while (re-search-forward org-verbatim-re nil t) 1697 (while (re-search-forward org-verbatim-re nil t)
1581 (add-text-properties (match-beginning 4) (match-end 4) 1698 (add-text-properties (match-beginning 4) (match-end 4)
1582 '(org-protected t)) 1699 '(org-protected t))
1583 (goto-char (1+ (match-end 4))))) 1700 (goto-char (1+ (match-end 4)))))
1584 1701
1585 (defun org-export-protect-examples () 1702 (defun org-export-protect-examples (&optional indent)
1586 "Protect code that should be exported as monospaced examples." 1703 "Protect code that should be exported as monospaced examples."
1587 (goto-char (point-min)) 1704 (goto-char (point-min))
1588 (while (re-search-forward "^#\\+BEGIN_EXAMPLE[ \t]*\n" nil t) 1705 (while (re-search-forward "^#\\+BEGIN_EXAMPLE[ \t]*\n" nil t)
1589 (goto-char (match-end 0)) 1706 (goto-char (match-end 0))
1590 (while (and (not (looking-at "#\\+END_EXAMPLE")) (not (eobp))) 1707 (while (and (not (looking-at "#\\+END_EXAMPLE")) (not (eobp)))
1591 (insert ": ") 1708 (insert (if indent ": " ":"))
1592 (beginning-of-line 2))) 1709 (beginning-of-line 2)))
1593 (goto-char (point-min)) 1710 (goto-char (point-min))
1594 (while (re-search-forward "^[ \t]*:.*\\(\n[ \t]*:.*\\)*" nil t) 1711 (while (re-search-forward "^[ \t]*:.*\\(\n[ \t]*:.*\\)*" nil t)
1595 (add-text-properties (match-beginning 0) (match-end 0) 1712 (add-text-properties (match-beginning 0) (match-end 0)
1596 '(org-protected t)))) 1713 '(org-protected t))))
1761 (defun org-export-grab-title-from-buffer () 1878 (defun org-export-grab-title-from-buffer ()
1762 "Get a title for the current document, from looking at the buffer." 1879 "Get a title for the current document, from looking at the buffer."
1763 (let ((inhibit-read-only t)) 1880 (let ((inhibit-read-only t))
1764 (save-excursion 1881 (save-excursion
1765 (goto-char (point-min)) 1882 (goto-char (point-min))
1766 (let ((end (save-excursion (outline-next-heading) (point)))) 1883 (let ((end (if (looking-at org-outline-regexp)
1884 (point)
1885 (save-excursion (outline-next-heading) (point)))))
1767 (when (re-search-forward "^[ \t]*[^|# \t\r\n].*\n" end t) 1886 (when (re-search-forward "^[ \t]*[^|# \t\r\n].*\n" end t)
1768 ;; Mark the line so that it will not be exported as normal text. 1887 ;; Mark the line so that it will not be exported as normal text.
1769 (org-unmodified 1888 (org-unmodified
1770 (add-text-properties (match-beginning 0) (match-end 0) 1889 (add-text-properties (match-beginning 0) (match-end 0)
1771 (list :org-license-to-kill t))) 1890 (list :org-license-to-kill t)))
2102 :for-ascii t 2221 :for-ascii t
2103 :skip-before-1st-heading 2222 :skip-before-1st-heading
2104 (plist-get opt-plist :skip-before-1st-heading) 2223 (plist-get opt-plist :skip-before-1st-heading)
2105 :drawers (plist-get opt-plist :drawers) 2224 :drawers (plist-get opt-plist :drawers)
2106 :verbatim-multiline t 2225 :verbatim-multiline t
2226 :select-tags (plist-get opt-plist :select-tags)
2227 :exclude-tags (plist-get opt-plist :exclude-tags)
2107 :archived-trees 2228 :archived-trees
2108 (plist-get opt-plist :archived-trees) 2229 (plist-get opt-plist :archived-trees)
2109 :add-text (plist-get opt-plist :text)) 2230 :add-text (plist-get opt-plist :text))
2110 "\n")) 2231 "\n"))
2111 thetoc have-headings first-heading-pos 2232 thetoc have-headings first-heading-pos
2461 "#+TITLE: %s 2582 "#+TITLE: %s
2462 #+AUTHOR: %s 2583 #+AUTHOR: %s
2463 #+EMAIL: %s 2584 #+EMAIL: %s
2464 #+DATE: %s 2585 #+DATE: %s
2465 #+LANGUAGE: %s 2586 #+LANGUAGE: %s
2466 #+TEXT: Some descriptive text to be emitted. Several lines OK.
2467 #+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 2587 #+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
2468 %s 2588 %s
2589 #+EXPORT_SELECT_TAGS: %s
2590 #+EXPORT_EXCUDE_TAGS: %s
2469 #+LINK_UP: %s 2591 #+LINK_UP: %s
2470 #+LINK_HOME: %s 2592 #+LINK_HOME: %s
2471 #+CATEGORY: %s 2593 #+CATEGORY: %s
2472 #+SEQ_TODO: %s 2594 #+SEQ_TODO: %s
2473 #+TYP_TODO: %s 2595 #+TYP_TODO: %s
2478 #+FILETAGS: %s 2600 #+FILETAGS: %s
2479 #+ARCHIVE: %s 2601 #+ARCHIVE: %s
2480 #+LINK: %s 2602 #+LINK: %s
2481 " 2603 "
2482 (buffer-name) (user-full-name) user-mail-address 2604 (buffer-name) (user-full-name) user-mail-address
2483 (format-time-string (car org-time-stamp-formats)) 2605 (format-time-string (substring (car org-time-stamp-formats) 1 -1))
2484 org-export-default-language 2606 org-export-default-language
2485 org-export-headline-levels 2607 org-export-headline-levels
2486 org-export-with-section-numbers 2608 org-export-with-section-numbers
2487 org-export-with-toc 2609 org-export-with-toc
2488 org-export-preserve-breaks 2610 org-export-preserve-breaks
2497 org-export-with-LaTeX-fragments 2619 org-export-with-LaTeX-fragments
2498 org-export-skip-text-before-1st-heading 2620 org-export-skip-text-before-1st-heading
2499 org-export-with-drawers 2621 org-export-with-drawers
2500 org-export-with-tags 2622 org-export-with-tags
2501 (if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "") 2623 (if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "")
2624 (mapconcat 'identity org-export-select-tags " ")
2625 (mapconcat 'identity org-export-exclude-tags " ")
2502 org-export-html-link-up 2626 org-export-html-link-up
2503 org-export-html-link-home 2627 org-export-html-link-home
2504 (file-name-nondirectory buffer-file-name) 2628 (file-name-nondirectory buffer-file-name)
2505 "TODO FEEDBACK VERIFY DONE" 2629 "TODO FEEDBACK VERIFY DONE"
2506 "Me Jason Marie DONE" 2630 "Me Jason Marie DONE"
2767 :skip-before-1st-heading 2891 :skip-before-1st-heading
2768 (plist-get opt-plist :skip-before-1st-heading) 2892 (plist-get opt-plist :skip-before-1st-heading)
2769 :drawers (plist-get opt-plist :drawers) 2893 :drawers (plist-get opt-plist :drawers)
2770 :archived-trees 2894 :archived-trees
2771 (plist-get opt-plist :archived-trees) 2895 (plist-get opt-plist :archived-trees)
2896 :select-tags (plist-get opt-plist :select-tags)
2897 :exclude-tags (plist-get opt-plist :exclude-tags)
2772 :add-text 2898 :add-text
2773 (plist-get opt-plist :text) 2899 (plist-get opt-plist :text)
2774 :LaTeX-fragments 2900 :LaTeX-fragments
2775 (plist-get opt-plist :LaTeX-fragments)) 2901 (plist-get opt-plist :LaTeX-fragments))
2776 "[\r\n]")) 2902 "[\r\n]"))
2928 (setq thetoc (if have-headings (nreverse thetoc) nil)))) 3054 (setq thetoc (if have-headings (nreverse thetoc) nil))))
2929 3055
2930 (setq head-count 0) 3056 (setq head-count 0)
2931 (org-init-section-numbers) 3057 (org-init-section-numbers)
2932 3058
3059 (org-open-par)
3060
2933 (while (setq line (pop lines) origline line) 3061 (while (setq line (pop lines) origline line)
2934 (catch 'nextline 3062 (catch 'nextline
2935 3063
2936 ;; end of quote section? 3064 ;; end of quote section?
2937 (when (and inquote (string-match "^\\*+ " line)) 3065 (when (and inquote (string-match "^\\*+ " line))
2992 (insert "</p>\n") 3120 (insert "</p>\n")
2993 (setq inverse nil) 3121 (setq inverse nil)
2994 (throw 'nextline nil)) 3122 (throw 'nextline nil))
2995 (when inverse 3123 (when inverse
2996 (let ((i (org-get-string-indentation line))) 3124 (let ((i (org-get-string-indentation line)))
2997 (if (> i 0) 3125 (if (> i 0)
2998 (setq line (concat (mapconcat 'identity 3126 (setq line (concat (mapconcat 'identity
2999 (make-list (* 2 i) "\\nbsp") "") 3127 (make-list (* 2 i) "\\nbsp") "")
3000 " " (org-trim line)))) 3128 " " (org-trim line))))
3001 (setq line (concat line " \\\\")))) 3129 (setq line (concat line " \\\\"))))
3002 3130
3003 ;; make targets to anchors 3131 ;; make targets to anchors
3004 (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line) 3132 (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line)
3005 (cond 3133 (cond
3006 ((match-end 2) 3134 ((match-end 2)
3304 (setq local-list-indent nil 3432 (setq local-list-indent nil
3305 in-local-list nil)) 3433 in-local-list nil))
3306 (org-html-level-start 1 nil umax 3434 (org-html-level-start 1 nil umax
3307 (and org-export-with-toc (<= level umax)) 3435 (and org-export-with-toc (<= level umax))
3308 head-count) 3436 head-count)
3309 ;; the </div> to lose the last text-... div. 3437 ;; the </div> to close the last text-... div.
3310 (insert "</div>\n") 3438 (insert "</div>\n")
3311 3439
3312 (unless body-only 3440 (unless body-only
3313 (when (plist-get opt-plist :auto-postamble) 3441 (when (plist-get opt-plist :auto-postamble)
3314 (insert "<div id=\"postamble\">") 3442 (insert "<div id=\"postamble\">")
3327 (when (and date org-export-time-stamp-file) 3455 (when (and date org-export-time-stamp-file)
3328 (insert "<p class=\"date\"> " 3456 (insert "<p class=\"date\"> "
3329 (nth 2 lang-words) ": " 3457 (nth 2 lang-words) ": "
3330 date "</p>\n")) 3458 date "</p>\n"))
3331 (when org-export-creator-info 3459 (when org-export-creator-info
3332 (insert (format "<p>HTML generated by org-mode %s in emacs %s<\p>\n" 3460 (insert (format "<p>HTML generated by org-mode %s in emacs %s</p>\n"
3333 org-version emacs-major-version))) 3461 org-version emacs-major-version)))
3334 (insert "</div>")) 3462 (insert "</div>"))
3335 3463
3336 (if org-export-html-with-timestamp 3464 (if org-export-html-with-timestamp
3337 (insert org-export-html-html-helper-timestamp)) 3465 (insert org-export-html-html-helper-timestamp))
3338 (insert (or (plist-get opt-plist :postamble) "")) 3466 (insert (or (plist-get opt-plist :postamble) ""))
3339 (insert "</body>\n</html>\n")) 3467 (insert "</body>\n</html>\n"))
3340 3468
3341 (normal-mode) 3469 (unless (plist-get opt-plist :buffer-will-be-killed)
3342 (if (eq major-mode default-major-mode) (html-mode)) 3470 (normal-mode)
3471 (if (eq major-mode default-major-mode) (html-mode)))
3343 3472
3344 ;; insert the table of contents 3473 ;; insert the table of contents
3345 (goto-char (point-min)) 3474 (goto-char (point-min))
3346 (when thetoc 3475 (when thetoc
3347 (if (or (re-search-forward 3476 (if (or (re-search-forward
3787 (setq s (org-export-html-convert-special-strings s))) 3916 (setq s (org-export-html-convert-special-strings s)))
3788 (if org-export-with-sub-superscripts 3917 (if org-export-with-sub-superscripts
3789 (setq s (org-export-html-convert-sub-super s))) 3918 (setq s (org-export-html-convert-sub-super s)))
3790 (if org-export-with-TeX-macros 3919 (if org-export-with-TeX-macros
3791 (let ((start 0) wd ass) 3920 (let ((start 0) wd ass)
3792 (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)" s start)) 3921 (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?"
3922 s start))
3793 (if (get-text-property (match-beginning 0) 'org-protected s) 3923 (if (get-text-property (match-beginning 0) 'org-protected s)
3794 (setq start (match-end 0)) 3924 (setq start (match-end 0))
3795 (setq wd (match-string 1 s)) 3925 (setq wd (match-string 1 s))
3796 (if (setq ass (assoc wd org-html-entities)) 3926 (if (setq ass (assoc wd org-html-entities))
3797 (setq s (replace-match (or (cdr ass) 3927 (setq s (replace-match (or (cdr ass)
4072 (dts (org-ical-ts-to-string 4202 (dts (org-ical-ts-to-string
4073 (format-time-string (cdr org-time-stamp-formats) (current-time)) 4203 (format-time-string (cdr org-time-stamp-formats) (current-time))
4074 "DTSTART")) 4204 "DTSTART"))
4075 hd ts ts2 state status (inc t) pos b sexp rrule 4205 hd ts ts2 state status (inc t) pos b sexp rrule
4076 scheduledp deadlinep todo prefix due start 4206 scheduledp deadlinep todo prefix due start
4077 tmp pri category entry location summary desc uid 4207 tmp pri categories entry location summary desc uid
4078 (sexp-buffer (get-buffer-create "*ical-tmp*"))) 4208 (sexp-buffer (get-buffer-create "*ical-tmp*")))
4079 (org-refresh-category-properties) 4209 (org-refresh-category-properties)
4080 (save-excursion 4210 (save-excursion
4081 (goto-char (point-min)) 4211 (goto-char (point-min))
4082 (while (re-search-forward re1 nil t) 4212 (while (re-search-forward re1 nil t)
4103 location (org-icalendar-cleanup-string 4233 location (org-icalendar-cleanup-string
4104 (org-entry-get nil "LOCATION")) 4234 (org-entry-get nil "LOCATION"))
4105 uid (if org-icalendar-store-UID 4235 uid (if org-icalendar-store-UID
4106 (org-id-get-create) 4236 (org-id-get-create)
4107 (or (org-id-get) (org-id-new))) 4237 (or (org-id-get) (org-id-new)))
4108 category (org-get-category) 4238 categories (org-export-get-categories)
4109 deadlinep nil scheduledp nil) 4239 deadlinep nil scheduledp nil)
4110 (if (looking-at re2) 4240 (if (looking-at re2)
4111 (progn 4241 (progn
4112 (goto-char (match-end 0)) 4242 (goto-char (match-end 0))
4113 (setq ts2 (match-string 1) 4243 (setq ts2 (match-string 1)
4175 rrule summary 4305 rrule summary
4176 (if (and desc (string-match "\\S-" desc)) 4306 (if (and desc (string-match "\\S-" desc))
4177 (concat "\nDESCRIPTION: " desc) "") 4307 (concat "\nDESCRIPTION: " desc) "")
4178 (if (and location (string-match "\\S-" location)) 4308 (if (and location (string-match "\\S-" location))
4179 (concat "\nLOCATION: " location) "") 4309 (concat "\nLOCATION: " location) "")
4180 category))))) 4310 categories)))))
4181 (when (and org-icalendar-include-sexps 4311 (when (and org-icalendar-include-sexps
4182 (condition-case nil (require 'icalendar) (error nil)) 4312 (condition-case nil (require 'icalendar) (error nil))
4183 (fboundp 'icalendar-export-region)) 4313 (fboundp 'icalendar-export-region))
4184 ;; Get all the literal sexps 4314 ;; Get all the literal sexps
4185 (goto-char (point-min)) 4315 (goto-char (point-min))
4226 (org-entry-get nil "LOCATION")) 4356 (org-entry-get nil "LOCATION"))
4227 due (and (member 'todo-due org-icalendar-use-deadline) 4357 due (and (member 'todo-due org-icalendar-use-deadline)
4228 (org-entry-get nil "DEADLINE")) 4358 (org-entry-get nil "DEADLINE"))
4229 start (and (member 'todo-start org-icalendar-use-scheduled) 4359 start (and (member 'todo-start org-icalendar-use-scheduled)
4230 (org-entry-get nil "SCHEDULED")) 4360 (org-entry-get nil "SCHEDULED"))
4361 categories (org-export-get-categories)
4231 uid (if org-icalendar-store-UID 4362 uid (if org-icalendar-store-UID
4232 (org-id-get-create) 4363 (org-id-get-create)
4233 (or (org-id-get) (org-id-new)))) 4364 (or (org-id-get) (org-id-new))))
4234 (and due (setq due (org-ical-ts-to-string due "DUE"))) 4365 (and due (setq due (org-ical-ts-to-string due "DUE")))
4235 (and start (setq start (org-ical-ts-to-string start "DTSTART"))) 4366 (and start (setq start (org-ical-ts-to-string start "DTSTART")))
4261 (if (and location (string-match "\\S-" location)) 4392 (if (and location (string-match "\\S-" location))
4262 (concat "\nLOCATION: " location) "") 4393 (concat "\nLOCATION: " location) "")
4263 (if (and desc (string-match "\\S-" desc)) 4394 (if (and desc (string-match "\\S-" desc))
4264 (concat "\nDESCRIPTION: " desc) "") 4395 (concat "\nDESCRIPTION: " desc) "")
4265 (if due (concat "\n" due) "") 4396 (if due (concat "\n" due) "")
4266 category 4397 categories
4267 pri status))))))))) 4398 pri status)))))))))
4399
4400 (defun org-export-get-categories ()
4401 "Get categories according to `org-icalendar-categories'."
4402 (let ((cs org-icalendar-categories) c rtn tmp)
4403 (while (setq c (pop cs))
4404 (cond
4405 ((eq c 'category) (push (org-get-category) rtn))
4406 ((eq c 'todo-state)
4407 (setq tmp (org-get-todo-state))
4408 (and tmp (push tmp rtn)))
4409 ((eq c 'local-tags)
4410 (setq rtn (append (nreverse (org-get-local-tags-at (point))) rtn)))
4411 ((eq c 'all-tags)
4412 (setq rtn (append (nreverse (org-get-tags-at (point))) rtn)))))
4413 (mapconcat 'identity (nreverse rtn) ",")))
4268 4414
4269 (defun org-icalendar-cleanup-string (s &optional is-body maxlength) 4415 (defun org-icalendar-cleanup-string (s &optional is-body maxlength)
4270 "Take out stuff and quote what needs to be quoted. 4416 "Take out stuff and quote what needs to be quoted.
4271 When IS-BODY is non-nil, assume that this is the body of an item, clean up 4417 When IS-BODY is non-nil, assume that this is the body of an item, clean up
4272 whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH 4418 whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH