unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Leo <sdl.web@gmail.com>
Cc: Davis Herring <herring@lanl.gov>,
	Daniel Colascione <dan.colascione@gmail.com>,
	8415@debbugs.gnu.org
Subject: bug#8415: 23.3.50; Extensible Emacs Registers
Date: Wed, 06 Apr 2011 11:38:43 -0400	[thread overview]
Message-ID: <jwv62qrv1jq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m11v1g7z57.fsf@th041153.ip.tsinghua.edu.cn> (Leo's message of "Wed, 06 Apr 2011 13:00:04 +0800")

>>>>> "Leo" == Leo  <sdl.web@gmail.com> writes:

> On 2011-04-05 21:50 +0800, Stefan Monnier wrote:
>>>> The end point is pretty much the same, but all the intermediate steps
>>>> are safe and easy to check.
>>> I think a structure still is a better approach.
>> 
>> I already agreed in the previous message.
>> 
>> 
>> Stefan

> Sorry if I have missed that.

> The alternative you propose, i.e. making the value a structure is
> actually the first approach I attempted in
> http://article.gmane.org/gmane.emacs.devel/137781.

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

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

> 2. needs explicitly creating a register-value struct i.e.
>   (register-set ?a (register-value-make ....)).

I see that as a feature.


        Stefan





  reply	other threads:[~2011-04-06 15:38 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 [this message]
2011-04-07  3:13                       ` Leo
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

  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=jwv62qrv1jq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=8415@debbugs.gnu.org \
    --cc=dan.colascione@gmail.com \
    --cc=herring@lanl.gov \
    --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).