unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dimitrios Apostolou <jimis@gmx.net>
Cc: 32921@debbugs.gnu.org
Subject: bug#32921: emacsclient obeys Xresources even when launched with -nw
Date: Wed, 18 May 2022 14:38:33 +0200	[thread overview]
Message-ID: <87o7zvc8xi.fsf@gnus.org> (raw)
In-Reply-To: <alpine.LFD.2.21.1810031946120.6536@jimisX1> (Dimitrios Apostolou's message of "Wed, 3 Oct 2018 19:49:31 +0200 (CEST)")

Dimitrios Apostolou <jimis@gmx.net> writes:

> I have set the Xresource *reverseVideo to true, and as expected emacs
> reverses the colours when launched under X, and does not when launched
> with -nw thus keeping the terminal colour selections.
>
> However emacsclient obeys the Xresources even when launched with
> -nw. This leads to colour reversal in text mode, which is unwanted
> since the xterm has already been configured as desired.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

This behaviour is still present in Emacs 29.  This seems to be stemming
from this:

  ;; Check the reverseVideo resource.
  (let ((case-fold-search t))
    (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
      (if (and rv
	       (string-match "^\\(true\\|yes\\|on\\)$" rv))
	  (setq default-frame-alist
		(cons '(reverse . t) default-frame-alist)))))

in term/x-win.el -- it sets reverse for all new frames, so when the -nw
frame appears, it also gets reverted (which isn't what we want, I
think).

If I just remove this, then everything still works fine (and the -nw
client problem disappears), because:

(defun x-handle-reverse-video (frame parameters)
  "Handle the reverse-video frame parameter and X resource.
`x-create-frame' does not handle this one."
  (when (cdr (or (assq 'reverse parameters)
		 (let ((resource (x-get-resource "reverseVideo"
						 "ReverseVideo")))

So it's always handled anyway, and the default-frame-alist setting is
just counter-productive, I think?

Does anybody see any possible negative consequences of just removing
that code from x-win.el?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-05-18 12:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 17:49 bug#32921: emacsclient obeys Xresources even when launched with -nw Dimitrios Apostolou
2022-05-18 12:38 ` Lars Ingebrigtsen [this message]
2022-05-18 13:02   ` Eli Zaretskii
2022-05-18 13:13     ` Lars Ingebrigtsen
2022-05-18 13:27       ` Eli Zaretskii
2022-05-18 13:52         ` Lars Ingebrigtsen
2022-05-18 14:00           ` Eli Zaretskii
2022-05-19 22:58             ` Lars Ingebrigtsen
2022-05-19  1:37           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19  7:02             ` Eli Zaretskii
2022-05-19  7:47               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19  8:26                 ` Eli Zaretskii
2022-05-19  8:59                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19  9:44                     ` Eli Zaretskii
2022-05-19 10:19                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19 12:40                         ` Eli Zaretskii
2022-05-19 13:09                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19 13:23                             ` Eli Zaretskii
2022-05-19 13:40                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19 13:55                                 ` Eli Zaretskii
2022-05-20  1:04                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-20  7:03                                     ` Eli Zaretskii
2022-05-20  8:15                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-19 23:04                   ` Lars Ingebrigtsen
2022-05-20  6:54                     ` Eli Zaretskii
2022-05-20  8:19                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-20 10:50                         ` Eli Zaretskii
2022-05-20  8:28                       ` Lars Ingebrigtsen
2022-05-20 11:00                         ` Eli Zaretskii
2022-05-20 11:30                           ` Lars Ingebrigtsen
2022-06-19 13:28   ` Lars Ingebrigtsen

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=87o7zvc8xi.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=32921@debbugs.gnu.org \
    --cc=jimis@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

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

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).