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#56662: 29.0.50; Funny region highlights when highlight-nonselected-windows is t Date: Sun, 24 Jul 2022 20:32:11 +0300 Message-ID: <837d42fmck.fsf@gnu.org> References: <87bktk585s.fsf@gmail.com> <83wnc8klhw.fsf@gnu.org> <877d48550b.fsf@gmail.com> <83sfmwkl0y.fsf@gnu.org> <871qufpmjp.fsf@gmail.com> <83lesnnfxy.fsf@gnu.org> <87h73a7lsx.fsf@gmail.com> <834jzaodza.fsf@gnu.org> <87a6927ijj.fsf@gmail.com> <83wnc6mygg.fsf@gnu.org> <875yjqr0s1.fsf@gmail.com> <83lesmmpfo.fsf@gnu.org> <871queqw9j.fsf@gmail.com> <83bktimnlg.fsf@gnu.org> <87sfmupfj6.fsf@gmail.com> <87y1wm9kqh.fsf@gmail.com> <864jz6784w.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38157"; mail-complaints-to="usenet@ciao.gmane.io" Cc: visuweshm@gmail.com, 56662@debbugs.gnu.org, kevin.legouguec@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 24 19:33:12 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 1oFfTc-0009o0-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 19:33:12 +0200 Original-Received: from localhost ([::1]:56364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFfTa-0004dy-VD for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 13:33:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFfTS-0004dm-4l for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFfTR-0000pV-SP for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFfTR-0003su-N2 for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jul 2022 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56662 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 56662-submit@debbugs.gnu.org id=B56662.165868394014878 (code B ref 56662); Sun, 24 Jul 2022 17:33:01 +0000 Original-Received: (at 56662) by debbugs.gnu.org; 24 Jul 2022 17:32:20 +0000 Original-Received: from localhost ([127.0.0.1]:48604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFfSm-0003rt-A6 for submit@debbugs.gnu.org; Sun, 24 Jul 2022 13:32:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFfSj-0003rg-Px for 56662@debbugs.gnu.org; Sun, 24 Jul 2022 13:32:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFfSe-0000iM-72; Sun, 24 Jul 2022 13:32: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=VtQsy5ddZkJc7nr6a/9436SOt2vXlFWlSEJkFLLBrIw=; b=r55wd1UEgusk XWmVNCDdKtARcHG/MnAsr60ZMEMvmHDlNMGEYWWmQkxEIWlk/cbWFeZlcjbbzhVluTppqj/oSCAWl dqNr7K+4Xns+G89p/vA29rMl00lBun9aME+rDINCgc2DRUDhrB+mmf4tCbHJVtr6dRsrYW552Ox0Z mWYxtnBnhikVJ5z0TPpRhbMqhdJOnW3QbnycgCgZ0i3Z2MI9HUGNEOmovHnRH5gTHIf6U8c0aQ0+B GEYjPkmfuZzhNCcvEaMG9Rf14k3cd0CwL0Jr1EzIl0PVpHpyQ/vljLHIawy+vk73IbwS8BcYnsr71 URVUDCZf0KfGrX/6bxMvcw==; Original-Received: from [87.69.77.57] (port=2722 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 1oFfSd-0005qY-Lw; Sun, 24 Jul 2022 13:32:11 -0400 In-Reply-To: <864jz6784w.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 24 Jul 2022 19:41:20 +0300) 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:237861 Archived-At: > From: Juri Linkov > Cc: Visuwesh , Eli Zaretskii , > 56662@debbugs.gnu.org > Date: Sun, 24 Jul 2022 19:41:20 +0300 > > It's very easy to make region highlighting window-local with just > > diff --git a/lisp/simple.el b/lisp/simple.el > index 5443d961e1..04002073bd 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -6944,7 +6944,7 @@ redisplay--update-region-highlight > (eq window (minibuffer-selected-window)))))) > (funcall redisplay-unhighlight-region-function rol) > (let* ((pt (window-point window)) > - (mark (mark)) > + (mark (or (window-parameter window 'mark) (mark))) > (start (min pt mark)) > (end (max pt mark)) > (new > > Then the main task would be to find the right logic of setting > the window-local mark. Since this feature request is closed, > here is a possible starting point for anyone who wants to experiment > with the prototype trying different use cases: > > (add-hook 'activate-mark-hook > (lambda () (set-window-parameter nil 'mark (mark)))) > (add-hook 'deactivate-mark-hook > (lambda () (set-window-parameter nil 'mark nil))) > (add-hook 'window-selection-change-functions > (lambda (window) > (when (eq window (selected-window)) > (set-marker (mark-marker) (window-parameter window 'mark))))) > Don't forget that this must only happen if highlight-nonselected-windows is non-nil.