]> git.eshelyaron.com Git - emacs.git/commitdiff
(just-one-space): Make arg optional.
authorKim F. Storm <storm@cua.dk>
Mon, 17 Jan 2005 10:56:07 +0000 (10:56 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 17 Jan 2005 10:56:07 +0000 (10:56 +0000)
lisp/simple.el

index 82ec0e6f7f29e0a39034d9b50664eb4a7b65d4e6..82dd693ad34402bdb2fd964f16fe8f8672628f37 100644 (file)
@@ -647,13 +647,13 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point."
        (skip-chars-backward " \t")
        (constrain-to-field nil orig-pos)))))
 
-(defun just-one-space (n)
+(defun just-one-space (&optional n)
   "Delete all spaces and tabs around point, leaving one space (or N spaces)."
   (interactive "*p")
   (let ((orig-pos (point)))
     (skip-chars-backward " \t")
     (constrain-to-field nil orig-pos)
-    (dotimes (i n)
+    (dotimes (i (or n 1))
       (if (= (following-char) ?\ )
          (forward-char 1)
        (insert ?\ )))