emacs-devel
[Top][All Lists]
Advanced

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

Re: Make register easier to hook


From: Daniel Colascione
Subject: Re: Make register easier to hook
Date: Mon, 28 Mar 2011 10:37:05 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

Hi Leo,

On 3/28/11 8:35 AM, Leo wrote:
> I would like to extend register.el so that 3rd party packages can add
> new register and have C-x r j, C-x r i and M-x list-registers work with
> it without needing to modify register.el.
> 
> With the attached draft patch, one can now do:
> 
> (defun WHATEVER-to-register (register)
>   (interactive)
>   (register-set register
>                 (register-make :info WHATEVER
>                                :jump-func function-to-handle-WHATEVER)))
> 
> And C-x r j will call function-to-handle-WHATEVER for jumping.
> 
> Any comments will be highly appreciated. Thanks.

Thanks for doing this work.  An extensible register system is also on my
wishlist.  Why did you decide to use the list for the register structure
instead of the default vector representation?

Also, have you considered eliminating the `info' slot?  Users can
construct closures over any necessary variables and assign these
closures to the register structure's remaining function slots.  After
all, we're getting lexbind, and this feature will make constructing
closures both easy and safe.

Thanks,
Daniel Colascione

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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