From 68c16b5994a2e054aa67dc2af1579effef241dc8 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 17 Jan 2005 10:56:07 +0000 Subject: [PATCH] (just-one-space): Make arg optional. --- lisp/simple.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 82ec0e6f7f..82dd693ad3 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 ?\ ))) -- 2.20.1