summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-12-28 17:03:16 +0100
committerGravatar Tom Willemse2013-12-28 17:19:40 +0100
commit6006120614c6f6a56a62f999c38a7c638e6b1c6d (patch)
treefc4a10749678281f58d0cf0f2e17ef64d9b312de
parent4297d6955a0cf08253173932d302732bf87fb77c (diff)
downloadedocs-6006120614c6f6a56a62f999c38a7c638e6b1c6d.tar.gz
edocs-6006120614c6f6a56a62f999c38a7c638e6b1c6d.zip
Micro refactor
-rw-r--r--edocs.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/edocs.el b/edocs.el
index 6cd0db6..46d7c8a 100644
--- a/edocs.el
+++ b/edocs.el
@@ -166,6 +166,13 @@ See the docstring for `edocs--module-name' for more information."
(package-desc-summary package-info)
(aref package-info 2)))
+(defun edocs--normalize (docs)
+ "Make sure DOCS is a properly formatted list."
+ (if (or (not (listp docs))
+ (not (listp (cdr docs))))
+ (list docs)
+ docs))
+
(defun edocs--format-symbol (symbol)
"Format the information in SYMBOL."
(let ((docs (edocs--get-docs (car symbol) (cdr symbol))))
@@ -182,10 +189,7 @@ See the docstring for `edocs--module-name' for more information."
(edocs--with-tag "p" nil
(insert (or (edocs--format-doc doc)
"Not documented."))))))
- (if (or (not (listp docs))
- (not (listp (cdr docs))))
- (list docs)
- docs))))
+ (edocs--normalize docs))))
(defun edocs-generate ()
"Generate nice-looking documentation for a module or file."