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.auctex.devel,gmane.emacs.help Subject: Re: A strange auto typesetting problem when using auctex. Date: Mon, 14 Jun 2021 14:12:33 +0800 Message-ID: References: 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="7865"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: auctex-devel@gnu.org Original-X-From: auctex-devel-bounces+gead-auctex-devel=m.gmane-mx.org@gnu.org Mon Jun 14 08:12:55 2021 Return-path: Envelope-to: gead-auctex-devel@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 1lsfqA-0001rR-Nb for gead-auctex-devel@m.gmane-mx.org; Mon, 14 Jun 2021 08:12:54 +0200 Original-Received: from localhost ([::1]:43444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsfq9-0002XZ-8t for gead-auctex-devel@m.gmane-mx.org; Mon, 14 Jun 2021 02:12:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsfq6-0002X6-KU; Mon, 14 Jun 2021 02:12:50 -0400 Original-Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:44953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsfq3-0007LZ-W0; Mon, 14 Jun 2021 02:12:50 -0400 Original-Received: by mail-lj1-x22b.google.com with SMTP id d2so18464275ljj.11; Sun, 13 Jun 2021 23:12:47 -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=QiKANRLwR3uDH0HQyNZS3nohI78yd8Z2hmI/x6RbEkk=; b=pZTBxgUVkXvqB+QWD0ew9FG6+tQT4qpcOOTIrND1O4vhW2XxDE+ftH/q0/fnswjWNe CRpIZUUFYij5+er7/lR9pZ7olXdGP7QoeBM2NLatlq/PailNzv/yk1n+oxb2pmGqxX8g mRzHaBcMKFjeXimIVtXNKIe24U6w9Dy9nTD/nQHwG+Flxk4r71Jk/F5YeP8ABceRQUo6 TaktiA0U8KhHB+jT4SninLn+ylUUF5qfeQKwr5rvsOwWenZ5oCw+jd1DHqY8DacmknlG KlNgBtfVuIQmqgEcxNlqPq3R7Sdmvt51tAOuhfmG8jjZd4SCKjH2HS4sJ7EsLJ0pGDtg K2Kw== 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=QiKANRLwR3uDH0HQyNZS3nohI78yd8Z2hmI/x6RbEkk=; b=bTEfsd7NSkHHvXFkYqEFiZpkGTmx8qhmUzmzZvJEO/+Y9WO6q0A3vpSzinsOw6Zjra MmPge1FwIo3nGn70YbNRXYwl2GAiqeB2ZZk1ofh9X0Lmvdjctzg3jMcrUSVINGTXnwf2 H7/LliDu88wBdP8QsdcpKew82rlLxNTYeCgo+RwB7cFzGJb1H3XRAhGsJ4MRrKkEp1S3 NfqBY84WghxI/v1Ex/T+eM1uDQvulTUconTEZ9eQ5sS0F5AII4mDlmkx9s0vOl4Azlov dD8U02pRpyoXlLl/Te0hQrtJQEh4ZrXhjQBp0Js+fEaBb4/QA0EOJGzkg7ob1BrX1n0G qvhw== X-Gm-Message-State: AOAM532p/rWFKS0C40iCgkVm2dMymu4nS/bfYfR/QMXXHx1k6dNd3xAK XhB0LujvHMxP6t+D7w+tYP1pk6ExOD9KK8UNjmKp3TuHgj0Ky5aZF0E= X-Google-Smtp-Source: ABdhPJxxbv0FRX1fsUCqpRbvb9QNUNG3kO0rUk4CSMG1C/wznYjSnY5HCQetDmKPOJH7NPqiiANpEptrtHz5RMPd7sM= X-Received: by 2002:a2e:9e16:: with SMTP id e22mr11755381ljk.447.1623651164851; Sun, 13 Jun 2021 23:12:44 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x22b.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: auctex-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion list for AUCTeX developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: auctex-devel-bounces+gead-auctex-devel=m.gmane-mx.org@gnu.org Original-Sender: "auctex-devel" Xref: news.gmane.io gmane.emacs.auctex.devel:6260 gmane.emacs.help:130803 Archived-At: On Mon, Jun 14, 2021 at 11:45 AM Hongyi Zhao wrote: > > On Ubuntu 20.04, I use the latest git master Emacs version compiled by > myself. I install and load auctex's git master version with the > following bootstrap code in `~/.emacs.d/init.el': > > ;;Bootstrap auctex via straight > (straight-use-package > `( auctex :type git :host nil :repo > "https://git.savannah.gnu.org/git/auctex.git" > :pre-build ,(pcase system-type > (`berkeley-unix '("gmake")) > (_ '( > ;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex") > ("./autogen.sh") > ("./configure") > ("make") > ("sudo" "make" "install")))))) > > (load "auctex.el" nil t t) > (load "preview-latex.el" nil t t) > ;;; auctex config ends here > > Then I try to test auctex with the following LaTeX sample file: > > %% LaTeX sample file > \documentclass{paper} > \usepackage{hyperref} > \begin{document} > See > \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page > 98} > \end{document} > %% LaTeX sample file ends here > > When I put the point after the `{page 98}' and hit RET, the LaTeX file > will be automatically completed into the following: > > %% LaTeX sample file > \documentclass{paper} > \usepackage{hyperref} > \begin{document} > See > \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page > % 98} > > \end{document} > %% LaTeX sample file ends here > > As you can see, the auto-completed typesetting result is wrong due to > the leading `%' before ` 98}'. > > Any hints for this problem? Finally, I found the problem was caused by the '%' character appearing in the URL, which in its literal form, is a comment character of LaTeX, so the Emacs/auctex thinks that the newline should be commented out continuously. Change the URL line into the following will fix the problem: \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine\%20L.\%20Quantum\%20mechanics\%20-\%20a\%20modern\%20development\%20(1998)(T)(673s).pdf}{page 98} Regards -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China