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

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

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


From: Peter
Subject: How to set background-color without damaging cut&paste ?
Date: Wed, 4 Sep 2024 01:28:08 +0200

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 could send an ansi sequence in advance, but then how do I get the
original color back later?

emacs is 29.4,3, compiled with
        ACL            : off
        GNUTLS         : off
        JSON           : off
        KQUEUE         : off
        MAILUTILS      : off
        MODULES        : on
        NATIVECOMP     : off
        SOURCES        : off
        SQLITE3        : off
        THREADS        : off
        TREESITTER     : on
        XML            : off



reply via email to

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