From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32921: emacsclient obeys Xresources even when launched with -nw Date: Wed, 18 May 2022 16:02:54 +0300 Message-ID: <835ym3f0xt.fsf@gnu.org> References: <87o7zvc8xi.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10935"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 32921@debbugs.gnu.org, jimis@gmx.net To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 18 15:08:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrJPR-0002h5-DK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 15:08:13 +0200 Original-Received: from localhost ([::1]:41052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrJPQ-0002Ny-9q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 09:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrJLP-00072N-1w for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrJLO-000628-OR for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrJLO-0001OE-Gx for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 May 2022 13:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32921 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 32921-submit@debbugs.gnu.org id=B32921.16528790005294 (code B ref 32921); Wed, 18 May 2022 13:04:02 +0000 Original-Received: (at 32921) by debbugs.gnu.org; 18 May 2022 13:03:20 +0000 Original-Received: from localhost ([127.0.0.1]:59355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrJKh-0001NK-Re for submit@debbugs.gnu.org; Wed, 18 May 2022 09:03:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrJKg-0001N7-6b for 32921@debbugs.gnu.org; Wed, 18 May 2022 09:03:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrJKZ-0005ya-CC; Wed, 18 May 2022 09:03:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=dP97aS5Bcb6koOnfqhFTFvoAUFHmGSmvZff65krnlj0=; b=B82tmgr7lZap 3SgdhHnzSb1JYimtwagqEv1ZzKioPxwGEpWwQ36pLU7Ss7RYAcvfL0Sw2tI0/d/GnxhL5U2TysxS2 2i7zh9wR/u4KvSA0FxS2Ha3eAoyvWtdGJgioYxzMLizJ4brUuz0+8aQmBnDzmcsMY5P5uJEto0M8V 5FkHyRDPKSFVKZ1mkV/djfFxLoJvvmt8/S0LCtJL6P1qe6xCE8WzetoHqLa4lK88OCLcNaXDzzNUK /mS9ap4lnz0GSyAJlVUV+8AKA2NNU2fLeBD89MJGbjnLJjyoVQ3668mXdTuVTZ8dIn+sZ3RYoLT1r eoHZBqLJ76qCkK3oJ4on7A==; Original-Received: from [87.69.77.57] (port=4982 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrJKQ-0004BC-VS; Wed, 18 May 2022 09:03:08 -0400 In-Reply-To: <87o7zvc8xi.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 18 May 2022 14:38:33 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232559 Archived-At: > Cc: 32921@debbugs.gnu.org > From: Lars Ingebrigtsen > Date: Wed, 18 May 2022 14:38:33 +0200 > > Dimitrios Apostolou 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? Which sequence of calls ends up calling x-handle-reverse-video, and what is the trigger for that sequence of calls? (These kinds of changes in code that was there for decades give me the creeps.)