[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display docstrings present in a buffer
From: |
Heime |
Subject: |
Re: Display docstrings present in a buffer |
Date: |
Fri, 16 Aug 2024 02:01:07 +0000 |
On Friday, August 16th, 2024 at 1:45 PM, Heime <heimeborgia@protonmail.com>
wrote:
> Is there a way to display docstrings in a buffer ? On at least to the first
> blank line.
Did this but the buffer remains blank
(defun display-defun-lines ()
"Display lines starting with `(defun` in a new buffer."
(interactive)
(let ((regexp "^\\s-*(defun.*")
(output-buffer (get-buffer-create "*Defun Lines*")))
(with-current-buffer output-buffer
(erase-buffer) ;; Clear previous contents
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(let ((line (match-string-no-properties 1)))
(insert (concat line "\n"))))
(display-buffer output-buffer))))
>