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

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

Re: how to delete a line without putting them into yanking?


From: emacs Fan
Subject: Re: how to delete a line without putting them into yanking?
Date: Sat, 11 Sep 2004 00:06:53 +0900

On Thu, 09 Sep 2004 22:28:27 +0200, Ole Laursen <olau@hardworking.dk> wrote:
> > 3. write a lisp function to delete the path line, not kill it.
> 
> Here's one. Just put in your Emacs file and bind it to some key with
> something alongs:
> 
>  (global-set-key (kbd "C-c d") 'delete-line)
>.......
>  (interactive "P")
>  (delete-region (point)
>               (progn
>                 (if arg
>                     (forward-visible-line (prefix-numeric-value arg))
>                   (if (eobp)
>                       (signal 'end-of-buffer nil))
>                   (if (or (looking-at "[ \t]*$") (and kill-whole-line (bolp)))
>                       (forward-visible-line 1)
>                     (end-of-visible-line)))
>                 (point))))
> 
> --
> Ole Laursen
> http://www.cs.aau.dk/~olau/

It works.
Thanks, you really did it.



reply via email to

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