From unknown Fri Sep 19 14:23:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79462: 14.1.0; Set correct TeX-sentinel-function before starting processes. Resent-From: Al Haji-Ali Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 17 Sep 2025 07:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79462 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: 79462@debbugs.gnu.org Cc: Ikumi Keita , Arash Esbati X-Debbugs-Original-To: bug-auctex@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17580947828331 (code B ref -1); Wed, 17 Sep 2025 07:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Sep 2025 07:39:42 +0000 Received: from localhost ([127.0.0.1]:53997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uymlR-0002AI-RG for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:39:42 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43778) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uymlO-00029k-PZ for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:39:39 -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 1uymlI-0005QR-Rc for bug-auctex@gnu.org; Wed, 17 Sep 2025 03:39:32 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uymlC-0007ir-2t for bug-auctex@gnu.org; Wed, 17 Sep 2025 03:39:32 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3eb0a50a4c3so1940639f8f.1 for ; Wed, 17 Sep 2025 00:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758094764; x=1758699564; darn=gnu.org; h=mime-version:message-id:date:cc:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=OI6wKJ1nmzGHwz7VkZo8K46RGriA/ZA3QVUoMpx7W3Q=; b=kUXTnt5xPHwWhd4qReW1xWE3azpEpmWysUjHlZUcBsaAat0pbET8ShAsUkoLheEy5y ovjk8CII5c+th+smJ5EDrdgiT0pNCw0C49RdPxL23VMcLoF9UnrhkPGWr+8U+9Qcd7NP oi0+9/SlmRv3gp2DNzwprUcXckDyo2VvtluNopB1dE29HEROSzvUcSKAwH5eAmBmPTMt qJWaj7uB9ZXFg+BS+rkkPyetHltGyMG6q7dsW9iV9MOv2DR4FkoI2RF5D48EKt8D8etK f+qMPgQQMjKMFbcXDW4r/rdeV1egnfpnlpma2QFYz3BKEY8n9GDh+Sb9pFGc1gEP6o1G a0Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758094764; x=1758699564; h=mime-version:message-id:date:cc:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OI6wKJ1nmzGHwz7VkZo8K46RGriA/ZA3QVUoMpx7W3Q=; b=woBSoJI7VPEUHRnyzlltyrZEHAlPEy9rsZKONEwaFCqSlgW1sV/k+ZvauUu4I4ztPj cEVtVZ8pIIBySQSrwKiqqy+8jJO7SvNTTmvlsIxVgRITGbg1dZZAkCFrn+xeJVq/3avf CDsOKHfI86gRE9u4IKDcDehhs0Tk7Chw9ugyOiA54Ihx0MbozW7RzDqOrI4nqL3+ulQq Pgfe9jLffni/d3WNoYbO/qJM8WjLLR8ZBIWkr52ev6mr+Scws+sZ0jMHXXU81iMCVx72 H+xp254c8oF/kJSqwQ2IX5B1H8Ga2tKeB7JK+2IbIvO387Vkf4B7LoW4F/zqnhm9T1td I39Q== X-Gm-Message-State: AOJu0Yz4zgP+ltE0WALL0GLxh77nmsODN12k8ErAuqEWaG+WWE1OGZA2 CrwjlK+3mo5lXNIQKeZhsOm5yZwUFLIp4/O0CWPYUigcg2ogvWcmhSnTBnt4ZPz2 X-Gm-Gg: ASbGncvZC8xojF8dcooKgoj4u7OzJVQU/aa8Og8aCLI/0Bd0+yGI2duvnGrqNNS96Xm YbGNoTD9squvQjuyITnhFAc20OBuVGeF5ly4Z+RXpmOPjQFUeK062h7KgQUW+hqVtYIG6rMsFhU eUalUM7e3LbOj2gbfD00Y8L3TN+iuyKh1OR8OaFzRO2uVY9LbQvVgIdKitHZtXl+5eFZnbmB/qR omHbZplZhCMBqOQFPxSa7jURpdgI4jyBNRi+9vkjal3CQ3u5P7aYoIRQE0TxR87NUhP0ZNIkuE6 Dc6Np13oWdRiXCzoMnJsTI1Vsf587ropJAUhedyylccn7mqIsRmuXlOqPl6Q10BUrcW171sN48c a1V+kGA/S9FLfKTWHSf2qVrFwfnNHZTET1bHHxIcrjg7m X-Google-Smtp-Source: AGHT+IHVGR6JghB9rHquiQIxfAGXP472jX4eWXZ9s1sZ0CYYfSMv0Qawj+2mpQNpsJE0o/+Iykjmkg== X-Received: by 2002:a5d:64e5:0:b0:3ec:4fe:864 with SMTP id ffacd0b85a97d-3ecdfa32ef4mr1021767f8f.45.1758094763918; Wed, 17 Sep 2025 00:39:23 -0700 (PDT) Received: from localhost ([2a00:8a60:e000:101:3953:8187:4257:bc0f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e8c7375fb7sm16889636f8f.14.2025.09.17.00.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 00:39:23 -0700 (PDT) From: Al Haji-Ali Date: Wed, 17 Sep 2025 09:31:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=abdo.haji.ali@gmail.com; helo=mail-wr1-x429.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=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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 (/) --=-=-= Content-Type: text/plain Hello, This is a follow-up bug-report/patch from: https://lists.gnu.org/archive/html/auctex-devel/2025-08/msg00026.html Previously, preview was setting the TeX-sentinel-function to temporary lambda functions inside `preview-start-*` functions which just outputs a message. This value is overwritten by functions that call `preview-start-*` to a correct sentinel. In most cases, this is harmless as the original sentinel is never called. However, preview-start-* also has a `sit-for` call which causes timers to be processed, and which may call `accept-process-output` causing the "wrong" temporary sentinel to be called. I faced this issue when developing preview-point (discussed above) and I am submitting this patch which simply sets the correct sentinel before calling preview-start-*. -- Al --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=preview-TeX-sentinel-function.patch >From 6166cbec1b40ef26eb79dca9bb9b37c8318ce1d2 Mon Sep 17 00:00:00 2001 From: Al Haji-Ali Date: Wed, 3 Sep 2025 11:10:11 +0100 Subject: [PATCH] preview: Set correct TeX-sentinel-function before starting processes. * preview.el (preview-gs-dvips-process-setup, preview-dvipng-process-setup, preview-pdf2dsc-process-setup, preview-dvipng-place-all): Set `TeX-sentinel-function` before calling preview-start-* functions to start processes. (preview-start-dvipng, preview-start-dvips, preview-start-pdf2dsc): Remove temporary setting of `TeX-sentinel-function`. --- preview.el | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/preview.el b/preview.el index 88886b83..22316335 100644 --- a/preview.el +++ b/preview.el @@ -133,8 +133,7 @@ considerable time under XEmacs, it should come after the `:min' spec to avoid unnecessary evaluation time." :group 'preview-appearance :type preview-specs-type - :set #'preview-specs-setter -) + :set #'preview-specs-setter) (defvar preview-error-icon nil "The icon used for PostScript errors. @@ -892,10 +891,10 @@ Pure borderless black-on-white will return an empty string." (cdr preview-resolution))))) (if preview-parsed-pdfoutput (preview-pdf2dsc-process-setup) - (let ((process (preview-start-dvips preview-fast-conversion))) (setq TeX-sentinel-function #'preview-gs-dvips-sentinel) - (list process (current-buffer) TeX-active-tempdir preview-ps-file - preview-gs-image-type)))) + (list (preview-start-dvips preview-fast-conversion) (current-buffer) + TeX-active-tempdir preview-ps-file + preview-gs-image-type))) (defun preview-dvipng-process-setup () "Set up dvipng process for conversion." @@ -913,17 +912,15 @@ Pure borderless black-on-white will return an empty string." (unless (preview-supports-image-type preview-dvipng-image-type) (error "preview-dvipng-image-type setting '%s unsupported by this Emacs" preview-dvipng-image-type)) - (let ((process (preview-start-dvipng))) (setq TeX-sentinel-function #'preview-dvipng-sentinel) - (list process (current-buffer) TeX-active-tempdir t - preview-dvipng-image-type)))) + (list (preview-start-dvipng) (current-buffer) TeX-active-tempdir t + preview-dvipng-image-type))) (defun preview-pdf2dsc-process-setup () - (let ((process (preview-start-pdf2dsc))) (setq TeX-sentinel-function #'preview-pdf2dsc-sentinel) - (list process (current-buffer) TeX-active-tempdir preview-ps-file - preview-gs-image-type))) + (list (preview-start-pdf2dsc) (current-buffer) TeX-active-tempdir + preview-ps-file preview-gs-image-type)) (defun preview-dvips-abort () "Abort a Dvips run." @@ -2528,12 +2525,12 @@ Deletes the dvi file when finished." (push ov preview-gs-queue)))) (if (setq preview-gs-queue (nreverse preview-gs-queue)) (progn - (preview-start-dvips preview-fast-conversion) (setq TeX-sentinel-function (lambda (process command) (preview-gs-dvips-sentinel process command t))) + (preview-start-dvips preview-fast-conversion) (dolist (ov preview-gs-queue) (setq snippet (aref (overlay-get ov 'queued) 2)) (overlay-put ov 'filenames @@ -3809,8 +3806,6 @@ The fourth value is the transparent border thickness." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option @@ -3851,8 +3846,6 @@ If FAST is set, do a fast conversion." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option @@ -3893,8 +3886,6 @@ If FAST is set, do a fast conversion." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option -- 2.39.3 (Apple Git-146) --=-=-=-- From unknown Fri Sep 19 14:23:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79462: 14.1.0; Set correct TeX-sentinel-function before starting processes. Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 17 Sep 2025 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79462 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Al Haji-Ali , "Ikumi Keita" Cc: 79462@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175810192919588 (code B ref -1); Wed, 17 Sep 2025 09:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Sep 2025 09:38:49 +0000 Received: from localhost ([127.0.0.1]:54887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uyoci-00055o-E0 for submit@debbugs.gnu.org; Wed, 17 Sep 2025 05:38:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47242) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uyocg-00055I-2J for submit@debbugs.gnu.org; Wed, 17 Sep 2025 05:38:46 -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 1uyocZ-0004dr-UZ for bug-auctex@gnu.org; Wed, 17 Sep 2025 05:38:40 -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 1uyocX-0005zz-Lt; Wed, 17 Sep 2025 05:38:37 -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=nA96DYtzq/zzZh4Vd9xlonmOvLcPw3KbPxsTnVY6Ops=; b=m3IMwD5TYiy/arG49JtK BjKEppoafl17ehykXCZ6awyBqU40axR2I6cKzEcKfrnzAK5cIgX/GVtZHwoqopG0WZbZjICPt0RO8 9/L3Ru7NrDwMbOC4ShOJgh46cUXdxHVNvtT2KCcxSRNXfmoTLoVWC23CXHGw93EQvbBWYYwtxYiqI rz4Rk9QTAffiPX/Q9mjYbdmP50AlWFNz75Es2n4yfyL+lP64OMLI4d1+ashwTIbKDbfLeVA13lP9V GCwsw4bTNfNBeGh2+uwKaaCTB15AUxxIF3VhOJW/IlEORu71AhDWRH3sxJlAAsKdqHCFEhMdXdokC ilZKXhNFlvsTqA==; From: Arash Esbati In-Reply-To: References: Date: Wed, 17 Sep 2025 11:38:32 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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 (-) Al Haji-Ali writes: > This is a follow-up bug-report/patch from: > https://lists.gnu.org/archive/html/auctex-devel/2025-08/msg00026.html > > Previously, preview was setting the TeX-sentinel-function to temporary > lambda functions inside `preview-start-*` functions which just outputs > a message. This value is overwritten by functions that call > `preview-start-*` to a correct sentinel. In most cases, this is > harmless as the original sentinel is never called. However, > preview-start-* also has a `sit-for` call which causes timers to be > processed, and which may call `accept-process-output` causing the > "wrong" temporary sentinel to be called. > I faced this issue when developing preview-point (discussed above) and > I am submitting this patch which simply sets the correct sentinel > before calling preview-start-*. Thanks, LGTM. @Keita: Do you have any comments? Otherwise I'll install this change. Best, Arash From unknown Fri Sep 19 14:23:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79462: 14.1.0; Set correct TeX-sentinel-function before starting processes. Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 17 Sep 2025 13:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79462 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Al Haji-Ali , Arash Esbati Cc: 79462@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175811485230395 (code B ref -1); Wed, 17 Sep 2025 13:15:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Sep 2025 13:14:12 +0000 Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uyrz9-0007uB-Rq for submit@debbugs.gnu.org; Wed, 17 Sep 2025 09:14:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42512) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uyrz4-0007tM-Fm for submit@debbugs.gnu.org; Wed, 17 Sep 2025 09:14:09 -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 1uyrys-0005Tk-IT for bug-auctex@gnu.org; Wed, 17 Sep 2025 09:13:56 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyryn-0008Fa-4J; Wed, 17 Sep 2025 09:13:52 -0400 Received: from localhost (42-144-37-8.rev.home.ne.jp [42.144.37.8]) by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id EFFF95F; Wed, 17 Sep 2025 22:13:38 +0900 (JST) From: Ikumi Keita In-reply-to: References: Comments: In-reply-to Arash Esbati message dated "Wed, 17 Sep 2025 11:38:32 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32330.1758114817.1@localhost> Date: Wed, 17 Sep 2025 22:13:37 +0900 Message-ID: <32331.1758114817@localhost> Received-SPF: pass client-ip=210.129.88.11; envelope-from=ikumi@ikumi.que.jp; helo=smtp1a.inetd.co.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-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 (/) Hi Arash and Al, >>>>> Arash Esbati writes: > Thanks, LGTM. > @Keita: Do you have any comments? Otherwise I'll install this change. Provided that Al's analysis is correct, it seems to me that we can/should also change `(sit-for 0)' to `(redisplay)' or `(force-mode-line-update)' in `preview-start-*' functions. However, his proposal seems to be towards the right direction, so I'm in favor of acceptiong it. :-) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopGenocide #CeasefireNOW From unknown Fri Sep 19 14:23:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Al Haji-Ali Subject: bug#79462: closed (Re: bug#79462: 14.1.0; Set correct TeX-sentinel-function before starting processes.) Message-ID: References: X-Gnu-PR-Message: they-closed 79462 X-Gnu-PR-Package: auctex Reply-To: 79462@debbugs.gnu.org Date: Thu, 18 Sep 2025 07:35:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1758180902-11064-1" This is a multi-part message in MIME format... ------------=_1758180902-11064-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #79462: 14.1.0; Set correct TeX-sentinel-function before starting processes. which was filed against the auctex package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 79462@debbugs.gnu.org. --=20 79462: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79462 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1758180902-11064-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 79462-done) by debbugs.gnu.org; 18 Sep 2025 07:34:30 +0000 Received: from localhost ([127.0.0.1]:59774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uz99y-0002rZ-62 for submit@debbugs.gnu.org; Thu, 18 Sep 2025 03:34:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41844) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uz99u-0002rK-3g for 79462-done@debbugs.gnu.org; Thu, 18 Sep 2025 03:34:27 -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 1uz99l-0000uR-UN; Thu, 18 Sep 2025 03:34:17 -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=4jc0IG2WJlnc3Amck5ca2azmaFcjLXGxJ6Ktv2wpd4g=; b=U842wfKhs/BrNhNA0GJ2 kZtfDekw6J1cnxsfYHzQXT7c1PMIcCsdBQo6911kCK8oQWrHD0PqW6WPiWEPtEzI1ofGp3PDdyRkh PHZcgZpXEomutu9kZ4oJuw3zu7+c41Kcez4CzzI40XMpxlAssB+Vca7gdSG5lmE22s/sHeIPQRyvW 3ue2RORIFkQ2f3/lWKnE2yZWqZnH+XDrkd/lgFGVk4wr2qyMmHF9k4+JylY6JsBMMFp2ioMkmG81s SyqKbvIjSl3jTWgaoWx2P2vmXuffMX4b4Ht0aDJ34vNuAL97H82aJbnJRV26+ONDKO4zNVjzd3Sy4 fF5SiH2sSFsCgg==; From: Arash Esbati To: Ikumi Keita Subject: Re: bug#79462: 14.1.0; Set correct TeX-sentinel-function before starting processes. In-Reply-To: <32331.1758114817@localhost> References: <32331.1758114817@localhost> Date: Thu, 18 Sep 2025 09:34:13 +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: 79462-done Cc: 79462-done@debbugs.gnu.org, Al Haji-Ali 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 (---) Hi all, Ikumi Keita writes: > Provided that Al's analysis is correct, it seems to me that we > can/should also change `(sit-for 0)' to `(redisplay)' or > `(force-mode-line-update)' in `preview-start-*' functions. However, his > proposal seems to be towards the right direction, so I'm in favor of > acceptiong it. :-) Thanks for the patch and the comment. I installed that change with commit f338ca4e and therefore closing this report. @Al: Can you please do me a favor and don't use markdown style ticks in commit messages? * preview.el (preview-gs-dvips-process-setup, preview-dvipng-process-setup, preview-pdf2dsc-process-setup, preview-dvipng-place-all): Set `TeX-sentinel-function` before calling ^---------------------^ Emacs convention is `x' or 'x', TIA. Best, Arash ------------=_1758180902-11064-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Sep 2025 07:39:42 +0000 Received: from localhost ([127.0.0.1]:53997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uymlR-0002AI-RG for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:39:42 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43778) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uymlO-00029k-PZ for submit@debbugs.gnu.org; Wed, 17 Sep 2025 03:39:39 -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 1uymlI-0005QR-Rc for bug-auctex@gnu.org; Wed, 17 Sep 2025 03:39:32 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uymlC-0007ir-2t for bug-auctex@gnu.org; Wed, 17 Sep 2025 03:39:32 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3eb0a50a4c3so1940639f8f.1 for ; Wed, 17 Sep 2025 00:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758094764; x=1758699564; darn=gnu.org; h=mime-version:message-id:date:cc:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=OI6wKJ1nmzGHwz7VkZo8K46RGriA/ZA3QVUoMpx7W3Q=; b=kUXTnt5xPHwWhd4qReW1xWE3azpEpmWysUjHlZUcBsaAat0pbET8ShAsUkoLheEy5y ovjk8CII5c+th+smJ5EDrdgiT0pNCw0C49RdPxL23VMcLoF9UnrhkPGWr+8U+9Qcd7NP oi0+9/SlmRv3gp2DNzwprUcXckDyo2VvtluNopB1dE29HEROSzvUcSKAwH5eAmBmPTMt qJWaj7uB9ZXFg+BS+rkkPyetHltGyMG6q7dsW9iV9MOv2DR4FkoI2RF5D48EKt8D8etK f+qMPgQQMjKMFbcXDW4r/rdeV1egnfpnlpma2QFYz3BKEY8n9GDh+Sb9pFGc1gEP6o1G a0Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758094764; x=1758699564; h=mime-version:message-id:date:cc:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OI6wKJ1nmzGHwz7VkZo8K46RGriA/ZA3QVUoMpx7W3Q=; b=woBSoJI7VPEUHRnyzlltyrZEHAlPEy9rsZKONEwaFCqSlgW1sV/k+ZvauUu4I4ztPj cEVtVZ8pIIBySQSrwKiqqy+8jJO7SvNTTmvlsIxVgRITGbg1dZZAkCFrn+xeJVq/3avf CDsOKHfI86gRE9u4IKDcDehhs0Tk7Chw9ugyOiA54Ihx0MbozW7RzDqOrI4nqL3+ulQq Pgfe9jLffni/d3WNoYbO/qJM8WjLLR8ZBIWkr52ev6mr+Scws+sZ0jMHXXU81iMCVx72 H+xp254c8oF/kJSqwQ2IX5B1H8Ga2tKeB7JK+2IbIvO387Vkf4B7LoW4F/zqnhm9T1td I39Q== X-Gm-Message-State: AOJu0Yz4zgP+ltE0WALL0GLxh77nmsODN12k8ErAuqEWaG+WWE1OGZA2 CrwjlK+3mo5lXNIQKeZhsOm5yZwUFLIp4/O0CWPYUigcg2ogvWcmhSnTBnt4ZPz2 X-Gm-Gg: ASbGncvZC8xojF8dcooKgoj4u7OzJVQU/aa8Og8aCLI/0Bd0+yGI2duvnGrqNNS96Xm YbGNoTD9squvQjuyITnhFAc20OBuVGeF5ly4Z+RXpmOPjQFUeK062h7KgQUW+hqVtYIG6rMsFhU eUalUM7e3LbOj2gbfD00Y8L3TN+iuyKh1OR8OaFzRO2uVY9LbQvVgIdKitHZtXl+5eFZnbmB/qR omHbZplZhCMBqOQFPxSa7jURpdgI4jyBNRi+9vkjal3CQ3u5P7aYoIRQE0TxR87NUhP0ZNIkuE6 Dc6Np13oWdRiXCzoMnJsTI1Vsf587ropJAUhedyylccn7mqIsRmuXlOqPl6Q10BUrcW171sN48c a1V+kGA/S9FLfKTWHSf2qVrFwfnNHZTET1bHHxIcrjg7m X-Google-Smtp-Source: AGHT+IHVGR6JghB9rHquiQIxfAGXP472jX4eWXZ9s1sZ0CYYfSMv0Qawj+2mpQNpsJE0o/+Iykjmkg== X-Received: by 2002:a5d:64e5:0:b0:3ec:4fe:864 with SMTP id ffacd0b85a97d-3ecdfa32ef4mr1021767f8f.45.1758094763918; Wed, 17 Sep 2025 00:39:23 -0700 (PDT) Received: from localhost ([2a00:8a60:e000:101:3953:8187:4257:bc0f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e8c7375fb7sm16889636f8f.14.2025.09.17.00.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 00:39:23 -0700 (PDT) From: Al Haji-Ali To: bug-auctex@gnu.org Subject: 14.1.0; Set correct TeX-sentinel-function before starting processes. Date: Wed, 17 Sep 2025 09:31:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=abdo.haji.ali@gmail.com; helo=mail-wr1-x429.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=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Ikumi Keita , Arash Esbati 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 (/) --=-=-= Content-Type: text/plain Hello, This is a follow-up bug-report/patch from: https://lists.gnu.org/archive/html/auctex-devel/2025-08/msg00026.html Previously, preview was setting the TeX-sentinel-function to temporary lambda functions inside `preview-start-*` functions which just outputs a message. This value is overwritten by functions that call `preview-start-*` to a correct sentinel. In most cases, this is harmless as the original sentinel is never called. However, preview-start-* also has a `sit-for` call which causes timers to be processed, and which may call `accept-process-output` causing the "wrong" temporary sentinel to be called. I faced this issue when developing preview-point (discussed above) and I am submitting this patch which simply sets the correct sentinel before calling preview-start-*. -- Al --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=preview-TeX-sentinel-function.patch >From 6166cbec1b40ef26eb79dca9bb9b37c8318ce1d2 Mon Sep 17 00:00:00 2001 From: Al Haji-Ali Date: Wed, 3 Sep 2025 11:10:11 +0100 Subject: [PATCH] preview: Set correct TeX-sentinel-function before starting processes. * preview.el (preview-gs-dvips-process-setup, preview-dvipng-process-setup, preview-pdf2dsc-process-setup, preview-dvipng-place-all): Set `TeX-sentinel-function` before calling preview-start-* functions to start processes. (preview-start-dvipng, preview-start-dvips, preview-start-pdf2dsc): Remove temporary setting of `TeX-sentinel-function`. --- preview.el | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/preview.el b/preview.el index 88886b83..22316335 100644 --- a/preview.el +++ b/preview.el @@ -133,8 +133,7 @@ considerable time under XEmacs, it should come after the `:min' spec to avoid unnecessary evaluation time." :group 'preview-appearance :type preview-specs-type - :set #'preview-specs-setter -) + :set #'preview-specs-setter) (defvar preview-error-icon nil "The icon used for PostScript errors. @@ -892,10 +891,10 @@ Pure borderless black-on-white will return an empty string." (cdr preview-resolution))))) (if preview-parsed-pdfoutput (preview-pdf2dsc-process-setup) - (let ((process (preview-start-dvips preview-fast-conversion))) (setq TeX-sentinel-function #'preview-gs-dvips-sentinel) - (list process (current-buffer) TeX-active-tempdir preview-ps-file - preview-gs-image-type)))) + (list (preview-start-dvips preview-fast-conversion) (current-buffer) + TeX-active-tempdir preview-ps-file + preview-gs-image-type))) (defun preview-dvipng-process-setup () "Set up dvipng process for conversion." @@ -913,17 +912,15 @@ Pure borderless black-on-white will return an empty string." (unless (preview-supports-image-type preview-dvipng-image-type) (error "preview-dvipng-image-type setting '%s unsupported by this Emacs" preview-dvipng-image-type)) - (let ((process (preview-start-dvipng))) (setq TeX-sentinel-function #'preview-dvipng-sentinel) - (list process (current-buffer) TeX-active-tempdir t - preview-dvipng-image-type)))) + (list (preview-start-dvipng) (current-buffer) TeX-active-tempdir t + preview-dvipng-image-type))) (defun preview-pdf2dsc-process-setup () - (let ((process (preview-start-pdf2dsc))) (setq TeX-sentinel-function #'preview-pdf2dsc-sentinel) - (list process (current-buffer) TeX-active-tempdir preview-ps-file - preview-gs-image-type))) + (list (preview-start-pdf2dsc) (current-buffer) TeX-active-tempdir + preview-ps-file preview-gs-image-type)) (defun preview-dvips-abort () "Abort a Dvips run." @@ -2528,12 +2525,12 @@ Deletes the dvi file when finished." (push ov preview-gs-queue)))) (if (setq preview-gs-queue (nreverse preview-gs-queue)) (progn - (preview-start-dvips preview-fast-conversion) (setq TeX-sentinel-function (lambda (process command) (preview-gs-dvips-sentinel process command t))) + (preview-start-dvips preview-fast-conversion) (dolist (ov preview-gs-queue) (setq snippet (aref (overlay-get ov 'queued) 2)) (overlay-put ov 'filenames @@ -3809,8 +3806,6 @@ The fourth value is the transparent border thickness." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option @@ -3851,8 +3846,6 @@ If FAST is set, do a fast conversion." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option @@ -3893,8 +3886,6 @@ If FAST is set, do a fast conversion." (goto-char (point-max)) (insert-before-markers "Running `" name "' with ``" command "''\n") (setq mode-name name) - (setq TeX-sentinel-function - (lambda (_process name) (message "%s: done." name))) (if TeX-process-asynchronous (let ((process (start-process name (current-buffer) TeX-shell TeX-shell-command-option -- 2.39.3 (Apple Git-146) --=-=-=-- ------------=_1758180902-11064-1--