all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to set background-color without damaging cut&paste ?
@ 2024-09-03 23:28 Peter
  2024-09-04 11:40 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter @ 2024-09-03 23:28 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-09 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 23:28 How to set background-color without damaging cut&paste ? Peter
2024-09-04 11:40 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.