auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fill breaks verbatim macros not followed with spaces


From: Arash Esbati
Subject: Re: fill breaks verbatim macros not followed with spaces
Date: Mon, 04 Jul 2022 10:11:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> There were still difficulties with my last proposal, so I took another
> approach.

Thanks for looking into this.

> So I ended up with a thought that this sort of matter should be handled
> by emacs built-in syntax facilities. I expect the attached patch
> addresses all issues discussed so far.
>
> I changed the syntax for shortvrb delimiters from "|" (generic string
> delimiters) to "\"" (string quotes) so that it can handle intermixed
> expressions like this:
> \documentclass{article}
> \usepackage{shortvrb}
> \MakeShortVerb{\|}
> \MakeShortVerb{\"}
> \begin{document}
> Donec |posuere"augue| in quam.  "Mauris|ac"
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% LaTeX-shortvrb-chars: (?| ?\")
> %%% End:

Your latest suggestion is probably easier, so we could take it for
LaTeX-mode.  I didn't have the time to check my proposal in docTeX-mode,
so I applied your patch and did it now with this test file:

--8<---------------cut here---------------start------------->8---
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage{etoolbox}
\usepackage{iftex}
\begin{document}
\DocInput{minimal-dtx.dtx}
\end{document}
%</driver>
% \fi
%
% Here is some text with \verb|longer inline verbatim input in one line|
% and now the same thing with
%
% Here is some text with |longer inline verbatim which does break over
% a line|
%
% \endinput
% Local Variables:
% mode: doctex
% TeX-master: t
% End:
--8<---------------cut here---------------end--------------->8---

ltxdoc.el adds '|' to `LaTeX-shortvrb-chars' but fontification of \verb
macro and verbatim-environment doesn't work with docTeX.  I think your
proposal doesn't work there for the same reason.  Maybe we can try to
address this issue as well.

And while we're at it, I think there is also a bug in docTeX-mode which
indents verbatim environments like this:

% \begin{verbatim}
% foobar
% \end{verbatim}

Note the spaces inserted, most notably before the content which means
that it will be inserted in the final product.  I will see if adding it
to `docTeX-indent-inner-fixed' fixes the issue.

> Even with this approach, backslash just before the closing shortvrb
> delimiter like |xyz\| can't be handled correctly, but I think we can
> live with that.

Yes, we can ;-)

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]