unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter <pmc@citylink.dinoex.sub.org>
To: help-gnu-emacs@gnu.org
Subject: How to set background-color without damaging cut&paste ?
Date: Wed, 4 Sep 2024 01:28:08 +0200	[thread overview]
Message-ID: <ZtebiDWUMn0t_Y4a@disp.intra.daemon.contact> (raw)

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	other threads:[~2024-09-03 23:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 23:28 Peter [this message]
2024-09-04 11:40 ` How to set background-color without damaging cut&paste ? 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
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=ZtebiDWUMn0t_Y4a@disp.intra.daemon.contact \
    --to=pmc@citylink.dinoex.sub.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).