Commit 998f1370 authored by Robert Strandh's avatar Robert Strandh

open-line now takes an optional count argument.

com-open-line now accepts a numeric argument that it passes on to
open-line.
parent 5f7acada
......@@ -67,14 +67,16 @@ The body is executed for each element, with object being the current object
(beginning-of-line mark)
(incf (offset mark) column)))
(defmethod open-line ((mark left-sticky-mark))
(defmethod open-line ((mark left-sticky-mark) &optional (count 1))
"Create a new line in a buffer after the mark."
(insert-object mark #\Newline))
(loop repeat count
do (insert-object mark #\Newline)))
(defmethod open-line ((mark right-sticky-mark))
(defmethod open-line ((mark right-sticky-mark) &optional (count 1))
"Create a new line in a buffer after the mark."
(insert-object mark #\Newline)
(decf (offset mark)))
(loop repeat count
do (insert-object mark #\Newline)
(decf (offset mark))))
(defun kill-line (mark)
"Remove a line from a buffer."
......
......@@ -462,8 +462,8 @@
(setf (slot-value win 'goal-column) (column-number point)))
(next-line point (slot-value win 'goal-column) numarg)))
(define-named-command com-open-line ()
(open-line (point (current-window))))
(define-named-command com-open-line ((numarg 'integer :prompt "How many lines?"))
(open-line (point (current-window)) numarg))
(define-named-command com-kill-line ((numarg 'integer :prompt "Kill how many lines?")
(numargp 'boolean :prompt "Kill entire lines?"))
......@@ -1348,7 +1348,7 @@ as two values"
(global-set-key '(#\p :control) `(com-previous-line ,*numeric-argument-marker*))
(global-set-key '(#\l :control) 'com-full-redisplay)
(global-set-key '(#\n :control) `(com-next-line ,*numeric-argument-marker*))
(global-set-key '(#\o :control) 'com-open-line)
(global-set-key '(#\o :control) `(com-open-line ,*numeric-argument-marker*))
(global-set-key '(#\k :control) `(com-kill-line ,*numeric-argument-marker* ,*numeric-argument-p*))
(global-set-key '(#\t :control) 'com-transpose-objects)
(global-set-key '(#\Space :control) 'com-set-mark)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment