help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to set background-color without damaging cut&paste ?


From: Eli Zaretskii
Subject: Re: How to set background-color without damaging cut&paste ?
Date: Wed, 04 Sep 2024 17:43:12 +0300

> Date: Wed, 4 Sep 2024 16:33:20 +0200
> From: Peter <pmc@citylink.dinoex.sub.org>
> Cc: help-gnu-emacs@gnu.org
> 
> I think I figured it out a bit further.
> 
> Syntax higlighting in C:
> 
> 
> /* bla bla              <line is filled with spaces>
>  *                      <line is filled with spaces> 
>  */                     <line is correctly terminated!>
> main()                  <line is correctly terminated!>
> {                       <line is correctly terminated!>
> }                       <line is correctly terminated!>
> 
> 
> So what is the difference with the first two lines? They are comments
> - and comments do not end until end-of-line!
> 
> The third line is different, it is also a comment, but it ends - and
> therefore it is copied correctly!
> 
> Somebody inside emacs did not bother to tell the curses library
> where these comments do actually end. Because it seems irrelevant, as
> anything subsequent on these lines will still be a comment.
> 
> The curses library, however, is a honest servant and tells the very
> same to the X cutbuffer: this line doesn't end.
> 
> And the cutbuffer then does what it is supposed to do: collect all
> the trailing spaces and add them to the line.
> 
> I might assume something similar is done with the background-color
> setting: just not telling curses that (and where!) this line has an
> end.
> 
> 
> So, for now I refrain from setting background-color, and also set
>      (global-font-lock-mode 0)
> which, I assume, should disable the entire color magic and get
> us back to the good old times of monochrome screens.
> 
> But I would greatly appreciate if we could get this fixed.

There's nothing to fix, because this is a feature: many faces have
their colors extended all the way to the edge of the window.  This is
what users expect.  For example, if the region spans more than one
line, then users expect the empty space at the right of the lines to
have the background color of the region face.



reply via email to

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