emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Lisp and Guile


From: Richard Stallman
Subject: Re: Emacs Lisp and Guile
Date: Thu, 15 Aug 2002 13:53:56 -0600 (MDT)

    There is a nearly standard macro out there called 'fluid-let' that
    encapsulates the process completely.  For example

It looks like the right idea, though the name is confusing given that
it does not use fluids.  Since the name fluid-let seems to be widely
known, perhaps fluids should be given a different name.  They could
be called per-threads or thread cells.

    > These functions could also have code for correct interaction with
    > buffer-local bindings and frame-local bindings.

    Does this refer to the fact that buffer-localness and frame-localness
    are not completely independent from dynamic scoping?

The point is, if the value that was saved by fluid-let came from a
buffer-local binding, it needs to restore that value into the same
buffer-local binding.  If the value that was saved was from the
buffer-global binding, fluid-let needs to restore that value into the
buffer-global binding.  The expansion of fluid-let needs extra code
both when saving and when restoring, to do this.

                                                          What would need
    to change in the above example when case-fold-search would be a
    buffer-local variable?

I am too overloaded to try to write the code (and I'd have to restudy
Scheme too).  Is my explanation above clear?

This needs to be done for all variables, since any might perhaps be
made buffer-local.  fluid-let could expand into the proper code for
this.

It might be useful to define a function to get the value and status of
a variable, and a function to restore based on that value and status.
(The status would identify the current buffer-local binding or
whatever.)  Then the expansion of fluid-let would call these
functions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]