unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: Leo <sdl.web@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Make register easier to hook
Date: Mon, 28 Mar 2011 10:37:05 -0700	[thread overview]
Message-ID: <4D90C741.2090808@gmail.com> (raw)
In-Reply-To: <m1tyen45s0.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2011-03-28 17:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 15:35 Make register easier to hook Leo
2011-03-28 17:37 ` Daniel Colascione [this message]
2011-03-29  0:52   ` Leo
2011-03-29  2:14     ` Daniel Colascione
2011-03-28 17:39 ` Davis Herring
2011-03-31 10:37   ` Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D90C741.2090808@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).