From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 30 20:48:56 2018 Received: (at submit) by debbugs.gnu.org; 1 May 2018 00:48:56 +0000 Received: from localhost ([127.0.0.1]:44575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fDJTU-0007zM-K1 for submit@debbugs.gnu.org; Mon, 30 Apr 2018 20:48:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fDJTS-0007z9-T3 for submit@debbugs.gnu.org; Mon, 30 Apr 2018 20:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDJTM-0006mj-O2 for submit@debbugs.gnu.org; Mon, 30 Apr 2018 20:48:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDJTM-0006mW-KF for submit@debbugs.gnu.org; Mon, 30 Apr 2018 20:48:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDJTL-0007Wi-AX for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2018 20:48:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDJTH-0006l6-ER for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2018 20:48:46 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:47088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDJTH-0006kw-9e for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2018 20:48:43 -0400 Received: by mail-qt0-x241.google.com with SMTP id m16-v6so13119842qtg.13 for ; Mon, 30 Apr 2018 17:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=DA1ey2E969F9TbACajGrWsAEe9gZogLz4dn4R6NjTJc=; b=t3Ii9HzAQabOFdorD8IIP2CJMAklzIwcOLvqit5PAyxjBfWQD48wHvD8/sKxlLvSqJ QEf9WKpgTM8k9bqVhuYasJ5Hr6YCOMj3/svd5VdkSiMxItf6T2S8J1LC9DP8evAIUYMI 61hq1+TBfgtOtMxW/zgL9gwH+NklKLUlJfI7o9Xi0HtQIehSSp/pUXSyGbRIWEIJKqja k49aaeOdi0Q9bw3A42uEW/34HWINR6YRDOkgYYMY0SLULdj/L4gfwD+FmR6fyUffntG/ +Mwn8jaZeFgkDoCG+C6qOmPw1cwPcw81G2gK9jRbhisETRgZMPUt3VNhwrCNg4mnxm6c Qr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=DA1ey2E969F9TbACajGrWsAEe9gZogLz4dn4R6NjTJc=; b=c2z3ijRGH9/VbJtmAjcFgU0xxXDWuzinOF6d8tq0A1uDEoFAhpVonG5DfGXt8KBcHX e8yv83/xzaVzHhqu1/vfHbsin5HU3vFlyDMHsepCyC1Pz59h22ewM4ejEeZAJhjim3/Y /vau84ffd3lIfSHwzlH+lbv+UKJ/lYh5YrQZSM0GSi++aEtaYfoYwzhYlnyNGhpgZzM9 VQrrtjZYqmTKUeknb91PqhDOyXFyYNTMla6x5uerXHUvmzVjfl8zGJC31FBZ5s8pakcr j2DkzKgDY+7oUjBttlWbXdx6Cg5nQv3iqjaCX+/sjGekYfGL98tSZ3UyGcyzhLNHXuLI efWg== X-Gm-Message-State: ALQs6tDD6clmP+3nAQW6u95U4DNP2zZZHr7ctlXB7qtu3sQyGqj9TQtP 1GopbBngeD7z0qK5hq7yG292Qyrc X-Google-Smtp-Source: AB8JxZoWVq/2+1BwDrx9vPWNpEJ1+U5hupQ6Dskzk+MVTPv/tifmu2nNu56TlYwnGQ2oMmt9WoGQEg== X-Received: by 2002:ac8:6698:: with SMTP id d24-v6mr12852926qtp.204.1525135721994; Mon, 30 Apr 2018 17:48:41 -0700 (PDT) Received: from de9210e3fd4c (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id d1-v6sm7385988qtk.57.2018.04.30.17.48.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 17:48:41 -0700 (PDT) From: John Shahid To: bug-gnu-emacs@gnu.org Subject: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame Date: Tue, 01 May 2018 00:48:25 +0000 Message-ID: <87po2gkxpi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This BUG is a continuation of this help-gnu-emacs mailing list thread [1]. As mentioned in the thread, I ran into a terminal flickering issue in flycheck which turns out to be caused by `recenter' redisplaying the frame when `recenter-redisplay' value is either `t' or `tty'. I agree with the arguments in the thread to maintain the backward compatible behavior. Instead, I'm proposing one of the following alternatives: 1. introduce a new lisp function for recentering and discourage the use of `recenter' from lisp (i.e. declaring it `interactive-only'), or 2. add a new `recenter-and-redisplay' and bound it to C-l Also, Stefan's suggestion/possible solution: 3. adding an argument to `recenter' to control the redisplay behavior [1]: http://lists.gnu.org/archive/html/help-gnu-emacs/2018-04/msg00326.html In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu) of 2018-04-16 built on 043fb36e1435 Repository revision: 6ec3ec7fbec2c04d5e9570b0470217cd97e5e7e6 System Description: Ubuntu 16.04.4 LTS Configured using: 'configure --without-x' Configured features: SOUND NOTIFY GNUTLS LIBXML2 ZLIB THREADS Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix From debbugs-submit-bounces@debbugs.gnu.org Mon May 07 21:37:26 2018 Received: (at 31325) by debbugs.gnu.org; 8 May 2018 01:37:26 +0000 Received: from localhost ([127.0.0.1]:53363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fFrZG-0001ZK-6V for submit@debbugs.gnu.org; Mon, 07 May 2018 21:37:26 -0400 Received: from pmta21.teksavvy.com ([76.10.157.36]:57218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fFrZC-0001Z5-L2 for 31325@debbugs.gnu.org; Mon, 07 May 2018 21:37:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FABAAI/vBa/7SpSC1cGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYNEgVuZDYF5E3yVHguEbAKCVCE4FAECAQEBAQEBAgICaCiFKwEEAW4?= =?us-ascii?q?LBQsLDQEmBwsUGDEuhH4IqigaAogqgkiIJYIThBqKRwKYKgiWECKEfZBMgSUzI?= =?us-ascii?q?oFSMxoIMDuCRIJHjiIjkXgBAQ?= X-IPAS-Result: =?us-ascii?q?A2FABAAI/vBa/7SpSC1cGgEBAQEBAgEBAQEIAQEBAYNEgVu?= =?us-ascii?q?ZDYF5E3yVHguEbAKCVCE4FAECAQEBAQEBAgICaCiFKwEEAW4LBQsLDQEmBwsUG?= =?us-ascii?q?DEuhH4IqigaAogqgkiIJYIThBqKRwKYKgiWECKEfZBMgSUzIoFSMxoIMDuCRIJ?= =?us-ascii?q?HjiIjkXgBAQ?= X-IronPort-AV: E=Sophos;i="5.49,376,1520913600"; d="scan'208";a="30769283" Received: from unknown (HELO fmsmemgm.homelinux.net) ([45.72.169.180]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 21:37:14 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id F2550AEC95; Mon, 7 May 2018 21:37:06 -0400 (EDT) From: Stefan Monnier To: John Shahid Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame Message-ID: References: <87po2gkxpi.fsf@gmail.com> Date: Mon, 07 May 2018 21:37:06 -0400 In-Reply-To: <87po2gkxpi.fsf@gmail.com> (John Shahid's message of "Tue, 01 May 2018 00:48:25 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > This BUG is a continuation of this help-gnu-emacs mailing list > thread [1]. As mentioned in the thread, I ran into a terminal flickering > issue in flycheck which turns out to be caused by `recenter' > redisplaying the frame when `recenter-redisplay' value is either `t' or > `tty'. I agree with the arguments in the thread to maintain the backward > compatible behavior. Instead, I'm proposing one of the following > alternatives: Indeed, most/all uses from Elisp shouldn't redisplay. > 1. introduce a new lisp function for recentering and discourage the use > of `recenter' from lisp (i.e. declaring it `interactive-only'), or > 2. add a new `recenter-and-redisplay' and bound it to C-l > Also, Stefan's suggestion/possible solution: > 3. adding an argument to `recenter' to control the redisplay behavior Either of those is OK. The benefit of the 3rd is that it would likely "magically fix" 99% of the existing uses (I'm thinking of adding an optional argument which we could call `and-redisplay` which when non-nil tells recenter to do a redisplay, so all existing Elisp calls would be implicitly modified not to cause a redisplay). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 28 09:27:51 2018 Received: (at 31325) by debbugs.gnu.org; 28 Jun 2018 13:27:51 +0000 Received: from localhost ([127.0.0.1]:38316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYWxj-0008On-CX for submit@debbugs.gnu.org; Thu, 28 Jun 2018 09:27:51 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:38202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYWxf-0008OM-OK for 31325@debbugs.gnu.org; Thu, 28 Jun 2018 09:27:49 -0400 Received: by mail-qt0-f171.google.com with SMTP id c5-v6so4677375qth.5 for <31325@debbugs.gnu.org>; Thu, 28 Jun 2018 06:27:47 -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=hN2vzKy7CEcmXaeQlzPWeT7AhV7i4wp4WFUeC10CK6Q=; b=HcuvZKiaQJ2XF55S7qGrqG1YE9F/Ib+hFs6TheYKOBKUoI7kXiXWVqiabbhB06j2GN M+GIhRlCvc3dIYSJ1vnisOfwazI+tlxN4ii0eo4OLJBNDd3bsdG1sWlJqWg0RJs2Qkcq 1j+0IugAC24+zky2VCtbG7oUeJhgG7CehP+jo6q1pD8zfJnvYKns9N0fqKtVaUhWBKBU eWVGxO0FxBsPVpMERlrBsnvJnjLF9fLQbAAfabAQj+gKwvJ5eaeZRtBJ2iyA7FjHrOWD 6HuyeVCwu+uYVZvYz0aYeHDQnqdJp/N50rUWeGOf03gKvCS2UayGFb08/grFqr/4/K3G bOEQ== 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=hN2vzKy7CEcmXaeQlzPWeT7AhV7i4wp4WFUeC10CK6Q=; b=jfh9aMnO7qtqAWCG88Ymz0IHeiG5/fO6YAD8CW9kQiSV9dbUUgYLlKqFumDOXF9V6s EN4nbcPEIJjrq8Rg1Gzinf4CZ3x2zz6/fpanAWl5bgXF82HjdyQQFvPJ7kqiwgEQvsQo tZYwlyrZKBAuPGzQhz3UbxDO2fz4B/jcvfc+DuRxyVBfTx3quWDnDOPN7AwZIOkOqnfF Rc2sxxU4KNnxTbqTZQkB25xUWPJpzoyKjAcBXE8dc7eQ0QEso28Z+yhGwFoZNC0b8SKu SyDV7yXuYdiE9wIm4XegRYWj376jRlIbhFGKVPnzTbmQcCUeTx9cPGAVi8r+v15+MCyl 2doA== X-Gm-Message-State: APt69E1N8tVyJKFIhvP1SD85C3sMOiBIiWq7p4n6llgiwTzhZMfnPk18 tIL882+oxeuwB1JuaML8+t2R7zi3 X-Google-Smtp-Source: AAOMgpeZMP1jckqGFjPQ6QMAAlWBVI/3rqPpY2hcL9pdHaS4s3bl89iwyu2W1JentAXvd839vVB8fg== X-Received: by 2002:a0c:94f1:: with SMTP id k46-v6mr9144472qvk.113.1530192461734; Thu, 28 Jun 2018 06:27:41 -0700 (PDT) Received: from fc83e572df23 (mobile-107-107-57-88.mycingular.net. [107.107.57.88]) by smtp.gmail.com with ESMTPSA id q26-v6sm1257593qte.51.2018.06.28.06.27.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 06:27:40 -0700 (PDT) References: <87po2gkxpi.fsf@gmail.com> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Stefan Monnier Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: Date: Thu, 28 Jun 2018 13:27:34 +0000 Message-ID: <87sh57yrax.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> This BUG is a continuation of this help-gnu-emacs mailing list >> thread [1]. As mentioned in the thread, I ran into a terminal flickering >> issue in flycheck which turns out to be caused by `recenter' >> redisplaying the frame when `recenter-redisplay' value is either `t' or >> `tty'. I agree with the arguments in the thread to maintain the backward >> compatible behavior. Instead, I'm proposing one of the following >> alternatives: > > Indeed, most/all uses from Elisp shouldn't redisplay. > >> 1. introduce a new lisp function for recentering and discourage the use >> of `recenter' from lisp (i.e. declaring it `interactive-only'), or >> 2. add a new `recenter-and-redisplay' and bound it to C-l >> Also, Stefan's suggestion/possible solution: >> 3. adding an argument to `recenter' to control the redisplay behavior > > Either of those is OK. The benefit of the 3rd is that it would likely > "magically fix" 99% of the existing uses (I'm thinking of adding an > optional argument which we could call `and-redisplay` which when non-nil > tells recenter to do a redisplay, so all existing Elisp calls would be > implicitly modified not to cause a redisplay). I ended up going with option 3. I also used `redisplay` instead of `and-redisplay`. I felt the `and` is redundant, not sure how strongly you feel about the name. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-a-new-argument-to-recenter-to-allow-finer-contro.patch >From a8c544c40f1d01544ced20fad3e81a231f5715c7 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Thu, 28 Jun 2018 09:13:45 -0400 Subject: [PATCH] Add a new argument to `recenter' to allow finer control of redisplay * window.c (recenter): add a new REDISPLAY argument to allow the caller to control the redisplay behavior. `recenter' will only redisplay the frame if this new arg and `recenter-redisplay' are both non-nil. * window.el (recenter-top-bottom): pass an extra non-nil argument to `recenter' to force a redisplay --- lisp/window.el | 10 +++++----- src/window.c | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index fdd510401d..6d9d8bdcd2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8778,15 +8778,15 @@ recenter-top-bottom (min (max 0 scroll-margin) (truncate (/ (window-body-height) 4.0))))) (cond ((eq recenter-last-op 'middle) - (recenter)) + (recenter nil t)) ((eq recenter-last-op 'top) - (recenter this-scroll-margin)) + (recenter this-scroll-margin t)) ((eq recenter-last-op 'bottom) - (recenter (- -1 this-scroll-margin))) + (recenter (- -1 this-scroll-margin) t)) ((integerp recenter-last-op) - (recenter recenter-last-op)) + (recenter recenter-last-op t)) ((floatp recenter-last-op) - (recenter (round (* recenter-last-op (window-height)))))))))) + (recenter (round (* recenter-last-op (window-height))) t))))))) (define-key global-map [?\C-l] 'recenter-top-bottom) diff --git a/src/window.c b/src/window.c index 81fd7f2b47..fcdb0d444e 100644 --- a/src/window.c +++ b/src/window.c @@ -5898,22 +5898,23 @@ displayed_window_lines (struct window *w) } -DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line ARG relative to the selected window. If ARG is negative, it counts up from the bottom of the window. (ARG should be less than the height of the window.) -If ARG is omitted or nil, then recenter with point on the middle line of -the selected window; if the variable `recenter-redisplay' is non-nil, -also erase the entire frame and redraw it (when `auto-resize-tool-bars' -is set to `grow-only', this resets the tool-bar's height to the minimum -height needed); if `recenter-redisplay' has the special value `tty', -then only tty frames are redrawn. +If ARG is omitted or nil, then recenter with point on the middle line +of the selected window; if REDISPLAY & `recenter-redisplay' are +non-nil, also erase the entire frame and redraw it (when +`auto-resize-tool-bars' is set to `grow-only', this resets the +tool-bar's height to the minimum height needed); if +`recenter-redisplay' has the special value `tty', then only tty frames +are redrawn. Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) - (register Lisp_Object arg) + (register Lisp_Object arg, register Lisp_Object redisplay) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->contents); @@ -5933,8 +5934,9 @@ and redisplay normally--don't erase and redraw the frame. */) if (NILP (arg)) { - if (!NILP (Vrecenter_redisplay) - && (!EQ (Vrecenter_redisplay, Qtty) + if (!NILP (redisplay) + && !NILP (Vrecenter_redisplay) + && (!EQ (redisplay, Qtty) || !NILP (Ftty_type (selected_frame)))) { ptrdiff_t i; -- 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 30 05:45:23 2018 Received: (at 31325) by debbugs.gnu.org; 30 Jun 2018 09:45:23 +0000 Received: from localhost ([127.0.0.1]:40360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZCRV-00015c-31 for submit@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZCRT-00015Q-MQ for 31325@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZCRJ-0004oX-I3 for 31325@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZCRJ-0004o5-Ed; Sat, 30 Jun 2018 05:45:09 -0400 Received: from [176.228.60.248] (port=1365 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZCRI-0001Gw-RX; Sat, 30 Jun 2018 05:45:09 -0400 Date: Sat, 30 Jun 2018 12:45:18 +0300 Message-Id: <83lgawmwup.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87sh57yrax.fsf@gmail.com> (message from John Shahid on Thu, 28 Jun 2018 13:27:34 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Date: Thu, 28 Jun 2018 13:27:34 +0000 > Cc: 31325@debbugs.gnu.org > > >> 1. introduce a new lisp function for recentering and discourage the use > >> of `recenter' from lisp (i.e. declaring it `interactive-only'), or > >> 2. add a new `recenter-and-redisplay' and bound it to C-l > >> Also, Stefan's suggestion/possible solution: > >> 3. adding an argument to `recenter' to control the redisplay behavior > > > > Either of those is OK. The benefit of the 3rd is that it would likely > > "magically fix" 99% of the existing uses (I'm thinking of adding an > > optional argument which we could call `and-redisplay` which when non-nil > > tells recenter to do a redisplay, so all existing Elisp calls would be > > implicitly modified not to cause a redisplay). > > I ended up going with option 3. I also used `redisplay` instead of > `and-redisplay`. I felt the `and` is redundant, not sure how strongly > you feel about the name. Thanks, but please also include a NEWS entry announcing the change, and a suitable change for the ELisp manual. And I have a few comments: > - (register Lisp_Object arg) > + (register Lisp_Object arg, register Lisp_Object redisplay) I believe nowadays we remove the 'register' qualifiers whenever we change code that uses them. > { > struct window *w = XWINDOW (selected_window); > struct buffer *buf = XBUFFER (w->contents); > @@ -5933,8 +5934,9 @@ and redisplay normally--don't erase and redraw the frame. */) > > if (NILP (arg)) > { > - if (!NILP (Vrecenter_redisplay) > - && (!EQ (Vrecenter_redisplay, Qtty) > + if (!NILP (redisplay) > + && !NILP (Vrecenter_redisplay) > + && (!EQ (redisplay, Qtty) ^^^^^^^^^ This should have been Vrecenter_redisplay, right? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 30 16:20:42 2018 Received: (at 31325) by debbugs.gnu.org; 30 Jun 2018 20:20:42 +0000 Received: from localhost ([127.0.0.1]:41478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZMMM-0003Ln-64 for submit@debbugs.gnu.org; Sat, 30 Jun 2018 16:20:42 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZMMJ-0003LZ-TW for 31325@debbugs.gnu.org; Sat, 30 Jun 2018 16:20:40 -0400 Received: by mail-qk0-f193.google.com with SMTP id c131-v6so6814858qkb.0 for <31325@debbugs.gnu.org>; Sat, 30 Jun 2018 13:20:39 -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=MaFqZd+j1t1Fjk2Z0Ro3Bby55iv9UZZW3Kxvrllxv1Y=; b=G2iayylChyJDODvxx6+Ad0qduQG9yTFYffRJampvdyKCozJmV2WkgdU754yK7rQMO3 f3Y5qVgirHtFOmOscc+AoTHCGqNqSchWbyG3zBbUyXctvWd8xHM295Fjh6/y/A2rj01w yl7sTgkRC3iH/Vy3aeTrXyMqK+0RAkySKsrTl3I/jEz4yhIreH5s9w/SdERl7HBeyxZb CpwrOlaj42bbmioZu7w9U3CzbyvF0U+ftbbHcejIG/T4vIprnpgdfpnyIds303tAHPjp 3WD7WtJfdQIDQyw4MFVB8VNDCErlxnC0rt8C9Q8mEYvV/QTJDE5iOGwH2PRbgT9ZRwDF JLWQ== 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=MaFqZd+j1t1Fjk2Z0Ro3Bby55iv9UZZW3Kxvrllxv1Y=; b=W5t7mADOqh1/RrMPmSk1kSEadSxUrdYZmrt65gxC3jLz5Xd2Vtmm32SFp1l/zlJez4 8N0hYGyb162ebYhi1dA/aD7rWmmYt+Uzi36tYc+SveHwpF6q/oqsXEWXyBkucLz2DhOS QRpAmJs2ziBBu+c3pXboeyKyD91rbyJE6ArgmCUTHDFty42IbjTe662sxjMopr8gdXeI INYltug+3Lb3rnIwbju644/NIJVTHVWrndaV1wbkkUdwDlqDG3s/2vkdzHHNsmD9hghs 4BnqcD4C8eciepbTQ6i3ApwYwoRLYAjae3HAKU3ZvWX5zqeMQ0mephsGntek+WDKqP8d shkQ== X-Gm-Message-State: APt69E1Mf+mfiPfLKi/8tIVe5LkwXSUmVIIW375LHucOvvMLDQS9MSmC Rrph9exhyHoRi/ccyHu+5p6jSeYD X-Google-Smtp-Source: AAOMgpfXDgYAtBRhwHUQ/NeX65QBxYXMESxSK74R3Q+8+5IswxzBO8yWE6TB0gVgJBsq0MzNVULrkA== X-Received: by 2002:a37:c8e:: with SMTP id 136-v6mr17311153qkm.197.1530390033909; Sat, 30 Jun 2018 13:20:33 -0700 (PDT) Received: from 36032806ccb0 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id c191-v6sm8167959qkb.22.2018.06.30.13.20.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 13:20:32 -0700 (PDT) References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> <83lgawmwup.fsf@gnu.org> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83lgawmwup.fsf@gnu.org> Date: Sat, 30 Jun 2018 20:20:24 +0000 Message-ID: <878t6wxbzr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: John Shahid >> Date: Thu, 28 Jun 2018 13:27:34 +0000 >> Cc: 31325@debbugs.gnu.org >> >> >> 1. introduce a new lisp function for recentering and discourage the use >> >> of `recenter' from lisp (i.e. declaring it `interactive-only'), or >> >> 2. add a new `recenter-and-redisplay' and bound it to C-l >> >> Also, Stefan's suggestion/possible solution: >> >> 3. adding an argument to `recenter' to control the redisplay behavior >> > >> > Either of those is OK. The benefit of the 3rd is that it would likely >> > "magically fix" 99% of the existing uses (I'm thinking of adding an >> > optional argument which we could call `and-redisplay` which when non-nil >> > tells recenter to do a redisplay, so all existing Elisp calls would be >> > implicitly modified not to cause a redisplay). >> >> I ended up going with option 3. I also used `redisplay` instead of >> `and-redisplay`. I felt the `and` is redundant, not sure how strongly >> you feel about the name. > > Thanks, but please also include a NEWS entry announcing the change, > and a suitable change for the ELisp manual. > > And I have a few comments: > >> - (register Lisp_Object arg) >> + (register Lisp_Object arg, register Lisp_Object redisplay) > > I believe nowadays we remove the 'register' qualifiers whenever we > change code that uses them. > >> { >> struct window *w = XWINDOW (selected_window); >> struct buffer *buf = XBUFFER (w->contents); >> @@ -5933,8 +5934,9 @@ and redisplay normally--don't erase and redraw the frame. */) >> >> if (NILP (arg)) >> { >> - if (!NILP (Vrecenter_redisplay) >> - && (!EQ (Vrecenter_redisplay, Qtty) >> + if (!NILP (redisplay) >> + && !NILP (Vrecenter_redisplay) >> + && (!EQ (redisplay, Qtty) > ^^^^^^^^^ > This should have been Vrecenter_redisplay, right? fixed all the issues mentioned above in the attached patch and documented the change in the NEWS file and the manual. cheers, --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-a-new-argument-to-recenter-to-allow-finer-contro.patch >From 1b7380df866e3ca7c1a940a92c36f43ce8e5043f Mon Sep 17 00:00:00 2001 From: John Shahid Date: Thu, 28 Jun 2018 09:13:45 -0400 Subject: [PATCH] Add a new argument to `recenter' to allow finer control of redisplay * window.c (recenter): add a new REDISPLAY argument to allow the caller to control the redisplay behavior. `recenter' will only redisplay the frame if this new arg and `recenter-redisplay' are both non-nil. * window.el (recenter-top-bottom): pass an extra non-nil argument to `recenter' to force a redisplay --- doc/lispref/windows.texi | 12 +++++++----- etc/NEWS | 5 +++++ lisp/window.el | 10 +++++----- src/window.c | 20 +++++++++++--------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5497759595..9740bbebf2 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4138,7 +4138,7 @@ Textual Scrolling only if point is already on that position do they signal an error. @end defopt -@deffn Command recenter &optional count +@deffn Command recenter &optional count redisplay @cindex centering point This function scrolls the text in the selected window so that point is displayed at a specified vertical position within the window. It does @@ -4152,8 +4152,9 @@ Textual Scrolling If @var{count} is @code{nil} (or a non-@code{nil} list), @code{recenter} puts the line containing point in the middle of the -window. If @var{count} is @code{nil}, this function may redraw the -frame, according to the value of @code{recenter-redisplay}. +window. If @var{count} is @code{nil} and @var{redisplay} is +non-@code{nil}, this function may redraw the frame, according to the +value of @code{recenter-redisplay}. When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the @@ -4181,8 +4182,9 @@ Textual Scrolling @defopt recenter-redisplay If this variable is non-@code{nil}, calling @code{recenter} with a -@code{nil} argument redraws the frame. The default value is -@code{tty}, which means only redraw the frame if it is a tty frame. +@code{nil} @var{count} argument and non-@code{nil} @var{redisplay} +argument redraws the frame. The default value is @code{tty}, which +means only redraw the frame if it is a tty frame. @end defopt @deffn Command recenter-top-bottom &optional count diff --git a/etc/NEWS b/etc/NEWS index 12757f61d2..8adb962120 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -658,6 +658,11 @@ manual for more details. * Lisp Changes in Emacs 27.1 ++++ +** The function 'recenter' accepts an additional optional argument. +If the optional second argument is nil, recenter will not redisplay +the frame regardless of the value of 'recenter-redisplay'. + +++ ** New functions 'major-mode-suspend' and 'major-mode-restore'. Use them when switching temporarily to another major mode, e.g. for diff --git a/lisp/window.el b/lisp/window.el index fdd510401d..6d9d8bdcd2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8778,15 +8778,15 @@ recenter-top-bottom (min (max 0 scroll-margin) (truncate (/ (window-body-height) 4.0))))) (cond ((eq recenter-last-op 'middle) - (recenter)) + (recenter nil t)) ((eq recenter-last-op 'top) - (recenter this-scroll-margin)) + (recenter this-scroll-margin t)) ((eq recenter-last-op 'bottom) - (recenter (- -1 this-scroll-margin))) + (recenter (- -1 this-scroll-margin) t)) ((integerp recenter-last-op) - (recenter recenter-last-op)) + (recenter recenter-last-op t)) ((floatp recenter-last-op) - (recenter (round (* recenter-last-op (window-height)))))))))) + (recenter (round (* recenter-last-op (window-height))) t))))))) (define-key global-map [?\C-l] 'recenter-top-bottom) diff --git a/src/window.c b/src/window.c index 81fd7f2b47..a966e99ca8 100644 --- a/src/window.c +++ b/src/window.c @@ -5898,22 +5898,23 @@ displayed_window_lines (struct window *w) } -DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line ARG relative to the selected window. If ARG is negative, it counts up from the bottom of the window. (ARG should be less than the height of the window.) -If ARG is omitted or nil, then recenter with point on the middle line of -the selected window; if the variable `recenter-redisplay' is non-nil, -also erase the entire frame and redraw it (when `auto-resize-tool-bars' -is set to `grow-only', this resets the tool-bar's height to the minimum -height needed); if `recenter-redisplay' has the special value `tty', -then only tty frames are redrawn. +If ARG is omitted or nil, then recenter with point on the middle line +of the selected window; if REDISPLAY & `recenter-redisplay' are +non-nil, also erase the entire frame and redraw it (when +`auto-resize-tool-bars' is set to `grow-only', this resets the +tool-bar's height to the minimum height needed); if +`recenter-redisplay' has the special value `tty', then only tty frames +are redrawn. Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) - (register Lisp_Object arg) + (Lisp_Object arg, Lisp_Object redisplay) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->contents); @@ -5933,7 +5934,8 @@ and redisplay normally--don't erase and redraw the frame. */) if (NILP (arg)) { - if (!NILP (Vrecenter_redisplay) + if (!NILP (redisplay) + && !NILP (Vrecenter_redisplay) && (!EQ (Vrecenter_redisplay, Qtty) || !NILP (Ftty_type (selected_frame)))) { -- 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 05:05:32 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 09:05:32 +0000 Received: from localhost ([127.0.0.1]:41619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZYIW-0004Xa-Nw for submit@debbugs.gnu.org; Sun, 01 Jul 2018 05:05:32 -0400 Received: from mout.gmx.net ([212.227.17.20]:40169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZYIV-0004XO-Ud for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 05:05:32 -0400 Received: from [192.168.1.101] ([46.125.250.78]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Ldcv0-1g0Ory22mA-00iirS; Sun, 01 Jul 2018 11:05:20 +0200 Message-ID: <5B38994B.2010605@gmx.at> Date: Sun, 01 Jul 2018 11:05:15 +0200 From: martin rudalics MIME-Version: 1.0 To: John Shahid , Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> <83lgawmwup.fsf@gnu.org> <878t6wxbzr.fsf@gmail.com> In-Reply-To: <878t6wxbzr.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:LMKR2IszpAJyfWYcygB8+jEE8ASqQsWL1YTPUYPDoa1yXgDj5eS DkNNPSXd+4jRvzTXmkR+2NRDeGP/98cU4kHs7FIowLSm66jFjX8gr3/A9Ex4mt2J+YxlnqI FsBam8x6utAfqB5p0YpLaw7x20OwC3XaKtyUOEws2JGeaWDoiIJ3loP3nt78hB3Yse9j53A pNLGPgMGknOojPiy+1Cqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:IZzVWbjCHeQ=:ts8RjLgRX4LcjOgp8W+z2h zQS+q7C77VcnGTq9uyeeRdWLKSdO5mK9STuv6ZYNREgeaIfKl+KV2DZgUXdS69ZU74SY519HN PW40l/wtMssjqI+lUBu2XUxI2wphah2GsoCyeRjDJj6GUOr0srHLe5+j0cqqXUanUhJZeqJnk QtGWU/EZZRxDd8lkHQ9BNkvPYP+gdHF2zOQoMZU4bWLXIkhGFAMLjhQqkV9D7feTgysw8fWhG PAPjX+6MpDXduv1jAQvrcXGGeTktP3WWuio1nY2v9TA2ETla573QAtfqwHgvRiHmpItHaDv5G eHjr5lNIesnI3ClSqj7VIsv/svCl2CYksuHWcwce/ln2FwiI/5+FDx+WHhMtIbGdtDDOtCRc7 +Chvg1kV+auKjTvqymaDRFYsgYINhCcy7LB5KCDmK85+4XG0FJPdNcHCtYQJvycFZ2F05rJdZ IXSCa+5PTSFPfFkqK4uRrsUDaqicNaO7CkRJoy3qEuoP2QxbFASyS5hSNBV+0Tlofrm0CxWsG AoLUzKUDDnAbkD9Lg5fnoMtt1YAr+bqfUlX+ZfaTdDzR511wKSiuty3GRdpNT0xuyMOO9/BXd jTAVpdVvK8XfQz86IaZUDOy/7QRBXCRSf1cYBFE0aGdPlH4LgZQxRRI2BL+3RpKk+LagCBMpP UST+5O+iuTn4yKLET1Bqdb8vxSzPucPdDdtbK3KtZ+UMVhfzuZmbhtRkg2nfK8xJXfjOgu4IK 3xbfwJI95lrzUeKxReOSlQlx/2rzr8lvrQ30wtftUJvVsPTWKbJulwqch6kcH0Gp0PvfUiU8f aS9rDbp X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > * window.c (recenter): add a new REDISPLAY argument to allow the Please capitalize the word after the colon ... > caller to control the redisplay behavior. `recenter' will only .. and use two spaces when beginning a new sentence. Thank you, martin From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 09:17:32 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 13:17:32 +0000 Received: from localhost ([127.0.0.1]:41680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZcEN-00056w-VN for submit@debbugs.gnu.org; Sun, 01 Jul 2018 09:17:32 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:32953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZcEL-00056b-HZ for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 09:17:29 -0400 Received: by mail-qt0-f171.google.com with SMTP id l10-v6so11815082qtj.0 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 06:17:29 -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=7oOnLlmUWXwaRulMqasRvIemifUqLZHSI6ufie032jA=; b=Rl4R4bg9LRAcglumSil0EDfJKwtFuji5w3R+v+GGYIEcL1JweSB5tDscocRb0H3N4Q VpcsvNneIgQS7sCfpGNFC5uJ2aFE2GArRTBj/xlAEAfwwDNLFy3Fh8+ycTXeOaQ31DjJ f1NiTdleJt/gUUNVLgBnFOR5N/5oNglaFy76t2egGb84O12cCKn1Z6Bwv5Q2ZgwUiMcb EW3mnQ4KkSsNU0yCbx2ISboOKH3Q9HMxEPPb/pMM+yJ4AmkHKZRnLErwaegiiWUNG08S 0tcVm8SAIYDw4qznRlvX/RAVnAVkWmsy1ocIAls1p9x9v0CvgxqlSSR9Jb2rPjRdIB80 WI6A== 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=7oOnLlmUWXwaRulMqasRvIemifUqLZHSI6ufie032jA=; b=XmN6Zr6G24P7LFg//uNFX1vL+r9GSeQi5QOawihXgS4jZpNWE9eTQUw8SNKE348m2e 71LgPNd0OkrBONzgsj13q+L3uKXbwDzgDCj6XC45ALPIOAK1oc2Os64zRZlhw/SKur7G 6lN8+MzfscgeFJerlEUikRBhaP1z+ee7E7I5kOkHGuBhaZpuXwMMSGkGwaYlRSWnmF7T 00C6q9w53HRkidXVO5WeeKNNb4pLrfmi6XxLMX6zzVffJblBWNuo86DEkezbiwvgXwAx j3CEfoUEJ8wwCSvlPDFHoExtyp2PtP5Ndy0HcjmThdZIVF25cWk6ByTbRLX/dXRcHIBy tT7g== X-Gm-Message-State: APt69E2hMW2wsuxib0oUbds34xwcF//jBM14LpLAoc3shRvlQ0qWDlhD jAXBASftAOEc8ibtIMDzo6U= X-Google-Smtp-Source: AAOMgpeSfH3x1K37uKC0az23AFfKePLorQaI4O/rjuZWLU10g1bCIpyrO1+mt3/1zoNvoFkj5+3X3Q== X-Received: by 2002:ac8:24fa:: with SMTP id t55-v6mr20656266qtt.196.1530451043827; Sun, 01 Jul 2018 06:17:23 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id c191-v6sm9102498qkb.22.2018.07.01.06.17.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 06:17:22 -0700 (PDT) References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> <83lgawmwup.fsf@gnu.org> <878t6wxbzr.fsf@gmail.com> <5B38994B.2010605@gmx.at> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: martin rudalics Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <5B38994B.2010605@gmx.at> Date: Sun, 01 Jul 2018 13:17:17 +0000 Message-ID: <87va9zxfhe.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain martin rudalics writes: >> * window.c (recenter): add a new REDISPLAY argument to allow the > > Please capitalize the word after the colon ... > >> caller to control the redisplay behavior. `recenter' will only > > .. and use two spaces when beginning a new sentence. > > Thank you, martin Fixed in the attached patch. Cheers, --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-a-new-argument-to-recenter-to-allow-finer-contro.patch >From c945faf3774ea8d331ced94b80422dfaebd83018 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Thu, 28 Jun 2018 09:13:45 -0400 Subject: [PATCH] Add a new argument to `recenter' to allow finer control of redisplay * window.c (recenter): Add a new REDISPLAY argument to allow the caller to control the redisplay behavior. `recenter' will only redisplay the frame if this new arg and `recenter-redisplay' are both non-nil. * window.el (recenter-top-bottom): pass an extra non-nil argument to `recenter' to force a redisplay --- doc/lispref/windows.texi | 12 +++++++----- etc/NEWS | 5 +++++ lisp/window.el | 10 +++++----- src/window.c | 20 +++++++++++--------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5497759595..9740bbebf2 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4138,7 +4138,7 @@ Textual Scrolling only if point is already on that position do they signal an error. @end defopt -@deffn Command recenter &optional count +@deffn Command recenter &optional count redisplay @cindex centering point This function scrolls the text in the selected window so that point is displayed at a specified vertical position within the window. It does @@ -4152,8 +4152,9 @@ Textual Scrolling If @var{count} is @code{nil} (or a non-@code{nil} list), @code{recenter} puts the line containing point in the middle of the -window. If @var{count} is @code{nil}, this function may redraw the -frame, according to the value of @code{recenter-redisplay}. +window. If @var{count} is @code{nil} and @var{redisplay} is +non-@code{nil}, this function may redraw the frame, according to the +value of @code{recenter-redisplay}. When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the @@ -4181,8 +4182,9 @@ Textual Scrolling @defopt recenter-redisplay If this variable is non-@code{nil}, calling @code{recenter} with a -@code{nil} argument redraws the frame. The default value is -@code{tty}, which means only redraw the frame if it is a tty frame. +@code{nil} @var{count} argument and non-@code{nil} @var{redisplay} +argument redraws the frame. The default value is @code{tty}, which +means only redraw the frame if it is a tty frame. @end defopt @deffn Command recenter-top-bottom &optional count diff --git a/etc/NEWS b/etc/NEWS index 12757f61d2..8adb962120 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -658,6 +658,11 @@ manual for more details. * Lisp Changes in Emacs 27.1 ++++ +** The function 'recenter' accepts an additional optional argument. +If the optional second argument is nil, recenter will not redisplay +the frame regardless of the value of 'recenter-redisplay'. + +++ ** New functions 'major-mode-suspend' and 'major-mode-restore'. Use them when switching temporarily to another major mode, e.g. for diff --git a/lisp/window.el b/lisp/window.el index fdd510401d..6d9d8bdcd2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8778,15 +8778,15 @@ recenter-top-bottom (min (max 0 scroll-margin) (truncate (/ (window-body-height) 4.0))))) (cond ((eq recenter-last-op 'middle) - (recenter)) + (recenter nil t)) ((eq recenter-last-op 'top) - (recenter this-scroll-margin)) + (recenter this-scroll-margin t)) ((eq recenter-last-op 'bottom) - (recenter (- -1 this-scroll-margin))) + (recenter (- -1 this-scroll-margin) t)) ((integerp recenter-last-op) - (recenter recenter-last-op)) + (recenter recenter-last-op t)) ((floatp recenter-last-op) - (recenter (round (* recenter-last-op (window-height)))))))))) + (recenter (round (* recenter-last-op (window-height))) t))))))) (define-key global-map [?\C-l] 'recenter-top-bottom) diff --git a/src/window.c b/src/window.c index 81fd7f2b47..a966e99ca8 100644 --- a/src/window.c +++ b/src/window.c @@ -5898,22 +5898,23 @@ displayed_window_lines (struct window *w) } -DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line ARG relative to the selected window. If ARG is negative, it counts up from the bottom of the window. (ARG should be less than the height of the window.) -If ARG is omitted or nil, then recenter with point on the middle line of -the selected window; if the variable `recenter-redisplay' is non-nil, -also erase the entire frame and redraw it (when `auto-resize-tool-bars' -is set to `grow-only', this resets the tool-bar's height to the minimum -height needed); if `recenter-redisplay' has the special value `tty', -then only tty frames are redrawn. +If ARG is omitted or nil, then recenter with point on the middle line +of the selected window; if REDISPLAY & `recenter-redisplay' are +non-nil, also erase the entire frame and redraw it (when +`auto-resize-tool-bars' is set to `grow-only', this resets the +tool-bar's height to the minimum height needed); if +`recenter-redisplay' has the special value `tty', then only tty frames +are redrawn. Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) - (register Lisp_Object arg) + (Lisp_Object arg, Lisp_Object redisplay) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->contents); @@ -5933,7 +5934,8 @@ and redisplay normally--don't erase and redraw the frame. */) if (NILP (arg)) { - if (!NILP (Vrecenter_redisplay) + if (!NILP (redisplay) + && !NILP (Vrecenter_redisplay) && (!EQ (Vrecenter_redisplay, Qtty) || !NILP (Ftty_type (selected_frame)))) { -- 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 12:23:00 2018 Received: (at 31325-done) by debbugs.gnu.org; 1 Jul 2018 16:23:00 +0000 Received: from localhost ([127.0.0.1]:42267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZf7s-00082N-E7 for submit@debbugs.gnu.org; Sun, 01 Jul 2018 12:23:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZf7r-00082A-1M for 31325-done@debbugs.gnu.org; Sun, 01 Jul 2018 12:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZf7l-0000AZ-4p for 31325-done@debbugs.gnu.org; Sun, 01 Jul 2018 12:22:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZf7g-00008W-Kc; Sun, 01 Jul 2018 12:22:48 -0400 Received: from [176.228.60.248] (port=3580 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZf7f-0007AW-Vp; Sun, 01 Jul 2018 12:22:48 -0400 Date: Sun, 01 Jul 2018 19:22:35 +0300 Message-Id: <83in5zkjsk.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87va9zxfhe.fsf@gmail.com> (message from John Shahid on Sun, 01 Jul 2018 13:17:17 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325-done Cc: rudalics@gmx.at, 31325-done@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sun, 01 Jul 2018 13:17:17 +0000 > > Fixed in the attached patch. Thanks, pushed to the master branch. Please in the future mention the bug number in the log message, and also grep the sources for callers of the functions you change. (In this case, there was one caller in w32console.c, and it wouldn't compile after the change, because the number of arguments changed.) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 12:55:10 2018 Received: (at 31325-done) by debbugs.gnu.org; 1 Jul 2018 16:55:10 +0000 Received: from localhost ([127.0.0.1]:42290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfcz-0000Mf-Pp for submit@debbugs.gnu.org; Sun, 01 Jul 2018 12:55:09 -0400 Received: from mail-qt0-f180.google.com ([209.85.216.180]:44663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfcx-0000MS-Sn for 31325-done@debbugs.gnu.org; Sun, 01 Jul 2018 12:55:08 -0400 Received: by mail-qt0-f180.google.com with SMTP id b15-v6so2096557qtp.11 for <31325-done@debbugs.gnu.org>; Sun, 01 Jul 2018 09:55:07 -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=12v6ykjOSMiKwzgtAsEJjqRbNDkm4Bv9K9VZcNpMprw=; b=EjSG031tNKt8kE3mlpIOKl2m/eQ+wEjxfObfT+YFub0dJ5G2+i77n4nPh6uFnfdOGB aA+s8jizvg8Sg/2e6xDPNPJwEr0+0MA6vBvvca3i3f+98jSzsOvzk8jV8LylCS6Hr/cd SiPodO8pGbPB77VZm5X0ILaeg4/xpY4WF7NGltYi5SSvGfbIdGqqwIjc4bQ7tVoBMskT LrW3J7ZCR7sXtoQ19gM3pbtMPnlHl5dpFmhyybXxYErosWj+hpumO+yX4F19LyhKbO3O GRPYmVFSLNEyEVAcOo7cKognraY2poImzflxUChyUnGgz8eKIyQa8m5+UUjQRPj/kKw5 uwyQ== 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=12v6ykjOSMiKwzgtAsEJjqRbNDkm4Bv9K9VZcNpMprw=; b=K+AH7jHQZePRtp/qZaOLSMlp1+GN09TKACTLvyYsGcbadNYKpac/SPkBmyQzqZAQ7m fxAu3kHN67+Oeo0p1TO9jRIHbx/DHVmZLVE0U4UR6BlxzEs9Hozw8wmDIj402ttYafz0 ZFRPnQVuGluToU31/N3AeOUnwxzSpyrswDv8mT17NDAnlFaPA18sXCvEHxdosMqAGLBf EnyJ7pig4yzF4o87dqXbIQGTQj7C5PVqO+wWewHJkjZMK91BfA/n9lDjY66mobNh0Ixk VXdPBzGYzw0cv/y3ZHIPzoezgY/HmlpeDOEjcrDd0V6ASaHTtow3Ap1/mn/cQSbEaj8q 4Z6Q== X-Gm-Message-State: APt69E37TWmw24VKbF1+9UrP/j7N71ufm7fi0TSPl3yW1Mgjcagfcgos QgsD/Mp96nZGK1zH+19qk80= X-Google-Smtp-Source: AAOMgpdrfF6fOv21QskwwnGnT96Xl1dfrtGvLgijRku5bZ5uw9cjXJXXmpkkTV7CRwqpI8PLnegsUw== X-Received: by 2002:a0c:8283:: with SMTP id i3-v6mr20030200qva.21.1530464101998; Sun, 01 Jul 2018 09:55:01 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id c93-v6sm2650195qkh.90.2018.07.01.09.55.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 09:55:01 -0700 (PDT) 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> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83in5zkjsk.fsf@gnu.org> Date: Sun, 01 Jul 2018 16:54:53 +0000 Message-ID: <87tvpiyjz6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31325-done Cc: rudalics@gmx.at, 31325-done@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: John Shahid >> Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sun, 01 Jul 2018 13:17:17 +0000 >> >> Fixed in the attached patch. > > Thanks, pushed to the master branch. > > Please in the future mention the bug number in the log message, and > also grep the sources for callers of the functions you change. (In > this case, there was one caller in w32console.c, and it wouldn't > compile after the change, because the number of arguments changed.) Thanks Eli. Sorry about that, I will try to be more careful in the future. It just occurred to me that this change will break backward comparability for those who bind some key to the `recenter' command, since now the second argument will always be nil and thus won't redisplay. Should we also change the interactive form of recenter to use "p" for the second argument? That way the second arg is never nil when used interactively. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 13:03:54 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 17:03:55 +0000 Received: from localhost ([127.0.0.1]:42294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZflS-0000Zl-NI for submit@debbugs.gnu.org; Sun, 01 Jul 2018 13:03:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZflQ-0000ZZ-CK for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:03:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZflI-0003DV-3J for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:03:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZfl8-00039o-A0; Sun, 01 Jul 2018 13:03:34 -0400 Received: from [176.228.60.248] (port=2725 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZfl7-0003Ft-8J; Sun, 01 Jul 2018 13:03:33 -0400 Date: Sun, 01 Jul 2018 20:03:21 +0300 Message-Id: <83fu12lwh2.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87tvpiyjz6.fsf@gmail.com> (message from John Shahid on Sun, 01 Jul 2018 16:54:53 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: rudalics@gmx.at, 31325-done@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sun, 01 Jul 2018 16:54:53 +0000 > > It just occurred to me that this change will break backward > comparability for those who bind some key to the `recenter' command, > since now the second argument will always be nil and thus won't > redisplay. Should we also change the interactive form of recenter to > use "p" for the second argument? That way the second arg is never nil > when used interactively. I think you are right. Alternatively, we could simply make 'recenter' behave specially in interactive invocations. But in any case, incompatible changes in behavior are bad, and should be avoided. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 13:15:00 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 17:15:00 +0000 Received: from localhost ([127.0.0.1]:42300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfwB-0000oz-P8 for submit@debbugs.gnu.org; Sun, 01 Jul 2018 13:14:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfwB-0000on-4g for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZfw5-00023A-2D for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:14:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZfw0-00020O-Pb; Sun, 01 Jul 2018 13:14:48 -0400 Received: from [176.228.60.248] (port=3410 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZfw0-0004oy-65; Sun, 01 Jul 2018 13:14:48 -0400 Date: Sun, 01 Jul 2018 20:14:37 +0300 Message-Id: <83efgmlvya.fsf@gnu.org> From: Eli Zaretskii To: jvshahid@gmail.com In-reply-to: <83fu12lwh2.fsf@gnu.org> (message from Eli Zaretskii on Sun, 01 Jul 2018 20:03:21 +0300) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Sun, 01 Jul 2018 20:03:21 +0300 > From: Eli Zaretskii > Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > > Alternatively, we could simply make 'recenter' behave specially in > interactive invocations. But in any case, incompatible changes in > behavior are bad, and should be avoided. Or maybe invert the meaning of the new argument? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 13:18:19 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 17:18:19 +0000 Received: from localhost ([127.0.0.1]:42304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfzP-0000uT-8C for submit@debbugs.gnu.org; Sun, 01 Jul 2018 13:18:19 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:45991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfzM-0000uE-7h for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:18:16 -0400 Received: by mail-qt0-f175.google.com with SMTP id y5-v6so2329371qti.12 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 10:18:16 -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=8H+JMaB0ZzCMzKFhgDy+Yihk4UcVpaOzzrxiDaH4Hv8=; b=df68HDomZDWYaeJLK8dDhQkeg0Wd0fj4ixtHFgegf8mO+7kv8pup0yHZiSGvIbHQ6y htDGE0iHleclRZiptnTgarU3UVKHdJpahUvHROTqDfKD8P+AzEbBjJ9ulybls+r7ZUMS k+0dl+0m08mhF29wxD1U/ng8M+Pw5B6Hp3Z9GD+0beLUcAFePOfyucVedUYOL9dgIXmP 25BVpvvm7kD3U600yqVyEa3gkZPeBhdsfuySRFHMlq8iTYYbt46zWHCJyEFERVnc8kAu JeggMfdg5ctocbZudesRC6uKe3Ma2KPOKIDMln0l6UMt5r2m/7l6BMDEbe+R+1/+wY9Q 5ogg== 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=8H+JMaB0ZzCMzKFhgDy+Yihk4UcVpaOzzrxiDaH4Hv8=; b=bv0Ht9GB4rr5E1HeERT+RY/RH0bmiDJ00grc0moJjquDGtD0m+vjLg4FCCQuzcLfXW GZFWJ7oiI94NTaqCCEXK7UwWJJPaFppLrpDx7qtDwlxG0680yebUNcjfF+W/M9q5khR3 XPa+hET+V2tsob0LyO8Li5hgzkrvRJoYhAz2cLrqjOzXeglmIoLRrZk/RvakglNGtaXs 30dY474GHSQHHpWjwLkXJFpcRcx4Z8FxHU9BIOLNyPip9IxsWacv3vrjFZtVtxIojSP6 vXyza/i2R3RSXRl2byJAVuBlNFlE1RrRcLLHfeZdngiQ9Me0CsD1Nf/hnUKbjdn7JJku VdkA== X-Gm-Message-State: APt69E2y7JWogbZZJrxsbutwhDAm5BrCZsTiZ51XgiG+cpC66qSH7mMC cBur73bSRH4FK1gYiOsl8yU= X-Google-Smtp-Source: AAOMgpcbOySvdZ8cPizjrarxLyZsdvPj8A6WkzUj4GRHZuYjo2bq4fHkuyH6n/hJBO/bCA6lRwSguA== X-Received: by 2002:ac8:610a:: with SMTP id a10-v6mr21391430qtm.139.1530465490576; Sun, 01 Jul 2018 10:18:10 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id u1-v6sm8831063qkd.45.2018.07.01.10.18.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 10:18:09 -0700 (PDT) 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> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83fu12lwh2.fsf@gnu.org> Date: Sun, 01 Jul 2018 17:18:08 +0000 Message-ID: <87sh52yiwf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: John Shahid >> Cc: rudalics@gmx.at, 31325-done@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sun, 01 Jul 2018 16:54:53 +0000 >> >> It just occurred to me that this change will break backward >> comparability for those who bind some key to the `recenter' command, >> since now the second argument will always be nil and thus won't >> redisplay. Should we also change the interactive form of recenter to >> use "p" for the second argument? That way the second arg is never nil >> when used interactively. > > I think you are right. > > Alternatively, we could simply make 'recenter' behave specially in > interactive invocations. But in any case, incompatible changes in > behavior are bad, and should be avoided. I am happy to make the change. Should we just revert this patch and instead of adding a new argument change the behavior of`recenter' to redraw if called interactively ? How can we determine from C whether the function is called interactively ? Is it ok to use `called-interactively-p' ? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 13:25:28 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 17:25:28 +0000 Received: from localhost ([127.0.0.1]:42312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZg6K-00015C-7z for submit@debbugs.gnu.org; Sun, 01 Jul 2018 13:25:28 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:34263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZg6I-00014x-GG for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 13:25:26 -0400 Received: by mail-qk0-f179.google.com with SMTP id b66-v6so7582256qkj.1 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 10:25:26 -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=Usa991cNuPHXOkpT3XIHQU1mHvYtjaB6coVPlBsJ/w0=; b=TV4EKq/52Gi9csLjXtdi4bzgtMBzId73OhD9jCNVHvl3CT2COR7RyPkWM0zMNwjfiT K1/lx87CzrFeIa61buXGL4/iEM6qOccVysDq0AXIXgMYzFrm7dTACJ9au2MAo4Iz5xO0 0e0LJdWwnvDWs2QMrk8Z+DFwQ9sx+titoWtpMa65nih91leAA0tHLYZkZgU0CAPkzqnC M5AxMjIKDZ28XfeZNd1nMXTSYGXtS1jEhvQWx4Av7uKL9pP4UcUhg6d7X/6dLP5zUaxK eis6L9YwP/bAdidRKa/YsG4iatSOYTi8UolQt2HrUvR/vh09zUvT5OJsMqgUKTHHpOl8 NRYg== 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=Usa991cNuPHXOkpT3XIHQU1mHvYtjaB6coVPlBsJ/w0=; b=FHJiFu7CQ9iQzznOuB7zdrqRdAcVtBJGFjwc3Y2BzquD1pdXvAdbwdsvUU82ouVXlp bwbyWIBRQwLfh59zulX3h1LL5AjOtLe1ML5M6ts12pK0GeN4zT9OhzBplQJziZaHm6yE X4vcdn/RzBsHjv7MZWNAj9LEd3nFsDY8SxtEJ0TRTwhwjLtji9ZyxJH/8oQC2kj78ImT N+n36568WiI7BGwFqZyE3JbYnCgPCOaTXtmxF9dJZ2lpDie/q0XSHfjlSbdQZc2PDTAD 1JLHQuEfE1rK2JIdM9sUoMonu6mgpCDqgCzSa9M39Avbv6Juo6wqEXNr/0nabWDEGr0u 7d1Q== X-Gm-Message-State: APt69E0n/67M4TJ1+53eJoeylKIUZDAUjXmFFnNvcvRHEO8ol3cgmy9d uLAjy90I0cqmmNWwHK9PgCc= X-Google-Smtp-Source: AAOMgpdn2vl4lKHEn1KKUitzeMwP2Xc3XsPwSvz2DFSQi4Zt2M7BAaqHvgsS8cXmqg7pZQ9QATa9Ng== X-Received: by 2002:a37:80a:: with SMTP id 10-v6mr19449274qki.168.1530465920822; Sun, 01 Jul 2018 10:25:20 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id 18-v6sm2777705qtw.43.2018.07.01.10.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 10:25:19 -0700 (PDT) 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> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83efgmlvya.fsf@gnu.org> Date: Sun, 01 Jul 2018 17:25:18 +0000 Message-ID: <87r2kmyikh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Date: Sun, 01 Jul 2018 20:03:21 +0300 >> From: Eli Zaretskii >> Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >> >> Alternatively, we could simply make 'recenter' behave specially in >> interactive invocations. But in any case, incompatible changes in >> behavior are bad, and should be avoided. > > Or maybe invert the meaning of the new argument? That isn't very ideal. The whole point from this change is not to force lisp callers to change anything. If lisp callers have to change how they call `recenter' they might as well change the call to be (let ((recenter-redisplay nil)) (recenter)) Few days ago I noticed the same flickering behavior in `xref-find-definitions' because it uses `recenter' in the `xref-after-jump-hook'. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 14:05:36 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 18:05:36 +0000 Received: from localhost ([127.0.0.1]:42362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZgjA-00022b-9n for submit@debbugs.gnu.org; Sun, 01 Jul 2018 14:05:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZgj8-00022N-3X for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 14:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZgj1-0000gY-O9 for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 14:05:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZgiv-0000Mb-JK; Sun, 01 Jul 2018 14:05:21 -0400 Received: from [176.228.60.248] (port=2530 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZgiu-0003sY-No; Sun, 01 Jul 2018 14:05:21 -0400 Date: Sun, 01 Jul 2018 21:05:07 +0300 Message-Id: <83d0w6ltm4.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87sh52yiwf.fsf@gmail.com> (message from John Shahid on Sun, 01 Jul 2018 17:18:08 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> <87sh52yiwf.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sun, 01 Jul 2018 17:18:08 +0000 > > >> It just occurred to me that this change will break backward > >> comparability for those who bind some key to the `recenter' command, > >> since now the second argument will always be nil and thus won't > >> redisplay. Should we also change the interactive form of recenter to > >> use "p" for the second argument? That way the second arg is never nil > >> when used interactively. > > > > I think you are right. > > > > Alternatively, we could simply make 'recenter' behave specially in > > interactive invocations. But in any case, incompatible changes in > > behavior are bad, and should be avoided. > > I am happy to make the change. Should we just revert this patch and > instead of adding a new argument change the behavior of`recenter' to > redraw if called interactively ? > > How can we determine from C whether the function is called interactively > ? Is it ok to use `called-interactively-p' ? That'd be gross, I think. Going through the interactive spec, as you suggested originally, should be much simpler. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 14:58:23 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 18:58:23 +0000 Received: from localhost ([127.0.0.1]:42376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZhYE-0003FB-Ld for submit@debbugs.gnu.org; Sun, 01 Jul 2018 14:58:22 -0400 Received: from mail-qt0-f177.google.com ([209.85.216.177]:35097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZhYB-0003Ew-W1 for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 14:58:20 -0400 Received: by mail-qt0-f177.google.com with SMTP id z6-v6so12194691qti.2 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 11:58:19 -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=ZJz+seIgyWNH5UwLZP9CooEt27HqsqqKaa/sfH8vsPM=; b=W3MXBBEZRTHq85s9MRt6c4DqnkJiTFxolMPSu/5SSqZnz3KjM4iWDFbdRfN/xtWB3n BCiq/P+Zow0EbORBEaZn6u7s8mgt+i+KCaD5iIjuPgopE+jO93qeZ+yoCzIQD37lKKLb oSechUOGN82ZnRySZDfV66r8s/0eJw3i/ec6od863fr3Gk5tJ1XX/kSZHhUI5EGicsx/ 6NNqlU/INGDst6C7lkBYWzJvi+VBmneEJyX/5rwIsV8bO8uGmnq9bHF2HHPasaQSchnW yrq8oObqQeCam6JxcEI2CT5pZo94OA+qR5IOIjCmOGXQ/TE5IVf/gc6fSl1Ut/UMbMlz mHsQ== 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=ZJz+seIgyWNH5UwLZP9CooEt27HqsqqKaa/sfH8vsPM=; b=Krw3MpIIg/US6Ja+cI7CvLOlF801+e4fKMN/Ei3b13QNuhYCaqpQu7ERdeby7RTXLD xnBqPUgYQ1QlSp7VcHsm0EC8jjfnfyp1Of2O4yH29DOzv23deFJTl3mRNcB1KvyhzMKZ qYRVPnohGidALz4EkH2b4QbzWmK624wcQBn+ZtJn9jOTB5gavZm8tX3W3LofJLDwVNts 1Bp5X37+iyQXyiMDwbWgGjTX4n8AtUxMq3EmY6Q0ruihCJotQuujiaXncl0LZwil5v7k /V43YouwDiXIZSFLTkasGpGCYCF94y+7OTOfqxzruowWeaQOH4N1vQUcsxYSaL08pCxT FchQ== X-Gm-Message-State: APt69E1RZGjMP70KpvfOGyW6sk5xuMaZeoPVnRHBL52SG0kCmgOs7GGi U/PXGLgRcb/F5BkmeF029j4= X-Google-Smtp-Source: AAOMgpdGmNy2UAIccLIw9V/pyjYasGKKjSviO4bVz65W/B1Z7ULxg7yEU0dNCdUl7uC35ZLv0Y2D2w== X-Received: by 2002:ac8:1642:: with SMTP id x2-v6mr1288711qtk.107.1530471494134; Sun, 01 Jul 2018 11:58:14 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id l26-v6sm8598479qtj.11.2018.07.01.11.58.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 11:58:13 -0700 (PDT) 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83d0w6ltm4.fsf@gnu.org> Date: Sun, 01 Jul 2018 18:58:09 +0000 Message-ID: <87po06ye9q.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: John Shahid >> Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sun, 01 Jul 2018 17:18:08 +0000 >> >> >> It just occurred to me that this change will break backward >> >> comparability for those who bind some key to the `recenter' command, >> >> since now the second argument will always be nil and thus won't >> >> redisplay. Should we also change the interactive form of recenter to >> >> use "p" for the second argument? That way the second arg is never nil >> >> when used interactively. >> > >> > I think you are right. >> > >> > Alternatively, we could simply make 'recenter' behave specially in >> > interactive invocations. But in any case, incompatible changes in >> > behavior are bad, and should be avoided. >> >> I am happy to make the change. Should we just revert this patch and >> instead of adding a new argument change the behavior of`recenter' to >> redraw if called interactively ? >> >> How can we determine from C whether the function is called interactively >> ? Is it ok to use `called-interactively-p' ? > > That'd be gross, I think. Going through the interactive spec, as you > suggested originally, should be much simpler. Updated the interactive spec in the attached patch and made the necessary changes to the manual and documentation. I also missed a place where `recenter-top-bottom' was calling `recenter' without passing a non-nil value for REDISPLAY that I also fixed in the attached patch. Let me know what you think. Thanks, --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Keep-recenter-behavior-backward-compatible-when-call.patch Content-Transfer-Encoding: quoted-printable >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sun, 1 Jul 2018 14:48:24 -0400 Subject: [PATCH] Keep `recenter' behavior backward compatible when called interactively * window.c (recenter): Change the interactive spec to always pass a non-nil value to the REDISPLAY argument when called interactively. * window.el (recenter-top-bottom): Make sure recenter's second argument is non-nil everywhere. * windows.texi (Textual Scrolling): Edit documentation of `recenter'. --- doc/lispref/windows.texi | 3 ++- lisp/window.el | 2 +- src/window.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 9740bbebf2..8903922da5 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4154,7 +4154,8 @@ Textual Scrolling @code{recenter} puts the line containing point in the middle of the window. If @var{count} is @code{nil} and @var{redisplay} is non-@code{nil}, this function may redraw the frame, according to the -value of @code{recenter-redisplay}. +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80=98ni= l=E2=80=99 +for @var{redisplay}. =20 When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the diff --git a/lisp/window.el b/lisp/window.el index 6d9d8bdcd2..d56bed63da 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8767,7 +8767,7 @@ recenter-top-bottom With plain `C-u', move current line to window center." (interactive "P") (cond - (arg (recenter arg)) ; Always respect ARG. + (arg (recenter arg t)) ; Always respect ARG. (t (setq recenter-last-op (if (eq this-command last-command) diff --git a/src/window.c b/src/window.c index a966e99ca8..ffa2236cf8 100644 --- a/src/window.c +++ b/src/window.c @@ -5898,7 +5898,7 @@ displayed_window_lines (struct window *w) } =20 =20 -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line = ARG relative to the selected window. If ARG is negative, it counts up from the @@ -5910,7 +5910,7 @@ non-nil, also erase the entire frame and redraw it (w= hen `auto-resize-tool-bars' is set to `grow-only', this resets the tool-bar's height to the minimum height needed); if `recenter-redisplay' has the special value `tty', then only tty frames -are redrawn. +are redrawn. Interactive calls pass non-nil for REDISPLAY. =20 Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) --=20 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 16:17:37 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 20:17:37 +0000 Received: from localhost ([127.0.0.1]:42399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZimv-0005vs-Kw for submit@debbugs.gnu.org; Sun, 01 Jul 2018 16:17:37 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZimt-0005vW-Eh for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 16:17:36 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w61KHTVs077826; Sun, 1 Jul 2018 20:17:29 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=38WLP51CJdCg+p2izxh883OE9gkXcwOz4Dp6/WMhYjI=; b=NbRpN/utqx+UWrlLJCX1uwgxmOTpzMYMyAukKFabtY4992936hkgLVfwkwnOJV67h7mm kYruuUMk2n6Woq/d2/vMIha2WzX6FOjBXaF0HA9GnYNdPGOc+corLDdj28U4QjlJ35Ta /C6Uikc72sMFtxldMYx6r7soTMco0kD+rTKL+pIARyYTZMQrW549PrRoGisMJSXCmkFF 5mh2bWBLS37PCHTcgUcmqXNbXeZ3vawkummH919qpt4zZZ7eEyYRDC8gRdoGi6HxSBm/ y8jlzFUAR4/TDQ/nkzZgPrGitVFwHTRr3uWoe0yMqHLqYP3jdm3NxXB7jqXNX3EO7eF5 Ew== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2jx2gpt82b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 01 Jul 2018 20:17:29 +0000 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 w61KHR42019250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 1 Jul 2018 20:17:28 GMT 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 w61KHPg8006498; Sun, 1 Jul 2018 20:17:26 GMT MIME-Version: 1.0 Message-ID: <7ac98ea5-23c8-456a-8c40-18c703bea617@default> Date: Sun, 1 Jul 2018 13:17:25 -0700 (PDT) From: Drew Adams To: John Shahid , Eli Zaretskii Subject: RE: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> In-Reply-To: <87r2kmyikh.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)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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=459 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807010242 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sorry, but I've not been following this bug thread. I took only a (very) quick look at it, at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D31325. It looks like you are changing the default behavior of `recenter', which is a backward-incompatible change. 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? 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? Apologies if I misunderstood something. I really only glanced at the thread. But if what thought I saw is right, is this really the right fix? The behavior of `recenter' has remained pretty much unchanged since, well, _forever_. And when I came up with `recenter-top-bottom' the idea was explicitly _not_ to change the behavior of `recenter'. 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? Please ignore, if my understanding is wrong or my comments on this are not helpful. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 16:56:10 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 20:56:10 +0000 Received: from localhost ([127.0.0.1]:42412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZjOD-0007Fv-T3 for submit@debbugs.gnu.org; Sun, 01 Jul 2018 16:56:10 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:32875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZjOC-0007Fc-70 for 31325@debbugs.gnu.org; Sun, 01 Jul 2018 16:56:08 -0400 Received: by mail-qt0-f173.google.com with SMTP id l10-v6so12325534qtj.0 for <31325@debbugs.gnu.org>; Sun, 01 Jul 2018 13:56:08 -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=yV9hxmseLjuwQk8m7yHkJj3UTB8FYrUui6poCJAzOrA=; b=ARWjKEgGCj0KJHSWrXZfXNHSdNqtdfvUrpKL2aW8t1dMnGV/tT3zc20zrbCz3i+bRl 8UAQZ7Gg4MqUzk3V7+udnH/7lk8+l/OKjfA3fPdIYzUqP1DbCOr6ItkmWG16VLj2F7DN fi5fGWwACkNoI9i+ZHv49wlB2s+yOVLUvyPbvt3nkSbazoZqybrmDNZw5pLH1HAONojl 0RylANfkFFLW9UPvO/nh9VUM6iDHk/2dVgJsDE6pgl6bEINtl+ub3smlbEXQendQJQgL qfI+iWl/I/cl4jrUawK/NPN3F0sA2KvaJDJ2q9yNGPdktk6xk4vkfEOqW8N6XwEtCJ+z YAYw== 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=yV9hxmseLjuwQk8m7yHkJj3UTB8FYrUui6poCJAzOrA=; b=Uvpx31JN29tkt/PGoAKK1s96r14jgcxvd40KsEFm/B/K83JdCd2NKRcVWdk+XynC9Y rP/eRPTm45eDs5JfbH+SD8aEwMRorZci8sgGr86uqL+zuQN+vxPD0sK91nNDOUc4ciY3 Olk3k2eFkcOiLVsfvdaz+zMJHgPCwku2jIQsWwC/LEDPo18DPoLGUJ9fMvwcgC4VGfnU x8UAn6utr08qibuSI97anktH9HlFL/PjreqSabL0JW7AyQSGO7uxKc3Loltm3zm+RdRN dwA1bMltyVuBNMao1BkK6EOtJ1Xq4+0u5zrDvSxAAZjO5BzEq9plIDbUsba598+YIFKB hPew== X-Gm-Message-State: APt69E3L5WFXdV/U67DjpJeVmOuH+C+1v7NDo6Ce7BBanK9+s8zi5Mne +7o9yoMew/o85A5KlZUgkJ0= X-Google-Smtp-Source: AAOMgpfH36BviSRXZFR0at5GfL8z4k72YnuUgW+DKTAG+0SECP3K1rNo3lwbeSx4ixLhpJC8QNXggw== X-Received: by 2002:a0c:e90c:: with SMTP id a12-v6mr5394797qvo.224.1530478562243; Sun, 01 Jul 2018 13:56:02 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id 140-v6sm6527783qkm.18.2018.07.01.13.56.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 13:56:01 -0700 (PDT) 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> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Drew Adams Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <7ac98ea5-23c8-456a-8c40-18c703bea617@default> Date: Sun, 01 Jul 2018 20:56:00 +0000 Message-ID: <87o9fqy8tb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Drew Adams writes: > Sorry, but I've not been following this bug thread. > I took only a (very) quick look at it, at > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31325. > > It looks like you are changing the default behavior of > `recenter', which is a backward-incompatible change. That's right but only for non-interactive uses of `recenter'. All interactive uses should remain backward compatible. > 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? 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. > 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? 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. > 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. > 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. Cheers, From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 19:04:13 2018 Received: (at 31325) by debbugs.gnu.org; 1 Jul 2018 23:04:13 +0000 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 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 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== 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 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 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 MIME-Version: 1.0 Message-ID: Date: Sun, 1 Jul 2018 16:04:00 -0700 (PDT) From: Drew Adams To: John Shahid Subject: RE: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> 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)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31325 Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > 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? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 01 22:27:36 2018 Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 02:27:36 +0000 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 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 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) 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) 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> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Drew Adams Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: Date: Mon, 02 Jul 2018 02:27:22 +0000 Message-ID: <87muvaxth1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 02 11:18:50 2018 Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 15:18:50 +0000 Received: from localhost ([127.0.0.1]:43714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0bK-00067n-9S for submit@debbugs.gnu.org; Mon, 02 Jul 2018 11:18:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0bJ-00067a-Aj for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 11:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0bD-0003ps-1u for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 11:18:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0b6-0003nB-Gd; Mon, 02 Jul 2018 11:18:36 -0400 Received: from [176.228.60.248] (port=4901 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fa0b5-00018Z-R7; Mon, 02 Jul 2018 11:18:36 -0400 Date: Mon, 02 Jul 2018 18:18:20 +0300 Message-Id: <83y3etk6o3.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87muvaxth1.fsf@gmail.com> (message from John Shahid on Mon, 02 Jul 2018 02:27:22 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> <87muvaxth1.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Mon, 02 Jul 2018 02:27:22 +0000 > > 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. Indeed, I think there's some confusion here. Recentering a window will always trigger redisplay of that window if the new point is out of view, or if enters the display margins. But it doesn't necessarily clear and redraw the entire frame. For the record: historically, 'recenter' always cleared the entire frame and drew it anew. Then, almost exactly 9 years ago, we changed the default behavior to clear and redraw frame only on TTYs, and introduced a variable, recenter-redisplay, to disable redrawing even of TTY frames. The current change goes a step further in the same direction: it modifies the behavior of non-interactive calls of 'recenter', such that even on a TTY it doesn't by default redraw the entire frame, unless the caller explicitly requests that. If not specifically requested, 'recenter' called non-interactively will just recenter (and trigger redisplay of the window which it recentered, if necessary). The rationale for this change is that the vast majority of non-interactive callers of 'recenter' have no reason to redraw the entire frame, and recenter-redisplay is a knob meant to control only the interactive behavior. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 02 11:23:12 2018 Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 15:23:12 +0000 Received: from localhost ([127.0.0.1]:43722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0fY-0006F0-5F for submit@debbugs.gnu.org; Mon, 02 Jul 2018 11:23:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa0fW-0006Eo-6M for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 11:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0fQ-0005dL-17 for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 11:23:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0fK-0005bn-R8; Mon, 02 Jul 2018 11:22:58 -0400 Received: from [176.228.60.248] (port=1196 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fa0fK-0001T9-8F; Mon, 02 Jul 2018 11:22:58 -0400 Date: Mon, 02 Jul 2018 18:22:44 +0300 Message-Id: <83woudk6gr.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87po06ye9q.fsf@gmail.com> (message from John Shahid on Sun, 01 Jul 2018 18:58:09 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sun, 01 Jul 2018 18:58:09 +0000 > > >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001 > From: John Shahid > Date: Sun, 1 Jul 2018 14:48:24 -0400 > Subject: [PATCH] Keep `recenter' behavior backward compatible when called > interactively > > * window.c (recenter): Change the interactive spec to always pass a > non-nil value to the REDISPLAY argument when called interactively. > * window.el (recenter-top-bottom): Make sure recenter's second > argument is non-nil everywhere. > * windows.texi (Textual Scrolling): Edit documentation of `recenter'. Bug number is missing. Also, we prefer to quite in documentation (as opposed to doc strings) 'like this', not `like this'. > --- a/doc/lispref/windows.texi > +++ b/doc/lispref/windows.texi > @@ -4154,7 +4154,8 @@ Textual Scrolling > @code{recenter} puts the line containing point in the middle of the > window. If @var{count} is @code{nil} and @var{redisplay} is > non-@code{nil}, this function may redraw the frame, according to the > -value of @code{recenter-redisplay}. > +value of @code{recenter-redisplay}. Interactive calls pass non-‘nil’ > +for @var{redisplay}. ^^ Two spaces between sentences. > -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", > +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", > doc: /* Center point in selected window and maybe redisplay frame. > With a numeric prefix argument ARG, recenter putting point on screen line ARG > relative to the selected window. If ARG is negative, it counts up from the > @@ -5910,7 +5910,7 @@ non-nil, also erase the entire frame and redraw it (when > `auto-resize-tool-bars' is set to `grow-only', this resets the > tool-bar's height to the minimum height needed); if > `recenter-redisplay' has the special value `tty', then only tty frames > -are redrawn. > +are redrawn. Interactive calls pass non-nil for REDISPLAY. I think this text is slightly more clear: Interactively, REDISPLAY is always non-nil. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 02 16:38:52 2018 Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 20:38:52 +0000 Received: from localhost ([127.0.0.1]:43975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa5b2-0007OG-BO for submit@debbugs.gnu.org; Mon, 02 Jul 2018 16:38:52 -0400 Received: from mail-qt0-f181.google.com ([209.85.216.181]:35655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa5b0-0007Nz-HD for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 16:38:50 -0400 Received: by mail-qt0-f181.google.com with SMTP id z6-v6so14971776qti.2 for <31325@debbugs.gnu.org>; Mon, 02 Jul 2018 13:38:50 -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=74GaVRUF8nF9mEsbnZDKVNr1enVxZD3fAtg3uGHlWQY=; b=SCHkiBLviH53PPxAdBi6ZQYZwXJIgAVuMmNke7FeoQjp7+CDbEdxTbviuJ0M9xs8cV A+U2hKnCuK3CrtXhio1MHXqAAqJ9+j6s8XQvSh4aEpMZ1rFn+2/S6uHRHdpGySPQzoLT +QLZJD148h65um5bIePJu9Ug8i7lRgu+b5onfOy0m5ezgsVGZnAwj2Q4aUVo3MEwq+r4 d96CU5DPuDtulQC30YRot1VCUwScDoFYmSsZJDfMc7MVMCTiFBTlvkw2UG/cHIZSWEPR huQX8ZwHDJl8/jCWFDqpJeFpLvEIexu7xGNrWq0jZePm25ruWe+yWL633tcF6apEpJ5u atJQ== 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=74GaVRUF8nF9mEsbnZDKVNr1enVxZD3fAtg3uGHlWQY=; b=oOPdJrbRAvcW6LhDlQIq1B88S9Gf7wyX1HxNJfw0WV8pqSULaeZfzbrDEuwt56aVWf 4mrwXsrp6tA7rI+4ohQCgdvDgGsICeidaQqSSkU2xKudxAzXs5SKJ3Bcs9whmo6moGTs 8COqM59IuqRFpVdDQ8a31iftROO8XGakeT6IFoKXnZ2/fmnTc74bWhrQk1KI9OiCGnJY Bwsg9UA6vFLffP9k4lPspV3Rs6b1fjMUzQzEjWI7RBiY0goVdUu9hpUyFdrt2Km12SMI Gb3PoyH9tj8/bjeKfhXXCi5z2DA2O+Nl6PQ5dHcxDaUBl6Xj09gUqfvDHWeTrYLaRvzn oT8A== X-Gm-Message-State: APt69E0cWozkbBGR9exZLlN2TlyyThEKYdPJ8YlrLCELfgDTUYpg7FUd QrlImip7xjZka5dx0Kiq0hc= X-Google-Smtp-Source: AAOMgpdWoCErz3vXHzoVhii4fz7m8V00IsZ5MRwst0dS7jPt/Ugt3ZV6Xdk+gYDCZJdhaTmqS4AphA== X-Received: by 2002:a0c:873d:: with SMTP id 58-v6mr24121795qvh.199.1530563924751; Mon, 02 Jul 2018 13:38:44 -0700 (PDT) Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id n20-v6sm9942839qtp.89.2018.07.02.13.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 13:38:43 -0700 (PDT) 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> <83woudk6gr.fsf@gnu.org> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <83woudk6gr.fsf@gnu.org> Date: Mon, 02 Jul 2018 20:38:38 +0000 Message-ID: <87lgatxtip.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: John Shahid >> Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sun, 01 Jul 2018 18:58:09 +0000 >>=20 >> >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001 >> From: John Shahid >> Date: Sun, 1 Jul 2018 14:48:24 -0400 >> Subject: [PATCH] Keep `recenter' behavior backward compatible when called >> interactively >>=20 >> * window.c (recenter): Change the interactive spec to always pass a >> non-nil value to the REDISPLAY argument when called interactively. >> * window.el (recenter-top-bottom): Make sure recenter's second >> argument is non-nil everywhere. >> * windows.texi (Textual Scrolling): Edit documentation of `recenter'. > > Bug number is missing. Also, we prefer to quite in documentation (as > opposed to doc strings) 'like this', not `like this'. That is fixed in the attached patch. > >> --- a/doc/lispref/windows.texi >> +++ b/doc/lispref/windows.texi >> @@ -4154,7 +4154,8 @@ Textual Scrolling >> @code{recenter} puts the line containing point in the middle of the >> window. If @var{count} is @code{nil} and @var{redisplay} is >> non-@code{nil}, this function may redraw the frame, according to the >> -value of @code{recenter-redisplay}. >> +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80= =98nil=E2=80=99 >> +for @var{redisplay}. ^^ > > Two spaces between sentences. Sorry about that, I'm still getting used to using 2 spaces after period. How do you spot these ? Do you have some font-lock keyword to highlight them. I found checkdoc not to be very useful for checking the manual or docstrings in .c files. > >> -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", >> +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", >> doc: /* Center point in selected window and maybe redisplay fram= e. >> With a numeric prefix argument ARG, recenter putting point on screen li= ne ARG >> relative to the selected window. If ARG is negative, it counts up from= the >> @@ -5910,7 +5910,7 @@ non-nil, also erase the entire frame and redraw it= (when >> `auto-resize-tool-bars' is set to `grow-only', this resets the >> tool-bar's height to the minimum height needed); if >> `recenter-redisplay' has the special value `tty', then only tty frames >> -are redrawn. >> +are redrawn. Interactive calls pass non-nil for REDISPLAY. > > I think this text is slightly more clear: > > Interactively, REDISPLAY is always non-nil. I changed the text in the attached patch. Thanks, --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Keep-interactive-uses-of-recenter-backward-compatibl.patch Content-Transfer-Encoding: quoted-printable >From ed35d20c422adc80bfbd4090b64d9a43d099b6b9 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sun, 1 Jul 2018 14:48:24 -0400 Subject: [PATCH] Keep interactive uses of 'recenter' backward compatible (Bug#31325) * window.c (recenter): Change the interactive spec to always pass a non-nil value to the REDISPLAY argument when called interactively. * window.el (recenter-top-bottom): Make sure recenter's second argument is non-nil everywhere. * windows.texi (Textual Scrolling): Edit documentation of 'recenter'. --- doc/lispref/windows.texi | 3 ++- lisp/window.el | 2 +- src/window.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 9740bbebf2..6f1cf788a0 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4154,7 +4154,8 @@ Textual Scrolling @code{recenter} puts the line containing point in the middle of the window. If @var{count} is @code{nil} and @var{redisplay} is non-@code{nil}, this function may redraw the frame, according to the -value of @code{recenter-redisplay}. +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80=98n= il=E2=80=99 +for @var{redisplay}. =20 When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the diff --git a/lisp/window.el b/lisp/window.el index 6d9d8bdcd2..d56bed63da 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8767,7 +8767,7 @@ recenter-top-bottom With plain `C-u', move current line to window center." (interactive "P") (cond - (arg (recenter arg)) ; Always respect ARG. + (arg (recenter arg t)) ; Always respect ARG. (t (setq recenter-last-op (if (eq this-command last-command) diff --git a/src/window.c b/src/window.c index 20f6862e3b..047b741475 100644 --- a/src/window.c +++ b/src/window.c @@ -5896,7 +5896,7 @@ displayed_window_lines (struct window *w) } =20 =20 -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line = ARG relative to the selected window. If ARG is negative, it counts up from the @@ -5908,7 +5908,7 @@ non-nil, also erase the entire frame and redraw it (w= hen `auto-resize-tool-bars' is set to `grow-only', this resets the tool-bar's height to the minimum height needed); if `recenter-redisplay' has the special value `tty', then only tty frames -are redrawn. +are redrawn. Interactively, REDISPLAY is always non-nil. =20 Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) --=20 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 03 04:49:58 2018 Received: (at 31325) by debbugs.gnu.org; 3 Jul 2018 08:49:58 +0000 Received: from localhost ([127.0.0.1]:44388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1faH0Y-0005jC-Dk for submit@debbugs.gnu.org; Tue, 03 Jul 2018 04:49:58 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:50989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1faH0W-0005iy-E9 for 31325@debbugs.gnu.org; Tue, 03 Jul 2018 04:49:56 -0400 Received: by mail-wm0-f43.google.com with SMTP id v25-v6so1421185wmc.0 for <31325@debbugs.gnu.org>; Tue, 03 Jul 2018 01:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=lQmjz+LNYwm4+5XLwNNmp+BJAjV6oeOCXwMCQWILDNY=; b=W+QLGVKUVUfmxl5by7BsVE2vdH8LKx7WiHehWYU0eWGESj2w/7Ufntjdkj4U6rgz29 KrLbH6GUp50qEaa6i02m5epyCDgjg5IiThOTS5vYHhIh5gw6ITJbUdSRyYHFqy/QTy37 5qGflcd5IgO1B1dljSJBtWfzszHW2Y8vZa2Ks/i0/PXoKUuKOhVBB6u6qqBefLBJsVja wL/6axr1Y+41r5ZxQ20rBwienSliPY8s3Uz2xoccUDFeIbFQoncXTm7XeZs4bInOZ/6/ 4w/hNNwn/rFNmaJmo3P0LZ+YJCTz/j3XYXZ3Y7rbw25qHsKkxvs7jT/ZUpb92O6PP2Wi xvlQ== 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:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=lQmjz+LNYwm4+5XLwNNmp+BJAjV6oeOCXwMCQWILDNY=; b=EsbaHFnEsQ8wSmhFE7+8Afci9EdwyIrRa+sSDu/9FNRazpYX5LCdPJeYFSQdPYbOCN xKxRJbwBHEmloPBlwwOcSni1qQYQ4v0FVG+XC/DREgeLvBLxus8Bok65ViwAZurh4axn NwEDRpgwFHFdU1RaGK/bcSMQj0AUOvyoD5cgQhRlrV67+CjpV+HrjsTg0d+Elp7nd4HI jCPA7hFFWQd1jsGfakqY+/yoiUVX2h270ZEnqD7/+9ZTknFl/FJ5qky0Pcd98+54L9jg MpDGMZ4+zzladrFuXykF4OP3tcnS+R+mqxNeihBqfLQNlo/QNj0JJwMN9S5HhXh72+EB vikg== X-Gm-Message-State: APt69E2srwsBPyaWTJTv4ub2NABFtz7y3vME1rjdTNzfEG5+61+NMCce mW+/5tstSJoIpgMZAGQCSvQ= X-Google-Smtp-Source: AAOMgpeUjIroYVAC1y2bmWa3Tz7KDWXeB1pYiau6BsACpO31XGaGwezr0S4Mahp4NgT8dHVUDPpU3g== X-Received: by 2002:a1c:d7c3:: with SMTP id o186-v6mr9940532wmg.67.1530607790465; Tue, 03 Jul 2018 01:49:50 -0700 (PDT) Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id s41-v6sm1714989wrc.5.2018.07.03.01.49.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 01:49:49 -0700 (PDT) From: Robert Pluim To: John Shahid Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> <83woudk6gr.fsf@gnu.org> <87lgatxtip.fsf@gmail.com> X-Debbugs-No-Ack: yes Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Tue, 03 Jul 2018 10:49:49 +0200 In-Reply-To: <87lgatxtip.fsf@gmail.com> (John Shahid's message of "Mon, 02 Jul 2018 20:38:38 +0000") Message-ID: <87d0w4d7pu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31325 Cc: Eli Zaretskii , 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) John Shahid writes: > Eli Zaretskii writes: >> >>> --- a/doc/lispref/windows.texi >>> +++ b/doc/lispref/windows.texi >>> @@ -4154,7 +4154,8 @@ Textual Scrolling >>> @code{recenter} puts the line containing point in the middle of the >>> window. If @var{count} is @code{nil} and @var{redisplay} is >>> non-@code{nil}, this function may redraw the frame, according to the >>> -value of @code{recenter-redisplay}. >>> +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80= =98nil=E2=80=99 >>> +for @var{redisplay}. ^^ >> >> Two spaces between sentences. > > Sorry about that, I'm still getting used to using 2 spaces after > period. How do you spot these ? Do you have some font-lock keyword to > highlight them. I found checkdoc not to be very useful for checking the > manual or docstrings in .c files. You get used to it. One way to check is to put point at the beginning of the text you changed and seeing if 'M-e' (forward-sentence) does the expected thing. Robert From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 03 12:38:49 2018 Received: (at 31325) by debbugs.gnu.org; 3 Jul 2018 16:38:49 +0000 Received: from localhost ([127.0.0.1]:45643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1faOKF-0003XB-KP for submit@debbugs.gnu.org; Tue, 03 Jul 2018 12:38:47 -0400 Received: from mail-qt0-f179.google.com ([209.85.216.179]:33277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1faOKD-0003Ww-L4 for 31325@debbugs.gnu.org; Tue, 03 Jul 2018 12:38:46 -0400 Received: by mail-qt0-f179.google.com with SMTP id l10-v6so2135539qtj.0 for <31325@debbugs.gnu.org>; Tue, 03 Jul 2018 09:38:45 -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=dwQhrY1Gcm4Z0pgjK/AictQsJddch0MguSU1V5fO5UY=; b=FBV/g/eWnhKzaZ70BoTV9Ssp+0/407RQ1OocHyQjxXG2IsBPKkl2149ssjY4RoAumi 4yY/HjkPmqy724rHzSFO0TsEQg3ZZJ+j37modA57NHFSjILeNh4s9kQ5dGPZ1+e49LT4 Io82DE7F3/Tto6zMmqb5oJbE9EhAuCK1X6Ezl1y0u7s6wyN0ocz5tAY2E51xgSxAfPdI 6dGTu2CwmQupy5ydZnSGGHJnKNWUfKJS0fCIUPH1kqeva1jGnJjYno7Ri/g+2UOhQOuh mf9y39M7/7PjIwy5H2xckxOKFipJXwP6CIZdrwD5hy1BGzKzSS16sDRZOaU+f5PA9Or5 SCsA== 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=dwQhrY1Gcm4Z0pgjK/AictQsJddch0MguSU1V5fO5UY=; b=Af8PAmVWIzyOviF2o7Q6vWCMzxn+o5rVdX/5c5Bg1q+OFMYfnMgan+vhfYGM94GMLz 0wXFPV1dzcIxRUEh/aAf8h418TM6JuM3Wr/sQcxHvQhA98+vUFiOutLD1K/z71dX8Fbf iYMqDAbrCCX6VJg2PxfuMfErJoYOQulpnf3cgByprNqoR8lq8KZFcVUShxpHXQepe0jB i9hfWi/Hu13xZ8ChAwsRhcruStTBE3rdkqYTuXhiJLyDJpfEfra5OxqKEBMkASoCMW/d 7+E3pliktymh82tNFbkzG+qfVG7GpQLc/I2kky4TDXWsu+vmRoosN4AnN2gVWu6SIJ6P XuwA== X-Gm-Message-State: APt69E0JmtyD5Dpsj4mc7VXMxQ5hcKXoJHdMs+FlOfQ4czDQqdQQf4jD IAErCP3dLDHAvs1sdb7gXGo= X-Google-Smtp-Source: AAOMgpfajPIBCsTpiwJXwXeGaQiyMYA/GA+30Y1iD+XHklZDEdZ+3nZvcU0iQsuKAxlknC95/x5MPQ== X-Received: by 2002:ac8:2f42:: with SMTP id k2-v6mr23005197qta.169.1530635919732; Tue, 03 Jul 2018 09:38:39 -0700 (PDT) Received: from 9a50e8462956 ([142.154.219.2]) by smtp.gmail.com with ESMTPSA id h22-v6sm876281qkj.84.2018.07.03.09.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 09:38:38 -0700 (PDT) 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> <83woudk6gr.fsf@gnu.org> <87lgatxtip.fsf@gmail.com> User-agent: mu4e 1.1.0; emacs 27.0.50 From: John Shahid To: Eli Zaretskii Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame In-reply-to: <87lgatxtip.fsf@gmail.com> Date: Tue, 03 Jul 2018 16:38:32 +0000 Message-ID: <87k1qcxojb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 31325 Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain John Shahid writes: > Eli Zaretskii writes: > >>> From: John Shahid >>> Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >>> Date: Sun, 01 Jul 2018 18:58:09 +0000 >>> >>> >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001 >>> From: John Shahid >>> Date: Sun, 1 Jul 2018 14:48:24 -0400 >>> Subject: [PATCH] Keep `recenter' behavior backward compatible when called >>> interactively >>> >>> * window.c (recenter): Change the interactive spec to always pass a >>> non-nil value to the REDISPLAY argument when called interactively. >>> * window.el (recenter-top-bottom): Make sure recenter's second >>> argument is non-nil everywhere. >>> * windows.texi (Textual Scrolling): Edit documentation of `recenter'. >> >> Bug number is missing. Also, we prefer to quite in documentation (as >> opposed to doc strings) 'like this', not `like this'. > > That is fixed in the attached patch. I rebased and attached a new patch since there were some changes to the manual on master. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Keep-interactive-uses-of-recenter-backward-compatibl.patch Content-Transfer-Encoding: quoted-printable >From 88c07293e82e2bcd9dbfc09a87e4d45f3e56676c Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sun, 1 Jul 2018 14:48:24 -0400 Subject: [PATCH] Keep interactive uses of 'recenter' backward compatible (Bug#31325) * window.c (recenter): Change the interactive spec to always pass a non-nil value to the REDISPLAY argument when called interactively. * window.el (recenter-top-bottom): Make sure recenter's second argument is non-nil everywhere. * windows.texi (Textual Scrolling): Edit documentation of 'recenter'. --- doc/lispref/windows.texi | 3 ++- lisp/window.el | 2 +- src/window.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index ae6837b444..3eaa15a603 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4156,7 +4156,8 @@ Textual Scrolling non-@code{nil}, this function may redraw the frame, according to the value of @code{recenter-redisplay}. Thus, omitting the second argument can be used to countermand the effect of -@code{recenter-redisplay} being non-@code{nil}. +@code{recenter-redisplay} being non-@code{nil}. Interactive calls +pass non-=E2=80=98nil=E2=80=99 for @var{redisplay}. =20 When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the diff --git a/lisp/window.el b/lisp/window.el index 6d9d8bdcd2..d56bed63da 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8767,7 +8767,7 @@ recenter-top-bottom With plain `C-u', move current line to window center." (interactive "P") (cond - (arg (recenter arg)) ; Always respect ARG. + (arg (recenter arg t)) ; Always respect ARG. (t (setq recenter-last-op (if (eq this-command last-command) diff --git a/src/window.c b/src/window.c index 20f6862e3b..047b741475 100644 --- a/src/window.c +++ b/src/window.c @@ -5896,7 +5896,7 @@ displayed_window_lines (struct window *w) } =20 =20 -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line = ARG relative to the selected window. If ARG is negative, it counts up from the @@ -5908,7 +5908,7 @@ non-nil, also erase the entire frame and redraw it (w= hen `auto-resize-tool-bars' is set to `grow-only', this resets the tool-bar's height to the minimum height needed); if `recenter-redisplay' has the special value `tty', then only tty frames -are redrawn. +are redrawn. Interactively, REDISPLAY is always non-nil. =20 Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) --=20 2.18.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 07 05:09:46 2018 Received: (at 31325-done) by debbugs.gnu.org; 7 Jul 2018 09:09:47 +0000 Received: from localhost ([127.0.0.1]:49080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbjDu-0004B8-NB for submit@debbugs.gnu.org; Sat, 07 Jul 2018 05:09:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbjDt-0004Aw-Tj for 31325-done@debbugs.gnu.org; Sat, 07 Jul 2018 05:09:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbjDn-0002KE-R5 for 31325-done@debbugs.gnu.org; Sat, 07 Jul 2018 05:09:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbjDi-0002Ht-SL; Sat, 07 Jul 2018 05:09:34 -0400 Received: from [176.228.60.248] (port=4030 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fbjDi-0008EO-5j; Sat, 07 Jul 2018 05:09:34 -0400 Date: Sat, 07 Jul 2018 12:09:38 +0300 Message-Id: <83h8lbjtt9.fsf@gnu.org> From: Eli Zaretskii To: John Shahid In-reply-to: <87k1qcxojb.fsf@gmail.com> (message from John Shahid on Tue, 03 Jul 2018 16:38:32 +0000) Subject: Re: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame 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> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> <83woudk6gr.fsf@gnu.org> <87lgatxtip.fsf@gmail.com> <87k1qcxojb.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31325-done Cc: rudalics@gmx.at, 31325-done@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: John Shahid > Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Tue, 03 Jul 2018 16:38:32 +0000 > > >> Bug number is missing. Also, we prefer to quite in documentation (as > >> opposed to doc strings) 'like this', not `like this'. > > > > That is fixed in the attached patch. > > I rebased and attached a new patch since there were some changes to the > manual on master. Thanks, pushed. From unknown Fri Jun 20 18:19:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Aug 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator