[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 46c378d 063/177: format args in docstrings as =code=, not
From: |
João Távora |
Subject: |
[elpa] master 46c378d 063/177: format args in docstrings as =code=, not /italic/ |
Date: |
Sat, 28 Mar 2015 15:40:52 +0000 |
branch: master
commit 46c378d73830a541cdfcd8c2dab0b011f7d0b4d0
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
format args in docstrings as =code=, not /italic/
---
doc/yas-doc-helper.el | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/doc/yas-doc-helper.el b/doc/yas-doc-helper.el
index c940b20..4969bdf 100755
--- a/doc/yas-doc-helper.el
+++ b/doc/yas-doc-helper.el
@@ -34,12 +34,15 @@
(flet ((concat-lines (&rest lines)
(mapconcat #'identity lines "\n")))
(let* ((stars (make-string level ?*))
+ (args (and (fboundp symbol)
+ (mapcar #'symbol-name (help-function-arglist symbol t))))
(heading (cond ((fboundp symbol)
- (format "%s =%s= (%s)"
- stars
- symbol
- (mapconcat #'symbol-name
- (help-function-arglist symbol t)
" ")))
+ (format
+ "%s =%s= (%s)" stars symbol
+ (mapconcat (lambda (a)
+ (format (if (string-prefix-p "&" a)
+ "/%s/" "=%s=") a))
+ args " ")))
(t
(format "%s =%s=\n" stars symbol))))
(after-heading
@@ -57,12 +60,17 @@
(format "*WARNING*: no symbol named =%s=" symbol)))
(format "*WARNING*: no doc for symbol =%s=" symbol)))
(case-fold-search nil))
- ;; do some transformations on the body: FOO becomes /foo/ and
+ ;; do some transformations on the body:
+ ;; ARG becomes =arg=
+ ;; FOO becomes /foo/
;; `bar' becomes [[#bar][=bar=]]
(setq body (replace-regexp-in-string
"[A-Z][A-Z-]+" #'(lambda (match)
- (format "/%s/" (downcase match)))
- body)
+ (setq match (downcase match))
+ (format (if (member match args)
+ "=%s=" "/%s/")
+ match))
+ body t)
body (replace-regexp-in-string "`\\([a-z-]+\\)'" #'(lambda (match)
(let* ((name
(downcase (match-string 1 match)))
(sym
(intern name)))
- [elpa] master 2c237cc 060/177: check function doc before variable doc, (continued)
- [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, 2015/03/28
- [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 <=
- [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
- [elpa] master 0a9885e 073/177: markup suffixed variable names, eg SUBEXPth, João Távora, 2015/03/28
- [elpa] master c61f81f 070/177: Closes #439: add a faq question about redefining keys, João Távora, 2015/03/28
- [elpa] master 7d4e4aa 074/177: Closes #440: don't use `make-variable-buffer-local' for `yas--extra-modes', João Távora, 2015/03/28
- [elpa] master 582e368 072/177: minor: cosmetic fixes to manual, João Távora, 2015/03/28
- [elpa] master 7518cb4 075/177: rake doc:upload: check for wrong/incomplete rev, João Távora, 2015/03/28