From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: bug in ascii export Date: Wed, 6 Feb 2013 19:28:25 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3HEA-0006yk-Ft for emacs-orgmode@gnu.org; Wed, 06 Feb 2013 21:28:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3HDv-0007Qh-MA for emacs-orgmode@gnu.org; Wed, 06 Feb 2013 21:28:42 -0500 Received: from mail-lb0-f173.google.com ([209.85.217.173]:55094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3HDv-0007QX-3U for emacs-orgmode@gnu.org; Wed, 06 Feb 2013 21:28:27 -0500 Received: by mail-lb0-f173.google.com with SMTP id gf7so1762073lbb.32 for ; Wed, 06 Feb 2013 18:28:26 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org exporting this subtree results in this bt. === *** test test === Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (&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. When SORT-ONLY is set, only sort the footnote definitions into the referenced sequence." (let* ((limit-level (and (boundp (quote org-inlinetask-min-level)) org-inlinetask-min-level (1- org-inlinetask-min-level))) (nstars (and limit-level (if org-odd-levels-only (1- (* limit-level 2)) limit-level))) (org-outline-regexp (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ "))) (count 0) ins-point ref ref-table) (save-excursion (goto-char (point-min)) (while (setq ref (org-footnote-get-next-reference)) (let* ((lbl (car ref)) (pos (nth 1 ref)) (a (and lbl (assoc lbl ref-table))) (marker (or (nth 1 a) (incf count))) (inlinep (or (stringp (nth 3 ref)) (nth 3 a)))) (if sort-only (goto-char (nth 2 ref)) (delete-region (nth 1 ref) (nth 2 ref)) (goto-char (nth 1 ref)) (insert (format "[%d]" marker)) (and inlinep org-footnote-fill-after-inline-note-extraction (org-fill-paragraph))) (unless a (let ((def (or (nth 3 ref) (nth 3 (org-footnote-get-definition lbl))))) (push (list lbl marker def inlinep (copy-marker pos)) ref-table))))) (cond ((and org-footnote-section (derived-mode-p (quote org-mode))) (goto-char (point-min)) (if (re-search-forward (concat "^\\*[ ]+" (regexp-quote org-footnote-section) "[ ]*$") nil t) (delete-region (match-beginning 0) (org-end-of-subtree t t))) (goto-char (point-max)) (skip-chars-backward " ") (forward-line) (unless (bolp) (newline))) ((derived-mode-p (quote org-mode))) (t (when org-footnote-tag-for-non-org-mode-files (let ((tag (concat "^" (regexp-quote org-footnote-tag-for-non-org-mode-files) "[ ]*$"))) (goto-char (point-min)) (while (re-search-forward tag nil t) (replace-match "") (delete-region (point) (progn (forward-line) (point)))))) (if (and (derived-mode-p (quote message-mode)) (goto-char (point-max)) (re-search-backward message-signature-separator nil t)) (beginning-of-line) (goto-char (point-max))))) (setq ins-point (point-marker)) (setq ref-table (delq nil (mapcar (lambda (x) (cond ((and sort-only (nth 3 x)) (set-marker (nth 4 x) nil) nil) ((not (nth 2 x)) (append (list (car x) (nth 1 x) (format "DEFINITION NOT FOUND: %s" (car x))) (nthcdr 3 x))) (t x))) ref-table))) (setq ref-table (nreverse ref-table)) (mapc (lambda (x) (unless (nth 3 x) (org-footnote-delete-definitions (car x)))) ref-table) (goto-char ins-point) (cond ((not ref-table)) ((or (not (derived-mode-p (quote org-mode))) org-footnote-section) (if (not (derived-mode-p (quote org-mode))) (progn (skip-chars-backward " ") (delete-region (point) ins-point) (unless (bolp) (newline)) (when org-footnote-tag-for-non-org-mode-files (insert " " org-footnote-tag-for-non-org-mode-files " "))) (when (and (cdr (assq (quote heading) org-blank-before-new-entry)) (zerop (save-excursion (org-back-over-empty-lines)))) (insert " ")) (insert "* " org-footnote-section " ")) (set-marker ins-point nil) (insert (mapconcat (lambda (x) (set-marker (nth 4 x) nil) (format " [%s] %s" (nth (if sort-only 0 1) x) (nth 2 x))) ref-table " ")) (unless (eobp) (insert " "))) (t (mapc (lambda (x) (let ((pos (nth 4 x))) (goto-char pos) (set-marker pos nil)) (org-footnote-goto-local-insertion-point) (insert (format " [%s] %s " (if sort-only (car x) (nth 1 x)) (nth 2 x)))) ref-table)))))) 2) org-footnote-normalize(nil (:for-backend ascii :skip-before-1st-heading nil :drawers nil :tags nil :priority nil :footnotes t :timestamps t :todo-keywords t :tasks nil :verbatim-multiline t :select-tags ("export") :exclude-tags ("himitsu" "noexport") :archived-trees headline :add-text nil)) (progn (org-footnote-normalize nil parameters)) (if (plist-get parameters :footnotes) (progn (org-footnote-normalize nil parameters))) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (let* ((org-export-current-backend (or (plist-get parameters :for-backend) org-export-current-backend)) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (current-buffer)) target-alist rtn) (setq org-export-target-aliases nil org-export-preferred-target-alist nil org-export-id-target-alist nil org-export-code-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) rtn) org-export-preprocess-string(#("*** test\ntest\n" 0 2 (fontified t org-category #("blog" 0 4 (fontified t face org-property-value org-category "blog")) org-category-position 26 :org-license-to-kill t face org-hide mouse-face highlight keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse))) 2 4 (fontified t org-category #("blog" 0 4 (fontified t face org-property-value org-category "blog")) org-category-position 26 :org-license-to-kill t face org-level-2 mouse-face highlight keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse))) 4 5 (fontified t face org-level-2 :org-license-to-kill t) 5 6 (fontified t face org-level-2 :org-license-to-kill t) 6 7 (fontified t face org-level-2 :org-license-to-kill t) 7 8 (fontified t face org-level-2 :org-license-to-kill t) 8 9 (fontified t :org-license-to-kill t) 9 10 (fontified t) 10 11 (fontified t) 11 12 (fontified t) 12 13 (fontified t) 13 14 (fontified t org-category #("blog" 0 4 (fontified t face org-property-value org-category "blog")) org-category-position 26)) :for-backend ascii :skip-before-1st-heading nil :drawers nil :tags nil :priority nil :footnotes t :timestamps t :todo-keywords t :tasks nil :verbatim-multiline t :select-tags ("export") :exclude-tags ("himitsu" "noexport") :archived-trees headline :add-text nil) (org-split-string (org-export-preprocess-string region :for-backend (quote ascii) :skip-before-1st-heading (plist-get opt-plist :skip-before-1st-heading) :drawers (plist-get opt-plist :drawers) :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :verbatim-multiline t :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :archived-trees (plist-get opt-plist :archived-trees) :add-text (plist-get opt-plist :text)) "\n") (let* ((opt-plist (org-combine-plists (org-default-export-plist) ext-plist (org-infile-export-plist))) (region-p (org-region-active-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (region-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when region-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>= ... rend)))))) (level-offset (if subtree-p (save-excursion (goto-char rbeg) (+ (funcall outline-level) (if org-odd-levels-only 1 0))) 0)) (opt-plist (setq org-export-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist rbeg) opt-plist))) (org-current-export-dir (or pub-dir (org-export-directory :html opt-plist))) (org-current-export-file buffer-file-name) (custom-times org-display-custom-times) (org-ascii-current-indentation (quote (0 . 0))) (level 0) line txt (umax nil) (umax-toc nil) (case-fold-search nil) (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer)))) (filename (if to-buffer nil (concat (file-name-as-directory (or pub-dir (org-export-directory :ascii opt-plist))) (file-name-sans-extension (or (and subtree-p ...) (file-name-nondirectory bfname))) ".txt"))) (filename (and filename (if (equal (file-truename filename) (file-truename bfname)) (concat filename ".txt") filename))) (buffer (if to-buffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org ASCII Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filename))) (org-levels-open (make-vector org-level-max nil)) (odd org-odd-levels-only) (date (plist-get opt-plist :date)) (author (plist-get opt-plist :author)) (title (or (and subtree-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) (and (buffer-file-name) (file-name-sans-extension (file-name-nondirectory bfname))) "UNTITLED")) (email (plist-get opt-plist :email)) (language (plist-get opt-plist :language)) (quote-re0 (concat "^\\(" org-quote-string "\\)\\( +\\|[ ]*$\\)")) (todo nil) (lang-words nil) (region (buffer-substring (if (org-region-active-p) (region-beginning) (point-min)) (if (org-region-active-p) (region-end) (point-max)))) (org-export-footnotes-seen nil) (org-export-footnotes-data (org-footnote-all-labels (quote with-defs))) (lines (org-split-string (org-export-preprocess-string region :for-backend (quote ascii) :skip-before-1st-heading (plist-get opt-plist :skip-before-1st-heading) :drawers (plist-get opt-plist :drawers) :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :verbatim-multiline t :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :archived-trees (plist-get opt-plist :archived-trees) :add-text (plist-get opt-plist :text)) "\n")) thetoc have-headings first-heading-pos table-open table-buffer link-buffer link type path desc desc0 rpl wrap fnc) (let ((inhibit-read-only t)) (org-unmodified (remove-text-properties (point-min) (point-max) (quote (:org-license-to-kill t))))) (setq org-min-level (org-get-min-level lines level-offset)) (setq org-last-level org-min-level) (org-init-section-numbers) (setq lang-words (or (assoc language org-export-language-setup) (assoc "en" org-export-language-setup))) (set-buffer buffer) (erase-buffer) (fundamental-mode) (org-install-letbind) (mapc (lambda (x) (set (make-local-variable (nth 2 x)) (plist-get opt-plist (car x)))) org-export-plist-vars) (org-set-local (quote org-odd-levels-only) odd) (setq umax (if arg (prefix-numeric-value arg) org-export-headline-levels)) (setq umax-toc (if (integerp org-export-with-toc) (min org-export-with-toc umax) umax)) (unless body-only (when (and title (not (string= "" title))) (org-insert-centered title 61) (insert "\n")) (if (and (or author email) org-export-author-info) (insert (concat (nth 1 lang-words) ": " (or author "") (if (and org-export-email-info email (string-match "\\S-" email)) (concat " <" email ">") "") "\n"))) (cond ((and date (string-match "%" date)) (setq date (format-time-string date))) (date) (t (setq date (format-time-string "%Y-%m-%d %T %Z")))) (if (and date org-export-time-stamp-file) (insert (concat (nth 2 lang-words) ": " date "\n"))) (unless (= (point) (point-min)) (insert "\n\n"))) (if (and org-export-with-toc (not body-only)) (progn (push (concat (nth 3 lang-words) "\n") thetoc) (push (concat (make-string (string-width (nth 3 lang-words)) 61) "\n") thetoc) (mapc (function (lambda (line) (if (string-match org-todo-line-regexp line) (progn ... ... ... ... ... ... ... ...)))) lines) (setq thetoc (if have-headings (nreverse thetoc) nil)))) (org-init-section-numbers) (while (setq line (pop lines)) (when (and link-buffer (string-match org-outline-regexp-bol line)) (org-export-ascii-push-links (nreverse link-buffer)) (setq link-buffer nil)) (setq wrap nil) (setq line (org-html-expand-for-ascii line)) (while (string-match org-bracket-link-analytic-regexp++ line) (setq path (match-string 3 line) link (concat (match-string 1 line) path) type (match-string 2 line) desc0 (match-string 5 line) desc0 (replace-regexp-in-string "\\\\_" "_" desc0) desc (or desc0 link) desc (replace-regexp-in-string "\\\\_" "_" desc)) (if (and (> (length link) 8) (equal (substring link 0 8) "coderef:")) (setq line (replace-match (format (org-export-get-coderef-format ... desc) (cdr ...)) t t line)) (setq rpl (concat "[" desc "]")) (if (functionp (setq fnc (nth 2 ...))) (setq rpl (or (save-match-data ...) rpl)) (when (and desc0 (not ...)) (if org-export-ascii-links-to-notes (push ... link-buffer) (setq rpl ... wrap ...)))) (setq line (replace-match rpl t t line)))) (when custom-times (setq line (org-translate-time line))) (cond ((string-match "^\\(\\*+\\)[ ]+\\(.*\\)" line) (setq first-heading-pos (or first-heading-pos (point))) (setq level (org-tr-level (- (match-end 1) (match-beginning 1) level-offset)) txt (match-string 2 line)) (org-ascii-level-start level txt umax lines)) ((and org-export-with-tables (string-match "^\\([ ]*\\)\\(|\\|\\+-+\\+\\)" line)) (if (not table-open) (setq table-open t table-buffer nil)) (setq table-buffer (cons line table-buffer)) (when (or (not lines) (not (string-match "^\\([ ]*\\)\\(|\\|\\+-+\\+\\)" ...))) (setq table-open nil table-buffer (nreverse table-buffer)) (insert (mapconcat (lambda ... ...) (org-format-table-ascii table-buffer) "\n") "\n"))) (t (if (string-match "^\\([ ]*\\)\\([-+*][ ]+\\)\\(.*?\\)\\( ::\\)" line) (setq line (replace-match "\\1\\3:" t nil line))) (setq line (org-fix-indentation line org-ascii-current-indentation)) (if (string-match "\\\\\\\\[ ]*$" line) (setq line (replace-match "" t t line))) (if (and org-export-with-fixed-width (string-match "^\\([ ]*\\)\\(:\\( \\|$\\)\\)" line)) (setq line (replace-match "\\1" nil nil line)) (if wrap (setq line (org-export-ascii-wrap line wrap)))) (insert line "\n")))) (org-export-ascii-push-links (nreverse link-buffer)) (normal-mode) (when thetoc (goto-char (point-min)) (if (re-search-forward "^[ ]*\\[TABLE-OF-CONTENTS\\][ ]*$" nil t) (progn (goto-char (match-beginning 0)) (replace-match "")) (goto-char first-heading-pos)) (mapc (quote insert) thetoc) (or (looking-at "[ ]*\n[ ]*\n") (insert "\n\n"))) (goto-char (point-min)) (let (beg end) (while (setq beg (next-single-property-change (point) (quote org-whitespace))) (setq end (next-single-property-change beg (quote org-whitespace))) (goto-char beg) (delete-region beg end) (insert (make-string (- end beg) 32)))) (let (beg end) (goto-char (point-min)) (while (setq beg (next-single-property-change (point) (quote display))) (setq end (next-single-property-change beg (quote display))) (delete-region beg end) (goto-char beg) (insert "=>")) (goto-char (point-min)) (while (setq beg (next-single-property-change (point) (quote org-cwidth))) (setq end (next-single-property-change beg (quote org-cwidth))) (delete-region beg end) (goto-char beg))) (run-hooks (quote org-export-ascii-final-hook)) (or to-buffer (save-buffer)) (goto-char (point-min)) (or (org-export-push-to-kill-ring "ASCII") (message "Exporting... done")) (if (eq to-buffer (quote string)) (prog1 (buffer-substring (point-min) (point-max)) (kill-buffer (current-buffer))) (current-buffer))) org-export-as-ascii(nil nil "*Org ASCII Export*") org-export-as-ascii-to-buffer(nil) -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. ANYBODY can get it. There is no hope without action.