[librep] Doc support for 'defun' in user-compiled file. Previously, docstring in defun is lost on byte-compil
- From: Christopher Bratusek <chrisb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librep] Doc support for 'defun' in user-compiled file. Previously, docstring in defun is lost on byte-compil
- Date: Sat, 11 Sep 2010 11:44:32 +0000 (UTC)
commit b0fa698639ba24746083c37f2687829436cc7695
Author: Teika kazura <teika lavabit com>
Date: Tue Sep 7 09:52:34 2010 +0900
Doc support for 'defun' in user-compiled file.
Previously, docstring in defun is lost on byte-compilation done by user,
i.e., when it's not saved in DOC.
Fix an error included in the reverted commit d83b5. It used to print
debugging messages.
lisp/rep/vm/compiler/rep.jl | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lisp/rep/vm/compiler/rep.jl b/lisp/rep/vm/compiler/rep.jl
index 4d7a49a..dcf2a62 100644
--- a/lisp/rep/vm/compiler/rep.jl
+++ b/lisp/rep/vm/compiler/rep.jl
@@ -107,7 +107,19 @@
(memq (car out) top-level-compiled))))))
(case (car form)
((defun)
- (remember-function (nth 1 form) (nth 2 form) (nthcdr 3 form)))
+ (remember-function (nth 1 form) (nth 2 form) (nthcdr 3 form))
+ (let* ((body (cdddr form))
+ (doc (car body))
+ prop-name)
+ (when (and (not *compiler-write-docs*)
+ (stringp doc))
+ (setq prop-name
+ (intern
+ (concat "documentation#"
+ (symbol-name (fluid current-module)))))
+ (setq form
+ `(progn (put ',(cadr form) ',prop-name ,doc)
+ ,form)))))
((defmacro)
(remember-function (nth 1 form) (nth 2 form))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]