From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#24051: 24.5; doc of `external-debugging-output' Date: Mon, 29 Jan 2018 19:38:38 -0500 Message-ID: <87o9lci3jl.fsf@users.sourceforge.net> References: <871t2jyqj0.fsf@russet.org.uk> <87lgghk1q6.fsf@users.sourceforge.net> <12148302-2962-4a77-b644-d791c8581ce1@default> <878tchjyvh.fsf@users.sourceforge.net> <834ln4inj6.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517272650 9598 195.159.176.226 (30 Jan 2018 00:37:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Jan 2018 00:37:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 24051@debbugs.gnu.org, phillip.lord@russet.org.uk To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 30 01:37:26 2018 Return-path: Envelope-to: geb-bug-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 1egJvD-0001N2-OW for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jan 2018 01:37:12 +0100 Original-Received: from localhost ([::1]:52239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egJxE-0001ko-Gy for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jan 2018 19:39:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egJx3-0001iv-GD for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 19:39:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egJx0-0007QH-BO for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 19:39:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egJx0-0007Q9-61 for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 19:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1egJwz-0003fn-V6 for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 19:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jan 2018 00:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24051-submit@debbugs.gnu.org id=B24051.151727273014103 (code B ref 24051); Tue, 30 Jan 2018 00:39:01 +0000 Original-Received: (at 24051) by debbugs.gnu.org; 30 Jan 2018 00:38:50 +0000 Original-Received: from localhost ([127.0.0.1]:48374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egJwo-0003fK-6q for submit@debbugs.gnu.org; Mon, 29 Jan 2018 19:38:50 -0500 Original-Received: from mail-it0-f45.google.com ([209.85.214.45]:38161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egJwl-0003f1-R8; Mon, 29 Jan 2018 19:38:48 -0500 Original-Received: by mail-it0-f45.google.com with SMTP id w14so11415944itc.3; Mon, 29 Jan 2018 16:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WB3VH3Hpk9KL88gM6H6idIpsGZHLJ12S0ff07FHjflA=; b=HWQxCcZdLFEQZSOXcRC4T19TGVCi0hIOke2JlplNEx5rLxobIm6DRhVEVy1xgJOzEr 7+0Ekfj7SN7dkkAbxx+54JRQD7VdcVT4ea2KcBwUvTLOtMTulf7GPCXdIUL1RcIK9Xuk h3zASV20tjw0GwVq/FFD5sS91N1vB7W0xJZJ6rCeV0NxrLQ3S1d6cV0726geWFbzsXde yoylYQf5Kwrzkk0N67fYGH09FcD5QeX3iDGLkAuNOz6v0g6Lv6KGriPioKuViUTLxexH muwk/OXnVo0+EULxZQFtD0KaphHsaRKd4X7E1TGYfnjYMaieWhbI//ls36m6wLRYbx6o iO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=WB3VH3Hpk9KL88gM6H6idIpsGZHLJ12S0ff07FHjflA=; b=ByZLOniKEJ4ERse/1AQOii88TnrxlLuRpPmjRIopeqYaree0Rfch7vlEBGobHMd8W8 SskOb0/DIZScrLnkiw6/+xp52bWmzyaQ/f+XzwxMOobmUTEjGDe6sjbSyt42K6YbdnMR 6m4GMoyVwwD532TE0iMBF83ZanYef8F8YUteeNBqBpl6O1g4FvZ88CAnCFoicMJTCVhh vb0LxYaxCiyfWWG8dffJQcQMjJbGpJMp9gDAODx9zwcSJoCtBHS3rcunhA6EuXMbtk/E 06U0GSd4kd0fRcaJdNq16iIVSFwx6oYkO8w0EzOacdmSNCcJaipgz2ABdrr0LE4opipa uKUg== X-Gm-Message-State: AKwxytddzvgkZ5wJpClfXGqIsoLZMaWIO/k6cIRwNp86HzEKVDX2lfRy b2X/w4EU0OcU2S3ezmU3ro2MsA== X-Google-Smtp-Source: AH8x224rVNk5qMarJOBdIxp03aX2pJV9DmKPvuqEJ6t89MxKY6+OEHWAt07WK5QbaNUhbuBBmWi/mg== X-Received: by 10.36.131.198 with SMTP id d189mr14280650ite.39.1517272722025; Mon, 29 Jan 2018 16:38:42 -0800 (PST) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o73sm368434ito.4.2018.01.29.16.38.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2018 16:38:40 -0800 (PST) In-Reply-To: <834ln4inj6.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Jan 2018 19:26:53 +0200") 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: 208.118.235.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:142675 Archived-At: --=-=-= Content-Type: text/plain tags 24051 + patch quit Eli Zaretskii writes: > You should use @print{} for displaying the results (inside the > @example, not outside it). There are examples of that elsewhere in > streams.texi. Ah, so there are. I see some of them use @group, and some don't. I can't see any visible effect from @group so I left it out. >> I don't think it fits under "Output Functions" though, as it says: > But you can also mention it there, with a cross-reference. Hmm, it's a bit of an awkward fit, but yes, worth a mention (and actual cross-references are only to nodes, not a single function entry, so "the previous section" is already all the cross-reference needed, right?). > stderr is not a function, so @findex is not appropriate for it. I'd > rather suggest this: > > @cindex @code{stderr} stream, use for debugging Okay, here's the full patch, please double check my texinfo. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Document-external-debugging-output-in-the-Elisp-M.patch Content-Description: patch >From bfdc940eaa265bc17aae79cf97fc9775ec3d6e56 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 28 Jan 2018 18:16:48 -0500 Subject: [PATCH v2] Document external-debugging-output in the Elisp Manual (Bug#24051) * doc/lispref/streams.texi (Output Streams): List external-debugging-output. * src/print.c (Fexternal_debugging_output): Quote `print' in docstring. --- doc/lispref/streams.texi | 22 ++++++++++++++++++---- src/print.c | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index a25a5bfe84..119dd02808 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -503,7 +503,7 @@ Output Streams @end group @group -(print "This is the output" 'eat-output) +(print "This is the output" #'eat-output) @result{} "This is the output" @end group @@ -530,6 +530,19 @@ Output Streams Calling @code{concat} converts the list to a string so you can see its contents more clearly. +@cindex @code{stderr} stream, use for debugging +@defun external-debugging-output character +This function can be useful as an output stream when debugging. It +writes @var{character} to the standard error stream. + +For example +@example +(print "This is the output" #'external-debugging-output) +@print{} This is the output +@result{} "This is the output" +@end example +@end defun + @node Output Functions @section Output Functions @@ -570,9 +583,10 @@ Output Functions @end example In the functions below, @var{stream} stands for an output stream. -(See the previous section for a description of output streams.) If -@var{stream} is @code{nil} or omitted, it defaults to the value of -@code{standard-output}. +(See the previous section for a description of output streams. A +useful stream value for debugging, @code{external-debugging-output}, +is also mentioned there.) If @var{stream} is @code{nil} or omitted, +it defaults to the value of @code{standard-output}. @defun print object &optional stream @cindex Lisp printer diff --git a/src/print.c b/src/print.c index 6cf3c37e5e..64fc7eda31 100644 --- a/src/print.c +++ b/src/print.c @@ -748,7 +748,7 @@ DEFUN ("print", Fprint, Sprint, 1, 2, 0, DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugging_output, 1, 1, 0, doc: /* Write CHARACTER to stderr. -You can call print while debugging emacs, and pass it this function +You can call `print' while debugging emacs, and pass it this function to make it write to the debugging output. */) (Lisp_Object character) { -- 2.11.0 --=-=-=--