summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-12-28 20:54:55 +0100
committerGravatar Tom Willemse2013-12-28 20:54:55 +0100
commitd7a276e89691b0ce24d87c8c1d8566a21764c237 (patch)
tree5e8f72952313025aa36259bee594b200d3d6c173
parentef969855ccfd6e9464d2cbd41b362b72113c2609 (diff)
downloadedocs-d7a276e89691b0ce24d87c8c1d8566a21764c237.tar.gz
edocs-d7a276e89691b0ce24d87c8c1d8566a21764c237.zip
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.
-rw-r--r--edocs.el13
1 files 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)