[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Guile modules and redefining functions
From: |
Leo |
Subject: |
Re: [Texmacs-dev] Guile modules and redefining functions |
Date: |
Fri, 11 Apr 2003 09:44:11 -0400 |
User-agent: |
KMail/1.4.3 |
On Friday April 11 2003 09:14, Joris van der Hoeven wrote:
>
> Hi Leo,
>
> > thank you for your suggestion but it does not work for me.
> > I am using TeXmacs-1.0.1.10 and "my-init-texmacs.scm" file is
> >
> > ; my-init-texmacs.scm
> >
> > (exec-file "$TEXMACS_PATH/progs" "init-texmacs.scm")
> > (use-modules (texmacs edit edit-misc) (core texmacs tm-define) )
> > (define (make-inactive-label) (make-expand-arg "MyOwnLabel"))
> >
> > ; EOF my-init-texmacs.scm
> >
> > Nevertheless when I type M-! or insert label from the menu the old
> > plain label is being inserted. It seems that my redefinition is simply
> > ignored.
>
> Try
>
> (set! make-inactive-label
> (lambda ()
> (make-expand-arg "MyOwnLabel")))
>
> Yours, Joris
Hi Joris,
I tried it and it WORKS!! Thank you a lot.
Let me guess: (define ...) defines a locally (file) scoped symbol.
which is different from the one by the same name defined
on the global or a module scope. This is why my redefintions were ignored.
Now, there should be a way to export such "local" definitions to outer
scopes without using (set! ...)
Yet another pitfall:
(define (make-inactive-label) nil)
(set! make-inactive-label
(lambda ()
(make-expand-arg "MyOwnLabel")))
does not work!! The reason (I guess) being that
(define (make-inactive-label) nil) introduces a "locally" scoped symbol
"make-inactive-label" and this locally scoped symbol shadows the global symbol
by
the same name, thus (set! ...) operates on the local one.
Thanks,
--Leo--