From d7a276e89691b0ce24d87c8c1d8566a21764c237 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 28 Dec 2013 20:54:55 +0100 Subject: Don't render "private" symbols What constitutes a "private" symbol is determined by the new `edocs-private-regexp' variable. Any symbol that matches this regexp is considered private and not included in the formatted output. --- edocs.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/edocs.el b/edocs.el index 0fabdd4..f9e5d3e 100644 --- a/edocs.el +++ b/edocs.el @@ -40,6 +40,9 @@ (defvar edocs-generate-only-body nil "Whether to genereate only the body and no header/footer info.") +(defvar edocs-private-regexp "--" + "Regular expression to identify private parts of a module's API.") + (defconst edocs--symbol-type-map #s(hash-table size 8 test equal data ("defclass" "Class" @@ -69,10 +72,12 @@ etc." " " (group (1+ (not (any space ?\n ?\))))))) nil :noerror) - (setq ls (cons (cons (buffer-substring-no-properties - (match-beginning 1) (match-end 1)) - (buffer-substring-no-properties - (match-beginning 2) (match-end 2))) ls)))) + (let ((type (buffer-substring-no-properties + (match-beginning 1) (match-end 1))) + (name (buffer-substring-no-properties + (match-beginning 2) (match-end 2)))) + (unless (string-match edocs-private-regexp name) + (setq ls (cons (cons type name) ls)))))) (reverse ls))) (defun edocs--get-docs (type name) -- cgit v1.2.3-54-g00ecf