From unknown Mon Aug 18 06:57:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped Resent-From: Diancheng Wang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Oct 2024 03:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 73687@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172835712727286 (code B ref -1); Tue, 08 Oct 2024 03:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Oct 2024 03:12:07 +0000 Received: from localhost ([127.0.0.1]:49960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0dq-000761-LS for submit@debbugs.gnu.org; Mon, 07 Oct 2024 23:12:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:47888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0do-00075t-Hb for submit@debbugs.gnu.org; Mon, 07 Oct 2024 23:12:05 -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 1sy0dg-000556-6A for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:11:56 -0400 Received: from m16.mail.163.com ([117.135.210.2]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sy0dd-0002JE-KC for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:11:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=2VIMy3ujtCFrNCglVcPYkCE54Txwq45G3zk8iWQKc9k=; b=HsRRampM0b0ta65V49pAR8ZoLAmEODq1nbPIJIrsjALCL7Nb9QX7cxsx1x7a/e BbQSi11/XSg727otmvWncmfDuaXTI7YiEJuTKVhqrfMLuP+drl5MnSv9pLM1VJb1 MxBgfhnGcNISw7So/zb1V4ct01LusBkfRQTOsxfnLYwfI= Received: from hadleywang-LC0 (unknown [111.206.94.147]) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wCX76DhogRnjyFJBg--.30450S3; Tue, 08 Oct 2024 11:11:39 +0800 (CST) From: Diancheng Wang Date: Tue, 08 Oct 2024 11:11:24 +0800 Message-ID: <87v7y31e77.fsf@163.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-CM-TRANSID: _____wCX76DhogRnjyFJBg--.30450S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxU13ktUUUUU X-Originating-IP: [111.206.94.147] X-CM-SenderInfo: xgld0u5khqwspzdqwqqrwthudrp/xtbBFRlyqWcEntRb3wAAs6 Received-SPF: pass client-ip=117.135.210.2; envelope-from=diancheng_wang@163.com; helo=m16.mail.163.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_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain When highlighting current line is enabled with gud-highlight-current-line-overlay, the highlighting current line is always enabled even debugee is running. Attachment is a patch to fix it. The patch introduces a new function 'gud-hide-current-line-indicator', then call it when debugee is running in gdb.el. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=gud-hide-current-line-indicator.patch diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2981965ee0c..6a9735fbc25 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2699,7 +2699,8 @@ gdb-starting (gdb-force-mode-line-update (propertize gdb-inferior-status 'face font-lock-type-face)) (setq gdb-active-process t) - (setq gud-running t)) + (setq gud-running t) + (gud-hide-current-line-indicator nil)) ;; -break-insert -t didn't give a reason before gdb 6.9 diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 53a7d78328c..a4e611277e4 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2949,11 +2949,19 @@ gud-highlight-current-line-overlay "Overlay created for `gud-highlight-current-line'. It is nil if not yet present.") +(defun gud-hide-current-line-indicator(destroy-overlay) + "Stop displaying arrow and highlighting current line in a source file." + ;; Stop displaying an arrow in a source file. + (setq gud-overlay-arrow-position nil) + ;; And any highlight overlays. + (when gud-highlight-current-line-overlay + (delete-overlay gud-highlight-current-line-overlay) + (if destroy-overlay + (setq gud-highlight-current-line-overlay nil)))) + (defun gud-sentinel (proc msg) (cond ((null (buffer-name (process-buffer proc))) ;; buffer killed - ;; Stop displaying an arrow in a source file. - (setq gud-overlay-arrow-position nil) (set-process-buffer proc nil) (if (and (boundp 'speedbar-initial-expansion-list-name) (string-equal speedbar-initial-expansion-list-name "GUD")) @@ -2963,12 +2971,9 @@ gud-sentinel (gdb-reset) (gud-reset))) ((memq (process-status proc) '(signal exit)) - ;; Stop displaying an arrow in a source file. - (setq gud-overlay-arrow-position nil) - ;; And any highlight overlays. - (when gud-highlight-current-line-overlay - (delete-overlay gud-highlight-current-line-overlay) - (setq gud-highlight-current-line-overlay nil)) + + (gud-hide-current-line-indicator t) + (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdbmi) (gdb-reset) --=-=-=-- From unknown Mon Aug 18 06:57:57 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: Diancheng Wang Subject: bug#73687: closed (Re: bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped) Message-ID: References: <86jzedwm6h.fsf@gnu.org> <87v7y31e77.fsf@163.com> X-Gnu-PR-Message: they-closed 73687 X-Gnu-PR-Package: emacs Reply-To: 73687@debbugs.gnu.org Date: Sat, 12 Oct 2024 12:26:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1728735964-11540-1" This is a multi-part message in MIME format... ------------=_1728735964-11540-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #73687: 31.0.50; Stop highlighting current line when debugee is not stopped which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 73687@debbugs.gnu.org. --=20 73687: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73687 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1728735964-11540-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 73687-done) by debbugs.gnu.org; 12 Oct 2024 12:25:16 +0000 Received: from localhost ([127.0.0.1]:41230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szbBM-0002pn-9d for submit@debbugs.gnu.org; Sat, 12 Oct 2024 08:25:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szb3g-0002O3-Ue for 73687-done@debbugs.gnu.org; Sat, 12 Oct 2024 08:17:21 -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 1szb3L-00032c-48; Sat, 12 Oct 2024 08:17:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0uTyR2miS9i1c9yfKj0OkaAN2ogGQekMd9mwCApWGB0=; b=N04hZnlzBHBg JAJFgUYmZA+x86hDazVJWOXLZ1qzjiwkf31Cf6oEDokHQfB41laUQ2xYu27vDDyVrl0CnaBzohwcV Ng7CtvfvLJg8/3w7+jEJp+nwnp66q5mbpEpiqwAiZmCDLuWurP2pDRNEzXxjS9/7HnOWEQZtwfUZc dIxb1x7y0TMsWOh5GSa3J2h0fQFWP9Qf4hknZ/2iyaFtq5bDAiDudxqvYxNHBfcxt5hxE3JhDC7Lj cQVJOt+IhnMTs58Z4g+EfuKExXapuhlH5Td5hZ1+cmAMuystwhA5Qm9+mpJJclNgawDVomQ0qTeRV +R1+KL3ehotDjYzYVPYKiw==; Date: Sat, 12 Oct 2024 15:16:54 +0300 Message-Id: <86jzedwm6h.fsf@gnu.org> From: Eli Zaretskii To: Diancheng Wang In-Reply-To: <87v7y31e77.fsf@163.com> (message from Diancheng Wang on Tue, 08 Oct 2024 11:11:24 +0800) Subject: Re: bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped References: <87v7y31e77.fsf@163.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73687-done Cc: 73687-done@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 (---) > From: Diancheng Wang > Date: Tue, 08 Oct 2024 11:11:24 +0800 > > When highlighting current line is enabled with > gud-highlight-current-line-overlay, the highlighting current line is always > enabled even debugee is running. Attachment is a patch to fix it. The patch > introduces a new function 'gud-hide-current-line-indicator', then call it > when debugee is running in gdb.el. Thanks, installed on the master branch, and closing the bug. ------------=_1728735964-11540-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Oct 2024 03:12:07 +0000 Received: from localhost ([127.0.0.1]:49960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0dq-000761-LS for submit@debbugs.gnu.org; Mon, 07 Oct 2024 23:12:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:47888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sy0do-00075t-Hb for submit@debbugs.gnu.org; Mon, 07 Oct 2024 23:12:05 -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 1sy0dg-000556-6A for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:11:56 -0400 Received: from m16.mail.163.com ([117.135.210.2]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sy0dd-0002JE-KC for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:11:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=2VIMy3ujtCFrNCglVcPYkCE54Txwq45G3zk8iWQKc9k=; b=HsRRampM0b0ta65V49pAR8ZoLAmEODq1nbPIJIrsjALCL7Nb9QX7cxsx1x7a/e BbQSi11/XSg727otmvWncmfDuaXTI7YiEJuTKVhqrfMLuP+drl5MnSv9pLM1VJb1 MxBgfhnGcNISw7So/zb1V4ct01LusBkfRQTOsxfnLYwfI= Received: from hadleywang-LC0 (unknown [111.206.94.147]) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wCX76DhogRnjyFJBg--.30450S3; Tue, 08 Oct 2024 11:11:39 +0800 (CST) From: Diancheng Wang To: bug-gnu-emacs@gnu.org Subject: 31.0.50; Stop highlighting current line when debugee is not stopped X-Debbugs-Cc: Date: Tue, 08 Oct 2024 11:11:24 +0800 Message-ID: <87v7y31e77.fsf@163.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-CM-TRANSID: _____wCX76DhogRnjyFJBg--.30450S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxU13ktUUUUU X-Originating-IP: [111.206.94.147] X-CM-SenderInfo: xgld0u5khqwspzdqwqqrwthudrp/xtbBFRlyqWcEntRb3wAAs6 Received-SPF: pass client-ip=117.135.210.2; envelope-from=diancheng_wang@163.com; helo=m16.mail.163.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_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain When highlighting current line is enabled with gud-highlight-current-line-overlay, the highlighting current line is always enabled even debugee is running. Attachment is a patch to fix it. The patch introduces a new function 'gud-hide-current-line-indicator', then call it when debugee is running in gdb.el. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=gud-hide-current-line-indicator.patch diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2981965ee0c..6a9735fbc25 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2699,7 +2699,8 @@ gdb-starting (gdb-force-mode-line-update (propertize gdb-inferior-status 'face font-lock-type-face)) (setq gdb-active-process t) - (setq gud-running t)) + (setq gud-running t) + (gud-hide-current-line-indicator nil)) ;; -break-insert -t didn't give a reason before gdb 6.9 diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 53a7d78328c..a4e611277e4 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2949,11 +2949,19 @@ gud-highlight-current-line-overlay "Overlay created for `gud-highlight-current-line'. It is nil if not yet present.") +(defun gud-hide-current-line-indicator(destroy-overlay) + "Stop displaying arrow and highlighting current line in a source file." + ;; Stop displaying an arrow in a source file. + (setq gud-overlay-arrow-position nil) + ;; And any highlight overlays. + (when gud-highlight-current-line-overlay + (delete-overlay gud-highlight-current-line-overlay) + (if destroy-overlay + (setq gud-highlight-current-line-overlay nil)))) + (defun gud-sentinel (proc msg) (cond ((null (buffer-name (process-buffer proc))) ;; buffer killed - ;; Stop displaying an arrow in a source file. - (setq gud-overlay-arrow-position nil) (set-process-buffer proc nil) (if (and (boundp 'speedbar-initial-expansion-list-name) (string-equal speedbar-initial-expansion-list-name "GUD")) @@ -2963,12 +2971,9 @@ gud-sentinel (gdb-reset) (gud-reset))) ((memq (process-status proc) '(signal exit)) - ;; Stop displaying an arrow in a source file. - (setq gud-overlay-arrow-position nil) - ;; And any highlight overlays. - (when gud-highlight-current-line-overlay - (delete-overlay gud-highlight-current-line-overlay) - (setq gud-highlight-current-line-overlay nil)) + + (gud-hide-current-line-indicator t) + (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdbmi) (gdb-reset) --=-=-=-- ------------=_1728735964-11540-1--