From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: emacs Fan Newsgroups: gmane.emacs.help Subject: Re: how to delete a line without putting them into yanking? Date: Sat, 11 Sep 2004 00:06:53 +0900 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5445eda004091008061b8f7a3f@mail.gmail.com> References: <87fz5rfaqc.fsf@bach.composers> Reply-To: emacs Fan NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1094828859 32032 80.91.224.253 (10 Sep 2004 15:07:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Sep 2004 15:07:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 10 17:07:21 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C5mzg-0002AV-00 for ; Fri, 10 Sep 2004 17:07:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5n54-000841-CM for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Sep 2004 11:12:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C5n4u-00081C-Ad for help-gnu-emacs@gnu.org; Fri, 10 Sep 2004 11:12:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C5n4s-0007zh-Nx for help-gnu-emacs@gnu.org; Fri, 10 Sep 2004 11:12:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5n4s-0007zZ-JR for help-gnu-emacs@gnu.org; Fri, 10 Sep 2004 11:12:42 -0400 Original-Received: from [216.239.56.242] (helo=mproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C5mzI-0003Ma-4g for help-gnu-emacs@gnu.org; Fri, 10 Sep 2004 11:06:56 -0400 Original-Received: by mproxy.gmail.com with SMTP id w41so184440cwb for ; Fri, 10 Sep 2004 08:06:54 -0700 (PDT) Original-Received: by 10.11.99.11 with SMTP id w11mr130589cwb; Fri, 10 Sep 2004 08:06:54 -0700 (PDT) Original-Received: by 10.11.118.38 with HTTP; Fri, 10 Sep 2004 08:06:53 -0700 (PDT) Original-To: Ole Laursen In-Reply-To: <87fz5rfaqc.fsf@bach.composers> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20597 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20597 On Thu, 09 Sep 2004 22:28:27 +0200, Ole Laursen 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.