From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#46119: 28.0.50; this-error-recenter Date: Sun, 31 Jan 2021 16:56:58 +0100 Message-ID: <87o8h5f6b9.fsf@gmail.com> References: <8735yn1jjn.fsf@gmail.com> <87czxqbwp4.fsf@mail.linkov.net> <87im7eqxij.fsf@gmail.com> <87mtwqqose.fsf@mail.linkov.net> <87y2g9bgjc.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26311"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46119@debbugs.gnu.org, uyennhi.qm@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 31 16:58:10 2021 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 1l6F73-0006iA-Tu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jan 2021 16:58:09 +0100 Original-Received: from localhost ([::1]:48582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6F72-0008Bb-LS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jan 2021 10:58:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6F6w-0008BU-Nq for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2021 10:58:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6F6w-0001Nx-GA for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2021 10:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6F6w-00075y-Et for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2021 10:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jan 2021 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46119 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46119-submit@debbugs.gnu.org id=B46119.161210862927207 (code B ref 46119); Sun, 31 Jan 2021 15:58:02 +0000 Original-Received: (at 46119) by debbugs.gnu.org; 31 Jan 2021 15:57:09 +0000 Original-Received: from localhost ([127.0.0.1]:57750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6F64-00074k-IU for submit@debbugs.gnu.org; Sun, 31 Jan 2021 10:57:09 -0500 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:54466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6F62-00074F-9q for 46119@debbugs.gnu.org; Sun, 31 Jan 2021 10:57:08 -0500 Original-Received: by mail-wm1-f41.google.com with SMTP id u14so10560377wml.4 for <46119@debbugs.gnu.org>; Sun, 31 Jan 2021 07:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Oh87tznBM3I/DBgjJyuszL5e6XD6GzxkonvI968mPLQ=; b=JYxLzy78Jvg37ucz9NFrjqcQgIUSBA+PoB/J2e0BwMaU7JgZJjReRIe9cSdd1B8tJQ ZL+Y49poAHJ0zVspCCGEjW/uqWBqP+IVBCnXTwJU2wbIy+bM4KIuRhhN8FJ0MjAzDa7T IK8ERif77cQyUlvn+SjYuKn8Xva9nk1ZlJxpFKdHJtEu5YPU6iJYB4+V/rBixZPliI6E x4izx/zqmPOTfcfgs5DNsM66o1QEPO7T60i+1zzFi3hCWNOHQlIYlHW2+kTd/42r1vt5 s/b4L7wlOT+rtHcyw2+IU9x9MjOSGhrpdiDCDJN4ahC5+/JWqEkDZN6MF06Qcq/hs7CO YJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Oh87tznBM3I/DBgjJyuszL5e6XD6GzxkonvI968mPLQ=; b=rQnQqJB6xwi/Jy5cN31f+tNN2ZGRgtcruopYN74ihzKa8Ivtmy3jE9khbiUM/2b3o2 i1pa2foQzBJPuFH4K+8T5rIS0BGkBkH9KnFhckB/wDIuC75ryxPgeUJ430sUrsehps3f amgb9STuWzD7zYiFpZ1NxShpbhh+SfbXL0ofam+EL/XHxqk1nRuh+bP379D2EGxMJ9vj E6ZfyRghV092LXLP52Gl5gPdyxu2Xj8vtolepIBCCVMKE+p7OGenxba+2vZ4uJF+HpaX nyNsBn7DsqmxteLfNfttBowFNYm6gIAK2Xo7BBDoV5ql0VPhCzJiRScfNm8s15+ZiAb5 HMfA== X-Gm-Message-State: AOAM531x6io/PA5ojTzTUCZpO6cP3xlKDU+kZa188+eif3ettVHU5tBJ 1S+RplP3WCbQWHqej3cuq+M= X-Google-Smtp-Source: ABdhPJxXzeMLEWFTeJf18OvME3STURQMtdGTjWhW18islbhW2s/z478L/VukHhyeMsuoONN6gY7ITQ== X-Received: by 2002:a05:600c:2253:: with SMTP id a19mr11309256wmm.75.1612108620375; Sun, 31 Jan 2021 07:57:00 -0800 (PST) Original-Received: from localhost.example.com ([31.7.242.222]) by smtp.gmail.com with ESMTPSA id k131sm18900932wmb.37.2021.01.31.07.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 07:56:59 -0800 (PST) In-Reply-To: <87y2g9bgjc.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 31 Jan 2021 11:29:43 +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:199015 Archived-At: Juri Linkov writes: >> I like to see the pulse highlight, as with `next-error-no-select', >> that's why I call `next-error-function' here. >> [I customize `next-error-highlight' and `next-error-highlight-no-select' to >> 3 s] > > Woundn't such pulse highlighting be useful for all cases, > not only compilation and occur? Yes, that helps to drive the eye to the position of the line. > Then you can use: > > (with-selected-window (other-window-for-scrolling) > (recenter-top-bottom) > (pulse-momentary-highlight-one-line (point))) > > and customize pulse-delay to 3 s, and pulse-iterations to 1. There is a problem: It is not guaranteed that Occur/Grep will scroll the right target window. Users might have divided the frame in 3 or more windows. For Occur/Grep, to ensure we scroll the right window, we would need to let bind `other-window-scroll-buffer' to the right targets (available at *Occur* and *Grep* as text properties); that part complicates the code. The original implementation, i.e.: + (funcall next-error-function 0 nil) + (recenter-top-bottom arg) + (pop-to-buffer next-error-last-buffer))) automatically takes care of finding the target. I'd prefer adding them as two separated entities: - recenter-other-window: as you have suggested, including the pulse. - recenter-this-error (or this-error-recenter): For occur/grep with the original proposal. Another small benefit is that for occur/grep, the pulse highlight automatically behaves the same as in `next-error-no-select': it matches only the occurrence/error. Do you agree with adding two separated commands?