Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

automatic setting of mode

0 views
Skip to first unread message

?manu*

unread,
Jul 3, 2009, 10:56:33 AM7/3/09
to
I know that it is possible to write some comments at the beginning of
a file, to tell emacs to open the file with a specified mode. For
example I use the line:

-*- mode: html; -*-

in some files that I would like to edit in HTML mode (even if they
don't have the html extension).

Now I wonder If there is a similar command to get the following:

1. automatically issuing the command
M-x tex-pdf
which tells emacs to compile a LaTeX file with pdflatex.

2. automatically issuing the command
M-x set-buffer-file-coding-system utf-8
telling emacs that the file is encoded in utf8

thank you for any help

E.

Peter Dyballa

unread,
Jul 3, 2009, 5:06:11 PM7/3/09
to ?manu*, help-gn...@gnu.org

Am 03.07.2009 um 16:56 schrieb ?manu*:

> Now I wonder If there is a similar command to get the following:
>
> 1. automatically issuing the command
> M-x tex-pdf
> which tells emacs to compile a LaTeX file with pdflatex.

I don't know what the simple built-in TeX-mode accepts, for AUCTeX
you can put among its block of (file) local variables:

%%% TeX-PDF-mode: t

>
> 2. automatically issuing the command
> M-x set-buffer-file-coding-system utf-8
> telling emacs that the file is encoded in utf8

LaTeX's Unicode or UTF-8 encoding support is very limited (maybe 1 %
of the BMP) (and complicated to use). For a TeX file you would need
to use % as comment character. In the file's header it would be:

coding: utf-8;

and in the file's footer (example):

%%% coding: utf-8-unix


--
Greetings

Pete

Make it simple, as simple as possible but no simpler.
– Albert Einstein

?manu*

unread,
Jul 4, 2009, 7:58:18 AM7/4/09
to
On 3 Lug, 23:06, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 03.07.2009 um 16:56 schrieb ?manu*:
>
> > Now I wonder If there is a similar command to get the following:
>
> > 1. automatically issuing the command
> > M-x tex-pdf
> > which tells emacs to compile a LaTeX file with pdflatex.
>
> I don't know what the simple built-in TeX-mode accepts, for AUCTeX  

Yes, I use AUCTeX

> you can put among its block of (file) local variables:
>
>         %%% TeX-PDF-mode: t

This didn't worked for me. But using your snippet code I found this
discussion which was useful to me:

http://osdir.com/ml/emacs.auctex.general/2006-01/msg00002.html

> > 2. automatically issuing the command
> > M-x set-buffer-file-coding-system utf-8
> > telling emacs that the file is encoded in utf8
>
> LaTeX's Unicode or UTF-8 encoding support is very limited (maybe 1 %  
> of the BMP) (and complicated to use). For a TeX file you would need  
> to use % as comment character. In the file's header it would be:
>
>         coding: utf-8;

Thank you so much. Actually this I need it in an HTML file not TeX. It
seems to me that it works.

E.

Lennart Borgman

unread,
Jul 4, 2009, 8:43:58 AM7/4/09
to ?manu*, help-gn...@gnu.org
>>         coding: utf-8;
>
> Thank you so much. Actually this I need it in an HTML file not TeX. It
> seems to me that it works.

If it is xhtml you can use

<?xml version="1.0" encoding="utf-8"?>


Peter Dyballa

unread,
Jul 4, 2009, 9:58:40 AM7/4/09
to ?manu*, help-gn...@gnu.org

Am 04.07.2009 um 13:58 schrieb ?manu*:

>> you can put among its block of (file) local variables:
>>
>> %%% TeX-PDF-mode: t


For me, and AUCTeX 11.85, it worked pretty well. The mode-line showed
pdfLaTeX in that case and LaTeX in the case without that variable.
Besides, to make tests best launch GNU Emacs without your
customisation, for example as 'emacs -q …' or 'emacs -Q …'

--
Greetings
Pete

"We need a president who's fluent in at least one language."
– Buck Henry

0 new messages