unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: auctex-devel@gnu.org, help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: A strange auto typesetting problem when using auctex.
Date: Mon, 14 Jun 2021 21:14:58 +0200	[thread overview]
Message-ID: <87o8c88cj7.fsf@gnu.org> (raw)
In-Reply-To: <CAGP6POKkBmpWkGpJ63nrXWdaTOcLKmBdh6-E_dsanFVOky8N_w@mail.gmail.com>

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

>> That's because the URL contains % and therefore looks like a "code
>> comment" to auctex, e.g.
>>
>>   \some\latex{code}% And some comment bla bla bla bla...
>>
>> which would be properly filled as
>>
>>   \some\latex{code}% And some comment bla bla bla
>>                    % ...bla...
>>
>> Of course, here it is wrong.
>>
>> I don't see what we could do here, unfortunately.  But please file a bug
>> report (M-x TeX-submit-bug-report RET).
>
> Where will this submit the bug report?

To the GNU bug tracker, debbugs.gnu.org, assigned to the package auctex.

> But now, very strange, the problem disappeared.

Me neither. :-)

The reason is that once the auto-parser has kicked in and seen that you
are using the hyperref LaTeX package, it'll recognize the \href macro
(which is now also fontified correctly, e.g., not with
font-lock-comment-face including and after the first %) and know that
the % in the URL are not starting a comment.

To demonstrate: When you comment the \usepackage{hyperref} and hit `C-c
C-n' the problem will be back.  Uncommenting it again then and hitting
`C-c C-n' makes it disappear.

Bye the way, you might want to add

    (setq TeX-parse-self t)
    (setq TeX-auto-save t)

to your auctex config as described in (info "(auctex) Top").

Bye,
Tassilo



  reply	other threads:[~2021-06-14 19:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14  3:45 A strange auto typesetting problem when using auctex Hongyi Zhao
2021-06-14  6:12 ` Hongyi Zhao
2021-06-14 11:48 ` Tassilo Horn
2021-06-14 15:43   ` Hongyi Zhao
2021-06-14 19:14     ` Tassilo Horn [this message]
2021-06-15  0:48       ` Hongyi Zhao
2021-06-14 20:04 ` Arash Esbati
2021-06-15  0:51   ` Hongyi Zhao

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8c88cj7.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=auctex-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).