Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread Ikumi Keita
> Ikumi Keita  writes:
> And sorry, I misunderstood the position of %(extraopts).  I thought that
> the current AUCTeX allows `TeX-command-extra-options' to insert TeX
> codes in a command line like this:

> %%% TeX-command-extra-options: "\\foo\\bar{\\bla}"

> But that's not the case.  Since %(extraopts) is put BEFORE %(mode) in
> the default `TeX-command-list' and `LaTeX-command-style', such settings
> won't work.

> Thus `TeX-command-extra-options' cannot be used to put TeX codes in a
> command line even with current AUCTeX.  I'm sorry for my confusing
> statements so far.

Argh, I was wrong again!  It IS possible to put TeX codes in a command
line through `TeX-command-extra-options' with current AUCTeX.
%%% TeX-command-extra-options: " \"\\foo\\bar{\\bla}\""
will do the trick.  I'm deeply sorry.  Sigh.
The codes written in `TeX-expand-list-builtin' associated with the four
entries
%` 
 "\
"
%'
cooperate to transport TeX codes wrapped inside dobule quotes just
before the "\input".  It can be confirmed by evaluating
(let ((TeX-command-extra-options " \"\\foo\\bar{\\bla}\""))
  (TeX-command-expand "%`%l%(mode)%'" 'TeX-master-file))
.  The TeX code "\foo\bar{\bla}" is put after the expansion of %(mode)
and just before "\input" in the return value.

> I wonder how Colin achieves to put TeX codes in a command line in
> AUCTeX.  Perhaps by customizing `TeX-command-list' or
> `LaTeX-command-style'?  Or customizing `TeX-expand-list' to override the
> default expansion of %(extraopts), %(mode) etc.?

Now I realize how he does.

> jfbu  writes:

> About this in the patch under discussion

> +  ;; Since TeXLive 2018, the default encoding for LaTeX files has been
> +  ;; changed to UTF-8 if used with classic TeX or pdfTeX.  I.e.,
> +  ;; \usepackage[utf8]{inputenc} is enabled by default in (pdf)latex.
> +  ;; c.f. LaTeX News issue 28
> +  ;; Due to this change, \detokenize is required to recognize non
> +  ;; ascii characters in the file name.

> The exact explanation would be that this is required in case the
> \input method of executing the file is used. It is not required
> in the case of "pdflatex filename" invocation,

Yes, the reason I added that comment is that the relavant entry has "%`"
and "%'" in it.  Although it might seem that \detokenize is placed where
no "\input" is present, "\input" is supplied automatically because of
these "%`" and "%'".  In other words, "\input" is always there actually.

Regards,
Ikumi Keita

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread Colin Baxter
> Arash Esbati  writes:

> Ikumi Keita  writes:
>> The difference between my two patches are summarized below:
>> 1. Previous patch Good points: - LaTeX format version banner is
>> not discarded in the log file. [1] - First line parsing is not
>> disabled. [2] - Bug#25276 is fixed. [3] Bad points: - Users
>> cannot put TeX codes in a command line by default.  2. New patch
>> Good points: - Users still can put TeX codes in a command line.
>> Bad points: - LaTeX format version banner is discarded in the log
>> file by default.  - First line parsing is disabled by default.  -
>> Bug#25276 remains.
>> 
>> I still prefer the approach of the previous patch, but will honor
>> your opinion if you are still against it.

> Hi Keita,

> many thanks for working on this.  I haven't looked at the patch,
> but I think we should keep `TeX-command-extra-options' working.
> It is a very flexible way to control the binary invoked on a file
> basis.  E.g., all files which \usepackage{minted} need this:

> %%% TeX-command-extra-options: "-shell-escape"

> I'm not sure if first line parsing is so important.  The issue
> described here[1] can be solved with

> %%% TeX-command-extra-options: "--fmt=foo.fmt"

> Hence, I'm voting to keep this feature running and drop something
> else.

I agree.

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread jfbu

Le 21/05/2018 à 14:06, jfbu a écrit :

Hi Arash

Le 21/05/2018 à 12:26, Arash Esbati a écrit :

Ikumi Keita  writes:


The difference between my two patches are summarized below:
1. Previous patch
    Good points:
    - LaTeX format version banner is not discarded in the log file. [1]
    - First line parsing is not disabled. [2]
    - Bug#25276 is fixed. [3]
    Bad points:
    - Users cannot put TeX codes in a command line by default.
2. New patch
    Good points:
    - Users still can put TeX codes in a command line.
    Bad points:
    - LaTeX format version banner is discarded in the log file by default.
    - First line parsing is disabled by default.
    - Bug#25276 remains.

I still prefer the approach of the previous patch, but will honor your
opinion if you are still against it.


Hi Keita,

many thanks for working on this.  I haven't looked at the patch, but I
think we should keep `TeX-command-extra-options' working.  It is a very
flexible way to control the binary invoked on a file basis.  E.g., all
files which \usepackage{minted} need this:

 %%% TeX-command-extra-options: "-shell-escape"



Surely Keita (sorry Keita for mixing up your firstname with lastname!)
will know better
than me but from brief look at the patch %(extraopts) is still there.




More precisely for LaTeX compilation it is inserted via

LaTeX-command-style is a variable defined in ‘tex.el’.
Its value is
(("" "%(PDF)%(latex) %(file-line-error) %(extraopts) %S%(PDFout)"))


which to best of my knowledge is not affected by Keita's patch.

Best,

Jean-François


The only thing is that it can't be used with TeX macros like \def\x{blurp}
if the file is not processed then via \input.

The documentation in tex.el says

"String with the extra options to be given to the TeX processor."

it does not mention possibility to use it for inserting TeX macros
before inputting the file for processing. Do AUXTeX users employ it
this way?

The patch has no impact on -shell-escape.

Best,

Jean-François



I'm not sure if first line parsing is so important.  The issue described
here[1] can be solved with

 %%% TeX-command-extra-options: "--fmt=foo.fmt"

Hence, I'm voting to keep this feature running and drop something else.

Best, Arash

Footnotes:
[1]  http://lists.gnu.org/archive/html/auctex/2018-05/msg4.html






___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread jfbu

Hi Arash

Le 21/05/2018 à 12:26, Arash Esbati a écrit :

Ikumi Keita  writes:


The difference between my two patches are summarized below:
1. Previous patch
Good points:
- LaTeX format version banner is not discarded in the log file. [1]
- First line parsing is not disabled. [2]
- Bug#25276 is fixed. [3]
Bad points:
- Users cannot put TeX codes in a command line by default.
2. New patch
Good points:
- Users still can put TeX codes in a command line.
Bad points:
- LaTeX format version banner is discarded in the log file by default.
- First line parsing is disabled by default.
- Bug#25276 remains.

I still prefer the approach of the previous patch, but will honor your
opinion if you are still against it.


Hi Keita,

many thanks for working on this.  I haven't looked at the patch, but I
think we should keep `TeX-command-extra-options' working.  It is a very
flexible way to control the binary invoked on a file basis.  E.g., all
files which \usepackage{minted} need this:

 %%% TeX-command-extra-options: "-shell-escape"



Surely Keita (sorry Keita for mixing up your firstname with lastname!)
will know better
than me but from brief look at the patch %(extraopts) is still there.

The only thing is that it can't be used with TeX macros like \def\x{blurp}
if the file is not processed then via \input.

The documentation in tex.el says

"String with the extra options to be given to the TeX processor."

it does not mention possibility to use it for inserting TeX macros
before inputting the file for processing. Do AUXTeX users employ it
this way?

The patch has no impact on -shell-escape.

Best,

Jean-François



I'm not sure if first line parsing is so important.  The issue described
here[1] can be solved with

 %%% TeX-command-extra-options: "--fmt=foo.fmt"

Hence, I'm voting to keep this feature running and drop something else.

Best, Arash

Footnotes:
[1]  http://lists.gnu.org/archive/html/auctex/2018-05/msg4.html




___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread Ikumi Keita
Hi Arash and Jean,

> jfbu  writes:
>> 
>> Hi Keita,
>> 
>> many thanks for working on this.  I haven't looked at the patch, but I
>> think we should keep `TeX-command-extra-options' working.  It is a very
>> flexible way to control the binary invoked on a file basis.  E.g., all
>> files which \usepackage{minted} need this:
>> 
>> %%% TeX-command-extra-options: "-shell-escape"

As Jean pointed out, I didn't touch how `TeX-command-extra-options' is
used.

And sorry, I misunderstood the position of %(extraopts).  I thought that
the current AUCTeX allows `TeX-command-extra-options' to insert TeX
codes in a command line like this:

%%% TeX-command-extra-options: "\\foo\\bar{\\bla}"

But that's not the case.  Since %(extraopts) is put BEFORE %(mode) in
the default `TeX-command-list' and `LaTeX-command-style', such settings
won't work.

Thus `TeX-command-extra-options' cannot be used to put TeX codes in a
command line even with current AUCTeX.  I'm sorry for my confusing
statements so far.

I wonder how Colin achieves to put TeX codes in a command line in
AUCTeX.  Perhaps by customizing `TeX-command-list' or
`LaTeX-command-style'?  Or customizing `TeX-expand-list' to override the
default expansion of %(extraopts), %(mode) etc.?

> Surely Keita (sorry Keita for mixing up your firstname with lastname!)

Don't mind, we Japanese (at least I) generally don't care much whether
to be called by first name or last name in conversation with western
people :-).

Regards,
Ikumi Keita

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Typeset LaTeX files with non-ascii file name in TeXLive 2018

2018-05-21 Thread Ikumi Keita
Hi Colin,

> Colin Baxter  writes:

> I really do not like what I understand to be this suggestion. If users
> cannot put TeX codes in a command then extensive functionality is
> lost. The bar on non-ascii file names seems trivial to me - sorry.

Thanks for your comment. I made out another patch, attached with this
message, which continues to let the user to be able to put TeX codes on
the command line, with some drawbacks explained later.

In fact, even with my previous patch, it is possible to retain the
functionality to put TeX codes in a command line.  If you modify the
relavant entries in `TeX-command-list' (or add new entries) so that it
looks as
("TeX" "%(PDF)%(tex) %(file-line-error) %(extraopts) %`%S%(PDFout)%(mode)%'
 %t" ...
("LaTeX" "%`%l%(mode)%' \"\\detokenize\"{%t}" ...
, you can still use `TeX-command-extra-options' to put raw TeX codes.

The difference between my two patches are summarized below:
1. Previous patch
   Good points:
   - LaTeX format version banner is not discarded in the log file. [1]
   - First line parsing is not disabled. [2]
   - Bug#25276 is fixed. [3]
   Bad points:
   - Users cannot put TeX codes in a command line by default.
2. New patch
   Good points:
   - Users still can put TeX codes in a command line.
   Bad points:
   - LaTeX format version banner is discarded in the log file by default.
   - First line parsing is disabled by default.
   - Bug#25276 remains.

Both approaches fix the original problem about non-ascii file names, and
in both cases, the bad points are circumvented by customizing
`TeX-command-list'.  However, if `TeX-command-list' is customized, the
user have to edit the cusomization every time a new AUCTeX release
contains modification to the default value of the variable, in order to
incorporate that modification into one's customized value.
Colin, could you please compare the two situations?  I still prefer the
approach of the previous patch, but will honor your opinion if you are
still against it.

Best regards,
Ikumi Keita

[1] https://lists.gnu.org/archive/html/auctex/2018-05/msg3.html
[2] https://lists.gnu.org/archive/html/auctex/2018-05/msg4.html
[3] https://lists.gnu.org/archive/html/auctex/2018-05/msg00010.html



non-ascii-file-name-v3.gz
Description: Continue to use \input
___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel