Commit 4b67ea89 authored by Carsten Dominik's avatar Carsten Dominik
Browse files

* org-export-latex.el (org-export-as-latex): Revert the change

	that killed the LaTeX buffer.
parent 2a57416f
2008-03-13 Carsten Dominik <dominik@science.uva.nl> 2008-03-13 Carsten Dominik <dominik@science.uva.nl>
   
* textmodes/org-publish.el: (org-publish-expand-components):
Remove null projects from the list of components.
(org-publish-attachment): Bugfix: handle the mandatory argument
pub-dir. Removed unused retrieval of the :publishing-directory
property.
(org-publish-file): Bugfix: when using a relative directory as the
publishing directory, convert it to a directory filename.
(org-publish-project): New alias.
(org-publish-get-files): Protect against empty p.
(org-publish-file): Send an error when file is not part of any
project.
(org-publish-file): Offer to refresh the list of files in known
project when the current file is not part of any project.
(org-publish-before-export-hook)
(org-publish-after-export-hook): New hooks.
(org-publish-org-to): Use new hooks and kill buffers.
(org-publish-file): Remove the code for killing buffers.
(org-publish-initialize-files-alist): Use interactive.
(org-publish-file): If the publishing function creates a new
buffer, kill it after publishing.
(org-publish-timestamp-filename): Protect ":" in file name path
under windows.
* textmodes/org-export-latex.el (org-export-as-latex): Revert the * textmodes/org-export-latex.el (org-export-as-latex): Revert the
change that killed the LaTeX buffer. change that killed the LaTeX buffer.
   
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
;; ;;
;; Emacs Lisp Archive Entry ;; Emacs Lisp Archive Entry
;; Filename: org-export-latex.el ;; Filename: org-export-latex.el
;; Version: 5.19 ;; Version: 5.23
;; Author: Bastien Guerry <bzg AT altern DOT org> ;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org> ;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: org, wp, tex ;; Keywords: org, wp, tex
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
;; M-x `org-export-as-latex-to-buffer' ;; M-x `org-export-as-latex-to-buffer'
;; M-x `org-export-region-as-latex' ;; M-x `org-export-region-as-latex'
;; M-x `org-replace-region-by-latex' ;; M-x `org-replace-region-by-latex'
;; ;;
;;; Code: ;;; Code:
(eval-when-compile (eval-when-compile
...@@ -329,7 +329,7 @@ in a window. A non-interactive call will only retunr the buffer." ...@@ -329,7 +329,7 @@ in a window. A non-interactive call will only retunr the buffer."
;;;###autoload ;;;###autoload
(defun org-export-as-latex (arg &optional hidden ext-plist (defun org-export-as-latex (arg &optional hidden ext-plist
to-buffer body-only) to-buffer body-only pub-dir)
"Export current buffer to a LaTeX file. "Export current buffer to a LaTeX file.
If there is an active region, export only the region. The prefix If there is an active region, export only the region. The prefix
ARG specifies how many levels of the outline should become ARG specifies how many levels of the outline should become
...@@ -344,7 +344,8 @@ buffer. If TO-BUFFER is the symbol `string', don't leave any ...@@ -344,7 +344,8 @@ buffer. If TO-BUFFER is the symbol `string', don't leave any
buffer behind but just return the resulting LaTeX as a string. buffer behind but just return the resulting LaTeX as a string.
When BODY-ONLY is set, don't produce the file header and footer, When BODY-ONLY is set, don't produce the file header and footer,
simply return the content of \begin{document}...\end{document}, simply return the content of \begin{document}...\end{document},
without even the \begin{document} and \end{document} commands." without even the \begin{document} and \end{document} commands.
when PUB-DIR is set, use this as the publishing directory."
(interactive "P") (interactive "P")
;; Make sure we have a file name when we need it. ;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only)) (when (and (not (or to-buffer body-only))
...@@ -375,7 +376,8 @@ without even the \begin{document} and \end{document} commands." ...@@ -375,7 +376,8 @@ without even the \begin{document} and \end{document} commands."
(file-name-sans-extension (file-name-sans-extension
(file-name-nondirectory buffer-file-name)))) (file-name-nondirectory buffer-file-name))))
(filename (concat (file-name-as-directory (filename (concat (file-name-as-directory
(org-export-directory :LaTeX ext-plist)) (or pub-dir
(org-export-directory :LaTeX ext-plist)))
(file-name-sans-extension (file-name-sans-extension
(file-name-nondirectory ;sans-extension (file-name-nondirectory ;sans-extension
buffer-file-name)) ".tex")) buffer-file-name)) ".tex"))
...@@ -391,9 +393,10 @@ without even the \begin{document} and \end{document} commands." ...@@ -391,9 +393,10 @@ without even the \begin{document} and \end{document} commands."
(find-file-noselect filename))) (find-file-noselect filename)))
(odd org-odd-levels-only) (odd org-odd-levels-only)
(header (org-export-latex-make-header title opt-plist)) (header (org-export-latex-make-header title opt-plist))
(skip (if subtree-p nil (skip (cond (subtree-p nil)
(region-p t)
;; never skip first lines when exporting a subtree ;; never skip first lines when exporting a subtree
(plist-get opt-plist :skip-before-1st-heading))) (t (plist-get opt-plist :skip-before-1st-heading))))
(text (plist-get opt-plist :text)) (text (plist-get opt-plist :text))
(first-lines (if skip "" (org-export-latex-first-lines))) (first-lines (if skip "" (org-export-latex-first-lines)))
(coding-system (and (boundp 'buffer-file-coding-system) (coding-system (and (boundp 'buffer-file-coding-system)
...@@ -1117,8 +1120,8 @@ Regexps are those from `org-export-latex-special-string-regexps'." ...@@ -1117,8 +1120,8 @@ Regexps are those from `org-export-latex-special-string-regexps'."
(if (match-string 2) "" (match-string 1)))) t t)) (if (match-string 2) "" (match-string 1)))) t t))
;; Delete @<...> constructs ;; Delete @<...> constructs
(goto-char (point-min))
;; Thanks to Daniel Clemente for this regexp ;; Thanks to Daniel Clemente for this regexp
(goto-char (point-min))
(while (re-search-forward "@<\\(?:[^\"\n]\\|\".*\"\\)*?>" nil t) (while (re-search-forward "@<\\(?:[^\"\n]\\|\".*\"\\)*?>" nil t)
(replace-match "")) (replace-match ""))
...@@ -1140,7 +1143,7 @@ Regexps are those from `org-export-latex-special-string-regexps'." ...@@ -1140,7 +1143,7 @@ Regexps are those from `org-export-latex-special-string-regexps'."
(let ((end (save-excursion (let ((end (save-excursion
(if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t) (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t)
(match-beginning 0) (point-max))))) (match-beginning 0) (point-max)))))
(setq footnote (concat (org-trim (buffer-substring (point) end)) (setq footnote (concat (org-trim (buffer-substring (point) end))
" ")) ; prevent last } being part of a link " ")) ; prevent last } being part of a link
(delete-region (point) end)) (delete-region (point) end))
(goto-char foot-beg) (goto-char foot-beg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment