From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to set background-color without damaging cut&paste ? Date: Wed, 04 Sep 2024 17:43:12 +0300 Message-ID: <865xrb5vjz.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19118"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 04 16:43:42 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1slrEU-0004r7-EL for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Sep 2024 16:43:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slrE4-0003uJ-Ra; Wed, 04 Sep 2024 10:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slrE2-0003mN-S6 for help-gnu-emacs@gnu.org; Wed, 04 Sep 2024 10:43:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slrE2-0007sm-Jq for help-gnu-emacs@gnu.org; Wed, 04 Sep 2024 10:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vROgd1aySAdZuzSPBvTYWv2k6Pamy992fy8CSYM3cNA=; b=dS6bdHowGEec lcq6F93HUugJCkbW7sciDh0+dB2xAyq9vBP/pFJZievLxTZcghxgNUmfUj/f3M37wJAaXcKnudLPZ r0dNO/bizG5VZkp8+VvfYjnzi9MOhnNUS/d8ch39vWMdbCGGw5cW9tFBYTVUMRdEIOiVR9rZb/gMl ROVdySS+cRZyUAd80avtUvbaMWoTcqBC78ptTn63LI4dYX11JWnSO9I/R3UrrnVipE8GjjETnBmQ0 7xnPOu3ZUGeZitwrdnChjEMa+68LzKX1u6zoCH1DobFfmY73uW+xfY60dg+69UhJr+3dZWBYucsDg s+pWQ5Lo8K+T3tugjbDlXA==; In-Reply-To: (message from Peter on Wed, 4 Sep 2024 16:33:20 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147905 Archived-At: > Date: Wed, 4 Sep 2024 16:33:20 +0200 > From: Peter > Cc: help-gnu-emacs@gnu.org > > I think I figured it out a bit further. > > Syntax higlighting in C: > > > /* bla bla > * > */ > main() > { > } > > > 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.