This is the mail archive of the guile-emacs@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

New internal implementation


Hello,

I've committed the new internal of Guile Emacs which uses GOOPS.

Now we have three primitive procedures: `%lisp-eval', `%lisp-apply',
and `%lisp->scheme'.  They work like this:

  (%lisp-eval '(current-buffer))
  => #<foreign-object <emacs-buffer> 40457800>

  (eq? (%lisp-eval '(current-buffer)) (%lisp-eval '(current-buffer)))
  => #t

  (define buffer (%lisp-eval '(current-buffer)))
  (define name (%lisp-apply 'buffer-name (list buffer)))
  name
  => #<foreign-object <emacs-string> 403cf4b0>

  (%lisp->scheme name)
  => "*scratch*"

So we are now ready to implement the new Emacs Scheme code that
utilizes GOOPS:

  (define (buffer-string)
    (%lisp-eval '(buffer-string)))

  (define-generic substring)
  (define-method (substring (string <emacs-string>) start end)
    (%lisp-apply 'substring (list string start end)))

  (define-generic eval-string)
  (define-method (eval-string (string <emacs-string>))
    (eval-string (%lisp->scheme string)))

  (eval-string (substring (buffer-string) 0 10))

For now, the old procedures (i.e., lisp-eval, lisp-apply, etc.) still
exist, so this version should not break the existing Scheme code.
After rewriting the code by using the new procedures, I'll remove the
old procedures.  (I'll be busy for more few days, so it will be after
May 10.)

Some additional changes from NEWS:

*** Guile Emacs turns on Guile's debugging features at startup time
if the command line option --debug-init is given.

*** Guile Emacs now displays an error and backtrace in the *Message*
buffer in detail when error-on-debug is non-nil.

*** The Lisp functions `scheme-apply' and `scmref-to-lisp' are removed.

Have fun!

-- Kei

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]