emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] new exporter fails on read only files
@ 2012-04-26 12:36 Eric Fraga
  2012-04-26 12:59 ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Fraga @ 2012-04-26 12:36 UTC (permalink / raw)
  To: emacs-orgmode

Hello all,

From one of the recent threads (on producing latex files for ACM
publications), I was finally motivated to try the new export engine.  I
have run into a small problem: org-export-dispatch fails if the file is
read only.  I often have read only files as I use RCS as my version
control system for one-off standalone files (as opposed to git or
mercurial for larger projects).

Specifically, I have added

   (require 'org-export)
   (require 'org-e-latex)

to my org customisation.  Then, while visiting a read only file, I try

   M-x org-export-dispatch RET p

and I get the error:

,----
| org-refresh-category-properties: Buffer is read-only: #<buffer proposal.org>
`----

This doesn't happen if I use the old exporter (C-c C-e p).  Also, the
error does not appear if I try the new export engine on a writable
file.  Toggling debug-on-error doesn't actually put me in the debugger
when the error occurs, by the way.

I *think* am running an up to date org (from an hour or so ago) but the
org-version information (auto-generated for my signature) seems
confused...  but maybe that's a problem for another day?

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.06 (release_7.8.09.392.ge0222)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-04-26 12:36 [bug] new exporter fails on read only files Eric Fraga
@ 2012-04-26 12:59 ` Bastien
  2012-04-27 13:22   ` Eric Fraga
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2012-04-26 12:59 UTC (permalink / raw)
  To: emacs-orgmode

Hi Eric,

Eric Fraga <e.fraga@ucl.ac.uk> writes:

> Specifically, I have added
>
>    (require 'org-export)
>    (require 'org-e-latex)
>
> to my org customisation.  Then, while visiting a read only file, I try
>
>    M-x org-export-dispatch RET p

Mhh.. I can't reproduce this error with latest Org.

> and I get the error:
>
> ,----
> | org-refresh-category-properties: Buffer is read-only: #<buffer proposal.org>
> `----

Maybe you have a hook which call this function?

In any case, as the other place where `org-refresh-category-properties'
is called is `org-prepare-agenda-buffers' and those buffers might be
read-only (for some obscure reason), I pushed a fix that make sure 
`org-refresh-category-properties' can modify the buffer correctly.

Please let me know if this fixes your problem.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-04-26 12:59 ` Bastien
@ 2012-04-27 13:22   ` Eric Fraga
  2012-04-27 14:50     ` Bastien
  2012-04-27 20:39     ` Nicolas Goaziou
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Fraga @ 2012-04-27 13:22 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Eric,
>
> Eric Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Specifically, I have added
>>
>>    (require 'org-export)
>>    (require 'org-e-latex)
>>
>> to my org customisation.  Then, while visiting a read only file, I try
>>
>>    M-x org-export-dispatch RET p
>
> Mhh.. I can't reproduce this error with latest Org.

Arghhh.  Strange.

>
>> and I get the error:
>>
>> ,----
>> | org-refresh-category-properties: Buffer is read-only: #<buffer proposal.org>
>> `----
>
> Maybe you have a hook which call this function?

I do not believe so.  Grepping for "category" in my .el files (including
custom variable setting) finds nothing org related.

Obviously, I can try emacs -Q etc and will do so later this weekend
hopefully.

In the meantime:

> In any case, as the other place where `org-refresh-category-properties'
> is called is `org-prepare-agenda-buffers' and those buffers might be
> read-only (for some obscure reason), I pushed a fix that make sure 
> `org-refresh-category-properties' can modify the buffer correctly.
>
> Please let me know if this fixes your problem.

Actually, I have updated (one minute ago) and the problem has now
changed!  I now get this error:

,----
| and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:evaporative}" :begin 11957 :end 11978 :post-blank 0))
`----

and I have no idea what is happening here.  For this error, I do get a
debug trace but it is rather long and my org file has material I cannot
post. The old exporter still works perfectly fine.

I will try emacs -Q later and will also see if I can come up with a
minimal example that fails in the same way as my longer confidential
document.

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.09 (release_7.8.09-392-ge02226 @ /home/ucecesf/git/org-mode/lisp/org-install.el)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-04-27 13:22   ` Eric Fraga
@ 2012-04-27 14:50     ` Bastien
  2012-04-27 20:39     ` Nicolas Goaziou
  1 sibling, 0 replies; 10+ messages in thread
From: Bastien @ 2012-04-27 14:50 UTC (permalink / raw)
  To: emacs-orgmode

Eric Fraga <e.fraga@ucl.ac.uk> writes:

> In the meantime:
>
>> In any case, as the other place where `org-refresh-category-properties'
>> is called is `org-prepare-agenda-buffers' and those buffers might be
>> read-only (for some obscure reason), I pushed a fix that make sure 
>> `org-refresh-category-properties' can modify the buffer correctly.
>>
>> Please let me know if this fixes your problem.
>
> Actually, I have updated (one minute ago) and the problem has now
> changed!  I now get this error:
>
> ,----
> | and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:evaporative}" :begin 11957 :end 11978 :post-blank 0))
> `----
>
> and I have no idea what is happening here.  For this error, I do get a
> debug trace but it is rather long and my org file has material I cannot
> post. The old exporter still works perfectly fine.
>
> I will try emacs -Q later and will also see if I can come up with a
> minimal example that fails in the same way as my longer confidential
> document.

Thanks -- hopefully Nicolas will be able to have a look and reproduce 
your problem.

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-04-27 13:22   ` Eric Fraga
  2012-04-27 14:50     ` Bastien
@ 2012-04-27 20:39     ` Nicolas Goaziou
  2012-05-03  9:37       ` Eric Fraga
  1 sibling, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2012-04-27 20:39 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hello,

Eric Fraga <e.fraga@ucl.ac.uk> writes:

> Actually, I have updated (one minute ago) and the problem has now
> changed!  I now get this error:
>
> ,----
> | and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:evaporative}" :begin 11957 :end 11978 :post-blank 0))
> `----

This is a bit short to start investigations. Something is happening at
position 11957 in your buffer. You may want to narrow it to the
paragraph/table/construct around and try to export it again. It could
make a minimal example.

You may also try (org-element-parse-buffer) to see if the error comes
from the parser or the export engine. You could even try to export to
something else, like ASCII, to check if the error comes from the engine
itself or from the latex back-end.

> and I have no idea what is happening here.  For this error, I do get a
> debug trace but it is rather long and my org file has material I cannot
> post.

The last ten lines are usually good enough.

> I will try emacs -Q later and will also see if I can come up with a
> minimal example that fails in the same way as my longer confidential
> document.

Since I have no clue for now, I cannot help much. I will look at any
data you can provide, though.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-04-27 20:39     ` Nicolas Goaziou
@ 2012-05-03  9:37       ` Eric Fraga
  2012-05-03 12:34         ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Fraga @ 2012-05-03  9:37 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Actually, I have updated (one minute ago) and the problem has now
>> changed!  I now get this error:
>>
>> ,----
>> | and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:evaporative}" :begin 11957 :end 11978 :post-blank 0))
>> `----
>
> This is a bit short to start investigations. Something is happening at
> position 11957 in your buffer. You may want to narrow it to the
> paragraph/table/construct around and try to export it again. It could
> make a minimal example.

Okay, I have investigated.  Attached is a simple example which
illustrates the problem which appears to be use of a latex macro within
a table.  Are latex macros still allowed?  I have used emacs -Q and
loaded in the new export etc.  No customisations.

The error message for this example is:

,----
| and: Wrong type argument: stringp, (latex-fragment (:value "\\ref{sec:bug}" :begin 322 :end 335 :post-blank 0))
`----

> You may also try (org-element-parse-buffer) to see if the error comes
> from the parser or the export engine. You could even try to export to

It's the export engine and it's due to my \ref{...} having the \
escaped, which should not happen.

Thanks,
eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: examplebug.org --]
[-- Type: text/org, Size: 476 bytes --]

#+TITLE:     examplebug.org
#+AUTHOR:    Eric S Fraga
#+EMAIL:     e.fraga@ucl.ac.uk
#+DATE:      2012-01-09 Mon

* new exporter
  \label{sec:bug}

  This section illustrates a simple bug in the new exporter, I think.

  | Section       | Description                |
  |---------------+----------------------------|
  | \ref{sec:bug} | An illustration of the bug |
  |---------------+----------------------------|

  The table has a reference using a direct latex command.



[-- Attachment #3: Type: text/plain, Size: 106 bytes --]


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-414-gb3e8a8

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-05-03  9:37       ` Eric Fraga
@ 2012-05-03 12:34         ` Nicolas Goaziou
  2012-05-06 13:55           ` Eric Fraga
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2012-05-03 12:34 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hello,

Eric Fraga <e.fraga@ucl.ac.uk> writes:

> Okay, I have investigated.  Attached is a simple example which
> illustrates the problem which appears to be use of a latex macro within
> a table.

Thank you. This bug should be fixed now.

> Are latex macros still allowed?

They are.

As side note, is the provided example, you can also replace
"\label{sec:bug}" with, for example <<sec-bug>> and "\ref{sec:bug}" with
[[sec-bug]] to achieve the same result, with the added benefit of being
able to navigate between the two with `org-open-link'.

> * new exporter
>   \label{sec:bug}
>
>   This section illustrates a simple bug in the new exporter, I think.
>
>   | Section       | Description                |
>   |---------------+----------------------------|
>   | \ref{sec:bug} | An illustration of the bug |
>   |---------------+----------------------------|


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-05-03 12:34         ` Nicolas Goaziou
@ 2012-05-06 13:55           ` Eric Fraga
  2012-05-06 18:13             ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Fraga @ 2012-05-06 13:55 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

Nicolas,

unfortunately, I have immediately run into another problem with the new
exporter (to latex) when going back to my long document (a project
proposal).

I have a minimal example which illustrates the problem.  The attached
are a simple org file with the resulting latex file.  The key problem is
that the =tabular= command has an empty argument, the argument that is
meant to specify the table alignments.

Specifically,  the new exporter generates:

,----
| \begin{center}
| \begin{tabular}{}
| \hline
| Task & Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & Q8 & Q9 & Q10 & Q11 & Q12\\
`----

whereas the old one generates

,----
| \begin{center}
| \begin{tabular}{lllllllllllll}
| \hline
|  Task                    &  Q1  &  Q2  &  Q3 [...]
`----

(last line truncated by me as it was too long)

This is with org up to date from a few minutes ago (see signature).  For
the new exporter, I started emacs with -Q and then:

#+begin_src emacs-lisp
(add-to-list 'load-path "~/git/org-mode")
(add-to-list 'load-path "~/git/org-mode/lisp")
(add-to-list 'load-path "~/git/org-mode/contrib/lisp/")
(require 'org-install)
(require 'org-export)
(require 'org-e-latex)
#+end_src

Thanks,
eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: examplebug.org --]
[-- Type: text/org, Size: 3116 bytes --]

#+TITLE:     examplebug.org
#+AUTHOR:    Eric S Fraga
#+EMAIL:     e.fraga@ucl.ac.uk
#+DATE:      2012-01-09 Mon

#+latex_header: \newcommand{\deliverable}[1]{D\ref{deliverable:#1}}

* new exporter
  <<sec:bug>>

  This section illustrates a simple bug in the new exporter, I think.

  The project has the following deliverables:

  1. \label{deliverable:evaporative-model} The evaporative model
  2. \label{deliverable:system-model} The system model
  3. \label{deliverable:control-model} The control model
  4. \label{deliverable:control-model-recycle} ... and with a recycle
  5. \label{deliverable:preprocessing-system} ... and with preprocessing

     
  The work plan for this project is shown in the following table:

  #+latex: \renewcommand{\arraystretch}{1.5}
 
  |------------------------+----+----+---------------------------------+----+----------------------------+----+-----------------------------+-------------------------------------+----+-----+-----+------------------------------------|
  | Task                   | Q1 | Q2 | Q3                              | Q4 | Q5                         | Q6 | Q7                          | Q8                                  | Q9 | Q10 | Q11 | Q12                                |
  |------------------------+----+----+---------------------------------+----+----------------------------+----+-----------------------------+-------------------------------------+----+-----+-----+------------------------------------|
  | \ref{sec:evaporative}  | XX | XX | XX                              |    |                            |    |                             |                                     |    |     |     |                                    |
  | \ref{sec:systems}      |    |    |                                 | XX | XX                         |    |                             |                                     |    |     | XX  |                                    |
  | \ref{sec:control}      |    |    |                                 |    |                            | XX | XX                          | XX                                  |    |     |     | XX                                 |
  | \ref{sec:desalination} |    |    |                                 |    |                            |    |                             |                                     | XX | XX  |     |                                    |
  |------------------------+----+----+---------------------------------+----+----------------------------+----+-----------------------------+-------------------------------------+----+-----+-----+------------------------------------|
  | Deliverables           |    |    | \deliverable{evaporative-model} |    | \deliverable{system-model} |    | \deliverable{control-model} | \deliverable{control-model-recycle} |    |     |     | \deliverable{preprocessing-system} |
  |------------------------+----+----+---------------------------------+----+----------------------------+----+-----------------------------+-------------------------------------+----+-----+-----+------------------------------------|
 



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: examplebug.tex --]
[-- Type: text/x-tex, Size: 2043 bytes --]

% Created 2012-05-06 Sun 23:21
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\newcommand{\deliverable}[1]{D\ref{deliverable:#1}}
\providecommand{\alert}[1]{\textbf{#1}}
\author{Eric S Fraga}
\date{2012-01-09 Mon}
\title{examplebug.org}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Generated by Org mode 7.8.09 in Emacs 24.1.50.1.}}
\begin{document}

\maketitle
\tableofcontents
\vspace*{1cm}


\section{new exporter}
\label{sec-1}
\label{sec-bug}

This section illustrates a simple bug in the new exporter, I think.

The project has the following deliverables:

\begin{enumerate}
\item \label{deliverable:evaporative-model} The evaporative model
\item \label{deliverable:system-model} The system model
\item \label{deliverable:control-model} The control model
\item \label{deliverable:control-model-recycle} \ldots{} and with a recycle
\item \label{deliverable:preprocessing-system} \ldots{} and with preprocessing
\end{enumerate}


The work plan for this project is shown in the following table:

\renewcommand{\arraystretch}{1.5}

\begin{center}
\begin{tabular}{}
\hline
Task & Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & Q8 & Q9 & Q10 & Q11 & Q12\\
\hline
\ref{sec:evaporative} & XX & XX & XX &  &  &  &  &  &  &  &  & \\
\ref{sec:systems} &  &  &  & XX & XX &  &  &  &  &  & XX & \\
\ref{sec:control} &  &  &  &  &  & XX & XX & XX &  &  &  & XX\\
\ref{sec:desalination} &  &  &  &  &  &  &  &  & XX & XX &  & \\
\hline
Deliverables &  &  & \deliverable{evaporative-model} &  & \deliverable{system-model} &  & \deliverable{control-model} & \deliverable{control-model-recycle} &  &  &  & \deliverable{preprocessing-system}\\
\hline
\end{tabular}
\end{center}
% Generated by Org mode 7.8.09 in Emacs 24.1.50.1.
\end{document}

[-- Attachment #4: Type: text/plain, Size: 106 bytes --]


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-489-g541288

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-05-06 13:55           ` Eric Fraga
@ 2012-05-06 18:13             ` Nicolas Goaziou
  2012-05-06 23:48               ` Eric S Fraga
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2012-05-06 18:13 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hello,

Eric Fraga <e.fraga@ucl.ac.uk> writes:


> unfortunately, I have immediately run into another problem with the new
> exporter (to latex) when going back to my long document (a project
> proposal).

> I have a minimal example which illustrates the problem.  The attached
> are a simple org file with the resulting latex file.  The key problem is
> that the =tabular= command has an empty argument, the argument that is
> meant to specify the table alignments.

This should be fixed now. Thanks again for the report.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bug] new exporter fails on read only files
  2012-05-06 18:13             ` Nicolas Goaziou
@ 2012-05-06 23:48               ` Eric S Fraga
  0 siblings, 0 replies; 10+ messages in thread
From: Eric S Fraga @ 2012-05-06 23:48 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric Fraga <e.fraga@ucl.ac.uk> writes:
>
>
>> unfortunately, I have immediately run into another problem with the new
>> exporter (to latex) when going back to my long document (a project
>> proposal).
>
>> I have a minimal example which illustrates the problem.  The attached
>> are a simple org file with the resulting latex file.  The key problem is
>> that the =tabular= command has an empty argument, the argument that is
>> meant to specify the table alignments.
>
> This should be fixed now. Thanks again for the report.

Thanks.  Works perfectly with my minimal example *and* with my long
document!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-482-gf47915

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-05-06 23:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 12:36 [bug] new exporter fails on read only files Eric Fraga
2012-04-26 12:59 ` Bastien
2012-04-27 13:22   ` Eric Fraga
2012-04-27 14:50     ` Bastien
2012-04-27 20:39     ` Nicolas Goaziou
2012-05-03  9:37       ` Eric Fraga
2012-05-03 12:34         ` Nicolas Goaziou
2012-05-06 13:55           ` Eric Fraga
2012-05-06 18:13             ` Nicolas Goaziou
2012-05-06 23:48               ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).