Function: actypes::rfc-toc

actypes::rfc-toc is an interactive and byte-compiled function defined in hactypes.el.

Signature

(actypes::rfc-toc &optional BUF-NAME OPOINT SECTIONS-START)

Documentation

Compute and display summary of an Internet rfc in BUF-NAME.

Assume point has already been moved to start of region to summarize. Optional OPOINT is point to return to in BUF-NAME after displaying summary; otherwise, point remains in the toc occurrence buffer. Optional SECTIONS-START limits toc entries to those after that point.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hactypes.el
(defact rfc-toc (&optional buf-name opoint sections-start)
  "Compute and display summary of an Internet rfc in BUF-NAME.
Assume point has already been moved to start of region to summarize.
Optional OPOINT is point to return to in BUF-NAME after displaying
summary; otherwise, point remains in the toc occurrence buffer.
Optional SECTIONS-START limits toc entries to those after that point."
  (interactive)
  (let ((sect-regexp "^[ \t]*[1-9][0-9]*\\.[0-9.]*[ \t]+[^ \t\n\r]")
	(rfc-buf-name (buffer-name))
	(toc-buf-name (format "*toc %s*" buf-name)))
    (when (get-buffer toc-buf-name)
      (kill-buffer toc-buf-name))
    (occur sect-regexp nil (list (cons sections-start (point-max))))
    (select-window (get-buffer-window "*Occur*"))
    (rename-buffer toc-buf-name)
    (re-search-forward "^[ ]*[0-9]+:" nil t)
    (beginning-of-line)
    (let ((inhibit-read-only t)
	  (buffer-read-only))
      (remove-text-properties (point-min) (point) '(read-only))
      (delete-region (point-min) (point))
      (insert "Sections of " rfc-buf-name ":\n")
      (set-buffer-modified-p nil))
    (when opoint
      (switch-to-buffer buf-name)
      (goto-char opoint))))