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#41130: bug#41198: 27.0.60; [PATCH] heading cycling command for outline Date: Thu, 15 Oct 2020 23:12:01 -0400 Message-ID: <94C08AB6-E780-45E1-918A-B47FBFA72782@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> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_D79B5D4E-194F-4D8E-B3E5-A927D5A4BB03" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22771"; 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 Fri Oct 16 05:13:14 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 1kTGB7-0005oV-QL for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 05:13:13 +0200 Original-Received: from localhost ([::1]:51710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTGB6-0000hg-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Oct 2020 23:13:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTGAw-0000f4-RP for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2020 23:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTGAw-0004Bn-Ga for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2020 23:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTGAw-0007jW-9I for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2020 23:13: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: Fri, 16 Oct 2020 03:13:02 +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.160281793129661 (code B ref 41130); Fri, 16 Oct 2020 03:13:02 +0000 Original-Received: (at 41130) by debbugs.gnu.org; 16 Oct 2020 03:12:11 +0000 Original-Received: from localhost ([127.0.0.1]:57138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTGA6-0007iK-OI for submit@debbugs.gnu.org; Thu, 15 Oct 2020 23:12:10 -0400 Original-Received: from mail-il1-f169.google.com ([209.85.166.169]:40782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTGA5-0007i5-Gf; Thu, 15 Oct 2020 23:12:09 -0400 Original-Received: by mail-il1-f169.google.com with SMTP id y16so1067409ila.7; Thu, 15 Oct 2020 20:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=BXSWIjhGvkand8H1R0Ox+YnU1FPUC38M64hcQ/VDATw=; b=gDb/avBK+R/wmLtXlCEykzjTePtX3pIakMUOnMQO5ztkFpE5t1Lj4Enj8Sc5kfb/G0 Ia5UP/yvzdyYHUk2/V/eqV+1fP4fkRQgKC2Q7l1cFiHFdiqbTo3JKLq+yla24FA62h1k tzGZs/kr5KBz9RCVrjambA6nmaaTSi9TE5OuQ2ozvQN7TAvIbKiRiue23KcgLV6sNYCX gVR1mE6weL8JuVBseyMlV6X/M5Xfi8RYe3teFLYxKz8B5qiu2jLCOuMzU891STIK9Xho iU5JjkYYx+salgknfdB+U1ZHB9BO21FZIxk0LsZqwydUVkEtI17013vpSAIa3jXOsNN8 DTwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=BXSWIjhGvkand8H1R0Ox+YnU1FPUC38M64hcQ/VDATw=; b=r6OT5uuP30gY9XTAOGWQy+ZFUJ5ApXMsoOJbR/yBZKhClKb8SIzTh3w81YFreDscOJ IbRVyI5xVmpBQ7BOslTn8VkTXYClgEJQukFB7y7KqMdeUaPiV2lJs1YKPFT17cGQOQbB +8epFC9vhmGtl0qN95pINgl8fVWZ+dhNKxM/ioHZXp6ed3HwIIVmr3pjTaLwxJvj/z7X mQGjchQVeHZ/CJBWmtyaFoBvqAU+D5KQYALSpm+SkB2r0Q2yzarbkQ7eDEt9ElJxWhOA Rxa8wGgctT80LlN0h4jl6whxTW8cNuzitaJNT5OuVYqDDql1pQ9mNza5djCSd7crAfw2 EBdw== X-Gm-Message-State: AOAM533DTvDRlkwtoZZhavgwyktiQ7nnU9jKQeis0SjXnr6RKDy7fnM1 RkI3B9kyMq2rM//qp7U17Sw= X-Google-Smtp-Source: ABdhPJyhrPwTvrBEGP8+A6zJwui9zF+A+7xRIrRsRU8WyFXqMkyAcjMCWfSzSE0uIKl87JhbVZW6rg== X-Received: by 2002:a05:6e02:582:: with SMTP id c2mr1209144ils.69.1602817923763; Thu, 15 Oct 2020 20:12:03 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:8954:af62:96c7:c6? ([2601:98a:4200:9210:8954:af62:96c7:c6]) by smtp.gmail.com with ESMTPSA id t26sm973580ioi.11.2020.10.15.20.12.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 20:12:02 -0700 (PDT) In-Reply-To: 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:190635 Archived-At: --Apple-Mail=_D79B5D4E-194F-4D8E-B3E5-A927D5A4BB03 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 15, 2020, at 7:33 PM, Yuan Fu wrote: >=20 >=20 >=20 >> On Oct 14, 2020, at 3:24 PM, Juri Linkov wrote: >>=20 >>> Skimming this thread, it seemed that everybody was in agreement that >>> this was a good change, but the patch was never applied, so I did = that >>> now. >>=20 >> Now finally org keys are available in etc/NEWS, nice! >> But typing S-TAB at the beginning of etc/NEWS signals the error: >>=20 >> Debugger entered--Lisp error: (error "Before first heading") >> signal(error ("Before first heading")) >>=20 >> This is not how org-mode works - S-TAB doesn't fail before first = heading >> in org-mode. >=20 > Do you suggest to change it to a user-error? Or just be silent? >=20 This patch should suppresses errors in both commands. Let me use it for = a while and see if it works ok. Yuan --Apple-Mail=_D79B5D4E-194F-4D8E-B3E5-A927D5A4BB03 Content-Disposition: attachment; filename=outline-fix.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="outline-fix.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ef70c39d52a3aa53e95beb64f877da78daffb0f4=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Thu,=20= 15=20Oct=202020=2022:20:20=20-0400=0ASubject:=20[PATCH]=20Suppress=20= "Before=20first=20headings"=20error=20in=20outline-cycle=0A=0A*=20= lisp/outline.el=20(outline-cycle,=20outline-cycle-buffer):=20Suppress=20= error.=0A---=0A=20lisp/outline.el=20|=2041=20= ++++++++++++++++++++++-------------------=0A=201=20file=20changed,=2022=20= insertions(+),=2019=20deletions(-)=0A=0Adiff=20--git=20a/lisp/outline.el=20= b/lisp/outline.el=0Aindex=20a4ce9afb44..5e22850292=20100644=0A---=20= a/lisp/outline.el=0A+++=20b/lisp/outline.el=0A@@=20-1167,19=20+1167,22=20= @@=20outline-cycle=0A=20`Headings=20only'=20means=20show=20sub=20= headings=20but=20not=20their=20bodies.=0A=20`Show=20all'=20means=20show=20= all=20subheadings=20and=20their=20bodies."=0A=20=20=20(interactive)=0A-=20= =20(pcase=20(outline--cycle-state)=0A-=20=20=20=20('hide-all=0A-=20=20=20= =20=20(if=20(outline-has-subheading-p)=0A-=20=20=20=20=20=20=20=20=20= (progn=20(outline-show-children)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(message=20"Only=20headings"))=0A-=20=20=20=20=20=20=20= (outline-show-subtree)=0A-=20=20=20=20=20=20=20(message=20"Show=20= all")))=0A-=20=20=20=20('headings-only=0A-=20=20=20=20=20= (outline-show-subtree)=0A-=20=20=20=20=20(message=20"Show=20all"))=0A-=20= =20=20=20('show-all=0A-=20=20=20=20=20(outline-hide-subtree)=0A-=20=20=20= =20=20(message=20"Hide=20all"))))=0A+=20=20(condition-case=20nil=0A+=20=20= =20=20=20=20(pcase=20(outline--cycle-state)=0A+=20=20=20=20=20=20=20=20= ('hide-all=0A+=20=20=20=20=20=20=20=20=20(if=20= (outline-has-subheading-p)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (progn=20(outline-show-children)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(message=20"Only=20headings"))=0A+=20=20=20=20=20=20= =20=20=20=20=20(outline-show-subtree)=0A+=20=20=20=20=20=20=20=20=20=20=20= (message=20"Show=20all")))=0A+=20=20=20=20=20=20=20=20('headings-only=0A= +=20=20=20=20=20=20=20=20=20(outline-show-subtree)=0A+=20=20=20=20=20=20=20= =20=20(message=20"Show=20all"))=0A+=20=20=20=20=20=20=20=20('show-all=0A= +=20=20=20=20=20=20=20=20=20(outline-hide-subtree)=0A+=20=20=20=20=20=20=20= =20=20(message=20"Hide=20all")))=0A+=20=20=20=20;;=20If=20error:=20= "Before=20first=20heading"=20occurs,=20ignore=20it.=0A+=20=20=20=20= (error=20nil)))=0A=20=0A=20(defvar-local=20outline--cycle-buffer-state=20= 'show-all=0A=20=20=20"Internal=20variable=20used=20for=20tracking=20= buffer=20cycle=20state.")=0A@@=20-1190,12=20+1193,12=20@@=20= outline-cycle-buffer=0A=20=20=20(pcase=20outline--cycle-buffer-state=0A=20= =20=20=20=20('show-all=0A=20=20=20=20=20=20(save-excursion=0A-=20=20=20=20= =20=20=20(let=20((start-point=20(point)))=0A-=20=20=20=20=20=20=20=20=20= (while=20(not=20(eq=20(point)=20start-point))=0A-=20=20=20=20=20=20=20=20= =20=20=20(outline-up-heading=201))=0A-=20=20=20=20=20=20=20=20=20= (outline-hide-sublevels=0A-=20=20=20=20=20=20=20=20=20=20(progn=20= (outline-back-to-heading)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(funcall=20'outline-level)))))=0A+=20=20=20=20=20=20=20= (outline-hide-sublevels=0A+=20=20=20=20=20=20=20=20;;=20If=20error:=20= "Before=20first=20heading"=20occurs,=20ignore=20it.=0A+=20=20=20=20=20=20= =20=20(or=20(ignore-errors=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (outline-back-to-heading)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (outline-level))=0A+=20=20=20=20=20=20=20=20=20=20=20=201)))=0A=20=20=20=20= =20=20(setq=20outline--cycle-buffer-state=20'top-level)=0A=20=20=20=20=20= =20(message=20"Top=20level=20headings"))=0A=20=20=20=20=20('top-level=0A= --=20=0A2.27.0=0A=0A= --Apple-Mail=_D79B5D4E-194F-4D8E-B3E5-A927D5A4BB03--