GNU bug report logs -
#8415
23.3.50; Extensible Emacs Registers
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Sun, 3 Apr 2011 12:30:03 UTC
Severity: wishlist
Tags: patch
Found in version 23.3.50
Fixed in version 24.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>> 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
This bug report was last modified 13 years and 323 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.