help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This delete line function problems on last line - how fix?


From: Chris Seberino
Subject: This delete line function problems on last line - how fix?
Date: Sat, 2 Feb 2002 23:47:40 -0800
User-agent: Mutt/1.2.5i

(defun new-kill-line(&optional arg)
   (interactive "P") 
   (let ((current-pos (point)))
      (kill-region (line-beginning-position) (+ (line-end-position arg) 1))
      (goto-char (min current-pos (line-end-position)))))

This little gem deletes a line no matter what position you are on
in the line.

How do I make this function avoid "args out of range" errors
on the *LAST* line when I try to erase that???

Thanks,

CS
-- 
=======================================================
| Dr. Christian Seberino  || (619) 553-7940  (office) |
| SPAWARSYSCEN 2363       || (619) 553-2836  (fax)    |
| 53560 HULL ST           ||                          |
| SAN DIEGO CA 92152-5001 || seberino@spawar.navy.mil |
=======================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]