forked from mirrors/org-mode
org-lparse/org-odt: Add docstring. Silence byte-compiler
I am attaching two org-odt patches for inclusion. Both are desirable and not mandatory.
This commit is contained in:
parent
43a380708e
commit
23c8be4518
|
@ -50,8 +50,6 @@
|
||||||
;;; See README.org file that comes with this library for answers to
|
;;; See README.org file that comes with this library for answers to
|
||||||
;;; FAQs and more information on using this library.
|
;;; FAQs and more information on using this library.
|
||||||
|
|
||||||
;;; Use M-x `org-odt-unit-test' for test driving the odt exporter
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'org-exp)
|
(require 'org-exp)
|
||||||
|
@ -59,10 +57,11 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-lparse-and-open (target-backend native-backend arg)
|
(defun org-lparse-and-open (target-backend native-backend arg)
|
||||||
"Export the outline as HTML and immediately open it with a browser.
|
"Export the outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file.
|
||||||
If there is an active region, export only the region.
|
If there is an active region, export only the region. The prefix
|
||||||
The prefix ARG specifies how many levels of the outline should become
|
ARG specifies how many levels of the outline should become
|
||||||
headlines. The default is 3. Lower levels will become bulleted lists."
|
headlines. The default is 3. Lower levels will become bulleted
|
||||||
|
lists."
|
||||||
;; (interactive "Mbackend: \nP")
|
;; (interactive "Mbackend: \nP")
|
||||||
(interactive
|
(interactive
|
||||||
(let* ((input (if (featurep 'ido) 'ido-completing-read 'completing-read))
|
(let* ((input (if (featurep 'ido) 'ido-completing-read 'completing-read))
|
||||||
|
@ -102,8 +101,9 @@ emacs --batch
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-lparse-to-buffer (backend arg)
|
(defun org-lparse-to-buffer (backend arg)
|
||||||
"Call `org-lparse` with output to a temporary buffer.
|
"Call `org-lparse' with output to a temporary buffer.
|
||||||
No file is created. The prefix ARG is passed through to `org-lparse'."
|
No file is created. The prefix ARG is passed through to
|
||||||
|
`org-lparse'."
|
||||||
(interactive "Mbackend: \nP")
|
(interactive "Mbackend: \nP")
|
||||||
(let ((tempbuf (format "*Org %s Export*" (upcase backend))))
|
(let ((tempbuf (format "*Org %s Export*" (upcase backend))))
|
||||||
(org-lparse backend backend arg nil nil tempbuf)
|
(org-lparse backend backend arg nil nil tempbuf)
|
||||||
|
@ -508,9 +508,36 @@ then that converter is used. Otherwise
|
||||||
(defvar org-lparse-toc)
|
(defvar org-lparse-toc)
|
||||||
(defvar org-lparse-entity-control-callbacks-alist)
|
(defvar org-lparse-entity-control-callbacks-alist)
|
||||||
(defvar org-lparse-entity-format-callbacks-alist)
|
(defvar org-lparse-entity-format-callbacks-alist)
|
||||||
(defvar org-lparse-backend)
|
(defvar org-lparse-backend nil
|
||||||
(defvar org-lparse-body-only)
|
"The native backend to which the document is currently exported.
|
||||||
(defvar org-lparse-to-buffer)
|
This variable is let bound during `org-lparse'. Valid values are
|
||||||
|
one of the symbols corresponding to `org-lparse-native-backends'.
|
||||||
|
|
||||||
|
Compare this variable with `org-export-current-backend' which is
|
||||||
|
bound only during `org-export-preprocess-string' stage of the
|
||||||
|
export process.
|
||||||
|
|
||||||
|
See also `org-lparse-other-backend'.")
|
||||||
|
|
||||||
|
(defvar org-lparse-other-backend nil
|
||||||
|
"The target backend to which the document is currently exported.
|
||||||
|
This variable is let bound during `org-lparse'. This variable is
|
||||||
|
set to either `org-lparse-backend' or one of the symbols
|
||||||
|
corresponding to OTHER-BACKENDS specification of the
|
||||||
|
org-lparse-backend.
|
||||||
|
|
||||||
|
For example, if a document is exported to \"odt\" then both
|
||||||
|
org-lparse-backend and org-lparse-other-backend are bound to
|
||||||
|
'odt. On the other hand, if a document is exported to \"odt\"
|
||||||
|
and then converted to \"doc\" then org-lparse-backend is set to
|
||||||
|
'odt and org-lparse-other-backend is set to 'doc.")
|
||||||
|
|
||||||
|
(defvar org-lparse-body-only nil
|
||||||
|
"Bind this to BODY-ONLY arg of `org-lparse'.")
|
||||||
|
|
||||||
|
(defvar org-lparse-to-buffer nil
|
||||||
|
"Bind this to TO-BUFFER arg of `org-lparse'.")
|
||||||
|
|
||||||
(defun org-do-lparse (arg &optional hidden ext-plist
|
(defun org-do-lparse (arg &optional hidden ext-plist
|
||||||
to-buffer body-only pub-dir)
|
to-buffer body-only pub-dir)
|
||||||
"Export the outline to various formats.
|
"Export the outline to various formats.
|
||||||
|
@ -1240,6 +1267,7 @@ But it has the disadvantage, that no cell- or row-spanning is allowed."
|
||||||
(org-lparse-do-format-table-table lines)
|
(org-lparse-do-format-table-table lines)
|
||||||
(buffer-substring-no-properties (point-min) (point-max))))
|
(buffer-substring-no-properties (point-min) (point-max))))
|
||||||
|
|
||||||
|
(defvar table-source-languages) ; defined in table.el
|
||||||
(defun org-lparse-format-table-table-using-table-generate-source (backend
|
(defun org-lparse-format-table-table-using-table-generate-source (backend
|
||||||
lines
|
lines
|
||||||
&optional
|
&optional
|
||||||
|
@ -1948,7 +1976,7 @@ Replaces invalid characters with \"_\"."
|
||||||
|
|
||||||
(defun org-lparse-format-section-number (&optional snumber level)
|
(defun org-lparse-format-section-number (&optional snumber level)
|
||||||
(and org-export-with-section-numbers
|
(and org-export-with-section-numbers
|
||||||
(not body-only) snumber level
|
(not org-lparse-body-only) snumber level
|
||||||
(org-lparse-format 'FONTIFY snumber (format "section-number-%d" level))))
|
(org-lparse-format 'FONTIFY snumber (format "section-number-%d" level))))
|
||||||
|
|
||||||
(defun org-lparse-warn (msg)
|
(defun org-lparse-warn (msg)
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
;;
|
;;
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;;; Use M-x `org-odt-unit-test' to test drive the exporter
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(require 'org-lparse)
|
(require 'org-lparse)
|
||||||
|
@ -1499,15 +1497,6 @@ To disable outline numbering pass a LEVEL of 0."
|
||||||
(replace-match replacement t nil))))
|
(replace-match replacement t nil))))
|
||||||
(save-buffer 0)))
|
(save-buffer 0)))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun org-odt-unit-test (&optional linger)
|
|
||||||
"Automatically visit the Unit Test file and export it."
|
|
||||||
(interactive "P")
|
|
||||||
(with-current-buffer
|
|
||||||
(find-file (expand-file-name "tests/test.org" org-odt-data-dir))
|
|
||||||
(unless linger
|
|
||||||
(call-interactively 'org-export-as-odt-and-open))))
|
|
||||||
|
|
||||||
(provide 'org-odt)
|
(provide 'org-odt)
|
||||||
|
|
||||||
;;; org-odt.el ends here
|
;;; org-odt.el ends here
|
||||||
|
|
Loading…
Reference in New Issue