aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorKenichi Handa2003-09-08 11:56:09 +0000
committerKenichi Handa2003-09-08 11:56:09 +0000
commit463f5630a5e7cbe7f042bc1175d1fa1c4e98860f (patch)
tree3287d0c628fea2249abf4635b3a4f45bedd6f8c4 /lisp/simple.el
parent4256310de631bd57c78b88b5131caa073315b3d7 (diff)
downloademacs-463f5630a5e7cbe7f042bc1175d1fa1c4e98860f.tar.gz
emacs-463f5630a5e7cbe7f042bc1175d1fa1c4e98860f.zip
New directory
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el45
1 files changed, 16 insertions, 29 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 46bfc12dc4e..5ab9d6bba7a 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 (&optional arg) 355(defun forward-to-indentation (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 (or arg 1)) 358 (forward-line arg)
359 (skip-chars-forward " \t")) 359 (skip-chars-forward " \t"))
360 360
361(defun backward-to-indentation (&optional arg) 361(defun backward-to-indentation (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 (- (or arg 1))) 364 (forward-line (- arg))
365 (skip-chars-forward " \t")) 365 (skip-chars-forward " \t"))
366 366
367(defun back-to-indentation () 367(defun back-to-indentation ()
@@ -661,10 +661,8 @@ 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 (if eval-expression-insert-value 664 (prin1 (car values)
665 (with-no-warnings 665 (if eval-expression-insert-value (current-buffer) t))))
666 (eval-last-sexp-print-value (car values)))
667 (prin1 (car values) t))))
668 666
669(defun edit-and-eval-command (prompt command) 667(defun edit-and-eval-command (prompt command)
670 "Prompting with PROMPT, let user edit COMMAND and eval result. 668 "Prompting with PROMPT, let user edit COMMAND and eval result.
@@ -2699,7 +2697,7 @@ If you are thinking of using this in a Lisp program, consider
2699using `forward-line' instead. It is usually easier to use 2697using `forward-line' instead. It is usually easier to use
2700and more reliable (no dependence on goal column, etc.)." 2698and more reliable (no dependence on goal column, etc.)."
2701 (interactive "p") 2699 (interactive "p")
2702 (or arg (setq arg 1)) 2700 (unless arg (setq arg 1))
2703 (if (and next-line-add-newlines (= arg 1)) 2701 (if (and next-line-add-newlines (= arg 1))
2704 (if (save-excursion (end-of-line) (eobp)) 2702 (if (save-excursion (end-of-line) (eobp))
2705 ;; When adding a newline, don't expand an abbrev. 2703 ;; When adding a newline, don't expand an abbrev.
@@ -2731,7 +2729,7 @@ If you are thinking of using this in a Lisp program, consider using
2731`forward-line' with a negative argument instead. It is usually easier 2729`forward-line' with a negative argument instead. It is usually easier
2732to use and more reliable (no dependence on goal column, etc.)." 2730to use and more reliable (no dependence on goal column, etc.)."
2733 (interactive "p") 2731 (interactive "p")
2734 (or arg (setq arg 1)) 2732 (unless arg (setq arg 1))
2735 (if (interactive-p) 2733 (if (interactive-p)
2736 (condition-case nil 2734 (condition-case nil
2737 (line-move (- arg)) 2735 (line-move (- arg))
@@ -3111,11 +3109,11 @@ With argument 0, interchanges line point is in with line mark is in."
3111 (goto-char (car pos1)) 3109 (goto-char (car pos1))
3112 (insert word2)))) 3110 (insert word2))))
3113 3111
3114(defun backward-word (&optional arg) 3112(defun backward-word (arg)
3115 "Move backward until encountering the beginning of a word. 3113 "Move backward until encountering the beginning of a word.
3116With argument, do this that many times." 3114With argument, do this that many times."
3117 (interactive "p") 3115 (interactive "p")
3118 (forward-word (- (or arg 1)))) 3116 (forward-word (- arg)))
3119 3117
3120(defun mark-word (arg) 3118(defun mark-word (arg)
3121 "Set mark arg words away from point. 3119 "Set mark arg words away from point.
@@ -3500,8 +3498,7 @@ when it is off screen)."
3500 (point))))) 3498 (point)))))
3501 (let* ((oldpos (point)) 3499 (let* ((oldpos (point))
3502 (blinkpos) 3500 (blinkpos)
3503 (mismatch) 3501 (mismatch))
3504 matching-paren)
3505 (save-excursion 3502 (save-excursion
3506 (save-restriction 3503 (save-restriction
3507 (if blink-matching-paren-distance 3504 (if blink-matching-paren-distance
@@ -3515,20 +3512,12 @@ when it is off screen)."
3515 (setq blinkpos (scan-sexps oldpos -1))) 3512 (setq blinkpos (scan-sexps oldpos -1)))
3516 (error nil))) 3513 (error nil)))
3517 (and blinkpos 3514 (and blinkpos
3518 (save-excursion 3515 (/= (char-syntax (char-after blinkpos))
3519 (goto-char blinkpos) 3516 ?\$)
3520 (not (looking-at "\\s$"))) 3517 (setq mismatch
3521 (setq matching-paren 3518 (or (null (matching-paren (char-after blinkpos)))
3522 (or (and parse-sexp-lookup-properties
3523 (let ((prop (get-text-property blinkpos 'syntax-table)))
3524 (and (consp prop)
3525 (eq (car prop) 4)
3526 (cdr prop))))
3527 (matching-paren (char-after blinkpos)))
3528 mismatch
3529 (or (null matching-paren)
3530 (/= (char-after (1- oldpos)) 3519 (/= (char-after (1- oldpos))
3531 matching-paren)))) 3520 (matching-paren (char-after blinkpos))))))
3532 (if mismatch (setq blinkpos nil)) 3521 (if mismatch (setq blinkpos nil))
3533 (if blinkpos 3522 (if blinkpos
3534 ;; Don't log messages about paren matching. 3523 ;; Don't log messages about paren matching.
@@ -4531,6 +4520,4 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil."
4531; 4520;
4532 4521
4533(provide 'simple) 4522(provide 'simple)
4534
4535;;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd
4536;;; simple.el ends here 4523;;; simple.el ends here