GNU bug report logs - #32921
emacsclient obeys Xresources even when launched with -nw

Previous Next

Package: emacs;

Reported by: Dimitrios Apostolou <jimis <at> gmx.net>

Date: Wed, 3 Oct 2018 17:50:02 UTC

Severity: normal

Tags: moreinfo

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dimitrios Apostolou <jimis <at> gmx.net>
Cc: 32921 <at> debbugs.gnu.org
Subject: bug#32921: emacsclient obeys Xresources even when launched with -nw
Date: Wed, 18 May 2022 14:38:33 +0200
Dimitrios Apostolou <jimis <at> 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




This bug report was last modified 2 years and 332 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.