From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41130: bug#41198: 27.0.60; [PATCH] heading cycling command for outline Date: Sat, 17 Oct 2020 23:30:06 +0300 Organization: LINKOV.NET Message-ID: <871rhwh91d.fsf@mail.linkov.net> References: <452A6049-893A-4E7E-8349-541D276FAD19@gmail.com> <92D944EF-6BF9-4635-AC05-4B51B386D5C7@gmail.com> <878sca7r43.fsf@gnus.org> <87mu0ozntx.fsf@mail.linkov.net> <87v9fatwdi.fsf@mail.linkov.net> <87sgadz7cw.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13649"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 41130@debbugs.gnu.org, Yuan Fu , Stefan Kangas , 41198@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 17 22:52:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTtBX-0003ST-Uc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 22:52:15 +0200 Original-Received: from localhost ([::1]:40010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTtBW-0003RO-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 16:52:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTtBK-0003RB-8A for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTtBJ-0006co-Uu for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTtBJ-0006SH-Rs for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Oct 2020 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41130-submit@debbugs.gnu.org id=B41130.160296789824774 (code B ref 41130); Sat, 17 Oct 2020 20:52:01 +0000 Original-Received: (at 41130) by debbugs.gnu.org; 17 Oct 2020 20:51:38 +0000 Original-Received: from localhost ([127.0.0.1]:35646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTtAw-0006RU-Do for submit@debbugs.gnu.org; Sat, 17 Oct 2020 16:51:38 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTtAt-0006RD-Ub; Sat, 17 Oct 2020 16:51:36 -0400 X-Originating-IP: 91.129.102.160 Original-Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160]) (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 3BBD920003; Sat, 17 Oct 2020 20:51:26 +0000 (UTC) In-Reply-To: <87sgadz7cw.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 17 Oct 2020 08:36:47 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190837 Archived-At: >> + (condition-case nil >> + (pcase (outline--cycle-state) >> + ('hide-all >> + (if (outline-has-subheading-p) >> + (progn (outline-show-children) >> + (message "Only headings")) >> + (outline-show-subtree) >> + (message "Show all"))) >> + ('headings-only >> + (outline-show-subtree) >> + (message "Show all")) >> + ('show-all >> + (outline-hide-subtree) >> + (message "Hide all"))) >> + ;; If error: "Before first heading" occurs, ignore it. >> + (error nil))) > > This is basically an `ignore-errors' around a whole bunch of code, used > as a program flow mechanism, and that's always awkward, because it hides > real errors in the code. > > Altering the functions to not error out in these situations would be > better. Like 'outline-back-to-heading' has an optional argument 'invisible-ok', maybe a new argument named 'error-ok' or 'outside-ok' could be added to not error out when point is outside of the outline tree.