[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 860858d 061/177: Merge pull request #436 from npostavs/aut
From: |
João Távora |
Subject: |
[elpa] master 860858d 061/177: Merge pull request #436 from npostavs/autodoc-1, 2 |
Date: |
Sat, 28 Mar 2015 15:40:50 +0000 |
branch: master
commit 860858de429775c17c74537805dbbc7906f8f994
Merge: fd3fa39 2c237cc
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Merge pull request #436 from npostavs/autodoc-1,2
Fix points 1 and 2 of #434
---
doc/yas-doc-helper.el | 9 ++++++---
yasnippet.el | 34 ++++++++++++++++++----------------
2 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/doc/yas-doc-helper.el b/doc/yas-doc-helper.el
index 67e5986..c940b20 100755
--- a/doc/yas-doc-helper.el
+++ b/doc/yas-doc-helper.el
@@ -46,10 +46,13 @@
(concat-lines ":PROPERTIES:"
(format ":CUSTOM_ID: %s" symbol)
":END:"))
- (body (or (cond ((boundp symbol)
+ (body (or (cond ((fboundp symbol)
+ (let ((doc-synth (car-safe (get symbol
'function-documentation))))
+ (if (functionp doc-synth)
+ (funcall doc-synth nil)
+ (documentation symbol t))))
+ ((boundp symbol)
(documentation-property symbol
'variable-documentation t))
- ((fboundp symbol)
- (documentation-property symbol
'function-documentation t))
(t
(format "*WARNING*: no symbol named =%s=" symbol)))
(format "*WARNING*: no doc for symbol =%s=" symbol)))
diff --git a/yasnippet.el b/yasnippet.el
index eb7afc6..6c95978 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -4298,31 +4298,33 @@ When multiple expressions are found, only the last one
counts."
;; depending on the context.
;;
(put 'yas-expand 'function-documentation
- '(yas--expand-from-trigger-key-doc))
-(defun yas--expand-from-trigger-key-doc ()
+ '(yas--expand-from-trigger-key-doc t))
+(defun yas--expand-from-trigger-key-doc (context)
"A doc synthesizer for `yas--expand-from-trigger-key-doc'."
- (let ((fallback-description
- (cond ((eq yas-fallback-behavior 'call-other-command)
- (let* ((fallback (yas--keybinding-beyond-yasnippet)))
- (or (and fallback
- (format " call command `%s'." (pp-to-string
fallback)))
- " do nothing (`yas-expand' doesn't shadow\nanything)")))
- ((eq yas-fallback-behavior 'return-nil)
- ", do nothing.")
- (t
- ", defer to `yas-fallback-behaviour' (which see)"))))
+ (let* ((yas-fallback-behavior (and context yas-fallback-behavior))
+ (fallback-description
+ (cond ((eq yas-fallback-behavior 'call-other-command)
+ (let* ((fallback (yas--keybinding-beyond-yasnippet)))
+ (or (and fallback
+ (format "call command `%s'."
+ (pp-to-string fallback)))
+ "do nothing (`yas-expand' doesn't shadow\nanything).")))
+ ((eq yas-fallback-behavior 'return-nil)
+ "do nothing.")
+ (t "defer to `yas-fallback-behaviour' (which see)."))))
(concat "Expand a snippet before point. If no snippet
-expansion is possible,"
+expansion is possible, "
fallback-description
"\n\nOptional argument FIELD is for non-interactive use and is an
object satisfying `yas--field-p' to restrict the expansion to.")))
-(put 'yas-expand-from-keymap 'function-documentation
'(yas--expand-from-keymap-doc))
-(defun yas--expand-from-keymap-doc ()
+(put 'yas-expand-from-keymap 'function-documentation
+ '(yas--expand-from-keymap-doc t))
+(defun yas--expand-from-keymap-doc (context)
"A doc synthesizer for `yas--expand-from-keymap-doc'."
(add-hook 'temp-buffer-show-hook 'yas--snippet-description-finish-runonce)
(concat "Expand/run snippets from keymaps, possibly falling back to original
binding.\n"
- (when (eq this-command 'describe-key)
+ (when (and context (eq this-command 'describe-key))
(let* ((vec (this-single-command-keys))
(templates (mapcan #'(lambda (table)
(yas--fetch table vec))
- [elpa] master 08a44b4 050/177: add code examples for snippet-expansion.rst, (continued)
- [elpa] master 08a44b4 050/177: add code examples for snippet-expansion.rst, João Távora, 2015/03/28
- [elpa] master dfdb89c 054/177: remove erroneous #+BEGIN/END_QUOTE, João Távora, 2015/03/28
- [elpa] master eaeb6ff 051/177: more links to docstrings, don't repeat docstrings, João Távora, 2015/03/28
- [elpa] master 07b1d39 056/177: move #+STARTUP to org-setup.inc; add #+LINK_HOME, João Távora, 2015/03/28
- [elpa] master fd3fa39 057/177: publish org doc from Rakefile, João Távora, 2015/03/28
- [elpa] master 2c237cc 060/177: check function doc before variable doc, João Távora, 2015/03/28
- [elpa] master eaa3141 059/177: fix docstring extraction for "fancy" docs, João Távora, 2015/03/28
- [elpa] master 8d7c9a6 058/177: retrieve function documentation correctly, João Távora, 2015/03/28
- [elpa] master 63873e7 052/177: snippet-menu.org: links, formatting, obsolete refs, João Távora, 2015/03/28
- [elpa] master e46d9c7 047/177: link to docstring ref; fix other links, formatting, João Távora, 2015/03/28
- [elpa] master 860858d 061/177: Merge pull request #436 from npostavs/autodoc-1, 2,
João Távora <=
- [elpa] master f6cace0 042/177: convert old rst manuals to org mode, João Távora, 2015/03/28
- [elpa] master 21914cf 064/177: yas--document-symbol: reindent, João Távora, 2015/03/28
- [elpa] master f86529c 065/177: only crosslink exported symbols, João Távora, 2015/03/28
- [elpa] master 0aebb41 055/177: move top heading to title, João Távora, 2015/03/28
- [elpa] master 46c378d 063/177: format args in docstrings as =code=, not /italic/, João Távora, 2015/03/28
- [elpa] master da9852a 053/177: {snippet-development, faq}.org: fixup pandoc output, João Távora, 2015/03/28
- [elpa] master a9e3035 066/177: docstring fixes, João Távora, 2015/03/28
- [elpa] master eda8330 067/177: only /italicize/ words completely in upper case, João Távora, 2015/03/28
- [elpa] master 0f8007e 071/177: Simplify: index.org no longer repeats info in the README, João Távora, 2015/03/28
- [elpa] master 6927f69 069/177: minor: README.mdown link, João Távora, 2015/03/28