From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Doyley, Marvin M." Subject: exporting org to docx Date: Sat, 24 Jun 2017 15:23:29 +0000 Message-ID: <3ECD3A60-C8B0-4EA9-9A79-C4DDF133E870@ur.rochester.edu> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Apple-Mail=_6E44947F-46FE-4DEC-AD56-120A72082BD4"; protocol="application/pgp-signature"; micalg=pgp-sha512 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOmuR-0004Da-Nh for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 11:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOmuM-0005LE-NR for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 11:23:39 -0400 Received: from mail-bn3nam01on0097.outbound.protection.outlook.com ([104.47.33.97]:20704 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dOmuM-00059p-D6 for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 11:23:34 -0400 Content-Language: en-US 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" To: "emacs-orgmode@gnu.org" --Apple-Mail=_6E44947F-46FE-4DEC-AD56-120A72082BD4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi there, I am play with John=E2=80=99s ox-word.el function, which us pandoc to = convert org via latex to docx. However, when I try to use it, I get the = following error helm-M-x: Wrong type argument: stringp, nil Any suggestion on how to resolve this issue. Cheers, M Ps Here is the backtrace Debugger entered--Lisp error: (void-function = my-other-delete-trailing-blank-lines) my-other-delete-trailing-blank-lines() run-hooks(before-save-hook) basic-save-buffer(nil) save-buffer() write-file("./test.tex.tex") (let ((coding-system-for-write encoding)) (write-file file)) (progn (insert output) (let ((coding-system-for-write encoding)) = (write-file file))) (unwind-protect (progn (insert output) (let ((coding-system-for-write = encoding)) (write-file file))) (and (buffer-name temp-buffer) = (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn = (insert output) (let ((coding-system-for-write encoding)) (write-file = file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) = (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn = (insert output) (let ((coding-system-for-write encoding)) (write-file = file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (let ((output (org-export-as backend subtreep visible-only body-only = ext-plist))) (let ((temp-buffer (generate-new-buffer " *temp*"))) = (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn = (insert output) (let ((coding-system-for-write encoding)) (write-file = file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if = (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn = (org-kill-new output))) (or (and (functionp post-process) (funcall = post-process file)) file)) (if async (let ((with-temp-message "Initializing asynchronous export = process") (current-message)) (unwind-protect (progn (if = with-temp-message (progn (setq current-message (current-message)) = (message "%s" with-temp-message))) (let ((--copy-fun = (org-export--generate-copy-script ...)) (--temp-file (make-temp-file = "org-export-process")) (--coding buffer-file-coding-system)) (let = ((temp-file --temp-file) (temp-buffer ...)) (unwind-protect (prog1 ... = ...) (and ... ...))) (let* ((process-connection-type nil) (--proc-buffer = ...) (--process ...)) (org-export-add-to-stack (get-buffer = --proc-buffer) nil --process) (let (...) (set-process-sentinel --process = ...))))) (and with-temp-message (if current-message (message "%s" = current-message) (message nil))))) (let ((output (org-export-as backend = subtreep visible-only body-only ext-plist))) (let ((temp-buffer = (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer = temp-buffer) (unwind-protect (progn (insert output) (let (...) = (write-file file))) (and (buffer-name temp-buffer) (kill-buffer = temp-buffer))))) (if (and (org-export--copy-to-kill-ring-p) = (org-string-nw-p output)) (progn (org-kill-new output))) (or (and = (functionp post-process) (funcall post-process file)) file))) (let ((ext-plist (org-combine-plists (list (quote :output-file) file) = ext-plist)) (encoding (or org-export-coding-system = buffer-file-coding-system))) (if async (let ((with-temp-message = "Initializing asynchronous export process") (current-message)) = (unwind-protect (progn (if with-temp-message (progn (setq = current-message ...) (message "%s" with-temp-message))) (let = ((--copy-fun ...) (--temp-file ...) (--coding = buffer-file-coding-system)) (let (... ...) (unwind-protect ... ...)) = (let* (... ... ...) (org-export-add-to-stack ... nil --process) (let ... = ...)))) (and with-temp-message (if current-message (message "%s" = current-message) (message nil))))) (let ((output (org-export-as backend = subtreep visible-only body-only ext-plist))) (let ((temp-buffer = (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer = temp-buffer) (unwind-protect (progn (insert output) (let ... ...)) (and = (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (and = (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn = (org-kill-new output))) (or (and (functionp post-process) (funcall = post-process file)) file)))) (if (not (file-writable-p file)) (error "Output file not writable") = (let ((ext-plist (org-combine-plists (list (quote :output-file) file) = ext-plist)) (encoding (or org-export-coding-system = buffer-file-coding-system))) (if async (let ((with-temp-message = "Initializing asynchronous export process") (current-message)) = (unwind-protect (progn (if with-temp-message (progn ... ...)) (let (... = ... ...) (let ... ...) (let* ... ... ...))) (and with-temp-message (if = current-message (message "%s" current-message) (message nil))))) (let = ((output (org-export-as backend subtreep visible-only body-only = ext-plist))) (let ((temp-buffer (generate-new-buffer " *temp*"))) = (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... = ...) (and ... ...)))) (if (and (org-export--copy-to-kill-ring-p) = (org-string-nw-p output)) (progn (org-kill-new output))) (or (and = (functionp post-process) (funcall post-process file)) file))))) org-export-to-file(latex "./test.tex.tex" nil nil nil nil nil) (let ((outfile (org-export-output-file-name ".tex" subtreep))) = (org-export-to-file (quote latex) outfile async subtreep visible-only = body-only ext-plist)) org-latex-export-to-latex(nil nil nil nil nil) (let* ((bibfiles (mapcar (quote expand-file-name) = (org-ref-find-bibliography))) (temp-bib) (bibtex-entries) biboption csl = (current-file (buffer-file-name)) (basename (file-name-sans-extension = current-file)) (tex-file (concat basename ".tex")) (docx-file (concat = basename ".docx"))) (save-buffer) (if bibfiles (progn (setq = bibtex-entries (let* ((bibtex-files bibfiles) (keys (reverse ...)) = (bibtex-entry-kill-ring-max (length keys)) (bibtex-entry-kill-ring = (quote nil))) (let ((wconfig ...)) (unwind-protect (progn ...) = (set-window-configuration wconfig))) (mapconcat (quote identity) = bibtex-entry-kill-ring "\n\n")) temp-bib (make-temp-file "ox-word-" nil = ".bib") biboption (format " --bibliography=3D%s " temp-bib)) (let = ((temp-file temp-bib) (temp-buffer (get-buffer-create = (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 = (save-current-buffer (set-buffer temp-buffer) (insert bibtex-entries)) = (save-current-buffer (set-buffer temp-buffer) (write-region nil nil = temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer = temp-buffer)))))) (setq csl (cdr (assoc "PANDOC-CSL" (org-element-map = (org-element-parse-buffer) (quote keyword) (function (lambda (key) (cons = ... ...))))))) (if csl (setq csl (format " --csl=3D%s " csl)) (setq csl = " ")) (org-latex-export-to-latex async subtreep visible-only body-only = options) (if (file-exists-p docx-file) (progn (delete-file docx-file))) = (shell-command (format "pandoc -s -S %s%s\"%s\" -o \"%s\"" biboption csl = tex-file docx-file)) (delete-file temp-bib) (org-open-file docx-file = (quote (16)))) ox-export-via-latex-pandoc-to-docx-and-open() funcall-interactively(ox-export-via-latex-pandoc-to-docx-and-open) call-interactively(ox-export-via-latex-pandoc-to-docx-and-open record = nil) command-execute(ox-export-via-latex-pandoc-to-docx-and-open record) helm-M-x(nil #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 = (match-part "ox-export-via-latex-pandoc-to-docx-and-open"))) funcall-interactively(helm-M-x nil = #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 (match-part = "ox-export-via-latex-pandoc-to-docx-and-open"))) call-interactively(helm-M-x nil nil) command-execute(helm-M-x) --Apple-Mail=_6E44947F-46FE-4DEC-AD56-120A72082BD4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJZToPwAAoJELrZY3BfcCrMImMIAJ+Ci66R+EJzFwGV4QTgU1DK 2Y5ZsZfv/c/XKgZVNLpltTswVuMD2BjuW02Rx/X2wo/VKbX2uZ3yqhGynhGl5lf2 kB2RbStgTvWVUB/RusY7PSKGs6Rv8kaO8FdjoViyC+RxkCKeDxJu6ZwB/75OV9fV cNyC5A3iLczzjEh+DGiH2cLR96/30JITzkof9lW8plfQXvkyO/VSlkaEMXjEtfNK BcEIDh70sbWMKbzomuQBFPF0ZzWY3KwINprIX50hIPu4gNeHMk1Evi9C6j0Z1OVt RMM4iIjDBh2/9hf1j3Spx6LUPVUeCK1VQNChNtfkCB0PKYW8IdboigFHovds/NQ= =2n/J -----END PGP SIGNATURE----- --Apple-Mail=_6E44947F-46FE-4DEC-AD56-120A72082BD4--