From unknown Mon Aug 18 11:17:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#70307 <70307@debbugs.gnu.org> To: bug#70307 <70307@debbugs.gnu.org> Subject: Status: [PATCH] Allow preview to work in non-file buffers Reply-To: bug#70307 <70307@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:17:38 +0000 retitle 70307 [PATCH] Allow preview to work in non-file buffers reassign 70307 auctex submitter 70307 Paul Nelson severity 70307 normal tag 70307 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 06:44:46 2024 Received: (at submit) by debbugs.gnu.org; 9 Apr 2024 10:44:46 +0000 Received: from localhost ([127.0.0.1]:48433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8y5-0003ks-Pe for submit@debbugs.gnu.org; Tue, 09 Apr 2024 06:44:46 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8y2-0003jr-EM for submit@debbugs.gnu.org; Tue, 09 Apr 2024 06:44:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ru8xo-0006I1-N9 for bug-auctex@gnu.org; Tue, 09 Apr 2024 06:44:28 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ru8xn-0001Bs-5s for bug-auctex@gnu.org; Tue, 09 Apr 2024 06:44:28 -0400 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7d6230233f9so11862039f.2 for ; Tue, 09 Apr 2024 03:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712659466; x=1713264266; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=AAIR0qXP7uX5h+gCxJAHhX/CKgqMWdUbEGdEQjiSnD0=; b=Zr+RHxv4pKKMITYINcdOnf840TtDqzPMcHn4O39cVQd9yEKzkrShili6t6aQR7VE7t 0F2+Sowbpz9kd1kASgZSnYzEMI7dG7/7PuyieiM4hBZaysOxCpQMVU24h+POFfgv/nR4 R5QGOUgmpkk3TnVK/iqCCzn8NGHO53l3gYGF7qz4wK1zKjwguHxWK2TWyF8lG5kp7JS6 loC91LoYOrWa/5AgRQR/z355YCZouXw9J5NIqrpFkOJErG8IQQZgWQ5obNy+ndBJS4/A gMxo8A3ScdCCpSsUwJjGK6+j1gNTK8bJdhhhttxHsdw/Vwrk652TSbrekv3uOuCSdqj1 N8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712659466; x=1713264266; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AAIR0qXP7uX5h+gCxJAHhX/CKgqMWdUbEGdEQjiSnD0=; b=gyxW7/MxdRSGAvzngTVqvVoMp14NCP9AKlFFMjpVXFzH05S5/TobaAuZBReE9OaNma JAywLCn8ZeBKPkgJ6kie29RsKnKMODuK0zBeihxLcq2JdPAY9aFWTe94NDg7QYIeE1JL o0SKc9U0zS9aVqZhcmFkykQP3Kqapj50PVf+Zg2AxuSXhlCoIpfU6EoOLClQxLKiBoRF aej6owlt3PBrpQqSiIn+Pjjt3X4JTbdy16PshaFxmhWe0h5aQScyJmk0yRyufVwxImAw jcIOm4i0W/y9GTw1R7nLs9sX1eF76vpkAyOigURymDNSNdTbfA1gJ+gdLCP5sO5cIVGt gaaQ== X-Gm-Message-State: AOJu0YwY8gI9pCsW6NS/PyXhuxw/OFgJPY1xE1zd0/IrKn1Q0JSukfb7 WAmVbrwsw0d0PDFWt3Lc3cx5tUsamj/285NInmXEXkbUizf1vdymOA/KvBVIvZrTcgpIJbAgvSk C4A9HKv8NQbrX81oGvZ5WsOmlDstXh1iCUpM= X-Google-Smtp-Source: AGHT+IF76PuUyrFlOstwDYhiKfBpfTxu7w8WTUaD4sVk8x63QyBN6gz3ComrQuDnnLLlthzN4YoBkSBVVAcD5mj7rX8= X-Received: by 2002:a05:6602:4745:b0:7d6:2b65:9612 with SMTP id dy5-20020a056602474500b007d62b659612mr762565iob.13.1712659465762; Tue, 09 Apr 2024 03:44:25 -0700 (PDT) MIME-Version: 1.0 From: Paul Nelson Date: Tue, 9 Apr 2024 12:44:14 +0200 Message-ID: Subject: [PATCH] Allow preview to work in non-file buffers To: bug-auctex@gnu.org Content-Type: multipart/mixed; boundary="0000000000001413920615a79b3d" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=ultrono@gmail.com; helo=mail-io1-xd2c.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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000001413920615a79b3d Content-Type: text/plain; charset="UTF-8" Hello, This patch allows preview.el to work in LaTeX-mode non-file buffers for which TeX-master has been set to the name of a valid tex file. This patch might appear to be adding a new feature, but if I understand correctly, it's really fixing an ancient bug. From what I can tell, preview.el was carefully designed to support non-file buffers, but this support was broken unintentionally in the commit 3651776f5a57283f97af54a53a6106519bef41b0. In more detail, when preview-region is called on a non-file buffer, the file name "" is passed along to TeX-region-create. Since that commit, the file name is subsequently relativized to the master file, even when it is "". As a result, in preview-parse-messages, the checks (string= file "") fail in cases where they should succeed. This patch makes it so that TeX-region-create only relativizes the file name when it is not equal to "", so that the checks in question succeed, as was intended. As motivation, I have been using something equivalent to this patch for a while, and have found it very useful in, e.g., indirect org-mode source blocks. Thanks, best, Paul --0000000000001413920615a79b3d Content-Type: application/octet-stream; name="0001-Allow-preview-to-work-in-non-file-buffers.patch" Content-Disposition: attachment; filename="0001-Allow-preview-to-work-in-non-file-buffers.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lus95tbs0 RnJvbSA4ZTYxN2ZjZDAyNjJjODQ4NDIxNmM1ODI4MjRmN2RlM2JlYTk5MDRiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIE5lbHNvbiA8dWx0cm9ub0BnbWFpbC5jb20+CkRhdGU6 IFR1ZSwgOSBBcHIgMjAyNCAxMjozMDowNyArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIEFsbG93IHBy ZXZpZXcgdG8gd29yayBpbiBub24tZmlsZSBidWZmZXJzCgoqIHRleC5lbCAoVGVYLXJlZ2lvbi1j cmVhdGUpOiBPbmx5IG1ha2UgZmlsZSBuYW1lIHJlbGF0aXZlIHRvIG1hc3Rlcgp3aGVuIGZpbGUg bmFtZSBpcyBub3QgIjxub25lPiIuCi0tLQogdGV4LmVsIHwgNyArKysrLS0tCiAxIGZpbGUgY2hh bmdlZCwgNCBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL3RleC5l bCBiL3RleC5lbAppbmRleCBjOTA1OTgxZC4uYzRlNDEwNGUgMTAwNjQ0Ci0tLSBhL3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oyLjM5LjMgKEFwcGxlIEdpdC0xNDUpCgo= --0000000000001413920615a79b3d-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 10 04:43:56 2024 Received: (at 70307) by debbugs.gnu.org; 10 Apr 2024 08:43:57 +0000 Received: from localhost ([127.0.0.1]:52112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruTYg-0000Xx-I5 for submit@debbugs.gnu.org; Wed, 10 Apr 2024 04:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruTYd-0000WM-Jh for 70307@debbugs.gnu.org; Wed, 10 Apr 2024 04:43:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruTYO-0000f6-MX; Wed, 10 Apr 2024 04:43:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=XhgDT2jVMiTYdN11yIKrNzgWQax3CgZp5TICO6VkSYs=; b=D96Qqj1XWSdZX9IMJn66 I2ZUCszkPWy+0Biqmk/HWxKIJCIZKFjPJsBANQ/k0OUG3C7pTGTm4obQCDZDH47FkOnYYEyM88Fno wsz7kX/EeypQpmPVkEQSg8bX38OooP+psiQZeZI5U7ILs4z6ZLNd1LsXxyJvtI+G5Sa77gXgpVBhC uVPeeCPHbQux0RsJOIBeWINCEH+sSIoD6xhHiMGFq0Dq6jIxja/3vomQO3zhzENQIXISLZ+/IUFRp ELai8zrs3IwGalWOA3+jHojUMaOM5Fm9RlhBnXCVHRDPeHE7TFadpnbmml/floY7M/EApZPAfkG8d roU+hshMOFcWZQ==; From: Arash Esbati To: Paul Nelson , David Kastrup , Ikumi Keita Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers In-Reply-To: (Paul Nelson's message of "Tue, 9 Apr 2024 12:44:14 +0200") References: Date: Wed, 10 Apr 2024 10:43:20 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70307 Cc: 70307@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Paul Nelson writes: > This patch allows preview.el to work in LaTeX-mode non-file buffers > for which TeX-master has been set to the name of a valid tex file. > > This patch might appear to be adding a new feature, but if I > understand correctly, it's really fixing an ancient bug. From what I > can tell, preview.el was carefully designed to support non-file > buffers, but this support was broken unintentionally in the commit > 3651776f5a57283f97af54a53a6106519bef41b0. > > In more detail, when preview-region is called on a non-file buffer, > the file name "" is passed along to TeX-region-create. Since > that commit, the file name is subsequently relativized to the master > file, even when it is "". As a result, in > preview-parse-messages, the checks (string= file "") fail in > cases where they should succeed. This patch makes it so that > TeX-region-create only relativizes the file name when it is not equal > to "", so that the checks in question succeed, as was intended. > > As motivation, I have been using something equivalent to this patch > for a while, and have found it very useful in, e.g., indirect org-mode > source blocks. Paul, thanks for the patch, the motivation and the change sound reasonable to me. @David and Keita: WDYT, any comments? Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 11 12:48:15 2024 Received: (at 70307) by debbugs.gnu.org; 11 Apr 2024 16:48:16 +0000 Received: from localhost ([127.0.0.1]:57226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruxaw-0006UK-42 for submit@debbugs.gnu.org; Thu, 11 Apr 2024 12:48:15 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:33102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruxao-0006T1-1b for 70307@debbugs.gnu.org; Thu, 11 Apr 2024 12:48:11 -0400 Received: from localhost (42-144-34-11.rev.home.ne.jp [42.144.34.11]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 71F8260; Fri, 12 Apr 2024 01:47:53 +0900 (JST) From: Ikumi Keita To: Arash Esbati Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers In-reply-to: References: Comments: In-reply-to Arash Esbati message dated "Wed, 10 Apr 2024 10:43:20 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19448.1712854072.1@localhost> Date: Fri, 12 Apr 2024 01:47:52 +0900 Message-ID: <19451.1712854072@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70307 Cc: David Kastrup , 70307@debbugs.gnu.org, Paul Nelson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, >>>>> Arash Esbati writes: > @David and Keita: WDYT, any comments? This makes difference only when the file name is "", so it wouldn't affect almost all regular usage. Thus I'm fine with applying this change. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 11 14:09:42 2024 Received: (at 70307-done) by debbugs.gnu.org; 11 Apr 2024 18:09:42 +0000 Received: from localhost ([127.0.0.1]:57274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruyrl-0000An-Oa for submit@debbugs.gnu.org; Thu, 11 Apr 2024 14:09:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruyrg-000093-Ii for 70307-done@debbugs.gnu.org; Thu, 11 Apr 2024 14:09:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruyrO-0005N5-Vq; Thu, 11 Apr 2024 14:09:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=JZu9O0NxfQ4dBiDkobtrN5Uc7F0qsbULPAH8ooOhZdQ=; b=Dr/4t4d3fxEYgxEt2n4T tsLCZVCevVSIZKkF2TnKOf/4EBqmyoP5gFyNL2yP4mMuKbDOHSy+rwez8FIq4lbdABprIjWURdPeD yvvWMXYm15zijEQjBrWDiLswfxAoEIRDg+L5gG13akxNW3LC4K23nepHDOnPi22wbcBjEpBmJ5G43 nM7aNlmfbLmpO7CGSZpqhtr7uLrgiXv+0CjJouaxi0V4tunNIZhBMUzGysCsFTzie8Z4pcg4jNQpC 9ODxg3I/fz2rKFbSYkfbhIP9SWBM3Mx4jkJgq0HOLjhyQoRjhHp1IvJVk9wpP2PUpNZnAO1gHrlJ+ 2O8MCK/1guxgEg==; From: Arash Esbati To: Ikumi Keita Subject: Re: bug#70307: [PATCH] Allow preview to work in non-file buffers In-Reply-To: <19451.1712854072@localhost> (Ikumi Keita's message of "Fri, 12 Apr 2024 01:47:52 +0900") References: <19451.1712854072@localhost> Date: Thu, 11 Apr 2024 20:09:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70307-done Cc: David Kastrup , 70307-done@debbugs.gnu.org, Paul Nelson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ikumi Keita writes: >>>>>> Arash Esbati writes: >> @David and Keita: WDYT, any comments? > > This makes difference only when the file name is "", so it > wouldn't affect almost all regular usage. Thus I'm fine with applying > this change. Gents, thanks for preparing and commenting this change which I just installed. Therefore I'm closing this report. Best, Arash From unknown Mon Aug 18 11:17:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 10 May 2024 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator