From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: How to delete all text from beginning of buffer to mark Date: Tue, 09 May 2017 03:07:40 +0000 Message-ID: References: <481f9e2a-475f-4fb6-bb6b-abba56a27c2f@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1494299306 11981 195.159.176.226 (9 May 2017 03:08:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 May 2017 03:08:26 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 09 05:08:23 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7vVe-000316-HX for geh-help-gnu-emacs@m.gmane.org; Tue, 09 May 2017 05:08:22 +0200 Original-Received: from localhost ([::1]:34709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7vVi-0001Y6-Ee for geh-help-gnu-emacs@m.gmane.org; Mon, 08 May 2017 23:08:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7vVB-0001Xz-3Y for help-gnu-emacs@gnu.org; Mon, 08 May 2017 23:07:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7vVA-0006eH-Be for help-gnu-emacs@gnu.org; Mon, 08 May 2017 23:07:53 -0400 Original-Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:36634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7vVA-0006cc-5L for help-gnu-emacs@gnu.org; Mon, 08 May 2017 23:07:52 -0400 Original-Received: by mail-wr0-x233.google.com with SMTP id l50so58636845wrc.3 for ; Mon, 08 May 2017 20:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9fWcImKv3Vej10nvnthplemcM28vM9KWdcgMznAJleU=; b=iebwptNv/efgj+uW89VQxus9IXpJM0VL0r79EywvE25g9c6BKP9Gz57d6stiwmJUy0 /0h59zypvv5c6QU4GtLnPp0IaQpfZeRrImBfgTPR80wE8PTGwWnEak/9G1PEo5mXfCaE bclNJdaLVqWMa5h6CQ8K8R7pDfMijD0QIaEjhF2gm0mCpJsPBqqB5y3zURt2c94VSl8E wqxBYDEli65vJ3+cV1jZtFeVBZU4IfnAJmfmzZklF52kea175rnIQIUPrkkGQisQHzm9 VlgXspuWn9UIWJqgQIbCHgPn2M52WSxTTeDZZ72VxifZyCh9oY/gZz2UfqaEkMK7CvTe M3Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9fWcImKv3Vej10nvnthplemcM28vM9KWdcgMznAJleU=; b=oGcFRnfSy+thmimUmhRzNU1MSA+It+kU3L9PNhCUl/ct3dHZ5ilBiz+xtxwbDL+v8A UpZYAsUqttZ6X/znlKPXgU+HNOFlYSnoOeDO3Sy1Pw0jGC5am7xFh6S3g0tFaNcRKy5n Oeab+jKkPycAf85WePwdDQYWVHA5km3uxCDUZQpRP561IlWvmrk+wcQfRSrhticNg+Sn +W1OCZkOlncf9TOwYYsFxCA7t+xLJ3plvZm82CwIjN46drzGCA5m4ugf96v1kTDO9DQc 6Q6A5Tj7cZtJcRYFZaNELWo1/DSXlAabTz3RH7TFkO3NGXoY7HydxADSbLVrEv+9stvz Z8rA== X-Gm-Message-State: AODbwcBs+Cx2aeVRfnAP9besybRjdCofII5j6pxu7RtBkFdwb/wup3Ih h4QlTw/21zhb7S0Bqh2LJ6NJWhJuFA== X-Received: by 10.46.0.23 with SMTP id 23mr7794239lja.33.1494299270786; Mon, 08 May 2017 20:07:50 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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 Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112970 Archived-At: > > However it can be interesting to discuss > a function: > > (defun delete-to-point () > (interactive) > (let ((start 1) > (end (point))) > (delete-region start end) )) > For safety, I would set the start to (point-min) instead of 1. Then if the user has narrowed the buffer, the deletion will begin only from the beginning of the narrowed region, instead of the actual beginning of the buffer. > -- Kaushal Modi