unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mike Gran <spk121@yahoo.com>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>,
	"help-zile@gnu.org" <help-zile@gnu.org>
Subject: Re: Guile on Zile, module questions
Date: Tue, 03 Jan 2012 23:58:28 +0100	[thread overview]
Message-ID: <8762gsieaz.fsf@gnu.org> (raw)
In-Reply-To: <1325048275.82363.YahooMailNeo@web37903.mail.mud.yahoo.com> (Mike Gran's message of "Tue, 27 Dec 2011 20:57:55 -0800 (PST)")

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

Hi Mike!

Mike Gran <spk121@yahoo.com> skribis:

> I have a somewhat complete version at
> https://github.com/spk121/zile

Nice!

So, first, the obligatory patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 322 bytes --]

diff --git a/build-aux/snarf-c2h.scm b/build-aux/snarf-c2h.scm
index 10ca880..edc933c 100755
--- a/build-aux/snarf-c2h.scm
+++ b/build-aux/snarf-c2h.scm
@@ -1,5 +1,5 @@
-#!/usr/local/bin/guile \
--e c2h -s
+#!/bin/sh
+guile -e c2h -s
 !#
 ;;; output.scm  --  Output documentation "snarffed" from C files in Texi/GDF.
 ;;;

[-- Attachment #3: Type: text/plain, Size: 479 bytes --]


Then, it fails to build for me, basically because the all the subrs are
undeclared; for instance, G_beginning_of_line is DEFUN’d in basic.c but
then there’s no header that declares it, which leads to errors when
trying to use it in another compilation unit:

  src/funcs.c: In function 'G_backward_paragraph':
  src/funcs.c:747:58: error: 'G_beginning_of_line' undeclared (first use in this function)

I tried the hack below but that doesn’t capture all uses:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/x-patch, Size: 1087 bytes --]

diff --git a/src/main.h b/src/main.h
index 3a01b49..f06d4bb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -230,7 +230,10 @@ SCM_DEFINE (G_ ## c_func, zile_func,				\
 
 /* Call an interactive function. */
 #define FUNCALL(c_func)				\
-  gfuncall (G_ ## c_func)
+  ({						\
+     extern SCM G_ ## c_func ();		\
+     gfuncall (G_ ## c_func);			\
+   })
 
 /* Call an interactive function with a universal argument. */
 #define FUNCALL_ARG(c_func, uniarg)             \
@@ -330,11 +333,17 @@ SCM_DEFINE (G_ ## c_func, zile_func,				\
       cname = true;					 \
     }
 
-#define G_FUNCALL(c_func) \
-  gfuncall (G_ ## c_func)
-
-#define G_FUNCALL_ARG(c_func, uniarg) \
-  gfuncall_arg (G_ ## c_func, uniarg)
+#define G_FUNCALL(c_func)			\
+   ({						\
+      extern SCM G_ ## c_func ();		\
+      gfuncall (G_ ## c_func);			\
+    })
+
+#define G_FUNCALL_ARG(c_func, uniarg)		\
+   ({						\
+      extern SCM G_ ## c_func ();		\
+      gfuncall_arg (G_ ## c_func, uniarg);	\
+    })
 
 /*--------------------------------------------------------------------------
  * Keyboard handling.

[-- Attachment #5: Type: text/plain, Size: 50 bytes --]


Am I missing something?

Thanks!

Ludo’.

  parent reply	other threads:[~2012-01-03 22:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 22:09 Guile on Zile, module questions Mike Gran
     [not found] ` <1322690970.58961.YahooMailNeo-K7NgfNXsWCyvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
2011-12-03  9:04   ` Reuben Thomas
2011-12-05 17:11 ` Ludovic Courtès
     [not found]   ` <87obvnhrja.fsf-mXXj517/zsQ@public.gmane.org>
2011-12-28  4:57     ` Mike Gran
2012-01-01 21:07       ` [Help-zile] " Reuben Thomas
2012-01-03 22:58       ` Ludovic Courtès [this message]
2012-01-04 19:01         ` Guile on Zile Mike Gran
2011-12-28  4:59   ` Guile on Zile, module questions Mike Gran
2011-12-28 11:06     ` Klaus Schilling
2011-12-28 16:27       ` Guile on Zile Mike Gran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762gsieaz.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=help-zile@gnu.org \
    --cc=spk121@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).