From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Sebastian Urban <mrsebastianurban@gmail.com>
Cc: 36358@debbugs.gnu.org
Subject: bug#36358: Indentation of not matched braces in latex-mode
Date: Tue, 25 Jun 2019 10:53:50 -0400 [thread overview]
Message-ID: <jwv1rzhwwqq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <dcdde73c-fe9e-735c-5045-7c5b3bea2ec5@gmail.com> (Sebastian Urban's message of "Tue, 25 Jun 2019 09:30:35 +0200")
> Hmmm... or I don't understand how "specify commands whose args
> shouldn't be indented" will work in practice, or this may be wrong
> path. It's not about \emph{} or \footnote{}, it's about every command
> which use '{}' (braces), so in latex... most of them(?). Therefore if
> you let people add them to the list it'll grow really big - just look
> at font styles: \textrm{}, \textit{}, \textmd{}, \textbf{}, \textup{},
> \textsl{}, \textsf{}, \textsc{}, \texttt{}, \textnormal{} - we could
> probably use "\text*", but there are other commands, for example the
> ones we define as new in preamble.
Most of the ones I define are commands for which I do want the args to
be indented. I typically use them like this:
prefix: \TAlign{
foo \\
bar
}
where \TAlign expands to a kind of `tabular` environment.
Similarly, I want
\section{foo bar baz
toto titi tata}
rather than
\section{foo bar baz
toto titi tata}
> Unless this patch is temporary lifebuoy for those who don't want to
> set 'tex-indent-basic' to 0, then well... carry on. :)
It's not meant as a temporary solution. More a tentative solution.
Thinking more about it, the main distinction is whether the command is
used "within a paragraph" or not. But I don't really know how to
precisely characterize this notion of "within a paragraph".
>> Note that the patch is for Emacs's bundled tex-mode, whereas you
>> seem to be using AUCTeX, which uses its own indentation code.
> No, I'm _not_ using AUCTeX, I'm using latex-mode. I only pointed to
> AUCTeX, because when I was looking for answer to this problem, I found
> solution (helpful internet) in AUCTeX - 'TeX-brace-indent-level'
> variable - and wanted something similar in latex-mode.
Good.
> Also I found code in theirs (AUCTeX) TEX.EL, which may help a bit.
> It may, but since I basically know no Elisp, I may be wrong.
> (defcustom TeX-brace-indent-level 2
[...]
> (defun TeX-brace-count-line ()
It seems to indent by 2 regardless of the command, just like what you
don't want.
Stefan
next prev parent reply other threads:[~2019-06-25 14:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 16:08 bug#36358: Indentation of not matched braces in latex-mode Sebastian Urban
2019-06-24 23:22 ` Stefan Monnier
2019-06-25 7:30 ` Sebastian Urban
2019-06-25 14:53 ` Stefan Monnier [this message]
2019-06-26 7:46 ` Sebastian Urban
2019-06-26 13:49 ` Stefan Monnier
2019-06-27 8:53 ` Sebastian Urban
2019-06-29 20:08 ` Sebastian Urban
2019-06-29 21:02 ` Stefan Monnier
2020-07-09 17:18 ` Sebastian Urban
2019-07-05 15:20 ` Basil L. Contovounesios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv1rzhwwqq.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=36358@debbugs.gnu.org \
--cc=mrsebastianurban@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.