From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Leo <sdl.web@gmail.com>
Cc: bug-gnu-emacs@gnu.org
Subject: bug#8415: 23.3.50; Extensible Emacs Registers
Date: Fri, 08 Apr 2011 22:25:02 -0300 [thread overview]
Message-ID: <jwvwrj49q2q.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m1bp0i7nyq.fsf@th041153.ip.tsinghua.edu.cn> (Leo's message of "Thu, 07 Apr 2011 11:13:49 +0800")
>> I think that's a better approach, yes (tho I'd pass the register object
>> to the functions, so instead of:
>>
>> (let* ((object (register-get register))
>> (val (if (register-p object)
>> (register-info object)
>> object))
>> (jump (and (register-p object)
>> (register-jump-func object))))
>> (cond
>> (jump (funcall jump val))
>>
>> you just have
>>
>> (let* ((object (register-get register))
>> (jump (and (register-p object)
>> (register-jump-func object))))
>> (cond
>> (jump (funcall jump object))
>>
>> or
>>
>> (let* ((object (register-get register)))
>> (cond
>> ((register-p object) (funcall (or (register-jump-func object)
>> (error "Don't know how to jump"))
>> object))
> I am lost here. VAL is needed in the rest of the function, the old code.
> So you can't just omit it.
In the rest of the function register-p is false, so `val' = `object'.
>>> 1. all existing register-creating commands need to use the new
>>> implementation, so the patch won't be any smaller.
>> That's for subsequent patches.
> The intention is to have a clean uniform extensible internal
> representation of registers so subsequent patches are completely trivial
> which I opted to omit for now so that people can focus on more important
> changes. Somehow that didn't work out well.
The patches will be just as clean with the other approach. Try it.
>>> 2. needs explicitly creating a register-value struct i.e.
>>> (register-set ?a (register-value-make ....)).
>> I see that as a feature.
> If register-value-make is not used, 'typecase polymorphism' has to be
> used. If we were to eliminate 'typecase polymorphism',
> register-value-make is required.
`typecase polymorphism' is what we have, and after the addition
I suggest we can remove it little by little.
> It just has selectors and three public function register-make,
> register-find, register-map. The rest of code can just build on top of
> them.
With the alist representation, register-find and register-map aren't
even needed.
Stefan
next prev parent reply other threads:[~2011-04-09 1:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-03 12:29 bug#8415: 23.3.50; Extensible Emacs Registers Leo
2011-04-03 17:21 ` Daniel Colascione
2011-04-04 1:29 ` Leo
2011-04-04 14:29 ` Stefan Monnier
2011-04-04 17:37 ` Leo
2011-04-04 22:19 ` Stefan Monnier
2011-04-04 22:27 ` Daniel Colascione
2011-04-05 1:41 ` Stefan Monnier
2011-04-05 1:49 ` Daniel Colascione
2011-04-05 3:07 ` Stefan Monnier
2011-04-05 5:42 ` Leo
2011-04-05 13:50 ` Stefan Monnier
2011-04-06 5:00 ` Leo
2011-04-06 15:38 ` Stefan Monnier
2011-04-07 3:13 ` Leo
2011-04-09 1:25 ` Stefan Monnier [this message]
2011-06-23 8:11 ` Leo
2011-06-25 13:19 ` Stefan Monnier
2011-06-26 6:42 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwrj49q2q.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=bug-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.