Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun eldocgen-process-files (files)
- "Process each file in FILES in temp buffer. Return the defuns."
- (with-temp-buffer
- (dolist (x files)
- (insert-file-contents x))
- (goto-char (point-min))
- (fetch-defuns (current-buffer))))
- (defun display-defuns (&optional files)
- "Display the defuns.
- Generate docs for FILES (which must be a list of files) if supplied.
- If FILES is not supplied, use `buffer-file-name' instead. Ditto
- if called interactively.
- Example:
- - With a list of files:
- (display-defuns '(\"~/foo.el\" \"~/bar.el\")
- - Using `find-lisp-find-files':
- (require 'find-lisp)
- (display-defuns (find-lisp-find-files \"~/.emacs.d\" \"\\\\.el$\"))"
- (interactive)
- (let ((out-buf (if files
- "*Generated docs*"
- (format "*Generated docs for: %s*"
- (file-name-nondirectory buffer-file-name))))
- (files (if files files (list buffer-file-name))))
- (get-buffer-create out-buf)
- (with-current-buffer out-buf
- (erase-buffer)
- ;; TODO: provide filename.
- (insert (eldocgen-process-files files))
- (if (fboundp 'org-mode) (org-mode) (outline-mode))
- (goto-char (point-min))
- (indent-region (point-min) (point-max)))
- (display-buffer out-buf)))
- (provide 'elisp-documenter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement