From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Jackson Subject: Bug: reftex breaking after org-mode export [8.2.10 (8.2.10-35-g19a7d6-elpa @ /Users/adamjackson/.emacs.d/elpa/org-20150323/)] Date: Mon, 23 Mar 2015 11:58:21 +0000 Message-ID: <1EAD2758-E620-4D07-9622-16E636B2EBE0@physics.org> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_10B9E2E4-E885-4C10-A4C4-AD2383880756" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya102-0001NA-FH for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 07:58:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya0zy-000696-50 for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 07:58:30 -0400 Received: from mansell.bath.ac.uk ([138.38.0.35]:33039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya0zx-00068m-OI for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 07:58:26 -0400 Received: from authenticated user by mansell.bath.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4) (envelope-from ) id 1Ya0zv-0006xF-5O for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 11:58:23 +0000 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 --Apple-Mail=_10B9E2E4-E885-4C10-A4C4-AD2383880756 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, I've been struggling with Reftex in org-mode. Initially things are fine, then after exporting the document to LaTeX and continuing to work with org-mode, using most of the reftex features (e.g. reftex-toc or trying = to insert a reference) produces a "Wrong type argument: stringp, nil" error message. The code in my init file to set up reftex: ;; Reftex (require 'reftex) (defun org-mode-reftex-setup () (load-library "reftex") (and (buffer-file-name) (file-exists-p (buffer-file-name)) ;enable auto-revert-mode to update reftex when bibtex file = changes on disk (global-auto-revert-mode t) (reftex-parse-all) (define-key org-mode-map (kbd "C-c [") 'reftex-citation) ;add a custom reftex cite format to insert links ;; (reftex-set-cite-format "** [[papers:%l][%l]]: %t \n") ) )=20 (add-hook 'org-mode-hook 'org-mode-reftex-setup)=20 At the moment I still enter reftex-mode on demand with "M-x = reftex-mode". Here is the backtrace for the error: Debugger entered--Lisp error: (wrong-type-argument stringp nil) re-search-forward(nil 10001 t) tex-main-file() reftex-TeX-master-file() reftex-insert-docstruct(# t "e" nil nil t nil nil = ("SEC:lagrange_gibbs_proof" "s" "We define the molar Gibbs free energy = in a molecular gas mixture as \\begin{align} \\h" = "/my/path/to/the/paper.org" nil) "" nil) byte-code("\306 =18\307\216\310 \210 =12\311 =13\f\203=1F=00\312r = q\210\313 !)!\210\202&=00\312\314!\210\315 \210=0E@\316=3D\2040=00\316 = \210\317\320p\"\210\321=16A\322\323\324\325\326=0EB\327\330\331\332\333\25= 7=0B=16C\334 \335U\203v=00\336=1ED\337\340!\210\341 =0EE \336=0EF=0EG=0EH=0EI=0EJ\206k=00=0EK=0EL\336&=0B= =16K)\202\211=00=0EJ\203\206=00\342 =0EJ = #=16K\202\211=00\321=16K\321=16D=0EK\206\222=00\321=16K\336=16J\343=0EM=0E= N=0EO=0EK\344=0EP&=06\211=16Q@=16R=0EQA@=16S\345=0EQ8=16T\321=16K=0ER\204\= 304=00\346\347\336\"\210=0ER\350=3D\203\321=00\315 \210\202 = =02=0ER\351=3D\204\337=00=0ER\352=3D\203\365=00=0EU\203\347=00\352=16R\315= \210\353 =0ET=0ER#\210\202 =02=0ER\354=3D\203=07=01\315 = \210=0EG?=16G\202 =02=0ER\355=3D\203=18=01=0EV=16J\356 =15\202 = =02=0ER\357=3D\2038=01\315 \210=0EU\2030=01\360=0EU!=16W\202 =02=0EE?=16E\= 202 =02=0ER\361=3D\203J=01\315 \210=0EF?=16F\202 =02=0ER\362=3D\203\\=01\3= 15 \210=0EH?=16H\202 =02=0ER\363=3D\203n=01\315 \210=0EI?=16I\202 = =02=0ER\364=3D\203\201=01=0EX=16Y\346\347\321\"\210\202 = =02=0ER\365=3D\203\264=01\366=0EZ=0E[\"=16[\367=0E[=0EZ8A!\206\236=01\370\= 371!=11=0E[=0EZ8@\206\251=01\372=16L q\210\373 \210\202 = =02=0ER;\203\324=01\374=0ER=0E\\J\"\206\310=01=0ER DCC=16Y\346\347\321\"\210\202 = =02=0ER\375>\203=1A=02=0E]\203\350=01=0E]\237=16Y\202\371=01=0ES\203\366=01= =0ESCC=16Y\202\371=01\336=16Y=0EY\203=0F=02=0ER\376\232\203=0B= =02\377=0EYB=16Y=0EY=16X q\210\346\347\321\"\210\202 = =02\370\201^=00!\210*\202=00=00" [wconfig buf = reftex-call-back-to-this-buffer reftex-latex-syntax-table = reftex-use-multiple-selection-buffers typekey = current-window-configuration ((set-window-configuration wconfig)) = delete-other-windows syntax-table switch-to-buffer-other-window = reftex-make-selection-buffer-name "*RefTeX Select*" reftex-erase-buffer = reftex-select-label-mode add-to-list selection-buffers t "---- " = mode-line-buffer-identification " " global-mode-string " (" ")" " = S<" reftex-refstyle ">" " -%-" buffer-size 0 nil message "Creating = Selection Buffer..." reftex-insert-docstruct reftex-get-offset = reftex-select-item reftex-show-label-location 2 throw exit 103 114 82 = reftex-reparse-document 99 115 reftex-query-label-type 116 = prefix-numeric-value 70 ...] 13) reftex-offer-label-menu("e") reftex-reference() call-interactively(reftex-reference nil nil) Many thanks, Adam Emacs : GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org Package: Org-mode version 8.2.10 (8.2.10-35-g19a7d6-elpa @ = /Users/adamjackson/.emacs.d/elpa/org-20150323/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-export-backends '(latex md ascii html icalendar beamer) org-tab-first-hook '(org-hide-block-toggle-maybe = org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe = org-babel-header-arg-expand) org-latex-classes '(("beamer" "\\documentclass[presentation]{beamer}" = ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") = ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ("article" "\\documentclass[11pt]{article}" = ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") = ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") = ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("report" "\\documentclass[11pt]{report}" = ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") = ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") = ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ("book" "\\documentclass[11pt]{book}" ("\\part{%s}" = . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") = ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") = ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ) org-speed-command-hook '(org-speed-command-default-hook = org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-html-format-drawer-function '(lambda (name contents) contents) org-log-done 'time org-latex-format-inlinetask-function 'ignore org-confirm-shell-link-function 'yes-or-no-p org-ascii-format-inlinetask-function = 'org-ascii-format-inlinetask-default org-agenda-custom-commands '(("h" "\"home\": Agenda and unscheduled = non-work TODOs" ((agenda "" nil) (tags-todo = "-work-SCHEDULED=3D{.+}" nil)) nil nil) ("H" "\"Home\": Non-work unscheduled = TODOs" tags "-work-SCHEDULED=3D{.+}" nil) ("w" "Unscheduled :work:" tags = "work-SCHEDULED=3D{.+}" nil) ("n" "Agenda and all TODOs" ((agenda "" = nil) (alltodo "" nil)) nil)) org-latex-format-headline-function = 'org-latex-format-headline-default-function org-after-todo-state-change-hook '(org-clock-out-if-current) org-latex-format-drawer-function '(lambda (name contents) contents) org-src-mode-hook '(org-src-babel-configure-edit-buffer = org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-agenda-dim-blocked-tasks 'invisible org-mode-hook '((lambda nil (org-add-hook (quote change-major-mode-hook) (quote = org-show-block-all) (quote append) (quote local)) ) (lambda nil (org-add-hook (quote change-major-mode-hook) (quote = org-babel-show-result-all) (quote append) (quote local)) ) #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook = org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook = org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes = org-mode-reftex-setup) org-ascii-format-drawer-function '(lambda (name contents width) = contents) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point = org-babel-execute-safely-maybe) org-directory "~/Dropbox/org" org-enforce-todo-dependencies t org-cycle-hook '(org-cycle-hide-archived-subtrees = org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines = org-optimize-window-after-visibility-change) org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent) org-html-format-headline-function 'ignore org-babel-load-languages '((python . t)) org-html-format-inlinetask-function 'ignore org-agenda-files '("~/Dropbox/org/todo.org" = "~/Dropbox/org/shopping.org") org-clock-out-hook '(org-clock-remove-empty-clock-drawer) ) --Apple-Mail=_10B9E2E4-E885-4C10-A4C4-AD2383880756 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
message.

The code in my init = file to set up reftex:

    ;; = Reftex
    (require 'reftex)
    = (defun org-mode-reftex-setup ()
      = (load-library "reftex")
      (and = (buffer-file-name) (file-exists-p (buffer-file-name))
  =        ;enable auto-revert-mode to update reftex = when bibtex file changes on disk
        =  (global-auto-revert-mode t)
        =  (reftex-parse-all)
          = (define-key org-mode-map (kbd "C-c [") = 'reftex-citation)
         ;add a = custom reftex cite format to insert links
      =    ;; (reftex-set-cite-format "** [[papers:%l][%l]]: %t = \n")
         )
  =   ) 

    (add-hook = 'org-mode-hook 'org-mode-reftex-setup) 

At = the moment I still enter reftex-mode on demand with "M-x = reftex-mode".
Here is the backtrace for the = error:

Debugger entered--Lisp error: = (wrong-type-argument stringp nil)
  re-search-forward(nil = 10001 t)
  tex-main-file()
  = reftex-TeX-master-file()
  = reftex-insert-docstruct(#<buffer paper.org> t "e" nil nil t nil nil = ("SEC:lagrange_gibbs_proof" "s" "We define the molar Gibbs free energy = in a molecular gas mixture as \\begin{align} \\h" "/my/path/to/the/paper.org" nil) "" nil)
  = byte-code("\306 =18\307\216\310 \210 =12\311 =13\f\203=1F=00\312r = q\210\313
!)!\210\202&=00\312\314!\210\315 = \210=0E@\316=3D\2040=00\316 = \210\317\320p\"\210\321=16A\322\323\324\325\326=0EB\327\330\331\332\333\25= 7=0B=16C\334 \335U\203v=00\336=1ED\337\340!\210\341 = =0EE
\336=0EF=0EG=0EH=0EI=0EJ\206k=00=0EK=0EL\336&=0B= =16K)\202\211=00=0EJ\203\206=00\342 = =0EJ
#=16K\202\211=00\321=16K\321=16D=0EK\206\222=00\321=16= K\336=16J\343=0EM=0EN=0EO=0EK\344=0EP&=06\211=16Q@=16R=0EQA@=16S\345=0E= Q8=16T\321=16K=0ER\204\304=00\346\347\336\"\210=0ER\350=3D\203\321=00\315 = \210\202 =02=0ER\351=3D\204\337=00=0ER\352=3D\203\365=00=0EU\203\347=00\35= 2=16R\315 \210\353 =0ET=0ER#\210\202 = =02=0ER\354=3D\203=07=01\315 \210=0EG?=16G\202 =02=0ER\355=3D\203=18=01=0E= V=16J\356 =15\202 =02=0ER\357=3D\2038=01\315 \210=0EU\2030=01\360=0EU!=16W= \202 =02=0EE?=16E\202 =02=0ER\361=3D\203J=01\315 \210=0EF?=16F\202 = =02=0ER\362=3D\203\\=01\315 \210=0EH?=16H\202 =02=0ER\363=3D\203n=01\315 = \210=0EI?=16I\202 =02=0ER\364=3D\203\201=01=0EX=16Y\346\347\321\"\210\202 = =02=0ER\365=3D\203\264=01\366=0EZ=0E[\"=16[\367=0E[=0EZ8A!\206\236=01\370\= 371!=11=0E[=0EZ8@\206\251=01\372=16L q\210\373 \210\202 = =02=0ER;\203\324=01\374=0ER=0E\\J\"\206\310=01=0ER
DCC=16Y\346\3= 47\321\"\210\202 = =02=0ER\375>\203=1A=02=0E]\203\350=01=0E]\237=16Y\202\371=01=0ES\203\36= 6=01=0ESCC=16Y\202\371=01\336=16Y=0EY\203=0F=02=0ER\376\232\203=0B= =02\377=0EYB=16Y=0EY=16X q\210\346\347\321\"\210\202 = =02\370\201^=00!\210*\202=00=00" [wconfig buf = reftex-call-back-to-this-buffer reftex-latex-syntax-table = reftex-use-multiple-selection-buffers typekey = current-window-configuration ((set-window-configuration wconfig)) = delete-other-windows syntax-table switch-to-buffer-other-window = reftex-make-selection-buffer-name "*RefTeX Select*" reftex-erase-buffer = reftex-select-label-mode add-to-list selection-buffers t "----  " = mode-line-buffer-identification "  " global-mode-string "   (" = ")" "  S<" reftex-refstyle ">" " -%-" buffer-size 0 nil = message "Creating Selection Buffer..." reftex-insert-docstruct = reftex-get-offset reftex-select-item reftex-show-label-location 2 throw = exit 103 114 82 reftex-reparse-document 99 115 reftex-query-label-type = 116 prefix-numeric-value 70 ...] 13)
  = reftex-offer-label-menu("e")
  = reftex-reference()
  call-interactively(reftex-reference = nil nil)

Many = thanks,
Adam



<= div>Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin, NS = apple-appkit-1038.36)
 of 2013-03-13 on bob.porkrind.org
Package: = Org-mode version 8.2.10 (8.2.10-35-g19a7d6-elpa @ = /Users/adamjackson/.emacs.d/elpa/org-20150323/)

c= urrent = state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(set= q
 org-export-backends '(latex md ascii html icalendar = beamer)
 org-tab-first-hook '(org-hide-block-toggle-maybe = org-src-native-tab-command-maybe
        =               = org-babel-hide-result-toggle-maybe = org-babel-header-arg-expand)
 org-latex-classes = '(("beamer" "\\documentclass[present= ation]{beamer}" ("\\section{%s}" . = "\\section*{%s}")
  =                     = ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
&n= bsp;                   =  ("article" "\\documentclass[11pt]{article}= " ("\\section{%s}" . "\\section*{%s}")
    =                   ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
&nb= sp;                   =   ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
&nbs= p;                   =  ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}")
    =                   ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
    =                   ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
&n= bsp;                   =  ("book" "\\documentclass[11pt]{book}" = ("\\part{%s}" . "\\part*{%s}")
    =                   ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
    =                   ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
&n= bsp;                   =  )
 org-speed-command-hook = '(org-speed-command-default-hook = org-babel-speed-command-hook)
 org-occur-hook = '(org-first-headline-recenter)
 org-metaup-hook = '(org-babel-load-in-session-maybe)
 org-html-format-drawer-= function '(lambda (name contents) contents)
 org-log-done = 'time
 org-latex-format-inlinetask-function = 'ignore
 org-confirm-shell-link-function = 'yes-or-no-p
 org-ascii-format-inlinetask-function = 'org-ascii-format-inlinetask-default
 org-agenda-custom-com= mands '(("h" "\"home\": Agenda and unscheduled non-work = TODOs"
                =                ((agenda "" nil) = (tags-todo "-work-SCHEDULED=3D{.+}" nil)) nil nil)
  =                     =         ("H" "\"Home\": Non-work unscheduled TODOs" = tags "-work-SCHEDULED=3D{.+}" nil)
        =                     =   ("w" "Unscheduled :work:" tags "work-SCHEDULED=3D{.+}" = nil)
                =               ("n" "Agenda and all = TODOs" ((agenda "" nil) (alltodo "" nil)) = nil))
 org-latex-format-headline-function = 'org-latex-format-headline-default-function
 org-after-todo= -state-change-hook = '(org-clock-out-if-current)
 org-latex-format-drawer-functi= on '(lambda (name contents) contents)
 org-src-mode-hook = '(org-src-babel-configure-edit-buffer = org-src-mode-configure-edit-buffer)
 org-agenda-before-writ= e-hook = '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook = '(save-buffer)
 org-agenda-dim-blocked-tasks = 'invisible
 org-mode-hook '((lambda nil
  =                 (org-add-hook = (quote change-major-mode-hook) (quote org-show-block-all) (quote = append)
              =      (quote local))
        =           )
      =            (lambda nil
  =                 (org-add-hook = (quote change-major-mode-hook) (quote org-babel-show-result-all) (quote = append)
              =      (quote local))
        =           )
      =            #[nil = "\300\301\302\303\304$\207"
          =          [org-add-hook change-major-mode-hook = org-show-block-all append local] 5]
      =            #[nil = "\300\301\302\303\304$\207"
          =          [org-add-hook change-major-mode-hook = org-babel-show-result-all append local] 5]
    =             =  org-babel-result-hide-spec org-babel-hide-all-hashes = org-mode-reftex-setup)
 org-ascii-format-drawer-function = '(lambda (name contents width) = contents)
 org-ctrl-c-ctrl-c-hook = '(org-babel-hash-at-point = org-babel-execute-safely-maybe)
 org-directory = "~/Dropbox/org"
 org-enforce-todo-dependencies = t
 org-cycle-hook '(org-cycle-hide-archived-subtrees = org-cycle-hide-drawers org-cycle-hide-inline-tasks
  =                 = org-cycle-show-empty-lines = org-optimize-window-after-visibility-change)
 org-babel-tan= gle-lang-exts '(("python" . "py") ("emacs-lisp" . = "el"))
 org-confirm-elisp-link-function = 'yes-or-no-p
 org-metadown-hook = '(org-babel-pop-to-session-maybe)
 org-blocker-hook = '(org-block-todo-from-children-or-siblings-or-parent)
 org-= html-format-headline-function = 'ignore
 org-babel-load-languages '((python . = t))
 org-html-format-inlinetask-function = 'ignore
 org-agenda-files '("~/Dropbox/org/todo.org" "~/Dropbox/org/shopping.org")
 org-clock-= out-hook = '(org-clock-remove-empty-clock-drawer)
 )
<= br>