From: Kim F. Storm Date: Mon, 17 Jan 2005 10:56:07 +0000 (+0000) Subject: (just-one-space): Make arg optional. X-Git-Tag: ttn-vms-21-2-B4~2708 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68c16b5994a2e054aa67dc2af1579effef241dc8;p=emacs.git (just-one-space): Make arg optional. --- diff --git a/lisp/simple.el b/lisp/simple.el index 82ec0e6f7f2..82dd693ad34 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 ?\ )))