emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#16192: closed (hl-line-mode: Current line highligh


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#16192: closed (hl-line-mode: Current line highlighting takes precedence over region highlighting)
Date: Thu, 19 Dec 2013 20:32:02 +0000

Your message dated Thu, 19 Dec 2013 15:31:28 -0500
with message-id <address@hidden>
and subject line Re: bug#16192: hl-line-mode: Current line highlighting takes 
precedence over region highlighting
has caused the debbugs.gnu.org bug report #16192,
regarding hl-line-mode: Current line highlighting takes precedence over region 
highlighting
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
16192: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16192
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: hl-line-mode: Current line highlighting takes precedence over region highlighting Date: Thu, 19 Dec 2013 12:38:28 +0100
I use a current emacs build from VCS. When you use hl-line-mode with the default settings, the highlighting of the current line takes precedence over the region highlighting. In my opinion this is bad usability, since you no longer see where the region is, and in this particular situation where the current line is would be obvious without the highlighting (the user is in the middle of selecting the region so he knows where he is in the file I guess). Would a hl-line-range function of this kind not be a better default:

(setq hl-line-range-function
      (lambda ()
        (if (region-active-p)
            nil
          (cons (line-beginning-position) (line-beginning-position 2)))))

Or one that keeps the current line highlighting only where it does not interfere with the region highlighting:

(setq hl-line-range-function
      (lambda ()
        (let ((line-beg-pos (line-beginning-position))
              (line-end-pos (line-beginning-position 2)))
          (if (region-active-p)
              (if (= (point) (region-end))
                  (cons (point) line-end-pos)
                (cons line-beg-pos (point)))
            (cons line-beg-pos line-end-pos)))))

The last function is better but since hl-line-range-function returns a single range, it is impossible to highlight the line on both sides of a region that is part of a single line. In general I appreciate that this is customizable and one can overwrite it, but it takes quite some time to fix it yourself, and I think most users want to see one of those two behaviours (as evidenced by what most editors do in this respect).

Cheers,
Jarosław Rzeszótko

--- End Message ---
--- Begin Message --- Subject: Re: bug#16192: hl-line-mode: Current line highlighting takes precedence over region highlighting Date: Thu, 19 Dec 2013 15:31:28 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> Thanks, it's perfect now!

Thank you, closing,


        Stefan


--- End Message ---

reply via email to

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