From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Diancheng Wang Newsgroups: gmane.emacs.bugs Subject: bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped Date: Tue, 08 Oct 2024 11:11:24 +0800 Message-ID: <87v7y31e77.fsf@163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15978"; mail-complaints-to="usenet@ciao.gmane.io" To: 73687@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 08 05:13:20 2024 Return-path: Envelope-to: geb-bug-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 1sy0f1-00041N-Oo for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Oct 2024 05:13:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sy0ee-00057w-F5; Mon, 07 Oct 2024 23:12:56 -0400 Original-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 1sy0ec-00057k-Su for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:12:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sy0ec-0002MU-Ki for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:12:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=2VIMy3ujtCFrNCglVcPYkCE54Txwq45G3zk8iWQKc9k=; b=n6o7hywS6P0kZvoWaksuyIMCIK+J4/+77XG1c9FFmUT9PcFuoqxdUrKeezOX9XDp5Tfd4Vi1eiYOCZuTHIRmjr0VKgCFlyyHooxb56zZNPAfDfFLib0bkWLOFFXqjKW9mBdh3DTeuE6qHOeoT4GWL3IpDf39P619aJp+L0yQLu7Oa0CLKR9THIZoLFBlL6ommHnpteGC0Nx44Hkjm0m3uGM3aucaohjgJq9YpL1bdyXz1lYk0c9eGdIvI+T2bmXsoBU6OoT0aE1LBcNXcwNy6s+jj01JIVDp8S7qRkZ0UQL8fQ+wyhIe8Fp0ywxX49r0b1Mltw9uoJXlRGyOXocy7w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sy0ek-00077Z-Lh for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2024 23:13:02 -0400 X-Loop: help-debbugs@gnu.org 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-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172835712727286 (code B ref -1); Tue, 08 Oct 2024 03:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2024 03:12:07 +0000 Original-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 Original-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 Original-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 Original-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= Original-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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293141 Archived-At: --=-=-= 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) --=-=-=--