emacs-devel
[Top][All Lists]
Advanced

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

Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup?


From: Arthur Miller
Subject: Re: Q: BLV for function slots + BL obarray/hmap for symbol lookup?
Date: Sat, 29 May 2021 09:31:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt)

Arthur Miller <arthur.miller@live.com> writes:

>>> If "local obarray" is declafed in a buffer, all interning would go to
>>> that one, like all set/qset set's the local vaalue if there is one.
>>
>> But how do you control which buffer is current when the `intern` takes place?
>>
>> Also, have you considered something like
>>
>>     (setq-local obarray (obarray-copy obarray))
>
> You mean to copy Emacs global obarray into local variable, the other way
> around so to say, and use that one all the way? I didn't :-). Feels a bit
> drastic to a big global environment, but it might work, I'll have to try
> it. Thanks for the suggestion(s).

Just as curiosa to confirm, yes that worked, rather well :-). That was actually
what I asked for if you think, I just didn't thought of copying over the
obarray.

(setq-local obarray (copy-sequence obarray))
(defvar mysymbol "A SYMBOL")
(defun myfunc () "HELLO")

nysymbol and myfunc were avialable only in that buffer.

Don't know how efficient it is to copy entire obarray, in possibly
serveral buffers, but for the intended purpose, as a buffer-local
namespace works well. Thanks. 



reply via email to

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