Skip to content

Commit

Permalink
yas--document-symbols: respect level arg, raise to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
npostavs committed Dec 24, 2013
1 parent e190b08 commit df58222
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions doc/snippet-reference.org
Expand Up @@ -2,14 +2,11 @@

#+TITLE: Reference

* Reference

#+BEGIN_SRC emacs-lisp :exports results :results value raw
(yas--document-symbols 2 `("Interactive functions" . ,#'interactive-form)
(yas--document-symbols 1 `("Interactive functions" . ,#'interactive-form)
`("Customization variables" . ,#'(lambda (sym)
(and (boundp sym)
(get sym 'standard-value))))
`("Useful functions" . ,#'fboundp)
`("Useful variables" . ,#'boundp))
#+END_SRC

5 changes: 3 additions & 2 deletions doc/yas-doc-helper.el
Expand Up @@ -91,7 +91,8 @@
body))))

(defun yas--document-symbols (level &rest names-and-predicates)
(let ((sym-lists (make-vector (length names-and-predicates) nil)))
(let ((sym-lists (make-vector (length names-and-predicates) nil))
(stars (make-string level ?*)))
(loop for sym in yas--exported-syms
do (loop for test in (mapcar #'cdr names-and-predicates)
for i from 0
Expand All @@ -100,7 +101,7 @@
(return))))
(loop for slist across sym-lists
for name in (mapcar #'car names-and-predicates)
concat (format "\n** %s\n" name)
concat (format "\n%s %s\n" stars name)
concat (mapconcat (lambda (sym)
(yas--document-symbol sym (1+ level)))
slist "\n\n"))))
Expand Down

0 comments on commit df58222

Please sign in to comment.