public inbox for guile-emacs@sourceware.org
 help / color / mirror / Atom feed
* emacs-guile
@ 2002-01-17 14:25 Chris Beggy
  2002-01-17 15:08 ` emacs-guile Keisuke Nishida
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Beggy @ 2002-01-17 14:25 UTC (permalink / raw)
  To: guile-emacs

While trying emacs-guile-0.2 and emacs21.1, guile-1.4, I
couldn't even get very simple expressions to evaluate in the
scheme-interaction-mode:

(guile-lisp-eval '(+ 1 2))

gives:

cond: Guile error: unbound-variable, "Unbound variable:
guile-lisp-eval"

C-h v guile-lisp-command RET

gives: 

guile

Any ideas?

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 14:25 emacs-guile Chris Beggy
@ 2002-01-17 15:08 ` Keisuke Nishida
  2002-01-17 15:23   ` emacs-guile Chris Beggy
  0 siblings, 1 reply; 7+ messages in thread
From: Keisuke Nishida @ 2002-01-17 15:08 UTC (permalink / raw)
  To: Chris Beggy; +Cc: guile-emacs

At Thu, 17 Jan 2002 17:25:47 -0500 (EST),
Chris Beggy wrote:
> 
> While trying emacs-guile-0.2 and emacs21.1, guile-1.4, I
> couldn't even get very simple expressions to evaluate in the
> scheme-interaction-mode:
> 
> (guile-lisp-eval '(+ 1 2))
> 
> gives:
> 
> cond: Guile error: unbound-variable, "Unbound variable:
> guile-lisp-eval"

In scheme-interaction-mode, what you type is evaluated by Guile.
That is, (guile-lisp-eval '(+ 1 2)) is evaluated by Guile, and
Guile throws an error because guile-lisp-eval is not defined in
Guile.

So, try simply

 (+ 1 2)

Hopes this helps.

Best regards,
Keisuke Nishida

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 15:08 ` emacs-guile Keisuke Nishida
@ 2002-01-17 15:23   ` Chris Beggy
  2002-01-17 15:40     ` emacs-guile Keisuke Nishida
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Beggy @ 2002-01-17 15:23 UTC (permalink / raw)
  To: knishida; +Cc: guile-emacs

From: Keisuke Nishida <knishida@sky.sannet.ne.jp>

> At Thu, 17 Jan 2002 17:25:47 -0500 (EST),
> Chris Beggy wrote:
> > 
> > While trying emacs-guile-0.2 and emacs21.1, guile-1.4, I
> > couldn't even get very simple expressions to evaluate in the
> > scheme-interaction-mode:
> > 
> > (guile-lisp-eval '(+ 1 2))
> > 
> > gives:
> > 
> > cond: Guile error: unbound-variable, "Unbound variable:
> > guile-lisp-eval"
> 
> In scheme-interaction-mode, what you type is evaluated by Guile.
> That is, (guile-lisp-eval '(+ 1 2)) is evaluated by Guile, and
> Guile throws an error because guile-lisp-eval is not defined in
> Guile.
> 
> So, try simply
> 
>  (+ 1 2)
> 
> Hopes this helps.

Yes, thanks!  That works.  I am so confused...

I thought these libraries would help me:

   1. use elisp libraries in scheme
   2. let me use scheme libraries to do functions in emacs, like
   manipulating buffers and so on.

am I completely wrong?

Chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 15:23   ` emacs-guile Chris Beggy
@ 2002-01-17 15:40     ` Keisuke Nishida
  2002-01-17 15:55       ` emacs-guile Keisuke Nishida
  0 siblings, 1 reply; 7+ messages in thread
From: Keisuke Nishida @ 2002-01-17 15:40 UTC (permalink / raw)
  To: Chris Beggy; +Cc: guile-emacs

At Thu, 17 Jan 2002 18:23:07 -0500 (EST),
Chris Beggy wrote:
> 
> I thought these libraries would help me:
> 
>    1. use elisp libraries in scheme
>    2. let me use scheme libraries to do functions in emacs, like
>    manipulating buffers and so on.
> 
> am I completely wrong?

I am sorry you can't do them.  In order to use Emacs's facilities
in Scheme, which I originally tried in Guile Emacs, you have to
import Emacs Lisp functions in Scheme in Scheme's fashion, which
I realized very tedious.

My conclusion was this: "Write Emacs's things in Emacs Lisp.
Use Guile's libraries from Emacs if it helps."

Maybe I should update my page soon..

Keisuke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 15:40     ` emacs-guile Keisuke Nishida
@ 2002-01-17 15:55       ` Keisuke Nishida
  2002-01-17 20:06         ` emacs-guile Chris Beggy
  0 siblings, 1 reply; 7+ messages in thread
From: Keisuke Nishida @ 2002-01-17 15:55 UTC (permalink / raw)
  To: Chris Beggy; +Cc: guile-emacs

At Fri, 18 Jan 2002 08:41:31 +0900,
Keisuke Nishida wrote:
> 
> >    2. let me use scheme libraries to do functions in emacs, like
> >    manipulating buffers and so on.

Oops, you can do something with Emacs's buffers using Scheme libraries.
Try the following in _lisp-interaction-mode_.

  (require 'guile)
  (guile-import string-upcase)

  (insert (string-upcase (buffer-substring-no-properties 1 100)))

`guile-lisp-eval' is also a Lisp function.  You can use
`guile-import-module' to import all functions defined in
a Guile's module.

Keisuke

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 15:55       ` emacs-guile Keisuke Nishida
@ 2002-01-17 20:06         ` Chris Beggy
  2002-01-18  0:05           ` emacs-guile Keisuke Nishida
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Beggy @ 2002-01-17 20:06 UTC (permalink / raw)
  To: knishida; +Cc: guile-emacs

From: Keisuke Nishida <knishida@sky.sannet.ne.jp>

> At Fri, 18 Jan 2002 08:41:31 +0900,
> Keisuke Nishida wrote:
> > 
> > >    2. let me use scheme libraries to do functions in emacs, like
> > >    manipulating buffers and so on.
> 
> Oops, you can do something with Emacs's buffers using Scheme libraries.
> Try the following in _lisp-interaction-mode_.
> 
>   (require 'guile)
>   (guile-import string-upcase)
> 
>   (insert (string-upcase (buffer-substring-no-properties 1 100)))

and that returns:

  (require 'guile)
  (guile-import string-upcase)

  (insert (string-upcase (buffer-substring-no-properties 1 115)))  (REQUIRE 'GUILE)
  (GUILE-IMPORT STRING-UPCASE)

  (INSERT (STRING-UPCASE (BUFFER-SUBSTRING-NO-PROPERTIES 1 115)

which is great!  Now I am starting to understand.

> `guile-lisp-eval' is also a Lisp function.  You can use
> `guile-import-module' to import all functions defined in
> a Guile's module.

so guile-import, guile-lisp-eval, guile-import-module are all
your functions from guile.el.  Thanks.

Do we have any capability to do something like C-h f <scheme
function> to learn about the scheme functions in the imported
library?  Do we have to worry about collision with elisp symbols?

Chris



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs-guile
  2002-01-17 20:06         ` emacs-guile Chris Beggy
@ 2002-01-18  0:05           ` Keisuke Nishida
  0 siblings, 0 replies; 7+ messages in thread
From: Keisuke Nishida @ 2002-01-18  0:05 UTC (permalink / raw)
  To: Chris Beggy; +Cc: guile-emacs

At Thu, 17 Jan 2002 23:06:02 -0500 (EST),
Chris Beggy wrote:
> 
> Do we have any capability to do something like C-h f <scheme
> function> to learn about the scheme functions in the imported
> library?  Do we have to worry about collision with elisp symbols?

If you are only interested in docstrings of Scheme procedures,
try guile-scheme-mode and type `C-c C-d' (guile-scheme-describe).

Or if you want to import Scheme procedures with their docstrings,
call `guile-import' with option `:with-docs'.  You can specify
the imported symbol by the second argument of `guile-import':

  (guile-import assq guile-assq :with-docs)

  (documentation 'guile-assq)  =>

" - Scheme Procedure: assq key alist
 - Scheme Procedure: assv key alist
 - Scheme Procedure: assoc key alist
     Fetch the entry in ALIST that is associated with KEY.  To decide
     whether the argument KEY matches a particular entry in ALIST,
     `assq' compares keys with `eq?', `assv' uses `eqv?' and `assoc'
     uses `equal?'.  If KEY cannot be found in ALIST (according to
     whichever equality predicate is in use), then return `#f'.  These
     functions return the entire alist entry found (i.e. both the key
     and the value)."

See the README file for (a little bit) more information.

Keisuke

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-01-18  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 14:25 emacs-guile Chris Beggy
2002-01-17 15:08 ` emacs-guile Keisuke Nishida
2002-01-17 15:23   ` emacs-guile Chris Beggy
2002-01-17 15:40     ` emacs-guile Keisuke Nishida
2002-01-17 15:55       ` emacs-guile Keisuke Nishida
2002-01-17 20:06         ` emacs-guile Chris Beggy
2002-01-18  0:05           ` emacs-guile Keisuke Nishida

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).