unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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 14:40:40 +0300	[thread overview]
Message-ID: <86ttev6407.fsf@gnu.org> (raw)
In-Reply-To: <ZtebiDWUMn0t_Y4a@disp.intra.daemon.contact> (message from Peter on Wed, 4 Sep 2024 01:28:08 +0200)

> Date: Wed, 4 Sep 2024 01:28:08 +0200
> From: Peter <pmc@citylink.dinoex.sub.org>
> 
> 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.



  reply	other threads:[~2024-09-04 11:40 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86ttev6407.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).