From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: New optional arg to [async-]shell-command[-on-region] Date: Wed, 13 Jul 2016 21:06:18 +0600 Message-ID: References: <57865044.2020807@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1468422430 19292 80.91.229.3 (13 Jul 2016 15:07:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 15:07:10 +0000 (UTC) Cc: =?UTF-8?B?Q2zDqW1lbnQgUGl0LS1DbGF1ZGVs?= , Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 13 17:07:10 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 1bNLkj-0002KW-29 for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 17:07:09 +0200 Original-Received: from localhost ([::1]:48297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLki-0008Ux-0e for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2016 11:07:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLkJ-0008Gh-Ht for emacs-devel@gnu.org; Wed, 13 Jul 2016 11:06:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNLkF-0004AL-AK for emacs-devel@gnu.org; Wed, 13 Jul 2016 11:06:43 -0400 Original-Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:35707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNLkF-0004AH-3F for emacs-devel@gnu.org; Wed, 13 Jul 2016 11:06:39 -0400 Original-Received: by mail-lf0-x234.google.com with SMTP id f93so41691011lfi.2 for ; Wed, 13 Jul 2016 08:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=npB2biXcs/iYd0XMBec1Wfqg9YQ7nI+LGNibBE8DXTE=; b=0o6zFFOLv+/hGbPqhOjwxZ/EpLMiaeGnuTWZDjGQkOziUvXqkUbdJi/FpCc1yg5vtE Fq9pSPt5eBKvb0dZVETTklpubzAGIf7YkYXaQha55R854QvJtGZQyWACggUtNrs93yMJ ZB6PPTyOp+xmP1NxhBsMlGJzu1BRoooNcaR9R0n6ZRkLFg2Xl8eXU0QvJiUgzEnDWlk9 3je/TULV1GRBWUzzcJ2NZOcKKlM5uCDoYylWx8b51xua6M2jVaRWjpeHnGdae6eOvqx+ 4R7MAdV99u2tUfROeSL2gNYtf8dLACA8pzCHYAZVfAleieDbfRAi4IkTvwhyDFlKjju/ iRYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=npB2biXcs/iYd0XMBec1Wfqg9YQ7nI+LGNibBE8DXTE=; b=NfmaNkJa2VLU2j96gnsroxnMmZV5nQubn9cUmlJMS/HVqeenJICFAD4mUZGdeCBoXg W0zwKrhM6PfUjsP91a4gNMgv33HQ9CtE5uIa0efxOsAV86pwq4hLtoqe42xO+83a5YO1 tgTCy3mOuTNRx1FyNdknFHMezRFhFOzbFW9wR0g0b7JO91sahf/8J3qnp5lQLTiWe/E0 sfIgznhIzWW+/GeT4VJzyFOG1x/d1oFz5ViOkmAEumniaR7zBeTOAFbrmDSiilT1ZaNl 16xxED8+UdazRE+1Y0KkHMO8aA28Ie8thjpyLw3LOQZA7YymLV3Zf9Es+156lQt8v9eg qINQ== X-Gm-Message-State: ALyK8tJY7+y3/6hEopCkw5xHhVIrYL9pW5gUVRLXBnJQ3hIxtDQnOM8sHyOcjLF3CkY4GcOIdCcpqt1CDdy2qw== X-Received: by 10.25.169.147 with SMTP id s141mr4589123lfe.203.1468422398056; Wed, 13 Jul 2016 08:06:38 -0700 (PDT) Original-Received: by 10.114.182.164 with HTTP; Wed, 13 Jul 2016 08:06:18 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: L5bEova194kbP9Hs1knsTxCS7Dk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::234 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:205639 Archived-At: On Wed, Jul 13, 2016 at 8:48 PM, Tino Calancha wr= ote: >> 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 poin= t >> in the target buffer? (Is that desirable?) > > I should drop the `goto-char' call, right? I believe Cl=C3=A9ment is not asking you to drop the goto-char. No, he=E2= =80=99s asking you to *think*. And maybe make a UI design decision. > I added that line in order to insert the output of commad 'i+1' after the > output from command 'i'. That is a good goal, and (goto-char (point-max)) achieves it. Inserting new output right where the point is would be very unnatural. However, Cl=C3=A9ment hints that, if the user desires to retain the previous contents of the buffer, maybe they also want to retain their position in said buffer. If they do, you=E2=80=99d better save the original point position and return there after inserting the new command=E2=80=99s output; this is easiest done with save-excursion. On the other hand, the user might want to keep old output but skip straight to the new output. In this case, jumping to the end and then inserting new output is ok. On the third hand (there always is a third hand!), if the new output is longer than a windowful, the user may also like to start at the beginning of the new output rather than the end. It is now up to you, as the designer of the new feature, to decide which of the above behaviors you want to support.