/[emacs]/emacs/lisp/simple.el
ViewVC logotype

Diff of /emacs/lisp/simple.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.581 by rms, Sat Dec 28 21:23:23 2002 UTC revision 1.582 by kfstorm, Fri Jan 3 22:46:06 2003 UTC
# Line 1  Line 1 
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
# Line 180  With arg N, insert N newlines." Line 181  With arg N, insert N newlines."
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    

Legend:
Removed from v.1.581  
changed lines
  Added in v.1.582

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26