[librep: 3/5] Bugfix in byte compiler of lost docstring.



commit b7ee27f4298e33d605cdc6ae48df0f1a21084660
Author: Teika kazura <teika lavabit com>
Date:   Tue Jan 5 15:22:58 2010 +0900

    Bugfix in byte compiler of lost docstring.
    
    Practical effect: Previously, if you byte compile, then the doc string
    is lost in sawfish-config. This is fixed.
    
    Details: Loss of docstring happened only if (1) byte compiler is not given
    --write-docs (2) defvar is invoked within macro definition. Plain defvar
    was not affected by this bug.
    It was because in 'trans-defvar' in lisp/rep/vm/compiler/rep.jl, the
    docstring is stored in a wrong property 'variable-documentation'. It
    is corrected to 'documentation'.
    
    Symbol 'variable-documentation' is not used elsewhere, including Sawfish
    and emacs' sawfish-mode.

 lisp/rep/vm/compiler/rep.jl |    7 +------
 man/news.texi               |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/lisp/rep/vm/compiler/rep.jl b/lisp/rep/vm/compiler/rep.jl
index 279bea7..b04e2f1 100644
--- a/lisp/rep/vm/compiler/rep.jl
+++ b/lisp/rep/vm/compiler/rep.jl
@@ -65,7 +65,6 @@
     '(defun defmacro defvar defconst defsubst %define require
       declare eval-when-compile define-structure structure))
 
-
 ;;; pass 1 support
 
   (defun pass-1 (forms) (add-progns (pass-1* forms)))
@@ -153,7 +152,6 @@
 
       form))
 
-
 ;;; pass 2 support
 
   (defun pass-2 (forms)
@@ -240,7 +238,6 @@
 	       (compile-form form)
 	     form)))))
 
-
 ;;; Source code transformations. These are basically macros that are only
 ;;; used at compile-time.
 
@@ -272,7 +269,7 @@
 	(add-documentation name nil (compiler-constant-value doc))
 	(setq doc nil))
       `(progn
-	 ,@(and doc (list `(put ',name 'variable-documentation ,doc)))
+	 ,@(and doc (list `(put ',name 'documentation ,doc)))
 	 (make-variable-special ',name)
 	 (unless (boundp ',name)
 	   (setq ,name ,value)))))
@@ -292,7 +289,6 @@
     `(not (= ,@(cdr form))))
   (put '/= 'rep-compile-transform trans-/=)
 
-
 ;;; Functions which compile non-standard functions (ie special-forms)
 
   ;; module compilers from compiler-modules
@@ -1064,7 +1060,6 @@
       ;; But that doesn't always evaluate all arguments..
       (compile-funcall (cons 'funcall form)))))
 
-
 ;;; Opcode properties for the generic instructions, in a progn for compiled
 ;;; speed
 
diff --git a/man/news.texi b/man/news.texi
index b3c3e02..832c187 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -7,6 +7,22 @@
 
 @itemize @bullet
 
+ item Byte compiler bugfix in docstring loss [Teika Kazura]
+
+Practical effect: Previously, if a user byte-compile files, then the
+docstring is lost in sawfish-config. This is fixed.
+
+Details: Loss of docstring happened only if (1) byte compiler is not
+given @code{--write-docs}, so only byte-compilation by user (2) defvar
+is invoked within macro definition, including @code{defcustom} in
+Sawfish. Plain defvar was not affected by this bug.  It was because in
+'trans-defvar' in lisp/rep/vm/compiler/rep.jl, the docstring is stored
+in a wrong property @code{variable-documentation}. It is corrected to
+ code{documentation} 
+
+Symbol @code{variable-documentation} is not used elsewhere, including
+Sawfish and emacs' sawfish-mode.
+
 @item Our own implementation of dlmalloc is disabled since 2002, as it breaks
 sawfish on several architectures. From this version on, we don't ship it.
 [Kim B. Heino]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]