From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bob Newell Newsgroups: gmane.emacs.help Subject: Re: How to really clear eshell buffer? Date: Sat, 9 Jun 2018 14:08:34 -1000 Message-ID: References: <39643308-1912-7c8c-88b8-e777f1b5230c@xgm.de> <867en7ybgv.fsf@zoho.com> <86zi03wucg.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1528589246 7279 195.159.176.226 (10 Jun 2018 00:07:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2018 00:07:26 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 10 02:07:22 2018 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 1fRntA-0001kQ-HO for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 02:07:20 +0200 Original-Received: from localhost ([::1]:41846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRnvF-0003mQ-NB for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 20:09:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRnui-0003mI-Qt for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 20:08:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRnuh-0008Pf-Tr for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 20:08:56 -0400 Original-Received: from mail-yb0-x22a.google.com ([2607:f8b0:4002:c09::22a]:46880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRnuh-0008PI-Lo for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 20:08:55 -0400 Original-Received: by mail-yb0-x22a.google.com with SMTP id p22-v6so5570031yba.13 for ; Sat, 09 Jun 2018 17:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobnewell-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=RkWECZy/nDxr4FRtyIW6Es4k1EjvT4XqDh3G47WCT3Y=; b=Vqgj2jFV+z31VddlBxBb7x76Q9oQqEMDAAYrYQ7k3NT7+9h4Y6abZjXFiimV7ecnk5 N/Z5lX7hJh88JT/Ob0T1YT4X4Pl/Qt5vniZSRdlN7wNYkHfXzHDJ9H8hqYQoXZGv0l2f G3SvAb5LoElejb7iL2cACghqNI39gpAy/44gOw3MfIhEta3wARk8j14//uXDr2PmeFr+ 0VNIw1MR6byfGk4SYpXFAvHfwli3T0ZmB0PGBKyCPJV7j+Ev/rqb5YSnChXLnwmbNOvh zOho406NrUHAxbsM7ShHKhluR+wYOQmzBn22dxWvU5W0kD2h+7LSd4rOJXuUV8duzeyS ie7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=RkWECZy/nDxr4FRtyIW6Es4k1EjvT4XqDh3G47WCT3Y=; b=QC7LlV63NOdrmO9rchnCQoryrdSli3mrcBfcr8t5wdHhl8bsrJYIqTKkEnOILdFMWB afSRMB9dwmh93042HtVq0r9gLlWcLBfduIc/A+LH6rNZYuykCgPIdui+05FSHF2IN70C UDMpnVsR9pcC+SOyvSAUkz8MD5UMebFwjUv12uPTIAlXAj9Me8jpfFtXVHmnclZ61uTy 3OHDGMxUAHFULSCndkqRPwEQXPdl7hK7Bqa/oiKqwUQTKW5w84QOsStLs4MJKJkq91X8 PSUizd8y3Y+rJWYCQVxZkXVraexe7rjmCMIrtiT7IHvIiGgV2Q7gn+5cUeugGxATM2YY 5jpg== X-Gm-Message-State: APt69E1J1Ec/e/p3NM1konhP7KpkreNkYaFdZp/Bhc8V+6CYB4/+Xno8 00Rd5xaRAKmLjsu/SdVbXT89tXwPU8E09+vf1aEYgg== X-Google-Smtp-Source: ADUXVKKqtaqeZJB43+C/fAngLPyllcxpvqTeincgiNTKI3+xvKxup6ua0y8OlmssIH2B7f3mod9S/nQk/CN28RIAcZw= X-Received: by 2002:a25:ca01:: with SMTP id a1-v6mr7250915ybg.212.1528589334710; Sat, 09 Jun 2018 17:08:54 -0700 (PDT) Original-Received: by 2002:a25:250e:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 17:08:34 -0700 (PDT) In-Reply-To: <86zi03wucg.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c09::22a 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:117077 Archived-At: > (defun eclear () > (interactive) > (let ((inhibit-read-only t)) > (delete-region (point-min) (point-at-bol)) )) Much better in many ways. It doesn't disturb the kill-ring and limits the scope of inhibit-read-only. Thank you. Please realize that I threw something together in literally one minute, and I am the first to say that I still have much to learn. One thing I question, though ... what you have here preserves the prompt but assumes that point is on the prompt line. This is probably the normal case but it is not the universal case. I suppose one could go to point-max and then back up a line, but for such an odd use case, I wonder how much perfection is necessary. -- Bob Newell Honolulu, Hawai`i Sent via Linux Mint 17.