comparison lisp/simple.el @ 83453:55e22205ba88

Merged from miles@gnu.org--gnu-2005 (patch 683-684) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-683 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-684 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-493
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 06 Jan 2006 16:13:05 +0000
parents d2af586aefe4 9ec3cbeca7b8
children 9b150bc96d33
comparison
equal deleted inserted replaced
83452:02980fcccc43 83453:55e22205ba88
3059 3059
3060 (defvar deactivate-mark-hook nil 3060 (defvar deactivate-mark-hook nil
3061 "Hook run when the mark becomes inactive.") 3061 "Hook run when the mark becomes inactive.")
3062 3062
3063 (defun mark (&optional force) 3063 (defun mark (&optional force)
3064 "Return this buffer's mark value as integer; error if mark inactive. 3064 "Return this buffer's mark value as integer, or nil if never set.
3065 If optional argument FORCE is non-nil, access the mark value 3065
3066 even if the mark is not currently active, and return nil 3066 In Transient Mark mode, this function signals an error if
3067 if there is no mark at all. 3067 the mark is not active. However, if `mark-even-if-inactive' is non-nil,
3068 or the argument FORCE is non-nil, it disregards whether the mark
3069 is active, and returns an integer or nil in the usual way.
3068 3070
3069 If you are using this in an editing command, you are most likely making 3071 If you are using this in an editing command, you are most likely making
3070 a mistake; see the documentation of `set-mark'." 3072 a mistake; see the documentation of `set-mark'."
3071 (if (or force (not transient-mark-mode) mark-active mark-even-if-inactive) 3073 (if (or force (not transient-mark-mode) mark-active mark-even-if-inactive)
3072 (marker-position (mark-marker)) 3074 (marker-position (mark-marker))
3677 (let ((line-beg (save-excursion (beginning-of-line) (point)))) 3679 (let ((line-beg (save-excursion (beginning-of-line) (point))))
3678 (while (and (not (bolp)) (line-move-invisible-p (1- (point)))) 3680 (while (and (not (bolp)) (line-move-invisible-p (1- (point))))
3679 (goto-char (previous-char-property-change (point) line-beg)))))))) 3681 (goto-char (previous-char-property-change (point) line-beg))))))))
3680 3682
3681 (defun move-end-of-line (arg) 3683 (defun move-end-of-line (arg)
3682 "Move point to end of current line. 3684 "Move point to end of current line as displayed.
3685 \(If there's an image in the line, this disregards newlines
3686 which are part of the text that the image rests on.)
3687
3683 With argument ARG not nil or 1, move forward ARG - 1 lines first. 3688 With argument ARG not nil or 1, move forward ARG - 1 lines first.
3684 If point reaches the beginning or end of buffer, it stops there. 3689 If point reaches the beginning or end of buffer, it stops there.
3685 To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 3690 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3686
3687 This command does not move point across a field boundary unless doing so
3688 would move beyond there to a different line; if ARG is nil or 1, and
3689 point starts at a field boundary, point does not move. To ignore field
3690 boundaries bind `inhibit-field-text-motion' to t."
3691 (interactive "p") 3691 (interactive "p")
3692 (or arg (setq arg 1)) 3692 (or arg (setq arg 1))
3693 (let (done) 3693 (let (done)
3694 (while (not done) 3694 (while (not done)
3695 (let ((newpos 3695 (let ((newpos
3713 ;; keep going. 3713 ;; keep going.
3714 (setq arg 1) 3714 (setq arg 1)
3715 (setq done t))))))) 3715 (setq done t)))))))
3716 3716
3717 (defun move-beginning-of-line (arg) 3717 (defun move-beginning-of-line (arg)
3718 "Move point to beginning of current display line. 3718 "Move point to beginning of current line as displayed.
3719 \(If there's an image in the line, this disregards newlines
3720 which are part of the text that the image rests on.)
3721
3719 With argument ARG not nil or 1, move forward ARG - 1 lines first. 3722 With argument ARG not nil or 1, move forward ARG - 1 lines first.
3720 If point reaches the beginning or end of buffer, it stops there. 3723 If point reaches the beginning or end of buffer, it stops there.
3721 To ignore intangibility, bind `inhibit-point-motion-hooks' to t. 3724 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3722
3723 This command does not move point across a field boundary unless doing so
3724 would move beyond there to a different line; if ARG is nil or 1, and
3725 point starts at a field boundary, point does not move. To ignore field
3726 boundaries bind `inhibit-field-text-motion' to t."
3727 (interactive "p") 3725 (interactive "p")
3728 (or arg (setq arg 1)) 3726 (or arg (setq arg 1))
3729 (if (/= arg 1) 3727 (if (/= arg 1)
3730 (line-move (1- arg) t)) 3728 (line-move (1- arg) t))
3731 (beginning-of-line 1) 3729 (beginning-of-line 1)