1 |
;;; simple.el --- basic editing commands for Emacs |
;;; simple.el --- basic editing commands for Emacs |
2 |
|
|
3 |
;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 |
;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, |
4 |
|
;; 2000, 2001, 2002, 2003 |
5 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
6 |
|
|
7 |
;; Maintainer: FSF |
;; Maintainer: FSF |
181 |
(goto-char loc) |
(goto-char loc) |
182 |
(end-of-line))) |
(end-of-line))) |
183 |
|
|
184 |
(defun split-line () |
|
185 |
"Split current line, moving portion beyond point vertically down." |
(defun split-line (&optional arg) |
186 |
(interactive "*") |
"Split current line, moving portion beyond point vertically down. |
187 |
|
If the current line starts with `fill-prefix', insert it on the new |
188 |
|
line as well. With prefix arg, don't insert fill-prefix on new line. |
189 |
|
|
190 |
|
When called from Lisp code, the arg may be a prefix string to copy." |
191 |
|
(interactive "*P") |
192 |
(skip-chars-forward " \t") |
(skip-chars-forward " \t") |
193 |
(let ((col (current-column)) |
(let ((col (current-column)) |
194 |
(pos (point))) |
(pos (point)) |
195 |
|
(beg (line-beginning-position)) |
196 |
|
(prefix (cond ((stringp arg) arg) |
197 |
|
(arg nil) |
198 |
|
(t fill-prefix)))) |
199 |
(newline 1) |
(newline 1) |
200 |
|
(if (and (stringp prefix) |
201 |
|
(string-equal prefix |
202 |
|
(buffer-substring beg (+ beg (length prefix))))) |
203 |
|
(insert-and-inherit prefix)) |
204 |
(indent-to col 0) |
(indent-to col 0) |
205 |
(goto-char pos))) |
(goto-char pos))) |
206 |
|
|