changeset 59598:9782a4d3aef5

(just-one-space): Make arg optional.
author Kim F. Storm <storm@cua.dk>
date Mon, 17 Jan 2005 10:56:07 +0000
parents 1aa9d082c67d
children 81cffebb04a5
files lisp/simple.el
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Mon Jan 17 10:55:49 2005 +0000
+++ b/lisp/simple.el	Mon Jan 17 10:56:07 2005 +0000
@@ -647,13 +647,13 @@
        (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 ?\ )))