From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help,gmane.emacs.auctex.devel Subject: Re: A strange auto typesetting problem when using auctex. Date: Tue, 15 Jun 2021 08:48:15 +0800 Message-ID: References: <87o8c83b4i.fsf@gnu.org> <87o8c88cj7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24579"; mail-complaints-to="usenet@ciao.gmane.io" Cc: auctex-devel@gnu.org, help-gnu-emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 15 02:48:56 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsxGB-0006Dd-Ko for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Jun 2021 02:48:55 +0200 Original-Received: from localhost ([::1]:58478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsxGA-0001rO-Nj for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 20:48:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsxFn-0001rC-HF; Mon, 14 Jun 2021 20:48:31 -0400 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:36487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsxFl-0005l4-J5; Mon, 14 Jun 2021 20:48:31 -0400 Original-Received: by mail-lj1-x22d.google.com with SMTP id 131so22605300ljj.3; Mon, 14 Jun 2021 17:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=shpu75JS13c5uByEFE0bf2wpWCMH6gBm+m/sCIsbXAE=; b=Ov/pfw5luUCq9SbcNIshW3YAcev2cw1EiJJpVjsy/Q2lsxXy2DqJIY3JqhluMlkRMy XU/4Qiwe1RIJhzE7SMsY0ZRihKr192Afxs/SHMDf0KqI6Rn2mZUHJ7vRx3X1HkHfLRGc ZvEtVxxr3rmQ/sVShNgk5SFWXODWTZPC0+XWDy4iuFgOw9WRP36JFd5019U1Gy5Ew31U xq6y/iVHTIzIqLrOaQDlpn8TC+GIsKtJu7s8++BFxGklyndugX7sU0VuweObnivAlZe1 jvCEKrhc5DJwyEu2KhpMUk+8WzctHVni+90sE7Y7TEkQJpOkThb/F4JHfquiDNZh7pMU RZqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=shpu75JS13c5uByEFE0bf2wpWCMH6gBm+m/sCIsbXAE=; b=ZRkpCIEWC2i8E5YZtiimay/yjoLHbPaUmBkhSttfkeBWtSiI3P4sJsTvmqfo2C6zvC 5k4yqtsYSNNewcxc/uB9ZLgH2H9CRUXGoss0483mQW7BfVsPWEtd5BUKD7rnj6yUR4k/ a66SKGur9pCHmIz3EPRV1stzThvqQY4tVwCTdAQPVF6lsqaxu7zOlk8O8PunghLzBhlK 8AK0MrFY6gsOdUZlyASlLp6EctnPxGQPDLWcQbH0AnN5H7qfvT7QkdSa4J764EE2C9bp rUtGID4h1SnLimheWDr8HbovBHjuC36+5XwIKu1SOekbHeVXIJsgvApZn249mUyzF6jS ohbg== X-Gm-Message-State: AOAM531OVyu/ze8nMLJOoDG9/Mi+T7UCZbNd4SCQQQJo/SUJbz6wENpc ThwF9xdO8y3JzoHPZLaoiZySa2HScu0KLDFTsLWX/6uSU1YL7muPpJk= X-Google-Smtp-Source: ABdhPJw7gmNOWMlbQRh+7Xq8UIQL+0W2yPnPAJJ/B04LWSb2j0SSQUZMF8TS448sWY21/NQh7nVEUjA66hmEsmh9+FA= X-Received: by 2002:a2e:3c08:: with SMTP id j8mr15992128lja.481.1623718106959; Mon, 14 Jun 2021 17:48:26 -0700 (PDT) In-Reply-To: <87o8c88cj7.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130827 gmane.emacs.auctex.devel:6266 Archived-At: On Tue, Jun 15, 2021 at 3:35 AM Tassilo Horn wrote: > > Hongyi Zhao 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. Thank you for your insightful analysis. > > Bye the way, you might want to add > > (setq TeX-parse-self t) > (setq TeX-auto-save t) So far, I am using the following settings: (load "auctex.el" nil t t) (load "preview-latex.el" nil t t) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) > > to your auctex config as described in (info "(auctex) Top"). > > Bye, > Tassilo Regards -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China