mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-24 22:07:36 +00:00
(just-one-space): Make arg optional.
This commit is contained in:
parent
aea3bdb121
commit
68c16b5994
1 changed files with 2 additions and 2 deletions
|
|
@ -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 ?\ )))
|
||||
|
|
|
|||
Loading…
Reference in a new issue