all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#8415: 23.3.50; Extensible Emacs Registers
Date: Thu, 07 Apr 2011 11:13:49 +0800	[thread overview]
Message-ID: <m1bp0i7nyq.fsf@th041153.ip.tsinghua.edu.cn> (raw)
In-Reply-To: <m17hbb4iy9.fsf@th041156.ip.tsinghua.edu.cn>

On 2011-04-06 23:38 +0800, Stefan Monnier wrote:
> 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.

>> 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.

>> 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.

For me, (register-make ...) is just simpler. One of the reasons that the
first patch I posted to emacs-devel evolved to the one I submitted in
this bug report.

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.

Leo






  reply	other threads:[~2011-04-07  3:13 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 [this message]
2011-04-09  1:25                         ` Stefan Monnier
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=m1bp0i7nyq.fsf@th041153.ip.tsinghua.edu.cn \
    --to=sdl.web@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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.