From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nalaginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: bug#13077: guile: add repl-option for customized print Date: Tue, 04 Dec 2012 14:30:36 +0800 Organization: HFG Message-ID: <1354602636.25329.9.camel@Renee-desktop.suse> References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1354602662 22594 80.91.229.3 (4 Dec 2012 06:31:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2012 06:31:02 +0000 (UTC) Cc: 13077@debbugs.gnu.org, guile-devel@gnu.org To: Daniel Hartwig Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Dec 04 07:31:15 2012 Return-path: Envelope-to: guile-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 1Tfm2D-0003BY-8N for guile-devel@m.gmane.org; Tue, 04 Dec 2012 07:31:13 +0100 Original-Received: from localhost ([::1]:53027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfm21-00056U-6g for guile-devel@m.gmane.org; Tue, 04 Dec 2012 01:31:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfm1u-00055z-JK for guile-devel@gnu.org; Tue, 04 Dec 2012 01:30:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tfm1p-0008W2-Gw for guile-devel@gnu.org; Tue, 04 Dec 2012 01:30:54 -0500 Original-Received: from mail-ia0-f174.google.com ([209.85.210.174]:59027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfm1k-0008Uz-Iw for guile-devel@gnu.org; Tue, 04 Dec 2012 01:30:47 -0500 Original-Received: by mail-ia0-f174.google.com with SMTP id y25so3123869iay.33 for ; Mon, 03 Dec 2012 22:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=6ageSXSjsJotTMigMso9KfxAbXj8e3CetMMseRkyHuA=; b=Fdo/CXmU8UcmEMNW4GGEx+mkNqOkRkICvAqGYQW+WOKQBr/8Q3xe6gZHjPB5jNqos7 DTk6PXZaqMeNI0+l+0I0eNHWrwcjPYjvLqcr1BsPNQelbiAWGcaZBRnYk+CzMDNNi79g tP+PloSRprdodqymG4+OVQ8OWptgObjcEm6Wb4HgaisAK8VXrYpQv0CLpCDz3KoAUzdw uAAlgNcp8iVF/BfGHT+XeKYhKBUz6vesdn0C0gTLnf1n9mkm40swzYuJ3t18uxY/WDYO 7pqqykU5GwanvWcGdFq3nKCL7XdYhNS+mg9KQ3Rf9JIfkWYb84HaOvgk+o8yqAVXYITV bvuw== Original-Received: by 10.50.170.66 with SMTP id ak2mr1644204igc.38.1354602641812; Mon, 03 Dec 2012 22:30:41 -0800 (PST) Original-Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id vq4sm9169401igb.10.2012.12.03.22.30.38 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 22:30:40 -0800 (PST) In-Reply-To: X-Mailer: Evolution 3.4.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.174 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15295 Archived-At: I'll post my original guile-colorized which uses 'before-print-hook' to guile-dev. Though I've already tested it, I wish all folks test it for me. And I'll update it to repl-option version after ludo/andy accepts your patch. Or I should post it include your patch altogether? ;-) On Tue, 2012-12-04 at 13:34 +0800, Daniel Hartwig wrote: > On 4 December 2012 13:19, nalaginrut wrote: > > Hi Daniel! > > I believe this patch simplified my work, and 'colorized' module has been > > finished, I'm testing and debugging. > > I'll post it when it's all done. > > Glad to hear it. > > Attached is an alternate patch that handles before-print-hook and > *unspecified* outside of the custom print procedure, to avoid the need > for boilerplate there. > > -- > scheme@(guile-user)> (define (repl-print* repl val) > (format #t "~20@y" val) > (newline)) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) > 'print repl-print*) > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 = (0 1 2 3 4 5 6 7 …)