aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-17 00:15:53 +0000
committerRichard M. Stallman2003-08-17 00:15:53 +0000
commitb82d844fa42f70b9d9ff6b34d7ea385692c1b742 (patch)
tree1d1bcca6362c465482e365a93070d93204928bc0
parent611bdf8254bad0d4e98625bb972715b83e946314 (diff)
downloademacs-b82d844fa42f70b9d9ff6b34d7ea385692c1b742.tar.gz
emacs-b82d844fa42f70b9d9ff6b34d7ea385692c1b742.zip
(eval-expression): Use eval-last-sexp-print-value.
(backward-word, forward-to-indentation) (backward-to-indentation): Argument changed to optional. (next-line, previous-line): Use `or' instead of `unless'.
-rw-r--r--lisp/simple.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 5ab9d6bba7a..2a90fa6740c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -352,16 +352,16 @@ useful for editing binary files."
352 (insert-and-inherit char) 352 (insert-and-inherit char)
353 (setq arg (1- arg))))) 353 (setq arg (1- arg)))))
354 354
355(defun forward-to-indentation (arg) 355(defun forward-to-indentation (&optional arg)
356 "Move forward ARG lines and position at first nonblank character." 356 "Move forward ARG lines and position at first nonblank character."
357 (interactive "p") 357 (interactive "p")
358 (forward-line arg) 358 (forward-line (or arg 1))
359 (skip-chars-forward " \t")) 359 (skip-chars-forward " \t"))
360 360
361(defun backward-to-indentation (arg) 361(defun backward-to-indentation (&optional arg)
362 "Move backward ARG lines and position at first nonblank character." 362 "Move backward ARG lines and position at first nonblank character."
363 (interactive "p") 363 (interactive "p")
364 (forward-line (- arg)) 364 (forward-line (- (or arg 1)))
365 (skip-chars-forward " \t")) 365 (skip-chars-forward " \t"))
366 366
367(defun back-to-indentation () 367(defun back-to-indentation ()
@@ -661,8 +661,10 @@ the echo area."
661 661
662 (let ((print-length eval-expression-print-length) 662 (let ((print-length eval-expression-print-length)
663 (print-level eval-expression-print-level)) 663 (print-level eval-expression-print-level))
664 (prin1 (car values) 664 (if eval-expression-insert-value
665 (if eval-expression-insert-value (current-buffer) t)))) 665 (with-no-warnings
666 (eval-last-sexp-print-value (car values)))
667 (prin1 (car values) t))))
666 668
667(defun edit-and-eval-command (prompt command) 669(defun edit-and-eval-command (prompt command)
668 "Prompting with PROMPT, let user edit COMMAND and eval result. 670 "Prompting with PROMPT, let user edit COMMAND and eval result.
@@ -2697,7 +2699,7 @@ If you are thinking of using this in a Lisp program, consider
2697using `forward-line' instead. It is usually easier to use 2699using `forward-line' instead. It is usually easier to use
2698and more reliable (no dependence on goal column, etc.)." 2700and more reliable (no dependence on goal column, etc.)."
2699 (interactive "p") 2701 (interactive "p")
2700 (unless arg (setq arg 1)) 2702 (or arg (setq arg 1))
2701 (if (and next-line-add-newlines (= arg 1)) 2703 (if (and next-line-add-newlines (= arg 1))
2702 (if (save-excursion (end-of-line) (eobp)) 2704 (if (save-excursion (end-of-line) (eobp))
2703 ;; When adding a newline, don't expand an abbrev. 2705 ;; When adding a newline, don't expand an abbrev.
@@ -2729,7 +2731,7 @@ If you are thinking of using this in a Lisp program, consider using
2729`forward-line' with a negative argument instead. It is usually easier 2731`forward-line' with a negative argument instead. It is usually easier
2730to use and more reliable (no dependence on goal column, etc.)." 2732to use and more reliable (no dependence on goal column, etc.)."
2731 (interactive "p") 2733 (interactive "p")
2732 (unless arg (setq arg 1)) 2734 (or arg (setq arg 1))
2733 (if (interactive-p) 2735 (if (interactive-p)
2734 (condition-case nil 2736 (condition-case nil
2735 (line-move (- arg)) 2737 (line-move (- arg))
@@ -3109,11 +3111,11 @@ With argument 0, interchanges line point is in with line mark is in."
3109 (goto-char (car pos1)) 3111 (goto-char (car pos1))
3110 (insert word2)))) 3112 (insert word2))))
3111 3113
3112(defun backward-word (arg) 3114(defun backward-word (&optional arg)
3113 "Move backward until encountering the beginning of a word. 3115 "Move backward until encountering the beginning of a word.
3114With argument, do this that many times." 3116With argument, do this that many times."
3115 (interactive "p") 3117 (interactive "p")
3116 (forward-word (- arg))) 3118 (forward-word (- (or arg 1))))
3117 3119
3118(defun mark-word (arg) 3120(defun mark-word (arg)
3119 "Set mark arg words away from point. 3121 "Set mark arg words away from point.