X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fmanual%2Fdocstrings.lisp;h=27d23a120c35fdcbc8922b4eab61aa31893f1419;hb=1ab1dd29f2602c87d404492e588abdf5f6abfbf2;hp=c258d20a18f7fb5d96ba231568c24f2d5ba0e7e0;hpb=146ca8325e1d9e206a6c14e76442543267dbbc51;p=sbcl.git diff --git a/doc/manual/docstrings.lisp b/doc/manual/docstrings.lisp index c258d20..27d23a1 100644 --- a/doc/manual/docstrings.lisp +++ b/doc/manual/docstrings.lisp @@ -499,11 +499,16 @@ semicolon, and the previous line is empty" (empty-p (1- line-number) lines)))) (defun collect-lisp-section (lines line-number) - (let ((lisp (loop for index = line-number then (1+ index) - for line = (and (< index (length lines)) (svref lines index)) - while (indentation line) - collect line))) - (values (length lisp) `("@lisp" ,@lisp "@end lisp")))) + (flet ((maybe-line (index) + (and (< index (length lines)) (svref lines index)))) + (let ((lisp (loop for index = line-number then (1+ index) + for line = (maybe-line index) + while (or (indentation line) + ;; Allow empty lines in middle of lisp sections. + (let ((next (1+ index))) + (lisp-section-p (maybe-line next) next lines))) + collect line))) + (values (length lisp) `("@lisp" ,@lisp "@end lisp"))))) ;;; itemized sections