all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Setting file-local list variables
@ 2008-05-20 19:30 Mark Elston
  2008-05-21 13:36 ` Joel J. Adamson
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Elston @ 2008-05-20 19:30 UTC (permalink / raw)
  To: help-gnu-emacs

(I sent this to the AucTeX mailing list as well but since this is
possibly more an Emacs issue I thought I would send it here as well.)

I have been trying to set a file local variable for a LaTeX file
I have been working on and it just doesn't seem to stick.  In
particular I am trying to set LaTeX-verbatim-environments.  I am
using the fancyvrb package and have developed some specific verbatim
environments and want AucTeX to deal with them appropriately.  These
environments are specific to the file I am working on and, so, I don't
want to customize AucTeX to *always* recognize them since they won't
appear in any other files.

However, when I put the following in my .tex file:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% LaTeX-verbatim-environments: ("verbatim" "verbatim*" "CodeListing" 
"OldCodeListing" "NewCodeListing")
%%% End:

I get a warning when loading the file that setting the variable may
not be safe.  I hit 'y' to apply the local variables list and the file
is loaded.  However, even though I can look at the variable and see that
it is set appropriately, AucTeX doesn't handle these environments as
verbatim environments.

If I customize the variable then it works fine.

How do I set this variable so that it applies to the file?

Mark


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

* Re: Setting file-local list variables
  2008-05-20 19:30 Setting file-local list variables Mark Elston
@ 2008-05-21 13:36 ` Joel J. Adamson
  0 siblings, 0 replies; 5+ messages in thread
From: Joel J. Adamson @ 2008-05-21 13:36 UTC (permalink / raw)
  To: Mark Elston; +Cc: help-gnu-emacs

Mark Elston <m.elston@RemoveAdvantest-ardRemove.com> writes:

> (I sent this to the AucTeX mailing list as well but since this is
> possibly more an Emacs issue I thought I would send it here as well.)
>
> I have been trying to set a file local variable for a LaTeX file
> I have been working on and it just doesn't seem to stick.  In
> particular I am trying to set LaTeX-verbatim-environments.  I am
> using the fancyvrb package and have developed some specific verbatim
> environments and want AucTeX to deal with them appropriately.  These
> environments are specific to the file I am working on and, so, I don't
> want to customize AucTeX to *always* recognize them since they won't
> appear in any other files.
>
> However, when I put the following in my .tex file:
>
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% LaTeX-verbatim-environments: ("verbatim" "verbatim*" "CodeListing" 
> "OldCodeListing" "NewCodeListing")
> %%% End:

[...]

> How do I set this variable so that it applies to the file?

Have you tried quoting?  I still get the same thing, when I try the
following document:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\documentclass{article}
\begin{document}

\begin{verbatim}
Kiss this!
\sin(x)

\end{verbatim}
\begin{equation}
  \label{eq:1}
  \sin(x)
\end{equation}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% LaTeX-verbatim-environments: '("verbatim" "verbatim*" "CodeListing" "OldCodeListing" "NewCodeListing")
%%% End:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@someone-who-knows: Does this just come up when a new variable is
introduced in a local variables list?

@OP: If so, what's wrong with marking the variables as safe and applying
them in the future (!)?

Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu
http://www.unc.edu/~adamsonj




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

* Re: Setting file-local list variables
@ 2008-05-21 17:21 Mark Elston
  2008-05-22 13:01 ` Joel J. Adamson
       [not found] ` <mailman.12007.1211462109.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Elston @ 2008-05-21 17:21 UTC (permalink / raw)
  To: help-gnu-emacs



* Joel J. Adamson wrote (on 5/21/2008 6:36 AM):
> 
> ...
> 
> Have you tried quoting?  I still get the same thing, when I try the
> following document:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> \documentclass{article}
> \begin{document}
> 
> \begin{verbatim}
> Kiss this!
> \sin(x)
> 
> \end{verbatim}
> \begin{equation}
>   \label{eq:1}
>   \sin(x)
> \end{equation}
> 
> \end{document}
> 
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% LaTeX-verbatim-environments: '("verbatim" "verbatim*" "CodeListing" "OldCodeListing" "NewCodeListing")
> %%% End:
> 

Yeah, it didn't work for me either.

> @someone-who-knows: Does this just come up when a new variable is
> introduced in a local variables list?
> 
> @OP: If so, what's wrong with marking the variables as safe and applying
> them in the future (!)?

I tried that, too.  It didn't work either.

I wonder if this is an AucTeX thing.  The AucTeX manual says that this variable controls
the verbatim-like environments.  However, in the help for the variable it says:



        LaTeX-verbatim-environments is a variable defined in `latex.el'.
        Its value is 
        '("verbatim" "verbatim*" "CodeListing" "OldCodeListing" "NewCodeListing")

        Local in buffer AddingStateMachineToClass.tex; global value is 
        ("verbatim" "verbatim*")

        Documentation:
        Verbatim environments.

        Programs should not use this variable directly but the function
        `LaTeX-verbatim-environments' which returns a value including
        buffer-local keyword additions via
        `LaTeX-verbatim-environments-local' as well.


I don't know if this means that setting the variables is the wrong way to go.

BTW, I have also tried setting 'LaTeX-verbatim-environments-local' both as a list
and a quoted list as well.  That, too, doesn't work.

Mark


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

* Re: Setting file-local list variables
  2008-05-21 17:21 Mark Elston
@ 2008-05-22 13:01 ` Joel J. Adamson
       [not found] ` <mailman.12007.1211462109.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Joel J. Adamson @ 2008-05-22 13:01 UTC (permalink / raw)
  To: Mark Elston; +Cc: help-gnu-emacs

Mark Elston <M.Elston@RemoveAdvantest-ardRemove.com> writes:

> * Joel J. Adamson wrote (on 5/21/2008 6:36 AM):

>
> Yeah, it didn't work for me either.

I wouldn't expect it to work for you, if it failed for me ;)

>> @someone-who-knows: Does this just come up when a new variable is
>> introduced in a local variables list?
>> 
>> @OP: If so, what's wrong with marking the variables as safe and applying
>> them in the future (!)?
>
> I tried that, too.  It didn't work either.

What do you mean it didn't work?  Did you enter "!" when prompted?  From
the *Help* you show, it seems that it did "work" as far as setting the variable.

> I wonder if this is an AucTeX thing.  The AucTeX manual says that this
>variable controls the verbatim-like environments.  However, in the help
>for the variable it says:
>
>
>
>         LaTeX-verbatim-environments is a variable defined in `latex.el'.
>         Its value is 
>         '("verbatim" "verbatim*" "CodeListing" "OldCodeListing" "NewCodeListing")

That's Emacs being a self-documenting editor.

>         Programs should not use this variable directly but the function
>         `LaTeX-verbatim-environments' which returns a value including
>         buffer-local keyword additions via
>         `LaTeX-verbatim-environments-local' as well.
>
> I don't know if this means that setting the variables is the wrong way to go.
>
> BTW, I have also tried setting 'LaTeX-verbatim-environments-local' both as a list
> and a quoted list as well.  That, too, doesn't work.

Hmmmm...what is it you're trying to accomplish?  Refresh my memory.

Glad to help, if only for discussion's sake :)

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu
http://www.unc.edu/~adamsonj




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

* Re: Setting file-local list variables
       [not found] ` <mailman.12007.1211462109.18990.help-gnu-emacs@gnu.org>
@ 2008-05-22 16:21   ` Mark Elston
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Elston @ 2008-05-22 16:21 UTC (permalink / raw)
  To: help-gnu-emacs

adamsonj@email.unc.edu (Joel J. Adamson) wrote in
news:mailman.12007.1211462109.18990.help-gnu-emacs@gnu.org: 

> Mark Elston <M.Elston@RemoveAdvantest-ardRemove.com> writes:
> 
>> * Joel J. Adamson wrote (on 5/21/2008 6:36 AM):
> ...
>
>>> @someone-who-knows: Does this just come up when a new variable is
>>> introduced in a local variables list?
>>> 
>>> @OP: If so, what's wrong with marking the variables as safe and
>>> applying them in the future (!)?
>>
>> I tried that, too.  It didn't work either.
>
> What do you mean it didn't work?  Did you enter "!" when prompted? 
> From the *Help* you show, it seems that it did "work" as far as
> setting the variable. 
> 

It didn't apply these variables to the buffer as it was loaded.  Rather,
it didn't result in the proper faces being applied to the appropriate
regions.
 
>> I wonder if this is an AucTeX thing.  The AucTeX manual says that
>> this 
>>variable controls the verbatim-like environments.  However, in the
>>help for the variable it says:
>>

It turns out it *is* an AucTeX thing.  See below.

> ... 
> Hmmmm...what is it you're trying to accomplish?  Refresh my memory.
> 

I'm trying to set a list variable in a buffer so that AucTeX can apply
the proper faces to verbatim-like regions in my text.  I wound up with
the following:

%%% eval: (eval-after-load "latex" '(progn (add-to-list 'LaTeX-verbatim-
environments "CodeListing")(add-to-list 'LaTeX-verbatim-environments 
"OldCodeListing")(add-to-list 'LaTeX-verbatim-environments 
"NewCodeListing")))

Unfortunately, this still isn't quite right since it applies the 
changes *globally* and doesn't affect the *first* load of a file with
this line in it (I have to close the file and reopen it to get the
changes applied).

It turns out that these environments are created only for one LaTeX
file I am working with so I don't want to put this in my custom.el
forever.  Other files may have other verbatim-like environments to
make use of so I want this on a file-by-file basis.

Sigh.  Still looking for the best answer.

Mark


> Glad to help, if only for discussion's sake :)
> 
> Joel
> 



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

end of thread, other threads:[~2008-05-22 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20 19:30 Setting file-local list variables Mark Elston
2008-05-21 13:36 ` Joel J. Adamson
  -- strict thread matches above, loose matches on Subject: below --
2008-05-21 17:21 Mark Elston
2008-05-22 13:01 ` Joel J. Adamson
     [not found] ` <mailman.12007.1211462109.18990.help-gnu-emacs@gnu.org>
2008-05-22 16:21   ` Mark Elston

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.