From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Adding streams for standard out and standard err Date: Thu, 21 Jul 2016 21:13:26 +0100 Message-ID: <87bn1q3g2h.fsf@russet.org.uk> References: <87oa5sexis.fsf@russet.org.uk> <83eg6nysug.fsf@gnu.org> <87k2ge3jsl.fsf@russet.org.uk> <83invyyffg.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469132060 29770 80.91.229.3 (21 Jul 2016 20:14:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2016 20:14:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 21 22:14: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 1bQKMD-0002Qi-IY for ged-emacs-devel@m.gmane.org; Thu, 21 Jul 2016 22:14:09 +0200 Original-Received: from localhost ([::1]:43515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQKMC-000523-UC for ged-emacs-devel@m.gmane.org; Thu, 21 Jul 2016 16:14:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQKLf-00050v-Lj for emacs-devel@gnu.org; Thu, 21 Jul 2016 16:13:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQKLd-00081Q-Jk for emacs-devel@gnu.org; Thu, 21 Jul 2016 16:13:34 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:38002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQKLY-0007zG-Ht; Thu, 21 Jul 2016 16:13:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=fRDpuqwrOeMTAXIbAk2wQkWaCRTmHIUM5bVkgtnGhHU=; b=gM0AfvNukX8WBhGS37aHeJtZO6 6TytMmSUFLqS5a98UiSwj884Zj5PdpzmYdmK6Ph9ArwOHQdc/V8nPN+bTulqFM90SXqL7dm5hYZ+v W+leRmQJVBE9LAzpjlK3s2sm8BSwfdCF+oAvdjhPyeeoZm6jhsywjEtTd1N6O+5BwTUyAn8oPA3nA EZjFWOvP8hAVkkN4MzxJLzBZ6LeC+6CQ2KI/xeUxktiNyw7TiS2HDdv4FHc293EVxtnfCM4xGviTP JE7MSwDVpM6R0uYqkOBLbf8GwY7VlmO1I02bv3XGkPmoMNmA3eHt1KRPMUgwHqhs4tSMw3TQhJ5Y3 PRbFWhvw==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:53005 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bQKLX-001CHX-DO; Thu, 21 Jul 2016 21:13:27 +0100 In-Reply-To: <83invyyffg.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jul 2016 22:11:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 31.216.48.48 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:205990 Archived-At: Eli Zaretskii writes: >> From: phillip.lord@russet.org.uk (Phillip Lord) >> Cc: emacs-devel@gnu.org >> Date: Thu, 21 Jul 2016 19:52:58 +0100 >> >> (append-to-file (print buffer-undo-list) nil "/dev/stderr") >> >> seems clunky compared to: >> >> (print buffer-undo-list 'stdout) > > Nothing a simple function won't heal, right? > > Maybe that's all we need: a small wrapper around append-to-file. Actually, adding a new stream was your idea... http://lists.gnu.org/archive/html/help-gnu-emacs/2016-06/msg00207.html I'd never heard of streams in emacs before. I thought it seemed like a nice idea, so I thought I would give it a go. Yes, you are probably correct, that append-to-file could be used, without resorting to new C primitives. However, all the functionality that we need is already in the C layer. Also append-to-file (or rather write-region) would need updating to not send messages. It would also allow fixing this: (defun append-to-file (start end filename) (interactive "r\nFAppend to file: ") (prog1 (write-region start end filename t) (when save-silently (message nil)))) Append-to-file does not actually save-silently AFAICT, it just hides the message quickly. Phil