Juri Linkov <juri@HIDDEN>
to control <at> debbugs.gnu.org.
Full text available.Received: (at 77370) by debbugs.gnu.org; 15 Nov 2025 17:17:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 15 12:17:43 2025 Received: from localhost ([127.0.0.1]:36078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vKJuA-0003qS-VW for submit <at> debbugs.gnu.org; Sat, 15 Nov 2025 12:17:43 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:51274) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vKJu9-0003qD-1N; Sat, 15 Nov 2025 12:17:41 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4d810Y0sTnz9sst; Sat, 15 Nov 2025 18:17:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1763227053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E4SbbFfVUXe1uJDwpCaA9N9oPfg5ZLZALVt9lugjWDY=; b=H/0RKW8wtvdQtaR7SNF6Vp4VzSWgSiZBYKgF3uim5AlPgDDre/4tKpQd41bFUlhuw3zRko 21bBs2yWhOcg9342uVUBL4e6NtfTmyQimpjJIjKDlEPd//wLA3175BP4n827v8coS7+364 XICCXAWpvK1elpWvbQFyd2TphNrDr0RmAwtUQUcqKQ0eFtbDS0twzKcJGVfhWK3vXaJpcp utff3XgKwhNerM6MokwNrTz6ZS1ylmQ4iqvlM7/t7XerNABk4GxtMjAdYU8ahUtg3n0yFD nl5ISyoe7c7xQNBgFRT0Ef1r+iEqFObYkQMw7epyMNjXPBk+X4eNFsWmjPz9rw== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates 2001:67c:2050:b231:465::2 as permitted sender) smtp.mailfrom=juri@HIDDEN From: Juri Linkov <juri@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#77370: [PATCH] Improve foldout-exit-fold behavior with negative argument In-Reply-To: <86ikfboabg.fsf@HIDDEN> Organization: LINKOV.NET References: <uxsg7ttt7beecf.fsf@HIDDEN> <CAOA-32Mmu1-_ZGTioAHM2e_tZhRHxi8in=V31a2RpFyn7g0f5g@HIDDEN> <86ikfboabg.fsf@HIDDEN> Date: Sat, 15 Nov 2025 19:16:41 +0200 Message-ID: <87v7jbrzba.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4d810Y0sTnz9sst X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77370 Cc: 77370 <at> debbugs.gnu.org, Paul Nelson <ultrono@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) close 77370 31.0.50 thanks >> I thought I'd gently ping on this. To summarize, when exiting a fold with a negative argument (to keep the >> text visible), Emacs currently moves point to the end of the fold and recenters. As far as I can tell, this >> behavior is an oversight rather than intentional: the recentering is helpful when hiding text (to reorient), but >> disruptive when keeping text visible. >> >> The patch preserves point and skips recentering when the fold is kept visible. I'd be happy to resubmit as a >> user option if there are concerns about changing default behavior, though that seems like overkill for what >> appears to be a bug fix. > > Thanks. > > Juri, any comments? The patch looks like a no-brainer to me. Everything looks correct, so now pushed. Thanks Paul for the patch.
bug-gnu-emacs@HIDDEN:bug#77370; Package emacs.
Full text available.Received: (at 77370) by debbugs.gnu.org; 15 Nov 2025 10:32:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 15 05:32:45 2025 Received: from localhost ([127.0.0.1]:33933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vKDaH-0008BU-13 for submit <at> debbugs.gnu.org; Sat, 15 Nov 2025 05:32:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35942) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKDaE-0008BI-Qu for 77370 <at> debbugs.gnu.org; Sat, 15 Nov 2025 05:32:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1vKDa9-0005Sv-Gc; Sat, 15 Nov 2025 05:32:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sEaiK96EB03Qn77HIk0fU990hqWpqjvAqEmaRT9ZM40=; b=FmVouZ7I32uw hNf54B9oufq4BaqABJ0m1Hkv1DXxCLF9K1iN9Bmn+udeAIJ2m2EW3Dy3naG82aAbStmHCN/DjFWDh K+1yYjVVMsjEEmRVAb4wH3hbOhxd2b/x8bPL8H2z4erQb0N4KIAdk8t2GF9ZzkiZ+uJHxVqM5KZJP 3OOTOwIbs3k/eApxKcXOCtt/uqWzPetgxDihKwKMYg9XzCewOu2XdUGP7660RvP1oqPtp/8djMxkh M1Evc0BRmRb0/UPPOhipObaItf2bl13aXK7BEtgfusw50z5ebgUfQ0vInt1+pg2BRbLkoUAXDqEuM 4eEZs8xeJpCqn2Wz4VNwbw==; Date: Sat, 15 Nov 2025 12:32:35 +0200 Message-Id: <86ikfboabg.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Paul Nelson <ultrono@HIDDEN>, Juri Linkov <juri@HIDDEN> In-Reply-To: <CAOA-32Mmu1-_ZGTioAHM2e_tZhRHxi8in=V31a2RpFyn7g0f5g@HIDDEN> (message from Paul Nelson on Thu, 13 Nov 2025 06:53:52 +0100) Subject: Re: bug#77370: [PATCH] Improve foldout-exit-fold behavior with negative argument References: <uxsg7ttt7beecf.fsf@HIDDEN> <CAOA-32Mmu1-_ZGTioAHM2e_tZhRHxi8in=V31a2RpFyn7g0f5g@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77370 Cc: 77370 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Paul Nelson <ultrono@HIDDEN> > Date: Thu, 13 Nov 2025 06:53:52 +0100 > > I thought I'd gently ping on this. To summarize, when exiting a fold with a negative argument (to keep the > text visible), Emacs currently moves point to the end of the fold and recenters. As far as I can tell, this > behavior is an oversight rather than intentional: the recentering is helpful when hiding text (to reorient), but > disruptive when keeping text visible. > > The patch preserves point and skips recentering when the fold is kept visible. I'd be happy to resubmit as a > user option if there are concerns about changing default behavior, though that seems like overkill for what > appears to be a bug fix. Thanks. Juri, any comments? The patch looks like a no-brainer to me.
bug-gnu-emacs@HIDDEN:bug#77370; Package emacs.
Full text available.Received: (at 77370) by debbugs.gnu.org; 13 Nov 2025 05:54:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 13 00:54:13 2025 Received: from localhost ([127.0.0.1]:53756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJQHd-0003LS-4a for submit <at> debbugs.gnu.org; Thu, 13 Nov 2025 00:54:13 -0500 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:47473) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1vJQHa-0003L9-LT for 77370 <at> debbugs.gnu.org; Thu, 13 Nov 2025 00:54:11 -0500 Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-9486696aafeso43747739f.3 for <77370 <at> debbugs.gnu.org>; Wed, 12 Nov 2025 21:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763013244; x=1763618044; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=4e0eP0FzNeyBUw/m7uOJrSKkYgNiCGVyu0+zdk2utCg=; b=KXyIFoPQs/AUWXgVFlKVE2UoP4qOajmVt8GIbDeUeiSlJ/Apjn1fk98cLJLKgdOTNf TiUvY6EbP7ydeoSbRo8Mvm6QHugkzeHm+LvlE2QS188hSDALgw84k4dzDfbUb8xIpxyr 0z/pWbkBp7+Wt8XDmB4JCAXke8HFXAhoYZ0CSBryKtrx/X/KUiC9OeCg/EyO5Se0FgoT AsIvKsYr4kzxA/TsnQ3Ma6YqSOyZqZXFZq5Wesy3iYW9kyMO1IykLeoNvndCkatkztcp u4sZUx8xKAiMchaReLnlMT9zSzzXOJQCC6VsFX2Hy4umlG2qZsE/WYnEp0B/CzBu4utS xZmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763013244; x=1763618044; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4e0eP0FzNeyBUw/m7uOJrSKkYgNiCGVyu0+zdk2utCg=; b=edutr10x2nZwHlKrbhsEEpoznzoE2oVqXnUsWCBefl/xU0GdIfeYtla2jP2RBGmYxQ KXajEJNTAYHGtB72T9UCcXVwdYgWvb17ZcetHPYZGyTSu4gPwZa88ZqIYWosg6K/2Uni RAIhWgQu7FtoBnjh3FM7ppl3biRkypMoh61ui3XfYS4BMTkSCcjWvijmgcJR+Nc7BvGS M+Qeso1doo2bSFDqsfJjazajB2A2f6It4yFFgOrxJXu9MxB2BDeix5jA1chCUujEPWY7 sO+HtXOHw/lI6pW1ljBi/7Wd04tPfYkNYFDPqZ7/nE9Wio6EKNzQPzkBYKnPFAGd35pZ 0ByA== X-Gm-Message-State: AOJu0Yw4iQBBJe7vZIHnlAgQ6ec+N+PfY9C158beY/l5/lobPUT630Qr gteci1RozNUz469j75Q7axV+V3FgNB2JNlG6GqJdrKRB9wBauTaynaHs9zfSetkLOrePECZixhQ LKo3V7aTg4sy2B1lI3i1Coq8BaUbPbhp1VGxf X-Gm-Gg: ASbGncsBRZXQrE9DFIva8WUb54EGScnulSGXxj+T2bz2vpgRI8EIKWxMFZTfu6McTCx 44N7jwjizkZxVFqfETShBspqQ3NP2P5d6JRckjOl2Kzoauyh6uWl1Xn14IZ0EcFu2eQnJjPojZ4 H3MIXOicLm3mK7hRYhERBVwb4oj4eSu9wsXTjOSrGxPgzxDm+1lg/yOLe9bsmdEgt//b+XPTBPv ZJxjREVriGTEW4oil4pmruH5PBFLVAKa10M2NjYMXrnzS89V+Rsw3alzrnz4HgFzVnP6uNw X-Google-Smtp-Source: AGHT+IEVUr6hOQzY4iTaqfuN4KUpv9MXX2ckRQ3yud03FTNrEq5Aw3Sm+2NrN3oDtxeT90jQSSvwShzzW/Px8F/GNlY= X-Received: by 2002:a05:6602:2c03:b0:940:d6df:3b19 with SMTP id ca18e2360f4ac-948c4643022mr775344439f.12.1763013244328; Wed, 12 Nov 2025 21:54:04 -0800 (PST) MIME-Version: 1.0 References: <uxsg7ttt7beecf.fsf@HIDDEN> In-Reply-To: <uxsg7ttt7beecf.fsf@HIDDEN> From: Paul Nelson <ultrono@HIDDEN> Date: Thu, 13 Nov 2025 06:53:52 +0100 X-Gm-Features: AWmQ_bltYj4QmkoUJjaHBbdR7OrFanE7Z-4-ok5jrv9Wn7wRC9v3g_u7TzSBh-0 Message-ID: <CAOA-32Mmu1-_ZGTioAHM2e_tZhRHxi8in=V31a2RpFyn7g0f5g@HIDDEN> Subject: Re: bug#77370: [PATCH] Improve foldout-exit-fold behavior with negative argument To: 77370 <at> debbugs.gnu.org Content-Type: multipart/mixed; boundary="00000000000029ba9906437382f8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77370 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --00000000000029ba9906437382f8 Content-Type: multipart/alternative; boundary="00000000000029ba9706437382f6" --00000000000029ba9706437382f6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I thought I'd gently ping on this. To summarize, when exiting a fold with a negative argument (to keep the text visible), Emacs currently moves point to the end of the fold and recenters. As far as I can tell, this behavior is an oversight rather than intentional: the recentering is helpful when hiding text (to reorient), but disruptive when keeping text visible. The patch preserves point and skips recentering when the fold is kept visible. I'd be happy to resubmit as a user option if there are concerns about changing default behavior, though that seems like overkill for what appears to be a bug fix. On Sat, Mar 29, 2025 at 10:07=E2=80=AFPM Paul D. Nelson <ultrono@HIDDEN>= wrote: > The foldout-* commands, available in outline-minor-mode, give a way to > zoom in and out of "folds", which are subtrees defined by the outline > structure. To follow along with this email, start by doing > foldout-zoom-subtree (C-c @ C-z) on a subtree (e.g., an elisp defun). > > By default, foldout-exit-fold (C-c @ C-x) exits one fold, hides the text > that was in that fold (outline-hide-subtree), moves point to the > heading, and recenters. When invoked with a negative prefix argument > like C-- C-c @ C-x, the command instead > > (1) exits one fold without hiding the text, > > (2) moves point to the bottom of the fold, and > > (3) recenters. > > I think that better behavior would be to skip steps (2) and (3), so that > the point stays put and the window view does not change. > > [Step (2) seems incidental rather than by design, so "skip" really means > "counter".] > > Advantages of omitting (2) are: > > - We don't lose our place when zooming out. > > - If we zoom in and zoom out (C-c @ C-z, C-- C-c @ C-x), then point > doesn't move. > > - Consistency with other outline/foldout commands that preserve "point > being on a heading". > > Regarding (3), recentering helps us reorient when hiding an exited fold, > but is disruptive when the text remains visible. > > We retain the flexibility to imitate the old behavior using M-> and C-l. > > The change could be guarded by a defcustom, but it seems to me like a > clear improvement. I'd be happy to learn if I missed some scenario > where it is not. > > Any feedback would be welcome. > > --00000000000029ba9706437382f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">I thought I'd gently ping on this.=C2= =A0 To summarize, when exiting a fold with a negative argument (to keep the= text visible), Emacs currently moves point to the end of the fold and rece= nters.=C2=A0 As far as I can tell, this behavior is an oversight rather tha= n intentional: the recentering is helpful when hiding text (to reorient), b= ut disruptive when keeping text visible.<br><br>The patch preserves point a= nd skips recentering when the fold is kept visible.=C2=A0 I'd be happy = to resubmit as a user option if there are concerns about changing default b= ehavior, though that seems like overkill for what appears to be a bug fix.<= br></div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"l= tr" class=3D"gmail_attr">On Sat, Mar 29, 2025 at 10:07=E2=80=AFPM Paul D. N= elson <<a href=3D"mailto:ultrono@HIDDEN">ultrono@HIDDEN</a>> wr= ote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px= 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The foldout= -* commands, available in outline-minor-mode, give a way to<br> zoom in and out of "folds", which are subtrees defined by the out= line<br> structure.=C2=A0 To follow along with this email, start by doing<br> foldout-zoom-subtree (C-c @ C-z) on a subtree (e.g., an elisp defun).<br> <br> By default, foldout-exit-fold (C-c @ C-x) exits one fold, hides the text<br= > that was in that fold (outline-hide-subtree), moves point to the<br> heading, and recenters.=C2=A0 When invoked with a negative prefix argument<= br> like C-- C-c @ C-x, the command instead<br> <br> =C2=A0(1) exits one fold without hiding the text,<br> <br> =C2=A0(2) moves point to the bottom of the fold, and<br> <br> =C2=A0(3) recenters.<br> <br> I think that better behavior would be to skip steps (2) and (3), so that<br= > the point stays put and the window view does not change.<br> <br> [Step (2) seems incidental rather than by design, so "skip" reall= y means<br> "counter".]<br> <br> Advantages of omitting (2) are:<br> <br> - We don't lose our place when zooming out.<br> <br> - If we zoom in and zoom out (C-c @ C-z, C-- C-c @ C-x), then point<br> =C2=A0 doesn't move.<br> <br> - Consistency with other outline/foldout commands that preserve "point= <br> =C2=A0 being on a heading".<br> <br> Regarding (3), recentering helps us reorient when hiding an exited fold,<br= > but is disruptive when the text remains visible.<br> <br> We retain the flexibility to imitate the old behavior using M-> and C-l.= <br> <br> The change could be guarded by a defcustom, but it seems to me like a<br> clear improvement.=C2=A0 I'd be happy to learn if I missed some scenari= o<br> where it is not.<br> <br> Any feedback would be welcome.<br> <br> </blockquote></div></div> --00000000000029ba9706437382f6-- --00000000000029ba9906437382f8 Content-Type: application/octet-stream; name="0001-Improve-foldout-exit-fold-with-negative-arg.patch" Content-Disposition: attachment; filename="0001-Improve-foldout-exit-fold-with-negative-arg.patch" Content-Transfer-Encoding: base64 Content-ID: <f_mhx0i5b50> X-Attachment-Id: f_mhx0i5b50 RnJvbSBhMzg0Y2E1MGFlYjY1Yzk3NmRmNmU1MzZkNTRmOTZhY2YxZDE0M2QyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIE5lbHNvbiA8dWx0cm9ub0BnbWFpbC5jb20+CkRhdGU6 IFNhdCwgMjkgTWFyIDIwMjUgMTk6MDc6MTMgKzAxMDAKU3ViamVjdDogW1BBVENIXSBJbXByb3Zl IGZvbGRvdXQtZXhpdC1mb2xkIHdpdGggbmVnYXRpdmUgYXJnCgoqIGxpc3AvZm9sZG91dC5lbCAo Zm9sZG91dC1leGl0LWZvbGQ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ogCQkJICAgICAgKHBvaW50LW1heCkpKSkp Ci0gICAgKHJlY2VudGVyKQorCisgICAgKGlmIGhpZGUtZm9sZAorICAgICAgICAocmVjZW50ZXIp CisgICAgICAoZ290by1jaGFyIG9yaWdpbmFsLXBvaW50KSkKIAogICAgIDs7IHVwZGF0ZSB0aGUg bW9kZSBsaW5lCiAgICAgKGZvbGRvdXQtdXBkYXRlLW1vZGUtbGluZSkpKQotLSAKMi4zOS4zIChB cHBsZSBHaXQtMTQ1KQoK --00000000000029ba9906437382f8--
bug-gnu-emacs@HIDDEN:bug#77370; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 29 Mar 2025 21:06:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 29 17:06:57 2025
Received: from localhost ([127.0.0.1]:33213 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1tydOL-0000bs-0u
for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 17:06:57 -0400
Received: from lists.gnu.org ([2001:470:142::17]:48004)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1tydOH-0000bT-P4
for submit <at> debbugs.gnu.org; Sat, 29 Mar 2025 17:06:55 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tydOB-0003lN-Fn
for bug-gnu-emacs@HIDDEN; Sat, 29 Mar 2025 17:06:47 -0400
Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tydO9-0008NZ-GZ
for bug-gnu-emacs@HIDDEN; Sat, 29 Mar 2025 17:06:47 -0400
Received: by mail-ej1-x62e.google.com with SMTP id
a640c23a62f3a-ac2bb7ca40bso653661666b.3
for <bug-gnu-emacs@HIDDEN>; Sat, 29 Mar 2025 14:06:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1743282403; x=1743887203; darn=gnu.org;
h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
:date:message-id:reply-to;
bh=5OmPEAGF5FAZF2gqT7yvlQtV3bHMLWwm8+xF/qCiOmQ=;
b=lz2x2nUcQHLfsizV3YxsavJGV9dqEQ68gijFtm43b/hApALDNcweSYFA9D0XDGCpWq
Nvu16I/8pkuhvtsSgK+J1E1slfANg43YD2Cs3oaIvG3MVuEdiYA+KIJNoUa1fcopS7Y1
RDgZKy+lbIqUyokcILcfOOpSbK5sA45MDMUq8V6O1jLez5zYXtlddbyqQsqk1YiTKDyk
wH2dk+FZCQTkzczHiLRE/agcU0fYJcPBtXzeaxpzDCsMeGnjrrsa18VvgAH9NF/m6DoC
SxR1ABDoBT+6O6maHHBPFLv6/qMgGBVyU3fAz0wmN59K1/064LLVUJk1uhnEOUaKzIP1
dzMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1743282403; x=1743887203;
h=mime-version:message-id:date:subject:to:from:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=5OmPEAGF5FAZF2gqT7yvlQtV3bHMLWwm8+xF/qCiOmQ=;
b=ElBqrO4NwEGBpXX9XqRamkVUbYDuuKVkBavk4PF0rh3Lxy5nwuRVhqwAzBbyUQve+s
I9IGhoUio+kSukHy95Fg2dqyU3ugkvX8YbUBieHAwYFcSLOeockgBruFW2d+YAcE5YOG
VIZg/xSJAzLCsgyTpN/dzTPawmddcgUYlP1mAMX+Iun6vOxD0yqbkH+qZXbxbC5K3U2I
4u4+PqajTAOswS2aQelr7f1y3sVraPhh5SCpm6OYhEHg5b1QY062ZAfRkTU4zjea+sLi
BxEcScXvaws/JWQvHdiMhSbC8kArbRe5FgpkNqNalHGnfmqMHolL2iUu5JHZGfHuDpeb
5EUg==
X-Gm-Message-State: AOJu0Yz5T+SmcF0zJQguXwHACy1sxNWFk5ZTZmY56ZeZ6Dy7uWDnBIXc
+JjYoD2EPAMNLsGzaxJhUBXXc8kvhpobcB7/ZLu2Tb1eHCDc9yDE/p9M2gA+
X-Gm-Gg: ASbGncsJ8SPWOY7dp+OziP2j4Hj8dJNuB3hqNvpyW04sK43Cw3Kb/8t1jWjAIO6Xvsg
6rThsySbAcABg2CK117N6UgO3mpCVRCJWbS8qWpKxWx4hlXbJoTE8++mydV6FLnymK/i49iPmA0
GJWltaKtLiYNC7huCBNiiEykko92+DTAGP7jgU7Bmnv3nU9DHR6c8UAeJLOna1Z8XxnA66Ig8eO
o9N/k/fCqhmBPfbOvY3dU27Tr2I9Q4v3Fx+P16/habyvVX6LSQmMC2ERjnpQSZCUUmLDsSmIUN+
vks4HmOi9Ov7rWUmMweJrnyz2wGi9sdDiq/ZRSH5RdGZs4l8Iam1uE8j21neLrJlI331JL7+5of
18knasXdeDg==
X-Google-Smtp-Source: AGHT+IHssCiNAyN8Rvvk618sYNNhhrsiz9Mu+eZRowHYQVsJsKyri5QexSH+BAtHybRxpAI+0f0C2g==
X-Received: by 2002:a17:906:6a0b:b0:ac3:8aa0:9d70 with SMTP id
a640c23a62f3a-ac738c6efc4mr282064466b.51.1743282402641;
Sat, 29 Mar 2025 14:06:42 -0700 (PDT)
Received: from localhost (0x573d6713.static.cust.fastspeed.dk. [87.61.103.19])
by smtp.gmail.com with UTF8SMTPSA id
a640c23a62f3a-ac71961f8b7sm382387066b.121.2025.03.29.14.06.41
for <bug-gnu-emacs@HIDDEN>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 29 Mar 2025 14:06:42 -0700 (PDT)
From: "Paul D. Nelson" <ultrono@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Improve foldout-exit-fold behavior with negative argument
Date: Sat, 29 Mar 2025 22:06:40 +0100
Message-ID: <uxsg7ttt7beecf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::62e;
envelope-from=ultrono@HIDDEN; helo=mail-ej1-x62e.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)
--=-=-=
Content-Type: text/plain
The foldout-* commands, available in outline-minor-mode, give a way to
zoom in and out of "folds", which are subtrees defined by the outline
structure. To follow along with this email, start by doing
foldout-zoom-subtree (C-c @ C-z) on a subtree (e.g., an elisp defun).
By default, foldout-exit-fold (C-c @ C-x) exits one fold, hides the text
that was in that fold (outline-hide-subtree), moves point to the
heading, and recenters. When invoked with a negative prefix argument
like C-- C-c @ C-x, the command instead
(1) exits one fold without hiding the text,
(2) moves point to the bottom of the fold, and
(3) recenters.
I think that better behavior would be to skip steps (2) and (3), so that
the point stays put and the window view does not change.
[Step (2) seems incidental rather than by design, so "skip" really means
"counter".]
Advantages of omitting (2) are:
- We don't lose our place when zooming out.
- If we zoom in and zoom out (C-c @ C-z, C-- C-c @ C-x), then point
doesn't move.
- Consistency with other outline/foldout commands that preserve "point
being on a heading".
Regarding (3), recentering helps us reorient when hiding an exited fold,
but is disruptive when the text remains visible.
We retain the flexibility to imitate the old behavior using M-> and C-l.
The change could be guarded by a defcustom, but it seems to me like a
clear improvement. I'd be happy to learn if I missed some scenario
where it is not.
Any feedback would be welcome.
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
filename=0001-Improve-foldout-exit-fold-with-negative-arg.patch
From a384ca50aeb65c976df6e536d54f96acf1d143d2 Mon Sep 17 00:00:00 2001
From: Paul Nelson <ultrono@HIDDEN>
Date: Sat, 29 Mar 2025 19:07:13 +0100
Subject: [PATCH] Improve foldout-exit-fold with negative arg
* lisp/foldout.el (foldout-exit-fold): When called with a
negative prefix argument (so that the exited fold is not
hidden), preserve the position of point and do not recenter.
---
etc/NEWS | 5 +++++
lisp/foldout.el | 9 ++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 1bd2fd6d486..7a3419ee59a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1367,6 +1367,11 @@ string instead of preprending it and 'tmm-mid-prompt' to said entry.
** Foldout
+*** Improved behavior of 'foldout-exit-fold' with negative prefix argument.
+When 'foldout-exit-fold' is called with a negative argument (so that the
+exited fold remains visible), the position of point and window view are
+preserved.
+
---
*** New command 'foldout-widen-to-current-fold'.
This command widens the view to the current fold level when in a fold,
diff --git a/lisp/foldout.el b/lisp/foldout.el
index fcc5e294561..748f56c0c9c 100644
--- a/lisp/foldout.el
+++ b/lisp/foldout.el
@@ -290,10 +290,10 @@ foldout-exit-fold
"Return to the ARG'th enclosing fold view. With ARG = 0 exit all folds.
Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are
-exited and text is left visible."
+exited, text is left visible, and point position is preserved."
(interactive "p")
(let ((hide-fold t) start-marker end-marker
- beginning-of-heading end-of-subtree)
+ beginning-of-heading end-of-subtree (original-point (point)))
;; check there are some folds to leave
(if (null foldout-fold-list)
@@ -369,7 +369,10 @@ foldout-exit-fold
(if end-marker
(1- (marker-position end-marker))
(point-max)))))
- (recenter)
+
+ (if hide-fold
+ (recenter)
+ (goto-char original-point))
;; update the mode line
(foldout-update-mode-line)))
--
2.39.3 (Apple Git-145)
--=-=-=--
"Paul D. Nelson" <ultrono@HIDDEN>:bug-gnu-emacs@HIDDEN.
Full text available.bug-gnu-emacs@HIDDEN:bug#77370; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.