From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Florian v. Savigny" Newsgroups: gmane.emacs.bugs Subject: bug#37906: 26.2; `call-process' docstring, section DESTINATION Date: Thu, 24 Oct 2019 17:45:07 +0200 (CEST) Message-ID: <1640869770.32054.1571931907572@office.mailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="159690"; mail-complaints-to="usenet@blaine.gmane.org" To: 37906@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 24 19:50:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNhFx-000fNt-Rj for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2019 19:50:42 +0200 Original-Received: from localhost ([::1]:49354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNhFw-0003Li-EM for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2019 13:50:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35784) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNgSy-0007OL-Va for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 13:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNgSx-0004mT-E1 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 13:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNgSx-0004lK-1N for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 13:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNgSw-0006Wa-Ve for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 13:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Florian v. Savigny" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2019 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37906 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157193634924971 (code B ref -1); Thu, 24 Oct 2019 17:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2019 16:59:09 +0000 Original-Received: from localhost ([127.0.0.1]:36867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNgS4-0006Uh-Pk for submit@debbugs.gnu.org; Thu, 24 Oct 2019 12:59:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNfIg-0002SL-9j for submit@debbugs.gnu.org; Thu, 24 Oct 2019 11:45:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50214) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNfIe-0000Uo-4C for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 11:45:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNfIb-0002WY-Ou for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 11:45:19 -0400 Original-Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2]:26740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNfIb-0002Ut-4n for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2019 11:45:17 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2a.mailbox.org (Postfix) with ESMTPS id 0D0C6A1CA1 for ; Thu, 24 Oct 2019 17:45:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :subject:subject:message-id:from:from:date:date:received; s= mail20150812; t=1571931907; bh=37fZx9ENDz3WBRQ+7H8FdKvNNygxcxTMw 8bklSsAahU=; b=B54fuY5E3NwfVXi6td8ENCCiDZcWeXQrBoHWoM7+GBEBZULWT g4Yk8y7VvV6jBjP9L9vkIvGyJkzZ79GEVjNJ5rJRuG3fQTkcxxpNvIDdXBKxRZxf nI/WTrbaO27W9+9eW/8C8KSwzHPaxe7nDYxPTjhaPULzsvg3U4rqVa39l7vJCF63 BDxzAplfyuvWYnsy6CTtcl3+w6XGShgQAWBGipVIL7wXBhH3O//9wKCc7tbha3d/ mdF1SutBC1IonXcr8vxKLkl1JpvdanUxvyqP76BuOgVPtn4h0grEftXbetlsqSyW FCYKV9Kc+x2PqjQh48FcI1tGOIVij+sVkNLSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1571931909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BN+meENbKlzP9EZFyhx71szmfsX8WRm48hCLtuzbFAI=; b=yld9v4XNymcQ/vrVxl0Tu8RWFy3S1k6xHY6jMB7U8ocR2+0iwslcIW36D0+MfmULoOnFXJ eGsb6LkeTPojLjuFgLlgky6RLpur1qYmmW2V4FzXDlTB3NqNnortSVJIvovTShQqn/AFHT CSWT08NQOxFm4hcP06HNst+/KQm4EHm15r0nCqnvJNMaCqxhDZB5zz4MSsK27WahrrQ+17 2yOiEJt0mlrFCquxlhb6ugqY0dOZOMHEM9CJO7+kUJCki2RINCrzVDYhNB0CM9LSGpsxsj e+DVP72cfmp3Dd5+hrSmGOKL0cLsn2Lm11x0Hp+2JSsDHAevRx+u+FYTBWKnjA== X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id psTwAoxeWotL for ; Thu, 24 Oct 2019 17:45:07 +0200 (CEST) X-Priority: 3 Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Thu, 24 Oct 2019 12:59:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170142 Archived-At: Dear Emacs maintainers, since this pertains to documentation only, I have left out all the unnecess= ary debugging information.=20 The docstring of `call-process', which is extremely confusing (and partly w= rong) as regards the DESTINATION argument, seems to have been in its presen= t form for what must have been at least 15 years. Although the relevant sec= tion in the Emacs Lisp Info does a much better job (even though I still fin= d the choice of "REAL-" for standard out puzzling), I would strongly sugges= t that the docstring be rewritten, too. (That would probably have considera= bly sped up my understanding of Elisp in particular and *nix systems in gen= eral.) Apart from the confusion, the docstring specifically does not acknowledge t= hat e.g. (nil nil) as the DESTINATION (which might be a style somebody choo= ses to be more explicit about the the use of stdout and stderr) is perfectl= y acceptable, and also e.g. (nil "file"). Even '(0 "file") will be accepted= and work as expected.=20 The following would be my suggestion as to how the relevant section could b= e rephrased: ---------------------------------------------------------------------------= ---------------- Third argument DESTINATION specifies how to handle program=E2=80=99s standa= rd and standard error output. Its general form is a two-element list=20 (STDOUT STDERR), but there are shorthand notations for common uses (see bel= ow): STDOUT can be: - 0: discard it and return immediately, i.e. do not even wait for the progr= am to terminate - nil: discard it. - t: insert it into the current buffer before point. - a buffer name (i.e. a string): insert it into the buffer of that name bef= ore point. If that buffer does not exist yet, create it (even if there is no output)= . - a list (:file "some_file_name"): Write it to a file called "some_file_nam= e". If the "some_file_name" exists, overwrite it, otherwise, create it. STDERR can be: - nil: discard it. - t: direct it where stdout goes (mix it with stdout). - a file name: Write it to a file of that name, overwriting it if it exists= , otherwise creating it. As shorthand for the list (STDOUT nil), i. e. when the user wants to discard STDERR, also accept STDOUT without a list, as detailed above. I.e. take e.g. '(:file "some_file_name") as '((:file "some_file_name") nil)= . Finally, as shorthand for '("buffer" t) (i.e. insert stdout in "buffer" and stderr, too), accept also the buffer of the name "buffer", without a li= st.=20 I.e. take (get-buffer-create "buffer") to mean '("buffer" t). ---------------------------------------------------------------------------= ---------------- Best regards, Florian v. Savigny=20 Siebenpfeiffer Str. 25=20 66482 Zweibr=C3=BCcken=20 0175 - 365 24 17