From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame Date: Mon, 02 Jul 2018 02:27:22 +0000 Message-ID: <87muvaxth1.fsf@gmail.com> References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> <83lgawmwup.fsf@gnu.org> <878t6wxbzr.fsf@gmail.com> <5B38994B.2010605@gmx.at> <87va9zxfhe.fsf@gmail.com> <83in5zkjsk.fsf@gnu.org> <87tvpiyjz6.fsf@gmail.com> <83fu12lwh2.fsf@gnu.org> <83efgmlvya.fsf@gnu.org> <87r2kmyikh.fsf@gmail.com> <7ac98ea5-23c8-456a-8c40-18c703bea617@default> <87o9fqy8tb.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530498370 19663 195.159.176.226 (2 Jul 2018 02:26:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2018 02:26:10 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 04:26:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZoXR-0004um-Iw for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 04:26:01 +0200 Original-Received: from localhost ([::1]:56382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZoZY-00020a-Rz for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jul 2018 22:28:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZoZR-0001z3-ML for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 22:28:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZoZO-000546-He for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 22:28:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZoZO-00053l-CN for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 22:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZoZN-00073j-W0 for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 22:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2018 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31325 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31325-submit@debbugs.gnu.org id=B31325.153049845627098 (code B ref 31325); Mon, 02 Jul 2018 02:28:01 +0000 Original-Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 02:27:36 +0000 Original-Received: from localhost ([127.0.0.1]:42515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZoYy-000730-Ei for submit@debbugs.gnu.org; Sun, 01 Jul 2018 22:27:36 -0400 Original-Received: from mail-qk0-f196.google.com ([209.85.220.196]:36018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZoYw-00072n-Nu for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 22:27:35 -0400 Original-Received: by mail-qk0-f196.google.com with SMTP id a132-v6so7949613qkg.3 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 19:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=Ok5bmiPZRnifmrrk03vKTRCN6BBGmVK7ibKZ2jMaiSA=; b=rB94n4XZD2khoezwKlEyX7MEXoFfVet1XSDl2Iv4OhwA9ISjDtjvxgAzobhhs1GFA5 fP0llkSgqvXi71QayO2ezyDeuV6tLrjynACJKItkcGl/pmS5SrD0CkEemqglvwOQAtNe eDJN2l+frKFUA4F/zDV85EAQ+pS9j+YXzYhB1XUW8Y+VgzsmmJJ6fpGw/GXxIoEHqWE4 MfstGO8MmcWv95MWWvDw8vytVBfIvf5CKRSg+XgUuKqCSQ2ZAUN/11qdKPrHzoc6C/AO u+aGd3jRIMHZjrI7KvOAMKxCuePJVxNcWCls8OPkVzvAakE4N7kzgsJ7GpQInO9aA1LH tqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=Ok5bmiPZRnifmrrk03vKTRCN6BBGmVK7ibKZ2jMaiSA=; b=M01/gMp3t2ngQwdBe/nM6XVqNUgBIGAJ/I74pNKrn7U2Sfq7cSfFY/OAN0WPcusr6h rxI+Ha7py2yozH5qTW//NYS1Ms+KehmCp+HoFugbaGerQND2RJhTdAawJphS6ASorTXu 1gC8CBqNdA1WElm/0F9VcEa7gvUAG8O/AAW+A3zG5+1dNEUtJWJAGK45v0utp9INaCIW pBArvnLNMANqjJssQGDMiWw7VYgUUaG6q1dQiIjQG/bQklODsMUC/9+R2GCfgQnj2oNg mRQcEyJdjA0AVHNejgpT0hbCODhWazyFGm8LarF2jQEGATRDwMvjZYa2GdjdLNlGn9HS 4PSA== X-Gm-Message-State: APt69E3qimfqi/cLBjlZfd2DsCY+XubrEApePmh4heDZUEBJ+hyrUG+x 7paaqEfaGMKBfbtlkb1LnY4= X-Google-Smtp-Source: AAOMgpeHPQeQZQq13cNa4cl3/qqku0yFzSXsug3dhZhRkr9UJilF4IbKv5pWpiAqAvTELsApZTrd/w== X-Received: by 2002:a37:6809:: with SMTP id d9-v6mr19608537qkc.444.1530498448936; Sun, 01 Jul 2018 19:27:28 -0700 (PDT) Original-Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id h23-v6sm8884071qtn.79.2018.07.01.19.27.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 19:27:27 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148070 Archived-At: Drew Adams writes: > In Bookmark+ function `bmkp-handle-region-default' I use > `(recenter 1)'. And yes, that code should redisplay. Are you confusing redisplaying the window that is displaying the buffer with clearing and redisplaying the entire tty frame ? This patch addresses the latter. To be clear, `recenter' will redisplay the window displaying the buffer and this patch doesn't change that behavior. If you meant the former (i.e. clearing and redisplaying the entire frame), can you elaborate on why `bmkp-handle-region-default' would need to do that. Clearing and redisplaying the entire frame causes unnecessary flickering that makes the eating experience very poor. To my knowledge this behavior is only needed for interactive users in order to clear the terminal and redisplay Emacs' content. For example, this could happen if the kernel decides to print messages or if a background process prints to the same terminal that Emacs is using. I fail to see how a lisp call would be interested in redisplaying the entire frame. > Icicles has multiple calls like this, where the default > value of option `icicle-recenter' is -4: > > (unless (pos-visible-in-window-p) (recenter icicle-recenter)) > > And in Isearch+ I have this in my version of `isearch-cancel': > > (when isearchp-win-pt-line (recenter isearchp-win-pt-line)) > > where that variable is the line number of point before > searching, relative to `window-start'. > > And in `palette.el' I do this: > (when win > (select-window win) (goto-char (point-min)) (recenter)) > > And in `synonyms.el' I have `(recenter 2)'. Same as above. I don't see how these calls to `recenter' should redisplay the entire frame as opposed to redrawing the single window that displays the buffer. > Could I just use `set-window-point' or some such? Maybe; > dunno. I don't feel like debugging all such stuff, to see. > Sure, I could adapt your code change, to add the 2nd arg > (also testing the Emacs version...). And I will, if you > go ahead with your change. I don't think you have to use a different lisp function or add the extra argument, unless of course I misunderstood what these libraries are trying to do. > But this is not at all about my code, and it is not really > even about whether there is other code out there that uses > `recenter' expecting it to redisplay, although I expect that > there is such other code. That's just what `recenter' does, > and it always has. So sure, there is bound to be code that > counts on that behavior. It's a very old function, with a > pretty simple behavior (from a use point of view, at least). > > But the existence of code that would break is not really > the question. The question is why this change should be > made to the Lisp behavior, just to accommodate a > terminal-Emacs display annoyance. What does the one have > to do with the other? > > It's really about what the _bug_ is and what it's solution > should be. So far (but again, I haven't really read the > thread), it does not sound to me like `recenter' has a > bug. It sounds like Emacs behaves badly in a terminal, > in this case (or in some terminals, some of the time, > perhaps). > > There is nothing older than the combination of `recenter' > (same as it's always been) and Emacs in a terminal, is > there? Why is this suddenly a bug now? I don't think anything changed other than having the desire and time to fix this behavior. I have been noticing this behavior for a while but didn't bother debugging it to figure out the root cause. > Use of `recenter' in a terminal is not the same as use of > `recenter' from Lisp. Lisp is used with GUI Emacs also. As I mentioned previously, the behavior of `recenter' in the GUI hasn't changed, assuming you use the default value of `recenter-redisplay'. > TRT surely has something to do with terminal Emacs, not > with whether or not the use is interactive, no? > > Please do fix the behavior of `recenter' for Emacs in a > terminal, if it's broken. But why "fix" it for GUI too, > if it's not broken there? Maybe just test > `display-graphic-p'? I don't think we need to do anything special for the GUI. As I mentioned above `recenter' doesn't redisplay the entire frame by default when a GUI is being used. This is because redisplaying the frame is unnecessary for GUI, since they don't suffer from the same problem as terminals where some random process could clobber the display. >> > And in the old days people used Emacs mainly (and >> > originally, only) in the terminal. Why is the terminal >> > behavior suddenly considered to be bugged? Or given >> > that it is bugged - is changing the default behavior >> > the best fix? >> >> I only use Emacs from the terminal, in fact I compile emacs `without-x` >> since I never use the GUI. > > OK. And did you just start seeing this bugged behavior? > Or did you just start using Emacs? Haven't people been > using it in a terminal for decades, without this having > been reported or addressed? I have been using Emacs for almost 10 years now. I don't think there is anything new about this except for my desire to fix it now. > Maybe it's a new problem, due to some other change. Or > maybe it's always been there and people have just ignored > it. In any case, IF it is to be fixed then it seems like > it should be fixed only for terminal Emacs. > >> > Please ignore, if my understanding is wrong or my >> > comments on this are not helpful. >> >> I think it is very valuable to have more feedback on the patch. That >> said, I am still having trouble understanding what are your concerns. > > Thanks; HTH. Is it any clearer now? I don't think so. The way you argue against merging the patch makes me believe you misunderstood the intended change. I suggest you read the entire thread as well as the original help-gnu-emacs [1] thread for more context. [1]: http://lists.gnu.org/archive/html/help-gnu-emacs/2018-04/msg00326.html