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 14:40:40 +0300 Message-ID: <86ttev6407.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39450"; 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 13:41:48 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 1sloOS-000A8a-BJ for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Sep 2024 13:41:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sloNp-0004bE-2F; Wed, 04 Sep 2024 07:41:09 -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 1sloNm-0004T9-UY for help-gnu-emacs@gnu.org; Wed, 04 Sep 2024 07:41:07 -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 1sloNm-00050d-Ma for help-gnu-emacs@gnu.org; Wed, 04 Sep 2024 07:41:06 -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=RNmy13S837KZyFtDSb2yYPt2bSCS0de0dfmDaDyTepU=; b=CxFH/TnZcEaI McMl5joC34qKX4nFRuXOB4n1VPyIqnKhO/qIi5W/YU0DzoUUhQGDR3pgofcC6qkI7Rb4uBVlg+SAu 56TEx/Hh8LHrYzuotkEZKOukgYh7wr7El4/DtpaxN/+SDoFHohvNbZdsLiuA+sPP+UqxwtEUmltVl QHRH2dgUZtchxub0e8ytJ2NiCKlF84icRg+XhkPu5hQ2Kpscl7Xm4cJM9v85zgKcFiuinCqQggJl/ zinkRyjXrI70ZU7ok1EfS9+QPFUTZl3AvWLjA3fVtiqCqlSzDnpcx7c0Cwhmjljz+VfR7wthwBKW1 9b4vTU4YVZMENWqP932INg==; In-Reply-To: (message from Peter on Wed, 4 Sep 2024 01:28:08 +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:147899 Archived-At: > Date: Wed, 4 Sep 2024 01:28:08 +0200 > From: Peter > > Hi, > > I'm using xterm. I want to set the background to paperwhite. > > I tried this, but it makes cut&paste unuseable: > > (unless (display-graphic-p) > (if (string-equal (getenv "TERM") "xterm-256color") > (add-to-list 'default-frame-alist '(background-color . "brightwhite")) > (add-to-list 'default-frame-alist '(background-color . "white"))) > ) > > Then, given a file with this content: > > First Line > Second Line > > Without the color setting, I can move the mouse over the first line, > click thrice and hold to the second line; then middle-click into a > hexdumper gives this: > > 00000000 46 69 72 73 74 20 4c 69 6e 65 0a 53 65 63 6f 6e |First Line.Secon| > 00000010 64 20 4c 69 6e 65 0a |d Line.| > > However, after setting the background-color, the result is this: > > 00000000 46 69 72 73 74 20 4c 69 6e 65 20 20 20 20 20 20 |First Line | > 00000010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000050 0a 53 65 63 6f 6e 64 20 4c 69 6e 65 20 20 20 20 |.Second Line | > 00000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000070 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 00000090 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | > 000000a0 20 0a | .| > > It basically fills the remainder from eol to the window-border > with spaces. > > Is there an other means to set the color? I think it doesn't matter. What you seem to see is xterm's effort to give you background-colored whitespace when the background is different from the default colors. The mouse clicks are processed by xterm in this case, not by Emacs. IOW, I think this is a question for xterm developers.