Mercurial > emacs
comparison lisp/simple.el @ 60486:47a57ff1da21
(move-beginning-of-line): New command.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 07 Mar 2005 11:12:31 +0000 |
parents | be3ac492036f |
children | 1b9a61c42a06 7ea3d7198adc 29e773288013 |
comparison
equal
deleted
inserted
replaced
60485:6a79fa294dd4 | 60486:47a57ff1da21 |
---|---|
3515 ;; and now we're not really at eol, | 3515 ;; and now we're not really at eol, |
3516 ;; keep going. | 3516 ;; keep going. |
3517 (setq arg 1) | 3517 (setq arg 1) |
3518 (setq done t))))))) | 3518 (setq done t))))))) |
3519 | 3519 |
3520 (defun move-beginning-of-line (arg) | |
3521 "Move point to beginning of current display line. | |
3522 With argument ARG not nil or 1, move forward ARG - 1 lines first. | |
3523 If point reaches the beginning or end of buffer, it stops there. | |
3524 To ignore intangibility, bind `inhibit-point-motion-hooks' to t. | |
3525 | |
3526 This command does not move point across a field boundary unless doing so | |
3527 would move beyond there to a different line; if ARG is nil or 1, and | |
3528 point starts at a field boundary, point does not move. To ignore field | |
3529 boundaries bind `inhibit-field-text-motion' to t." | |
3530 (interactive "p") | |
3531 (or arg (setq arg 1)) | |
3532 (if (/= arg 1) | |
3533 (line-move (1- arg) t)) | |
3534 (let (done pos) | |
3535 (while (not done) | |
3536 (beginning-of-line 1) | |
3537 ;; (not bolp) means that it stopped at a field boundary. | |
3538 (if (or (bobp) (not (bolp))) | |
3539 (setq done t) | |
3540 (sit-for 0) | |
3541 (if (and (consp (setq pos (pos-visible-in-window-p (point) nil t))) | |
3542 (= (car pos) 0)) | |
3543 (setq done t) | |
3544 (backward-char 1)))))) | |
3545 | |
3546 | |
3520 ;;; Many people have said they rarely use this feature, and often type | 3547 ;;; Many people have said they rarely use this feature, and often type |
3521 ;;; it by accident. Maybe it shouldn't even be on a key. | 3548 ;;; it by accident. Maybe it shouldn't even be on a key. |
3522 (put 'set-goal-column 'disabled t) | 3549 (put 'set-goal-column 'disabled t) |
3523 | 3550 |
3524 (defun set-goal-column (arg) | 3551 (defun set-goal-column (arg) |