diff --git a/lisp/org-clock.el b/lisp/org-clock.el index e6e4dbe89..1bf53c329 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -26,11 +26,11 @@ ;; This file contains the time clocking code for Org-mode -(require 'org-exp) ;;; Code: (eval-when-compile (require 'cl)) +(require 'org) (declare-function calendar-absolute-from-iso "cal-iso" (&optional date)) (declare-function notifications-notify "notifications" (&rest params)) @@ -273,7 +273,7 @@ string as argument." (defcustom org-clocktable-defaults (list :maxlevel 2 - :lang org-export-default-language + :lang (or (org-bound-and-true-p org-export-default-language) "en") :scope 'file :block nil :wstart 1 @@ -2317,7 +2317,8 @@ from the dynamic block definition." ;; well-defined number of columns... (let* ((hlchars '((1 . "*") (2 . "/"))) (lwords (assoc (or (plist-get params :lang) - org-export-default-language) + (org-bound-and-true-p org-export-default-language) + "en") org-clock-clocktable-language-setup)) (multifile (plist-get params :multifile)) (block (plist-get params :block)) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 4cde24bf5..ec3baf25a 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -42,8 +42,6 @@ (declare-function org-back-to-heading "org" (&optional invisible-ok)) (declare-function org-combine-plists "org" (&rest plists)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) -(declare-function org-export-preprocess-string "org-exp" - (string &rest parameters)) (declare-function org-fill-paragraph "org" (&optional justify)) (declare-function org-icompleting-read "org" (&rest args)) (declare-function org-id-uuid "org-id" ()) @@ -96,15 +94,19 @@ :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 -outline node. If can also be the name of a special outline heading -under which footnotes should be put. + "Outline heading containing footnote definitions. + +This can be nil, to place footnotes locally at the end of the +current outline node. If can also be the name of a special +outline heading under which footnotes should be put. + This variable defines the place where Org puts the definition -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." +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 ignored." :group 'org-footnote :type '(choice (string :tag "Collect footnotes under heading") @@ -182,8 +184,6 @@ extracted will be filled again." (not (or (org-in-commented-line) (org-in-indented-comment-line) (org-inside-LaTeX-fragment-p) - ;; Avoid protected environments (LaTeX export) - (get-text-property (point) 'org-protected) ;; Avoid literal example. (org-in-verbatim-emphasis) (save-excursion @@ -602,38 +602,15 @@ With prefix arg SPECIAL, offer additional commands in a menu." (org-footnote-goto-previous-reference (car tmp))) (t (org-footnote-new))))) -(defvar org-footnote-insert-pos-for-preprocessor 'point-max - "See `org-footnote-normalize'.") - -(defvar org-export-footnotes-seen) ; silence byte-compiler -(defvar org-export-footnotes-data) ; silence byte-compiler - ;;;###autoload -(defun org-footnote-normalize (&optional sort-only export-props) +(defun org-footnote-normalize (&optional sort-only) "Collect the footnotes in various formats and normalize them. This finds the different sorts of footnotes allowed in Org, and -normalizes them to the usual [N] format that is understood by the -Org-mode exporters. +normalizes them to the usual [N] format. When SORT-ONLY is set, only sort the footnote definitions into the -referenced sequence. - -If Org is amidst an export process, EXPORT-PROPS will hold the -export properties of the buffer. - -When EXPORT-PROPS is non-nil, the default action is to insert -normalized footnotes towards the end of the pre-processing -buffer. Some exporters (docbook, odt...) expect footnote -definitions to be available before any references to them. Such -exporters can let bind `org-footnote-insert-pos-for-preprocessor' -to symbol `point-min' to achieve the desired behaviour. - -Additional note on `org-footnote-insert-pos-for-preprocessor': -1. This variable has not effect when FOR-PREPROCESSOR is nil. -2. This variable (potentially) obviates the need for extra scan - of pre-processor buffer as witnessed in - `org-export-docbook-get-footnotes'." +referenced sequence." ;; This is based on Paul's function, but rewritten. ;; ;; Re-create `org-with-limited-levels', but not limited to Org @@ -643,17 +620,12 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': org-inlinetask-min-level (1- org-inlinetask-min-level))) (nstars (and limit-level - (if org-odd-levels-only - (and limit-level (1- (* limit-level 2))) + (if org-odd-levels-only (1- (* limit-level 2)) limit-level))) (org-outline-regexp (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ "))) - ;; Determine the highest marker used so far. - (ref-table (when export-props org-export-footnotes-seen)) - (count (if (and export-props ref-table) - (apply 'max (mapcar (lambda (e) (nth 1 e)) ref-table)) - 0)) - ins-point ref) + (count 0) + ins-point ref ref-table) (save-excursion ;; 1. Find every footnote reference, extract the definition, and ;; collect that data in REF-TABLE. If SORT-ONLY is nil, also @@ -675,15 +647,10 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ;; Replace footnote reference with [MARKER]. Maybe fill ;; paragraph once done. If SORT-ONLY is non-nil, only move ;; to the end of reference found to avoid matching it twice. - ;; If EXPORT-PROPS isn't nil, also add `org-footnote' - ;; property to it, so it can be easily recognized by - ;; exporters. (if sort-only (goto-char (nth 2 ref)) (delete-region (nth 1 ref) (nth 2 ref)) (goto-char (nth 1 ref)) - (let ((new-ref (format "[%d]" marker))) - (when export-props (org-add-props new-ref '(org-footnote t))) - (insert new-ref)) + (insert (format "[%d]" marker)) (and inlinep org-footnote-fill-after-inline-note-extraction (org-fill-paragraph))) @@ -691,22 +658,9 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ;; type (INLINEP) and position (POS) to REF-TABLE if data ;; was unknown. (unless a - (let ((def (or (nth 3 ref) ; inline - (and export-props - (cdr (assoc lbl org-export-footnotes-data))) + (let ((def (or (nth 3 ref) ; Inline definition. (nth 3 (org-footnote-get-definition lbl))))) - (push (list lbl marker - ;; When exporting, each definition goes - ;; through `org-export-preprocess-string' so - ;; it is ready to insert in the - ;; backend-specific buffer. - (if (and export-props def) - (let ((parameters - (org-combine-plists - export-props - '(:todo-keywords t :tags t :priority t)))) - (apply #'org-export-preprocess-string def parameters)) - def) + (push (list lbl marker def ;; Reference beginning position is a marker ;; to preserve it during further buffer ;; modifications. @@ -728,14 +682,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': (unless (bolp) (newline))) ;; No footnote section set: Footnotes will be added at the end ;; of the section containing their first reference. - ;; Nevertheless, in an export situation, set insertion point to - ;; `point-max' by default. - ((derived-mode-p 'org-mode) - (when export-props - (goto-char (point-max)) - (skip-chars-backward " \r\t\n") - (forward-line) - (delete-region (point) (point-max)))) + ((derived-mode-p 'org-mode)) (t ;; Remove any left-over tag in the buffer, if one is set up. (when org-footnote-tag-for-non-org-mode-files @@ -753,14 +700,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': (re-search-backward message-signature-separator nil t)) (beginning-of-line) (goto-char (point-max))))) - ;; During export, `org-footnote-insert-pos-for-preprocessor' has - ;; precedence over previously found position. - (setq ins-point - (copy-marker - (if (and export-props - (eq org-footnote-insert-pos-for-preprocessor 'point-min)) - (point-min) - (point)))) + (setq ins-point (point-marker)) ;; 3. Clean-up REF-TABLE. (setq ref-table (delq nil @@ -791,26 +731,22 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ;; No footnote: exit. ((not ref-table)) ;; Cases when footnotes should be inserted in one place. - ((or (not (derived-mode-p 'org-mode)) - org-footnote-section - export-props) + ((or (not (derived-mode-p 'org-mode)) org-footnote-section) ;; Insert again the section title, if any. Ensure that title, ;; or the subsequent footnotes, will be separated by a blank ;; lines from the rest of the document. In an Org buffer, ;; separate section with a blank line, unless explicitly ;; stated in `org-blank-before-new-entry'. - (cond - ((not (derived-mode-p 'org-mode)) - (skip-chars-backward " \t\n\r") - (delete-region (point) ins-point) - (unless (bolp) (newline)) - (when org-footnote-tag-for-non-org-mode-files - (insert "\n" org-footnote-tag-for-non-org-mode-files "\n"))) - ((and org-footnote-section (not export-props)) + (if (not (derived-mode-p 'org-mode)) + (progn (skip-chars-backward " \t\n\r") + (delete-region (point) ins-point) + (unless (bolp) (newline)) + (when org-footnote-tag-for-non-org-mode-files + (insert "\n" org-footnote-tag-for-non-org-mode-files "\n"))) (when (and (cdr (assq 'heading org-blank-before-new-entry)) (zerop (save-excursion (org-back-over-empty-lines)))) (insert "\n")) - (insert "* " org-footnote-section "\n"))) + (insert "* " org-footnote-section "\n")) (set-marker ins-point nil) ;; Insert the footnotes, separated by a blank line. (insert @@ -820,10 +756,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': (set-marker (nth 4 x) nil) (format "\n[%s] %s" (nth (if sort-only 0 1) x) (nth 2 x))) ref-table "\n")) - (unless (eobp) (insert "\n\n")) - ;; When exporting, add newly inserted markers along with their - ;; associated definition to `org-export-footnotes-seen'. - (when export-props (setq org-export-footnotes-seen ref-table))) + (unless (eobp) (insert "\n\n"))) ;; Each footnote definition has to be inserted at the end of ;; the section where its first reference belongs. (t diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 43913acac..112d3df20 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -27,31 +27,25 @@ ;;; Commentary: ;; ;; This module implements inline tasks in Org-mode. Inline tasks are -;; tasks that have all the properties of normal outline nodes, including -;; the ability to store meta data like scheduling dates, TODO state, tags -;; and properties. However, these nodes are treated specially by the -;; visibility cycling and export commands. +;; tasks that have all the properties of normal outline nodes, +;; including the ability to store meta data like scheduling dates, +;; TODO state, tags and properties. However, these nodes are treated +;; specially by the visibility cycling. ;; -;; Visibility cycling exempts these nodes from cycling. So whenever their -;; parent is opened, so are these tasks. This will only work with -;; `org-cycle', so if you are also using other commands to show/hide -;; entries, you will occasionally find these tasks to behave like -;; all other outline nodes, seemingly splitting the text of the parent -;; into children. +;; Visibility cycling exempts these nodes from cycling. So whenever +;; their parent is opened, so are these tasks. This will only work +;; with `org-cycle', so if you are also using other commands to +;; show/hide entries, you will occasionally find these tasks to behave +;; like all other outline nodes, seemingly splitting the text of the +;; parent into children. ;; -;; Export commands do not treat these nodes as part of the sectioning -;; structure, but as a special inline text that is either removed, or -;; formatted in some special way. This in handled by -;; `org-inlinetask-export' and `org-inlinetask-export-templates' -;; variables. +;; Special fontification of inline tasks, so that they can be +;; immediately recognized. From the stars of the headline, only the +;; first and the last two will be visible, the others will be hidden +;; using the `org-hide' face. ;; -;; Special fontification of inline tasks, so that they can be immediately -;; recognized. From the stars of the headline, only the first and the -;; last two will be visible, the others will be hidden using the -;; `org-hide' face. -;; -;; An inline task is identified solely by a minimum outline level, given -;; by the variable `org-inlinetask-min-level', default 15. +;; An inline task is identified solely by a minimum outline level, +;; given by the variable `org-inlinetask-min-level', default 15. ;; ;; If you need to have a time planning line (DEADLINE etc), drawers, ;; for example LOGBOOK of PROPERTIES, or even normal text as part of @@ -111,69 +105,6 @@ When nil, the first star is not shown." :tag "Org Inline Tasks" :group 'org-structure) -(defcustom org-inlinetask-export t - "Non-nil means export inline tasks. -When nil, they will not be exported." - :group 'org-inlinetask - :type 'boolean) - -(defvar org-inlinetask-export-templates - '((html "
%s