unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Condy Chen <condy0919@gmail.com>
To: Zhiwei Chen <chenzhiwei03@kuaishou.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, Eli Zaretskii <eliz@gnu.org>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Highlight current line when using gud
Date: Fri, 2 Jul 2021 01:27:10 +0800	[thread overview]
Message-ID: <CAHO21CK2YDFuBi-g00CPeyemLOL0Zd6eqtrt2csfHR7-T-4MwA@mail.gmail.com> (raw)
In-Reply-To: <29192159-2E0E-434D-B44B-13F4099561ED@kuaishou.com>


[-- Attachment #1.1: Type: text/plain, Size: 1820 bytes --]

On Thu, Jul 1, 2021 at 7:35 PM Zhiwei Chen <chenzhiwei03@kuaishou.com>
wrote:

>
> On Jul 1, 2021, at 7:26 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Zhiwei Chen <chenzhiwei03@kuaishou.com> writes:
>
> 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.
>
>
> So, Doom has customised the hi-line face to be less perceptible, so you
> want to introduce a new highlighting mechanism to make it more
> perceptible again, but only in gud buffers?
>
> This can be done with `face-remapping-alist' -- it's a buffer-local
> variable that's used to display a different face in certain buffers.
> Would using that variable in gud buffers solve your problems?
>
>
> Another problem it can’t solve is the debugging line will be lost if I
> select the source buffer and move the point since the highlighted line uses
> hl-line-mode.
> And I think the new mechanism can supersede the use of hl-line-mode almost.
>
>
Why do I introduce a new overlay in gud buffer?
Because it's used to show the line where the debugger stops at. The
position of the gud overlay is controlled by the debugger, not by users. So
using hl-line-mode in such a situation is not the proper way.

See the pic below.
[image: image.png]
gdb stops at line 4 (see the arrow in left fringe). But after I select the
source buffer and move 3 lines down, the line 7 is highlighted. Does it
mean that gdb stops at line 7? It's too confusing to users.

[-- Attachment #1.2: Type: text/html, Size: 3015 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 188731 bytes --]

  reply	other threads:[~2021-07-01 17:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 12:43 Highlight current line when using gud Zhiwei Chen
2021-06-29 20:00 ` Condy Chen
2021-06-30 11:54   ` Lars Ingebrigtsen
2021-06-30 12:27     ` Eli Zaretskii
2021-06-30 13:07       ` Zhiwei Chen
2021-06-30 12:53     ` Zhiwei Chen
2021-06-30 12:59       ` Zhiwei Chen
2021-06-30 13:18         ` Eli Zaretskii
2021-06-30 13:17       ` Eli Zaretskii
2021-06-30 14:26         ` Zhiwei Chen
2021-06-30 15:50           ` Eli Zaretskii
2021-07-01  3:17             ` Zhiwei Chen
2021-07-01 11:26           ` Lars Ingebrigtsen
2021-07-01 11:35             ` Zhiwei Chen
2021-07-01 17:27               ` Condy Chen [this message]
2021-07-01 18:25             ` Zhiwei Chen
2021-07-02 11:01               ` Lars Ingebrigtsen
2021-07-02 11:39                 ` Eli Zaretskii
2021-07-04  0:12                   ` Zhiwei Chen
2021-07-04  4:30                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHO21CK2YDFuBi-g00CPeyemLOL0Zd6eqtrt2csfHR7-T-4MwA@mail.gmail.com \
    --to=condy0919@gmail.com \
    --cc=chenzhiwei03@kuaishou.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).