]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/cl-extra.el
Enhance terpri to allow conditionally output a newline
[gnu-emacs] / lisp / emacs-lisp / cl-extra.el
index c8404e0bc2d7deb23e34bcec003a7949c5820f49..a7970261608c2a2fb352dee8ad231cefba83066e 100644 (file)
@@ -415,7 +415,8 @@ as an integer unless JUNK-ALLOWED is non-nil."
        (skip-whitespace)
        (cond ((and junk-allowed (null sum)) sum)
              (junk-allowed (* sign sum))
-             ((/= start end) (error "Not an integer string: %s" string))
+             ((or (/= start end) (null sum))
+              (error "Not an integer string: `%s'" string))
              (t (* sign sum)))))))
 
 
@@ -646,6 +647,13 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
        (progn (setplist sym (cdr (cdr plist))) t)
       (cl--do-remf plist tag))))
 
+;;; Streams.
+
+;;;###autoload
+(defun cl-fresh-line (&optional stream)
+  "Output a newline unless already at the beginning of a line."
+  (terpri stream 'ensure))
+
 ;;; Some debugging aids.
 
 (defun cl-prettyprint (form)