all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 69511@debbugs.gnu.org
Subject: bug#69511: Restore any state after revert-buffer
Date: Tue, 04 Jun 2024 09:37:18 +0300	[thread overview]
Message-ID: <86frtti57l.fsf@mail.linkov.net> (raw)
In-Reply-To: <86y1b0r00p.fsf@mail.linkov.net> (Juri Linkov's message of "Sat,  02 Mar 2024 19:55:50 +0200")

close 69511 30.0.50
thanks

> One of numerous examples is to save and restore
> hidden outlines after doing 'revert-buffer':
>
> (add-hook 'Buffer-menu-mode-hook
>           (lambda ()
>             (add-hook 'revert-buffer-state-functions
>                       (lambda ()
>                         (let ((regexp (outline-hidden-headings-regexp)))
>                           (when regexp
>                             (lambda ()
>                               (outline-hide-by-heading-regexp regexp))))))))
>
> Currently this handles outlines only in the buffer list.
> But probably this settings should be added to outline-minor-mode.

This is now adapted to outline-minor-mode.
(xref needs changes as well, so the patch is sent to bug#49731).

> And here is the immediate need to use it to rehighlight the outlines
> after reverting the buffer list:
>
> diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
> +  (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t)
> +  (add-hook 'revert-buffer-state-functions
> +            (lambda ()
> +              (when (bound-and-true-p outline-minor-mode)
> +                (lambda ()
> +                  (outline-minor-mode-highlight-buffer))))))

And this was moved to outline-minor-mode as well.





      parent reply	other threads:[~2024-06-04  6:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 17:55 bug#69511: Restore any state after revert-buffer Juri Linkov
2024-03-02 18:11 ` Eli Zaretskii
2024-03-03  7:59   ` Juri Linkov
2024-03-03  9:04     ` Eli Zaretskii
2024-03-03 17:28       ` Juri Linkov
2024-03-03 17:43         ` Eli Zaretskii
2024-03-03 17:55           ` Juri Linkov
2024-03-03 18:46             ` Eli Zaretskii
2024-06-03  6:35               ` Juri Linkov
2024-06-03 16:55                 ` Juri Linkov
2024-03-03  2:46 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-03  7:55   ` Juri Linkov
2024-03-03  9:03     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04  6:37 ` Juri Linkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86frtti57l.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=69511@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.