comparison lisp/emulation/vi.el @ 91058:4b09bb044f38

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 899-900) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 129-130) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 259-260) - Merge from emacs--rel--22 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-272
author Miles Bader <miles@gnu.org>
date Sat, 20 Oct 2007 02:22:59 +0000
parents 424b655804ca e1af3a725ca4
children 53108e6cea98
comparison
equal deleted inserted replaced
91057:5e056bb0109f 91058:4b09bb044f38
799 (ding))) ; no moving, already at end of buffer 799 (ding))) ; no moving, already at end of buffer
800 800
801 (defun vi-previous-line-first-nonwhite (count) 801 (defun vi-previous-line-first-nonwhite (count)
802 "Go up COUNT lines. Stop at first non-white." 802 "Go up COUNT lines. Stop at first non-white."
803 (interactive "p") 803 (interactive "p")
804 (previous-line count) 804 (forward-line (- count))
805 (back-to-indentation)) 805 (back-to-indentation))
806 806
807 (defun vi-scroll-up-window (count) 807 (defun vi-scroll-up-window (count)
808 "Scrolls up window COUNT lines. 808 "Scrolls up window COUNT lines.
809 If COUNT is nil (actually, non-integer), scrolls default amount. 809 If COUNT is nil (actually, non-integer), scrolls default amount.
1060 (setq begin (point))) 1060 (setq begin (point)))
1061 (cond ((or (eq moving-unit 'match) (eq moving-unit 'find)) 1061 (cond ((or (eq moving-unit 'match) (eq moving-unit 'find))
1062 (setq end (1+ end))) 1062 (setq end (1+ end)))
1063 ((eq moving-unit 'line) 1063 ((eq moving-unit 'line)
1064 (goto-char begin) (beginning-of-line) (setq begin (point)) 1064 (goto-char begin) (beginning-of-line) (setq begin (point))
1065 (goto-char end) (next-line 1) (beginning-of-line) (setq end (point)))) 1065 (goto-char end) (forward-line 1) (beginning-of-line) (setq end (point))))
1066 (if (> end (point-max)) (setq end (point-max))) ; force in buffer region 1066 (if (> end (point-max)) (setq end (point-max))) ; force in buffer region
1067 (cons begin end))))) 1067 (cons begin end)))))
1068 1068
1069 (defun vi-delete-op (motion-command arg) 1069 (defun vi-delete-op (motion-command arg)
1070 "Delete range specified by MOTION-COMMAND with ARG." 1070 "Delete range specified by MOTION-COMMAND with ARG."
1122 (current-kill (- reg ?0 1) 'do-not-rotate)) 1122 (current-kill (- reg ?0 1) 'do-not-rotate))
1123 ((stringp (get-register reg)) (get-register reg)) 1123 ((stringp (get-register reg)) (get-register reg))
1124 (t (error "Register %c is not containing text string" reg)))) 1124 (t (error "Register %c is not containing text string" reg))))
1125 (if (vi-string-end-with-nl-p put-text) ; put back text as lines 1125 (if (vi-string-end-with-nl-p put-text) ; put back text as lines
1126 (if after-p 1126 (if after-p
1127 (progn (next-line 1) (beginning-of-line)) 1127 (progn (forward-line 1) (beginning-of-line))
1128 (beginning-of-line)) 1128 (beginning-of-line))
1129 (if after-p (forward-char 1))) 1129 (if after-p (forward-char 1)))
1130 (push-mark (point)) 1130 (push-mark (point))
1131 (insert put-text) 1131 (insert put-text)
1132 (exchange-point-and-mark) 1132 (exchange-point-and-mark)