[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight current line when using gud

From: Eli Zaretskii
Subject: Re: Highlight current line when using gud
Date: Wed, 30 Jun 2021 18:50:48 +0300

> From: Zhiwei Chen <chenzhiwei03@kuaishou.com>
> CC: Lars Ingebrigtsen <larsi@gnus.org>,
>         "condy0919@gmail.com"
>       <condy0919@gmail.com>,
>         "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Wed, 30 Jun 2021 14:26:33 +0000
> Personally, hl-line-mode is used to show the approximate position of my point 
> so the face defined in
> doom-one is fine to me. It needn’t to be too contrast as it hurts my eyes in 
> daily use.
> But when debugging, I need to know where the line as if I step over the 
> interesting line I will blame myself.
> Debugging is more serious than coding/writing, so I would like to
> make the line highlighted/contrast. 
> (defun make-hl-line-face-contrast ()
>   (setq-local hl-line-face ‘a-more-contrast-one))
> (add-hook gdb-mode-hook #’make-hl-line-face-contrast)
> But when I select the source buffer and move the point, forward a page, I 
> can’t tell which line I’m debugging.
> So I need to seek for the arrow in fringe but it’s too small to be discovered.
> I imagine that if there is a sticky overlay what will happen. I will never 
> lose my debug point…
> > Why remove hl-line-mode?  It has gobs of users.
> Specifically, the 8 lines in gud.el rather than the hl-line-mode itself.
>  ;; If they turned on hl-line, move the hl-line highlight to
>  ;; the arrow's line.
>  (when (featurep 'hl-line)
>    (cond
>     (global-hl-line-mode
>      (global-hl-line-highlight))
>     ((and hl-line-mode hl-line-sticky-flag)
>      (hl-line-highlight)))))

Thanks.  It all looks to me as differences in personal preferences.  I
have no doubt that some of us (myself included) have no problems
finding the current line in the source buffer, and others use
hl-line-mode with the above code and have no problems at all.  So I
wonder what would be the best way of adding the feature you want
without disappointing those who like the existing behavior.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]