From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: New optional arg to [async-]shell-command[-on-region] Date: Wed, 13 Jul 2016 23:48:57 +0900 (JST) Message-ID: References: <57865044.2020807@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-2045949363-1468421340=:23367" X-Trace: ger.gmane.org 1468421391 2507 80.91.229.3 (13 Jul 2016 14:49:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 14:49:51 +0000 (UTC) Cc: tino.calancha@gmail.com, emacs-devel@gnu.org To: =?ISO-8859-15?Q?Cl=E9ment_Pit--Claudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 13 16:49:50 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNLTv-0006rr-W5 for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 16:49:48 +0200 Original-Received: from localhost ([::1]:48184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLTv-0000bJ-74 for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 10:49:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLTC-0000W3-Rk for emacs-devel@gnu.org; Wed, 13 Jul 2016 10:49:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNLTB-00085V-UZ for emacs-devel@gnu.org; Wed, 13 Jul 2016 10:49:02 -0400 Original-Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:35871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLTB-00085R-Nk for emacs-devel@gnu.org; Wed, 13 Jul 2016 10:49:01 -0400 Original-Received: by mail-pa0-x231.google.com with SMTP id pp5so11805184pac.3 for ; Wed, 13 Jul 2016 07:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=W5ZwXLRVAetTAYAsdXyt7g/8Kztmg6KADE81vegFrmk=; b=m7vzR5vKiL/ll652+uAYC9IUCKryS3LPa+rG5l0uj5chcvIaD0DtyilWzVNvBcPgGg 9QWS+OYHvPmsfWQ5Os/W8HScIQ5b36b+LJ2fnISWi4LZsX4X9Bum1ZwvmehboUcorOS7 Xx7q3B3LqUD16q1wveQa4plVz7ihPVB/aoEk0AVn81xVrZHUzvuopTseMtRYII2W4fmp PH/u+3i5N+OPcmHGXuxY9q0MG5TkwAEetwqlaNC6VpA1PIvslv7XdaBUG1pqfO+cf234 VDGKUaUWoxvkreT1fTwo+NdKV0pVngROq77ZNNNPJyb6mWQOBxYQnLc5rQ2J56F3Kuns 7o/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=W5ZwXLRVAetTAYAsdXyt7g/8Kztmg6KADE81vegFrmk=; b=G15tIH7XmrT4SB2iWk2xlFKTWutxMNjwEgcfopfPcuS3wywysE/6wGJ/WF7t5PDQi7 f/dItqdXg6GejNkhFEsNVA4KMntFX6piy5ozpC0UfCSswpsRBCG9rYjmlzQJ87cRfnvK Tp+tTdSXQDnGiCfeEFk1KSntp6rTfLeRWwYgNyNKmCCpkPos7/Xz4mRuGTeRn44Zpkjk vtGN81d/PnQ+TfTt87saaZHPSMVTX6GEzpZg8tXuSxW7IBgW88KFDVspPcuiCuLNidPt NdgP4LKhbiPzSIinLoqF9DiRbnbViwa77D42/IKiui8wqdf0CPkR7Ct8gQZ8hSP8QzgA c/Cw== X-Gm-Message-State: ALyK8tK2MBo1V/ql2NQuAlB/idEDxuE7FpKrbQrDYIKmim8vWUrMee91oLgvpo/WNdbvmA== X-Received: by 10.66.235.227 with SMTP id up3mr14209443pac.32.1468421340854; Wed, 13 Jul 2016 07:49:00 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id i20sm4634390pfj.91.2016.07.13.07.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 07:49:00 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <57865044.2020807@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205637 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2045949363-1468421340=:23367 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 13 Jul 2016, Clément Pit--Claudel wrote: > On 2016-07-13 16:09, Tino Calancha wrote: >> I would like to propose a patch adding a new optional argument KEEP >> for commands: `shell-command,' `async-shell-command' and >> `shell-command-on-region'. > > This looks like an OK idea to me :) Although you could also make it a defcustom instead of cluttering the call signature. That sounds good to me. Thank you. > Some comments below: > >> (let ((inhibit-read-only t)) >> - (erase-buffer)) >> + (or keep (erase-buffer))) > > I tend to prefer (unless ...) here. I see. Thanks. >> +Optional ninth arg KEEP, if non-nil, then the output buffer is >> +not erased before inserting the output." Thanks. I will polish it. > I think something went wrong with the grammar here. > >> - (erase-buffer))) >> + (if keep >> + (goto-char (point-max)) >> + (erase-buffer)))) > > Is this in a save-excursion? If not, is there a way to preserve the point in the target buffer? (Is that desirable?) I should drop the `goto-char' call, right? I added that line in order to insert the output of commad 'i+1' after the output from command 'i'. --8323329-2045949363-1468421340=:23367--