🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99425

kill-line (was Re: philosophical bugs in emacs)

#99425
From: Kenny Ranerup
Date: Wed, 05 Sep 1990 19:59
38 lines
2106 bytes
>         Line processing would  be  much facilitated  if there  were a
>  real "delete line" command  that deleted  the whole   line including
>  <CR> with a single keystroke.
>
>Yes, I'm with you there.  I haven't used vi in years, but I still miss
>the "dd" command.

Well, I'm not sure if you're asking for just a key binding or a
delete-line function, but anyway.  I use the following function bound
to a function key to get the behavior I want for delete-line. It
deletes the current line irrespective of where the cursor is
positioned on the line. It also behaves the same for "empty" lines.
I'm sure there is a better way to do this in emacs-lisp but I'm just a
novice in emacs-lisp programming.

(defun delete-line ()
  "Delete current line as EDT, not as kill-line."
  (interactive)
  (beginning-of-line)
  (kill-region (point)
               (progn
                 (end-of-line)
                 (if (not (eobp))
                     (+ 1 (point))
                   (point)))))

In the edt emulation package there is also a delete-current-line
function, but unfortunately it doesn't put the deleted line in the
kill buffer.

   Kenny Ranerup

+-----------------------------------------------------------------------------+
+ Kenny Ranerup, Dept. of Computer Engineering, Lund University, Sweden
+ Phone: +46 46 104940
+ Email: kenny@dit.lth.se
+-----------------------------------------------------------------------------+
Technical Details
Message-ID: <1990Sep5.195926.18281@lth.se>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!lth.se!newsuser

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,ee315c1bc9fb981f,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-09-06 10:03:03 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!lth.se!newsuser
From: kenny@efd.lth.se (Kenny Ranerup)
Newsgroups: gnu.emacs.bug
Subject: kill-line (was Re: philosophical bugs in emacs)
Message-ID: <1990Sep5.195926.18281@lth.se>
Date: 5 Sep 90 19:59:26 GMT
Sender: newsuser@lth.se (LTH network news server)
Reply-To: kenny@efd.lth.se (Kenny Ranerup)
Distribution: gnu
Organization: Lund Institute of Technology, Sweden
Lines: 38
Posted: Wed Sep  5 20:59:26 1990