From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#8415: 23.3.50; Extensible Emacs Registers Date: Thu, 07 Apr 2011 11:13:49 +0800 Message-ID: References: <4D9A45CD.4030808@gmail.com> <4D9A7537.5030005@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1302147473 22166 80.91.229.12 (7 Apr 2011 03:37:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 03:37:53 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 05:37:50 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7g2W-0007PL-KW for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 05:37:48 +0200 Original-Received: from localhost ([127.0.0.1]:53454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7g2W-0004P9-38 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Apr 2011 23:37:48 -0400 Original-Received: from [140.186.70.92] (port=45408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7g23-0004Db-4C for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:37:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7g22-0006m7-04 for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:37:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7g21-0006m3-US for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:37:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q7fhR-0003Ew-KK; Wed, 06 Apr 2011 23:16:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Apr 2011 03:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8415 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by submit@debbugs.gnu.org id=B.130214613912425 (code B ref -1); Thu, 07 Apr 2011 03:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Apr 2011 03:15:39 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7fh5-0003EM-Fz for submit@debbugs.gnu.org; Wed, 06 Apr 2011 23:15:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7fgy-0003E3-0X for submit@debbugs.gnu.org; Wed, 06 Apr 2011 23:15:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7fgr-0001pm-M3 for submit@debbugs.gnu.org; Wed, 06 Apr 2011 23:15:26 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:36913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7fgr-0001ph-Hx for submit@debbugs.gnu.org; Wed, 06 Apr 2011 23:15:25 -0400 Original-Received: from [140.186.70.92] (port=35553 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7fgq-00069a-6l for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:15:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7ffc-0001XI-Jw for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:14:09 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:54455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7ffc-0001XB-74 for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2011 23:14:08 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q7ffZ-0007XR-Fz for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2011 05:14:05 +0200 Original-Received: from th041122.ip.tsinghua.edu.cn ([59.66.41.122]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2011 05:14:05 +0200 Original-Received: from sdl.web by th041122.ip.tsinghua.edu.cn with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2011 05:14:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 60 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: th041122.ip.tsinghua.edu.cn Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAElBMVEUAAAAAAP+LRRP0pGC+ vr7///+7mT1iAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMO DhglKe4AAAEsSURBVCjPbZNBboQwDEV/Cd4X9QJRThApmn0XYW+Jyf2v0m+HhqDBgiAe9rcTG7QH w/1Vn2Ar8gBb/ocywSN3qK9T3z4eFDB4eApocBpeBs1RSykoJd8gQcm8pGmHXFso3ajnmsqV0TnY DQkOfXUfN5NwaI7AWTVOyEhcu1aHmdWItHddUVUcUgUBCkitu8V6ditHVOVdqzl2EQ1ZVGTbdK0V 7cqn8vWzoU5Q/bF9Y/Y0cRU1xwkys5dJ+Dt6pBDWifcNQml8Gh2JVmPSoQzo7en0grswkxrUGYJ7 0hSxxAGr7ZMwYcHIzprpi7TENEE1xtiYxixRlCfPBsUUrwHD7uGIwATrbnODJcVrPpVn3hxiGloe m/S+z3CtuzUSMo83N4DPH+F0evwR3P4A2k+75838OKQAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) Cancel-Lock: sha1:1Zl1/s5ffQxgSayswmiWoHl/MPQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 06 Apr 2011 23:16:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45673 Archived-At: 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