Re: Displaying outline-heading-alist and outline-regexp in a dedicated buffer

uzibalqa <[email protected]> Mon, 13 Jul 2026 10:31:09 +0000
Newsgroups gmane.emacs.help
Message-ID <GqzdCtvDNLEgeauGTajDuQtOxrB916f5cf7YkgFyBkEjZ1IhNtKHwCwcyJ89BG5e1lFybX-anpdDy2a2kN7qpE-Ajtt8dPxvmZYFlZr7ex4=@proton.me>
On Monday, July 13th, 2026 at 6:00 PM, Jean Louis <[email protected]> wrote:

> * Heime <[email protected]> [2026-07-10 04:57]:
> > How may I print the values of outline-heading-alist and outline-regexp
> > in a dedicated buffer?
> 
> (defun my-print-outline-variables ()
>   "Display outline-heading-alist and outline-regexp in a dedicated buffer."
>   (interactive)
>   (let ((buf (get-buffer-create "*Outline Variables*")))
>     (with-current-buffer buf
>       (erase-buffer)
>       (insert (format "Outline Variables\n")
>               (format "=================\n\n")
>               (format "outline-regexp:\n  %s\n\n"
>                       (prin1-to-string outline-regexp))
>               (format "outline-heading-alist:\n  %s\n"
>                       (prin1-to-string outline-heading-alist))))
>     (display-buffer buf)))
> 
> --
> Jean Louis
 
The difficulty is that outline-heading-alist and outline-regexp 
are buffer local variables.  This means that the values are obtained
from current buffer buf rather than the buffer from where the command
was invoked.