home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34exe.zip
/
mutt
/
contrib
/
dupline.mut
< prev
next >
Wrap
Lisp/Scheme
|
1995-01-14
|
852b
|
29 lines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; duplicate-line: Duplicate current line without using the cut ;
;; buffer. Stay on the same column on the duplicated line.;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Nadav Horesh Public Domain 2/93
(include me.mh)
(defun duplicate-line {
(int mark1 column bag)
(mark1 (create-mark))
(bag (create-bag))
(column (current-column))
(beginning-of-line) ;; mark beginning of line
(set-mark mark1)
(forward-line 1)
(append-to-bag bag APPEND-REGION mark1 0) ;; copy the line to bag
;; (newline) ;; open new line
(insert-bag bag) ;; duplicate buffer to new line
(forward-line -1)
(current-column column) ;; restore column
(free-mark mark1)
(free-bag bag)
}
)