diff options
| author | Kim F. Storm | 2005-01-17 10:56:07 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-17 10:56:07 +0000 |
| commit | 68c16b5994a2e054aa67dc2af1579effef241dc8 (patch) | |
| tree | 1a5e6e54a9735fd08a0cdc6af45cde59f97a9dd6 | |
| parent | aea3bdb1215bb559537d719c889c4b05c58742f9 (diff) | |
| download | emacs-68c16b5994a2e054aa67dc2af1579effef241dc8.tar.gz emacs-68c16b5994a2e054aa67dc2af1579effef241dc8.zip | |
(just-one-space): Make arg optional.
| -rw-r--r-- | lisp/simple.el | 4 |
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 ?\ ))) |