From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#41198: bug#41130: bug#41198: 27.0.60; [PATCH] heading cycling command for outline Date: Sat, 17 Oct 2020 20:28:25 -0400 Message-ID: <3346E33F-BFF2-4DD7-8411-F852CCF3C830@gmail.com> 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> <871rhwh91d.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8574"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41130@debbugs.gnu.org, Lars Ingebrigtsen , Stefan Kangas , 41198@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 18 02:29: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 1kTwZY-00021j-2c for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 02:29:16 +0200 Original-Received: from localhost ([::1]:39054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTwZW-0000BK-MX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 20:29:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTwZL-0000BA-2e for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 20:29:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTwZK-0003xL-Pb for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 20:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTwZK-0005Gc-Mp for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 20:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Oct 2020 00:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41198-submit@debbugs.gnu.org id=B41198.160298091620197 (code B ref 41198); Sun, 18 Oct 2020 00:29:02 +0000 Original-Received: (at 41198) by debbugs.gnu.org; 18 Oct 2020 00:28:36 +0000 Original-Received: from localhost ([127.0.0.1]:35801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTwYt-0005Fc-SH for submit@debbugs.gnu.org; Sat, 17 Oct 2020 20:28:36 -0400 Original-Received: from mail-io1-f45.google.com ([209.85.166.45]:45655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTwYr-0005FJ-IH; Sat, 17 Oct 2020 20:28:33 -0400 Original-Received: by mail-io1-f45.google.com with SMTP id n6so8638813ioc.12; Sat, 17 Oct 2020 17:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PQj8PTY7A074Gu4+wE2UYND0Fjeuvf261Y+LENgyzQs=; b=jMSWxUjwlvIU771mBDPO6qxDiSuGJi2RZSwHqZNW6oWCObrR0Ucw2nQnDk1rzU41Tr X4HX9Nuj/KjgfkehQmi8qmD1zmB/dlJnKx9t9gMHT//rS1DoGh8dQOshSpmmMTOgtF2V /+Dy34rKWGAniZX5FfQie9uD2HIKw6rdaPATg5sNKL6SnUSZ+8UaYcuGEvpkB9eAYZwQ 1P1BKvFimxUeSxdcqObESZEPdlOCUPFuuSs4KdW/UaK626rT1DehIU0A50+XeYPgjhhW MSge9IT+au8kf2rMHpx+Fg+6zRpoY9H5tPFGKR7X878NmkSyQApDmI2ym37WzQIiMUPY LBEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=PQj8PTY7A074Gu4+wE2UYND0Fjeuvf261Y+LENgyzQs=; b=ZnJjQIxzTS0a2522Gt8E7oQ7aGH4WYxDmBThY2uXEieM2pL7t8bR35H3BDFVDi/eht U8NKH11OzG/4GfxzJmhZl34QOQ7uPIgnf7W2a/EF+6MY0AjqJ4xlSTC7bsqr1I9A5O2C 7hDxVs3/f6gCs83peO2LBqV+nQrghd78IXg8x19CY06i1ODkply3vODH8soXnJ99PBHD G4hivTqElLXZLXCBd2Zx6kIbRGketgmC96AMWFL536iAJagQBNxNzXSp1GiJLMGJ5pXJ fLM/uaQXU+5s2GnHi33js3zyH+tjpHtAaUfauikinazuBnVuUDxjylsHzPJPot3vpZwo 1nHA== X-Gm-Message-State: AOAM533e2ixnK8LKlsTjl/onNfBYvyHrostmRrB62ap7ZxPQAQu8dw/Z m65JqseIf9BqgodkTE2Np1M= X-Google-Smtp-Source: ABdhPJwgrvVJ/26v0OQg1gqx7n4JiTNaafkg8jvthWhp+feMS30u5Hpv1Ioyt2xLuOyKA/uUquEFFg== X-Received: by 2002:a6b:4014:: with SMTP id k20mr6746408ioa.177.1602980907707; Sat, 17 Oct 2020 17:28:27 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:d02a:1c66:2033:eacb? ([2601:98a:4200:9210:d02a:1c66:2033:eacb]) by smtp.gmail.com with ESMTPSA id e13sm6113330iob.43.2020.10.17.17.28.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2020 17:28:27 -0700 (PDT) In-Reply-To: <871rhwh91d.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3608.120.23.2.4) 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:190843 Archived-At: > On Oct 17, 2020, at 4:30 PM, Juri Linkov wrote: >=20 >>> + (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))) >>=20 >> 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. >>=20 >> Altering the functions to not error out in these situations would be >> better. >=20 > 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. I can modify outline code to signal a signal (say = =E2=80=98outline-before-first-heading) rather than an error, and handle = that signal specifically. How=E2=80=99s that? Yuan=