diff options
author | Tom Willemse | 2013-12-28 20:54:55 +0100 |
---|---|---|
committer | Tom Willemse | 2013-12-28 20:54:55 +0100 |
commit | d7a276e89691b0ce24d87c8c1d8566a21764c237 (patch) | |
tree | 5e8f72952313025aa36259bee594b200d3d6c173 | |
parent | ef969855ccfd6e9464d2cbd41b362b72113c2609 (diff) | |
download | edocs-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.el | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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) |