all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to set background-color without damaging cut&paste ?
Date: Wed, 04 Sep 2024 17:43:12 +0300	[thread overview]
Message-ID: <865xrb5vjz.fsf@gnu.org> (raw)
In-Reply-To: <ZthvsNygZURQdcd6@disp.intra.daemon.contact> (message from Peter on Wed, 4 Sep 2024 16:33:20 +0200)

> 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	other threads:[~2024-09-04 14:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 23:28 How to set background-color without damaging cut&paste ? Peter
2024-09-04 11:40 ` Eli Zaretskii
2024-09-04 12:41 ` Yuri Khan
2024-09-04 13:51   ` Peter
2024-09-04 14:33   ` Peter
2024-09-04 14:43     ` Eli Zaretskii [this message]
2024-09-09 13:24 ` Stefan Monnier via Users list for the GNU Emacs text editor

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

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

  git send-email \
    --in-reply-to=865xrb5vjz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.