From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Marc Chantreux Newsgroups: gmane.lisp.guile.user Subject: scheme with vim Date: Wed, 29 Jan 2020 16:56:47 +0100 Message-ID: <20200129155647.GA23079@prometheus.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="118475"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: julien@lepiller.eu To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Jan 29 16:57:07 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iwpiE-000UP6-Uz for guile-user@m.gmane-mx.org; Wed, 29 Jan 2020 16:57:06 +0100 Original-Received: from localhost ([::1]:48264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwpiD-0006n2-UR for guile-user@m.gmane-mx.org; Wed, 29 Jan 2020 10:57:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56401) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwpi4-0006mU-4s for guile-user@gnu.org; Wed, 29 Jan 2020 10:56:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwpi2-0003bC-5a for guile-user@gnu.org; Wed, 29 Jan 2020 10:56:55 -0500 Original-Received: from smtpout02-ext2.partage.renater.fr ([194.254.241.33]:33090 helo=smtpout02-ext1.partage.renater.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iwpi1-0003Si-V7 for guile-user@gnu.org; Wed, 29 Jan 2020 10:56:54 -0500 Original-Received: from zmtaauth02.partage.renater.fr (zmtaauth02.partage.renater.fr [194.254.241.25]) by smtpout20.partage.renater.fr (Postfix) with ESMTP id 1D373BFA0C; Wed, 29 Jan 2020 16:56:49 +0100 (CET) Original-Received: from zmtaauth02.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTPS id 134B1A00C1; Wed, 29 Jan 2020 16:56:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTP id 05A9BA0128; Wed, 29 Jan 2020 16:56:49 +0100 (CET) X-Virus-Scanned: amavisd-new at zmtaauth02.partage.renater.fr Original-Received: from zmtaauth02.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth02.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MyJGnV-fNhpP; Wed, 29 Jan 2020 16:56:48 +0100 (CET) Original-Received: from 91.168.156.224 (unknown [194.254.241.251]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTPA id DA563A00C1; Wed, 29 Jan 2020 16:56:48 +0100 (CET) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 194.254.241.33 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16116 Archived-At: hello people, during the guix days 2019, i made a demo of how awesome vim is as a scheme editor (because s-expr actually are text objects). then during the JRES, i said to Julien i'll write a tutorial about it. i started to write a filetype plugin and an interactive tutorial (vimtutor inspired) but i realize i need more guile skills. the very first start is here: https://github.com/eiro/vim-ft-scheme with: * simple completion based on searching the first letters after the '-' symbols (so `us-m` becomes `use-modules`). * mappings like (d for (define |) *l for =CE=BB, * explaination about what text objects are and how to use them but i have some questions: # completion i don't know what is the good way to get the list of built-in commands of guile so i ended up with aptitude search '~i ~n guile-2' -F%p | xargs -n1 dpkg -L | perl -lnE 'print if /[.]scm$/ && -f' | ctags -L - -f ~/.vim/ctags/guile any better way ? # please be quiet a way to test a code in vim is to use the interpreter as a filter using the ! action (:h !) or write in a pipe. if you do that with guile, the repl header is printed: GNU Guile 2.2.4 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. i wrote a wrapper: guile_as_filter () { local x=3D$( mktemp /tmp/guile-as-filter-XXXXX ) cat "$@" > $x guile -s $x rm $x } then i got ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/guile-as-filter-RTGLe ;;; compiled /home/mc/.cache/guile/ccache/2.2-LE-8-3.A/tmp/guile-as-f= ilter-RTGLe.go is there a way to restrict stderr and stdout to the content produced by the actual script ? (also interesting for a quickfix errformat) regards marc