aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el4
1 files changed, 2 insertions, 2 deletions
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."
647 (skip-chars-backward " \t") 647 (skip-chars-backward " \t")
648 (constrain-to-field nil orig-pos))))) 648 (constrain-to-field nil orig-pos)))))
649 649
650(defun just-one-space (n) 650(defun just-one-space (&optional n)
651 "Delete all spaces and tabs around point, leaving one space (or N spaces)." 651 "Delete all spaces and tabs around point, leaving one space (or N spaces)."
652 (interactive "*p") 652 (interactive "*p")
653 (let ((orig-pos (point))) 653 (let ((orig-pos (point)))
654 (skip-chars-backward " \t") 654 (skip-chars-backward " \t")
655 (constrain-to-field nil orig-pos) 655 (constrain-to-field nil orig-pos)
656 (dotimes (i n) 656 (dotimes (i (or n 1))
657 (if (= (following-char) ?\ ) 657 (if (= (following-char) ?\ )
658 (forward-char 1) 658 (forward-char 1)
659 (insert ?\ ))) 659 (insert ?\ )))