[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c485d13 04/63: Remove last use of flet
From: |
Noam Postavsky |
Subject: |
[elpa] master c485d13 04/63: Remove last use of flet |
Date: |
Mon, 17 Jul 2017 22:54:10 -0400 (EDT) |
branch: master
commit c485d13995b6c569ae680b8f155026e85ca7933c
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Remove last use of flet
It is obsolete as of 24.3, and this particular use of flet in this place
isn't much use anyway.
* doc/yas-doc-helper.el (yas--document-symbol): Stop using flet.
Fixes #752
---
doc/yas-doc-helper.el | 112 +++++++++++++++++++++++---------------------------
1 file changed, 52 insertions(+), 60 deletions(-)
diff --git a/doc/yas-doc-helper.el b/doc/yas-doc-helper.el
index 8459eb7..ffce751 100644
--- a/doc/yas-doc-helper.el
+++ b/doc/yas-doc-helper.el
@@ -40,66 +40,58 @@
tag content tag))
(defun yas--document-symbol (symbol level)
- (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 (lambda (a)
- (format (if (string-prefix-p "&" a)
- "/%s/" "=%s=") a))
- args " ")))
- (t
- (format "%s =%s=\n" stars symbol))))
- (after-heading
- (concat-lines ":PROPERTIES:"
- (format ":CUSTOM_ID: %s" symbol)
- ":END:"))
- (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))
- (t
- (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:
- ;; ARGxxx becomes @<code>arg@</code>xxx
- ;; FOO becomes /foo/
- ;; `bar' becomes [[#bar][=bar=]]
- (setq body (replace-regexp-in-string
- "\\<\\([A-Z][-A-Z0-9]+\\)\\(\\sw+\\)?\\>"
- #'(lambda (match)
- (let* ((match1 (match-string 1 match))
- (prefix (downcase match1))
- (suffix (match-string 2 match))
- (fmt (cond
- ((member prefix args)
- (yas--org-raw-html "code" "%s"))
- ((null suffix) "/%s/"))))
- (if fmt (format fmt prefix)
- match1)))
- body t t 1)
- body (replace-regexp-in-string
- "`\\([a-z-]+\\)'"
- #'(lambda (match)
- (let* ((name (downcase (match-string 1 match)))
- (sym (intern name)))
- (if (memq sym yas--exported-syms)
- (format "[[#%s][=%s=]]" name name)
- (format "=%s=" name))))
- body t))
- ;; output the paragraph
- ;;
- (concat-lines heading
- after-heading
- body))))
+ (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 (lambda (a)
+ (format (if (string-prefix-p "&" a)
+ "/%s/" "=%s=") a))
+ args " ")))
+ (t
+ (format "%s =%s=\n" stars symbol))))
+ (after-heading (format ":PROPERTIES:\n:CUSTOM_ID: %s\n:END:" 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))
+ (t
+ (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:
+ ;; ARGxxx becomes @<code>arg@</code>xxx
+ ;; FOO becomes /foo/
+ ;; `bar' becomes [[#bar][=bar=]]
+ (setq body (replace-regexp-in-string
+ "\\<\\([A-Z][-A-Z0-9]+\\)\\(\\sw+\\)?\\>"
+ #'(lambda (match)
+ (let* ((match1 (match-string 1 match))
+ (prefix (downcase match1))
+ (suffix (match-string 2 match))
+ (fmt (cond
+ ((member prefix args)
+ (yas--org-raw-html "code" "%s"))
+ ((null suffix) "/%s/"))))
+ (if fmt (format fmt prefix)
+ match1)))
+ body t t 1)
+ body (replace-regexp-in-string
+ "`\\([a-z-]+\\)'"
+ #'(lambda (match)
+ (let* ((name (downcase (match-string 1 match)))
+ (sym (intern name)))
+ (if (memq sym yas--exported-syms)
+ (format "[[#%s][=%s=]]" name name)
+ (format "=%s=" name))))
+ body t))
+ ;; output the paragraph
+ (concat heading "\n" after-heading "\n" body)))
(defun yas--document-symbols (level &rest names-and-predicates)
(let ((sym-lists (make-vector (length names-and-predicates) nil))
- [elpa] master updated (2cdd182 -> 3fd07de), Noam Postavsky, 2017/07/17
- [elpa] master 4fa52e6 01/63: Improve final message produced by yas-reload-all, Noam Postavsky, 2017/07/17
- [elpa] master 8412d71 03/63: Reword #744 yet again, Noam Postavsky, 2017/07/17
- [elpa] master 4ef1768 10/63: Add timestamp of source revision to HTML doc, Noam Postavsky, 2017/07/17
- [elpa] master 7b013db 06/63: Keep yas--snippets-at-point for compatibility, Noam Postavsky, 2017/07/17
- [elpa] master 5534cab 07/63: Respect yas-indent-line for mirror updates, Noam Postavsky, 2017/07/17
- [elpa] master c485d13 04/63: Remove last use of flet,
Noam Postavsky <=
- [elpa] master 80a1098 02/63: Rework yas-reload-all message introduced by #744, Noam Postavsky, 2017/07/17
- [elpa] master 28d5496 11/63: Use git describe for doc HTML output, Noam Postavsky, 2017/07/17
- [elpa] master cce2e0d 09/63: Make the documentation build reproducible, Noam Postavsky, 2017/07/17
- [elpa] master 2ca6321 05/63: Promote yas--snippets-at-point to a public API, Noam Postavsky, 2017/07/17
- [elpa] master 9abf842 19/63: Enable snippet-mode automatically, Noam Postavsky, 2017/07/17
- [elpa] master 48cd716 14/63: Use more compact format for snippet menus, Noam Postavsky, 2017/07/17
- [elpa] master b62cf52 23/63: Remove lambda list building hack, Noam Postavsky, 2017/07/17
- [elpa] master 7b3c29d 13/63: * doc/faq.org: Typos and grammar., Noam Postavsky, 2017/07/17
- [elpa] master 14819c9 28/63: Make yas-buffer-local-condition into a defcustom, Noam Postavsky, 2017/07/17
- [elpa] master f3d0e03 25/63: * yasnippet-tests.el (snippet-exit-hooks): New test., Noam Postavsky, 2017/07/17