bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19493: [PATCH] Fix trailing ... for outline-toggle-children


From: Oleh Krehel
Subject: bug#19493: [PATCH] Fix trailing ... for outline-toggle-children
Date: Fri, 16 Jan 2015 15:12:30 +0100

> Hi! This piece of code doesn't make sense to me:
>
> On 01/03/2015 03:04 AM, Oleh Krehel wrote:
>
> -  (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp)))
> +  (if (and (bolp) (or outline-blank-line (eobp))
> +           (not (bobp)) (not (eobp)))
>
> The second condition already checks for `eobp', so apparently the function
> is supposed to handle the end-of-buffer case.
>
> If that was an error in someone's thinking, the patch should correct that as
> well. But maybe the fix should do something in the caller instead.

You're right, I hadn't noticed before.
Alternatively, `show-entry' can be patched like this:

    (defun show-entry ()
      "Show the body directly following this heading.
    Show the heading too, if it is currently invisible."
      (interactive)
      (save-excursion
        (outline-back-to-heading t)
        (outline-flag-region
         (1- (point))
         (progn
           (outline-next-preface)
           (min (1+ (point))
                (point-max))) nil)))

The point is just not to have a single trailing hidden char, which
results from passing different bounds to `outline-flag-region' when
hiding and unhiding.

Oleh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]