From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame Date: Sun, 1 Jul 2018 16:04:00 -0700 (PDT) Message-ID: 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; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530486191 2564 195.159.176.226 (1 Jul 2018 23:03:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2018 23:03:11 +0000 (UTC) Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca To: John Shahid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 01:03:06 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 1fZlN2-0000Wx-Ru for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 01:03:05 +0200 Original-Received: from localhost ([::1]:55918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZlP8-0002Q1-Ca for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jul 2018 19:05:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZlP0-0002Pf-7y for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 19:05:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZlOx-0002ov-23 for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 19:05:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZlOw-0002oh-U5 for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 19:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZlOw-0002Qk-GE for bug-gnu-emacs@gnu.org; Sun, 01 Jul 2018 19:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jul 2018 23:05:02 +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.15304862539283 (code B ref 31325); Sun, 01 Jul 2018 23:05:02 +0000 Original-Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 23:04:13 +0000 Original-Received: from localhost ([127.0.0.1]:42447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZlO9-0002Pf-4t for submit@debbugs.gnu.org; Sun, 01 Jul 2018 19:04:13 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:44704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZlO6-0002PR-SD for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 19:04:11 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w61MwhvW155700; Sun, 1 Jul 2018 23:04:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=4X0cd0FX4kljAQ6PsrmQUitnLCd1/lOaUj6pb4sSImg=; b=bJv95VjGOyhMF9kxhns8BRPy9CoyXiCYOqmkA9aJ0qHHSbuiGAkUdBlpTpbhsJEc2gAy Tp0TauA8vLij+YYKU+SJLkU5r3brG8dTTWF/xrEhsFU9xKrM8eF1yvn9OoDJ8IMXAMsY Je9I7GfQQM0DOQ913kR9U8VXnu3lz6Fnurv4rhTefT7YfjK/CaHYUg2tILje6vlv0DzF r+wkMRnLJdlp2Hm8uyefxMRCOMiXrQYPTw952I1aC5uofsvu3vZMDKpF+iythyTJSzev ZBetEcTtrH6NPA9LsW65RkGw9CLOvz/1dSmwFxGcf8fC8Lx6Ost8HGLj9XcvdRvFmWl7 UQ== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2jx19sjdn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 01 Jul 2018 23:04:05 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w61N42Nd022326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 1 Jul 2018 23:04:03 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w61N40OU018687; Sun, 1 Jul 2018 23:04:00 GMT In-Reply-To: <87o9fqy8tb.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8941 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807010275 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:148067 Archived-At: > > It looks like you are changing the default behavior of > > `recenter', which is a backward-incompatible change. >=20 > That's right but only for non-interactive uses of `recenter'. All > interactive uses should remain backward compatible. Sure. That's why I said "Lisp calls". > > Am I right about that, so that all Lisp calls of that > > function would now need to be changed, to add a non-nil > > 2nd arg in order to keep the same behavior? >=20 > That's right but only if the caller need to redisplay the frame. Are > you aware of any lisp calls that make use of that feature > (i.e. redisplay the frame as well as recenter) ? I'm only aware of two > uses in Flycheck and `xref-find-definitions'. IMHO, in both cases the > redisplay side-effect is undesirable. I think you mean that in both cases it is undesirable _in a terminal_, no? Am I aware of any such calls? That's irrelevant - to me. And I really had no idea whether I know of such calls. The point is that this function has been around since Day One, with the same behavior, and it's likely that there is code out there that is broken by this change. It's certainly not enough to search the Lisp code distributed with Emacs, to get an idea whether something is used. However, as it turns out, I do have such calls in some of my code. I expected that this was not true (bad memory), but grepping just now shows that it is. I know it might look like I was complaining about this change affecting my code, but that's not the case. I really had no idea (I'd forgotten) that I in fact use `recenter'. In Bookmark+ function `bmkp-handle-region-default' I use `(recenter 1)'. And yes, that code should redisplay. I haven't bothered to try it in terminal mode, but if that's a problem then doesn't it indicate a problem (bug) in Emacs terminal mode, not in `recenter'? Invoking a function from Lisp is not the same as invoking it from Lisp with Emacs in terminal mode. And I have other uses of it, all of which should redisplay. 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)'. 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. 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? > > The reported bug was only about a problem for Emacs in > > a terminal, right? Can't it just be fixed to DTRT in > > that case, without changing so much in the definition > > and behavior of the function? >=20 > I am not sure what does the right thing mean in this case. AFAIK, the > patch was trying to do the right thing by keeping the interactive use > backward compatible but prevent calling `recenter' from lisp from > redisplaying the frame. Use of `recenter' in a terminal is not the same as use of `recenter' from Lisp. Lisp is used with GUI Emacs also. 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'? > > 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? >=20 > 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? 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. >=20 > 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?