unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped
@ 2024-10-08  3:11 Diancheng Wang
  2024-10-12 12:16 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Diancheng Wang @ 2024-10-08  3:11 UTC (permalink / raw)
  To: 73687

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gud-hide-current-line-indicator.patch --]
[-- Type: text/x-diff, Size: 2143 bytes --]

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped
  2024-10-08  3:11 bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped Diancheng Wang
@ 2024-10-12 12:16 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2024-10-12 12:16 UTC (permalink / raw)
  To: Diancheng Wang; +Cc: 73687-done

> From: Diancheng Wang <diancheng_wang@163.com>
> 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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-12 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08  3:11 bug#73687: 31.0.50; Stop highlighting current line when debugee is not stopped Diancheng Wang
2024-10-12 12:16 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).