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

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

bug#67287: closed (29.1; hs-set-up-overlay messes up indent-sexp)


From: GNU bug Tracking System
Subject: bug#67287: closed (29.1; hs-set-up-overlay messes up indent-sexp)
Date: Fri, 22 Dec 2023 14:52:02 +0000

Your message dated Fri, 22 Dec 2023 06:51:28 -0800
with message-id 
<CADwFkmm-QESte9+rWeKCHfU+beipvKjxFxubBO3Zvri+3J6dLg@mail.gmail.com>
and subject line Re: bug#67287: 29.1; hs-set-up-overlay messes up indent-sexp
has caused the debbugs.gnu.org bug report #67287,
regarding 29.1; hs-set-up-overlay messes up indent-sexp
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
67287: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67287
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.1; hs-set-up-overlay messes up indent-sexp Date: Sun, 19 Nov 2023 16:35:31 -0300
Greetings!

When setting `hs-set-up-overlay' to a custom value, such as the one in
the docstring for the variable, it messes up the behaviour of
`indent-sexp' when it is called "before" the s-expression.

Steps to reproduce:

1. Go to any lisp buffer e.g. *scracth*
2. Paste the following piece of code

    (setq hs-set-up-overlay
          (lambda (ov)
            (when (eq 'code (overlay-get ov 'hs))
              (overlay-put ov 'display
                           (propertize
                            (format " ... <%d>"
                                    (count-lines (overlay-start ov)
                                                 (overlay-end ov)))
                            'face 'font-lock-type-face)))))

3. Evaluate it
4. Enable `hs-minor-mode'
5. Hide the block with `hs-hide-block' (need to be on the beginning line
   of the forms)
6. Move point either to the first opening parenthesis or the the empty
   line before the `setq' form

   (setq
   ^----

7. Call `indent-sexp'
8. Open the block with `hs-show-block'

You should see the following:

    (setq hs-set-up-overlay
          (lambda (ov)
            (when (eq 'code (overlay-get ov 'hs))
              (overlay-put ov 'display
                           (propertize
                            (format " ... <%d>"
                                    (count-lines (overlay-start ov)
                                                 (overlay-end ov)))
                            )

I tried to investigate why it does that, but couldn't really get to the
root cause. It seems that its only affected when we're setting the
`display' prop of the overlay, but I couldn't confirm it either.

Best regards,

-- 
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)

--- End Message ---
--- Begin Message --- Subject: Re: bug#67287: 29.1; hs-set-up-overlay messes up indent-sexp Date: Fri, 22 Dec 2023 06:51:28 -0800
Eli Zaretskii <eliz@gnu.org> writes:

> This is not a bug.

I'm therefore closing this bug report.


--- End Message ---

reply via email to

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