From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#56662: 29.0.50; Funny region highlights when highlight-nonselected-windows is t Date: Sun, 24 Jul 2022 19:41:20 +0300 Organization: LINKOV.NET Message-ID: <864jz6784w.fsf@mail.linkov.net> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , 56662@debbugs.gnu.org, Visuwesh To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 24 19:21:09 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 1oFfHx-0006BN-Qj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 19:21:09 +0200 Original-Received: from localhost ([::1]:53732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFfHw-000241-Pj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 13:21:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFfEw-00075J-Ff for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFfEw-000765-6T for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFfEw-0003Tt-2C for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 13:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jul 2022 17:18:02 +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.165868307713362 (code B ref 56662); Sun, 24 Jul 2022 17:18:02 +0000 Original-Received: (at 56662) by debbugs.gnu.org; 24 Jul 2022 17:17:57 +0000 Original-Received: from localhost ([127.0.0.1]:48588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFfEq-0003TS-WB for submit@debbugs.gnu.org; Sun, 24 Jul 2022 13:17:57 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:58353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFfEm-0003T0-Nv for 56662@debbugs.gnu.org; Sun, 24 Jul 2022 13:17:53 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 767D7200005; Sun, 24 Jul 2022 17:17:45 +0000 (UTC) In-Reply-To: <87y1wm9kqh.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Fri, 22 Jul 2022 00:14:30 +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:237859 Archived-At: >> In any case, I don't think there's any reasonable action we can take. >> "Active region" is already bending Emacs quite a bit, the current >> scenario seems to break the camel's hump in unexpected ways (altho >> there's always a reason to explain the behaviour). Closing the bug >> report. > > That's fair. My argument for keeping it open would be that people who > would be able and willing to scratch that itch in the future might not > think to search for closed reports; but then again I suppose there's not > a lot of information in our present discussion that they wouldn't be > able to rediscover on their own. 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)))))