emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-latex-custom-lang-environments
@ 2015-05-19 15:16 Jacob Gerlach
  2015-05-19 15:29 ` org-latex-custom-lang-environments Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2015-05-19 15:16 UTC (permalink / raw)
  To: Org-mode

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

Hello,

I thought I had successfully used this variable, but after restarting
emacs, I can no longer reproduce the documented behavior.

Given the following org file:
----------
#+BEGIN_SRC sh :exports code
echo "Hello"
#+END_SRC

# Local Variables:
# org-latex-listings: t
# org-latex-custom-lang-environments: (quote ((sh "myverbatim")))
# END:
----------

I expect to export
----------
\begin{myverbatim}
echo "Hello"
\end{myverbatim}
----------
(and I thought I had observed this behavior the first time I tried it).
Instead, I get
----------
\lstset{language=sh,label= ,caption= ,captionpos=b,numbers=none}
\begin{lstlisting}
echo "Hello"
\end{lstlisting}
----------

Am I missing something?

Regards,
Jake

[-- Attachment #2: Type: text/html, Size: 1164 bytes --]

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

* Re: org-latex-custom-lang-environments
  2015-05-19 15:16 org-latex-custom-lang-environments Jacob Gerlach
@ 2015-05-19 15:29 ` Rasmus
  2015-05-19 15:55   ` org-latex-custom-lang-environments Jacob Gerlach
  0 siblings, 1 reply; 4+ messages in thread
From: Rasmus @ 2015-05-19 15:29 UTC (permalink / raw)
  To: emacs-orgmode

Hi Jake,

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> I thought I had successfully used this variable, but after restarting
> emacs, I can no longer reproduce the documented behavior.
>
> Given the following org file:
> ----------
> #+BEGIN_SRC sh :exports code
> echo "Hello"
> #+END_SRC
>
> # Local Variables:
> # org-latex-listings: t
> # org-latex-custom-lang-environments: (quote ((sh "myverbatim")))
> # END:
> ----------

If I explicitly eval: 

    (org-babel-do-load-languages 'org-babel-load-languages '((sh . t)))
    (setq org-latex-custom-lang-environments '((sh "myverbatim"))
          org-latex-listings t)

And export

#+BEGIN_SRC sh :exports code
echo "Hello"
#+END_SRC

I get the the block wrapped in the desired environment.  I don't know why
your local variables are ignored, but it seems the result is the same when
using the Org-specific BIND keyword...

Rasmus




-- 
And I faced endless streams of vendor-approved Ikea furniture. . .

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

* Re: org-latex-custom-lang-environments
  2015-05-19 15:29 ` org-latex-custom-lang-environments Rasmus
@ 2015-05-19 15:55   ` Jacob Gerlach
  2015-05-19 16:09     ` org-latex-custom-lang-environments Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2015-05-19 15:55 UTC (permalink / raw)
  Cc: Org-mode

Hello,

On Tue, May 19, 2015 at 11:29 AM, Rasmus <rasmus@gmx.us> wrote:
> If I explicitly eval:
>
>     (org-babel-do-load-languages 'org-babel-load-languages '((sh . t)))
>     (setq org-latex-custom-lang-environments '((sh "myverbatim"))
>           org-latex-listings t)
>
> And export
>
> #+BEGIN_SRC sh :exports code
> echo "Hello"
> #+END_SRC
>
> I get the the block wrapped in the desired environment.  I don't know why
> your local variables are ignored, but it seems the result is the same when
> using the Org-specific BIND keyword...


Yes, I see the same - setting them with setq gives the desired
behavior. I must have done this during my initial experimentation
which is why it worked until I restarted emacs.

I know the local variables are parsed - I get asked for confirmation
on potentially unsafe values, and after confirming, C-h v ... shows
that the value has been set correctly.

Does this maybe have to do with export happening in a temporary
buffer? I would assume that file local variables get copied over to
the temp buffer as buffer local variables. Is that the case?

Regards,
Jake

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

* Re: org-latex-custom-lang-environments
  2015-05-19 15:55   ` org-latex-custom-lang-environments Jacob Gerlach
@ 2015-05-19 16:09     ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2015-05-19 16:09 UTC (permalink / raw)
  To: emacs-orgmode

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> Hello,
>
> On Tue, May 19, 2015 at 11:29 AM, Rasmus <rasmus@gmx.us> wrote:
>> If I explicitly eval:
>>
>>     (org-babel-do-load-languages 'org-babel-load-languages '((sh . t)))
>>     (setq org-latex-custom-lang-environments '((sh "myverbatim"))
>>           org-latex-listings t)
>>
>> And export
>>
>> #+BEGIN_SRC sh :exports code
>> echo "Hello"
>> #+END_SRC
>>
>> I get the the block wrapped in the desired environment.  I don't know why
>> your local variables are ignored, but it seems the result is the same when
>> using the Org-specific BIND keyword...
>
>
> Yes, I see the same - setting them with setq gives the desired
> behavior. I must have done this during my initial experimentation
> which is why it worked until I restarted emacs.
>
> I know the local variables are parsed - I get asked for confirmation
> on potentially unsafe values, and after confirming, C-h v ... shows
> that the value has been set correctly.
>
> Does this maybe have to do with export happening in a temporary
> buffer? I would assume that file local variables get copied over to
> the temp buffer as buffer local variables. Is that the case?

No.  And actually it works, only it shouldn't be quoted.

# -*- org-export-allow-bind-keywords: t; -*-
#+BIND: org-latex-listings t
#+BIND: org-latex-custom-lang-environments ((sh "myverbatim"))

#+BEGIN_SRC sh :exports code
echo "Hello"
#+END_SRC


Or

#+BEGIN_SRC sh :exports code
echo "Hello"
#+END_SRC

# Local Variables:
# org-latex-listings: t
# org-latex-custom-lang-environments:  ((sh "myverbatim"))
# END:


Hope it helps,
Rasmus

-- 
Don't panic!!!

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

end of thread, other threads:[~2015-05-19 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-19 15:16 org-latex-custom-lang-environments Jacob Gerlach
2015-05-19 15:29 ` org-latex-custom-lang-environments Rasmus
2015-05-19 15:55   ` org-latex-custom-lang-environments Jacob Gerlach
2015-05-19 16:09     ` org-latex-custom-lang-environments Rasmus

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).