changeset 59567:638fd0a9f545

(just-one-space): Argument specifies number of spaces. (eval-expression-print-format): Avoid warning about edebug-active.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Jan 2005 18:08:46 +0000
parents 7b97d6104891
children 3c6c2682ad8f
files lisp/simple.el
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Jan 15 18:07:21 2005 +0000
+++ b/lisp/simple.el	Sat Jan 15 18:08:46 2005 +0000
@@ -647,15 +647,16 @@
        (skip-chars-backward " \t")
        (constrain-to-field nil orig-pos)))))
 
-(defun just-one-space ()
-  "Delete all spaces and tabs around point, leaving one space."
-  (interactive "*")
+(defun just-one-space (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)
-    (if (= (following-char) ? )
-	(forward-char 1)
-      (insert ? ))
+    (dotimes (i n)
+      (if (= (following-char) ?\ )
+	  (forward-char 1)
+	(insert ?\ )))
     (delete-region
      (point)
      (progn
@@ -899,7 +900,7 @@
   (if (and (integerp value)
            (or (not (memq this-command '(eval-last-sexp eval-print-last-sexp)))
                (eq this-command last-command)
-               (and (boundp 'edebug-active) edebug-active)))
+               (if (boundp 'edebug-active) edebug-active)))
       (let ((char-string
              (if (or (and (boundp 'edebug-active) edebug-active)
                      (memq this-command '(eval-last-sexp eval-print-last-sexp)))
@@ -4115,7 +4116,7 @@
     (play-sound sound)))
 
 (define-key global-map "\e\e\e" 'keyboard-escape-quit)
-
+
 (defcustom read-mail-command 'rmail
   "*Your preference for a mail reading package.
 This is used by some keybindings which support reading mail.
@@ -4257,7 +4258,7 @@
    (list nil nil nil current-prefix-arg))
   (compose-mail to subject other-headers continue
 		'switch-to-buffer-other-frame yank-action send-actions))
-
+
 (defvar set-variable-value-history nil
   "History of values entered with `set-variable'.")
 
@@ -4320,7 +4321,7 @@
   ;; Force a thorough redisplay for the case that the variable
   ;; has an effect on the display, like `tab-width' has.
   (force-mode-line-update))
-
+
 ;; Define the major mode for lists of completions.
 
 (defvar completion-list-mode-map nil