Minor cleanups in org-odt

* contrib/lisp/org-odt.el (org-odt-format-spaces): Minor
change. Always emit a leading space.
(org-odt-fill-tabs-and-spaces): Simplify.
(org-odt-finalize-outfile): Remove a stray message.
This commit is contained in:
Jambunathan K 2011-08-16 23:49:18 +05:30
parent 300b2e8f4e
commit a2e6a7ef90
1 changed files with 8 additions and 7 deletions

View File

@ -813,7 +813,11 @@ PUB-DIR is set, use this as the publishing directory."
desc href (or attr "")))))
(defun org-odt-format-spaces (n)
(org-odt-format-tags "<text:s text:c=\"%d\"/>" "" n))
(cond
((= n 1) " ")
((> n 1) (concat
" " (org-odt-format-tags "<text:s text:c=\"%d\"/>" "" (1- n))))
(t "")))
(defun org-odt-format-tabs (&optional n)
(let ((tab "<text:tab/>")
@ -842,11 +846,9 @@ PUB-DIR is set, use this as the publishing directory."
(defun org-odt-fill-tabs-and-spaces (line)
(replace-regexp-in-string
"\\([\t]\\|\\([ ]+\\)\\)" (lambda (s)
(cond
((string= s "\t") (org-odt-format-tabs))
((> (length s) 1)
(org-odt-format-spaces (length s)))
(t " "))) line))
(cond
((string= s "\t") (org-odt-format-tabs))
(t (org-odt-format-spaces (length s))))) line))
(defun org-odt-format-source-code-or-example-line (line)
(org-odt-format-stylized-paragraph 'src (org-odt-fill-tabs-and-spaces line)))
@ -1463,7 +1465,6 @@ MAY-INLINE-P allows inlining it as an image."
(insert (format org-odt-manifest-file-entry-tag media-type full-path))))
(defun org-odt-finalize-outfile ()
(message "org-newodt: Finalizing outfile")
(org-odt-delete-empty-paragraphs))
(defun org-odt-delete-empty-paragraphs ()