mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +00:00
yas--document-symbols: respect level arg, raise to 1
This commit is contained in:
parent
e190b088f0
commit
df58222fe6
@ -2,14 +2,11 @@
|
|||||||
|
|
||||||
#+TITLE: Reference
|
#+TITLE: Reference
|
||||||
|
|
||||||
* Reference
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp :exports results :results value raw
|
#+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)
|
`("Customization variables" . ,#'(lambda (sym)
|
||||||
(and (boundp sym)
|
(and (boundp sym)
|
||||||
(get sym 'standard-value))))
|
(get sym 'standard-value))))
|
||||||
`("Useful functions" . ,#'fboundp)
|
`("Useful functions" . ,#'fboundp)
|
||||||
`("Useful variables" . ,#'boundp))
|
`("Useful variables" . ,#'boundp))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -91,7 +91,8 @@
|
|||||||
body))))
|
body))))
|
||||||
|
|
||||||
(defun yas--document-symbols (level &rest names-and-predicates)
|
(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
|
(loop for sym in yas--exported-syms
|
||||||
do (loop for test in (mapcar #'cdr names-and-predicates)
|
do (loop for test in (mapcar #'cdr names-and-predicates)
|
||||||
for i from 0
|
for i from 0
|
||||||
@ -100,7 +101,7 @@
|
|||||||
(return))))
|
(return))))
|
||||||
(loop for slist across sym-lists
|
(loop for slist across sym-lists
|
||||||
for name in (mapcar #'car names-and-predicates)
|
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)
|
concat (mapconcat (lambda (sym)
|
||||||
(yas--document-symbol sym (1+ level)))
|
(yas--document-symbol sym (1+ level)))
|
||||||
slist "\n\n"))))
|
slist "\n\n"))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user