GNU bug report logs -
#41130
outline-mode: Add new commands like org-cycle and org-global-cycle
Previous Next
Reported by: Stefan Kangas <stefankangas <at> gmail.com>
Date: Thu, 7 May 2020 20:55:02 UTC
Severity: wishlist
Tags: patch
Merged with 41198
Found in version 27.0.60
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #134 received at 41130 <at> debbugs.gnu.org (full text, mbox):
> On Oct 17, 2020, at 4:30 PM, Juri Linkov <juri <at> linkov.net> wrote:
>
>>> + (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.
I can modify outline code to signal a signal (say ‘outline-before-first-heading) rather than an error, and handle that signal specifically. How’s that?
Yuan
This bug report was last modified 4 years and 156 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.