From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs registers above 255 Date: Thu, 20 May 2010 10:46:38 +0200 Message-ID: <87aarvneoh.fsf@gmail.com> References: <87sk5ohtt4.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1274345237 18853 80.91.229.12 (20 May 2010 08:47:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 May 2010 08:47:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 20 10:47:15 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@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 1OF1PP-0001Iw-9E for ged-emacs-devel@m.gmane.org; Thu, 20 May 2010 10:47:15 +0200 Original-Received: from localhost ([127.0.0.1]:36836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF1PO-0001In-Br for ged-emacs-devel@m.gmane.org; Thu, 20 May 2010 04:47:14 -0400 Original-Received: from [140.186.70.92] (port=44769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF1PD-0001D0-9T for emacs-devel@gnu.org; Thu, 20 May 2010 04:47:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF1P5-0005cV-8X for emacs-devel@gnu.org; Thu, 20 May 2010 04:47:03 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.159]:41568) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF1P5-0005cH-2w for emacs-devel@gnu.org; Thu, 20 May 2010 04:46:55 -0400 Original-Received: by fg-out-1718.google.com with SMTP id 16so380895fgg.12 for ; Thu, 20 May 2010 01:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :in-reply-to:references:user-agent:date:message-id:mime-version :content-type:content-transfer-encoding; bh=bTeXJYzYGc3+ab522suG+SiVT4PKTFfXzylV4DfEZuI=; b=EeiNeamYDg+Z+PzKbSryq2tshxVQV36b4g//K9FNId+pVoIGfd6UIx5uxezRvvEkA+ R3tcQNehvsZ04X9ka92fWFfqYHNYcl8xedxd4r1hCewNlYzO/NngW1+2Cc7pxQAJN4VY jop4gKBmN2BgLPyjtebAXo20xJpNxH5v8e1bM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; b=h/nFYPbQ9NHnQCJorjaJEzPsp/dS754bIlv19jV1D782rsNm1kYyExA9DmxBAC4tFx 2UgH3bAGoiAkjRuAE1dWoaDr5hPmeLMQR4amdmNbRbx26mar+KMVd9HRHToS5hs28PD7 Ms2q/YM7y3w4N98Uf8QVPMO22xWLJkBBw3r4Q= Original-Received: by 10.87.47.23 with SMTP id z23mr1261370fgj.28.1274345213713; Thu, 20 May 2010 01:46:53 -0700 (PDT) Original-Received: from localhost ([88.103.132.186]) by mx.google.com with ESMTPS id 21sm12295991fkx.40.2010.05.20.01.46.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 May 2010 01:46:51 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 19 May 2010 13:18:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124960 Archived-At: Stefan Monnier writes: >> according to the documentation, registers are characters up to 255. >> But the actual implementation is very simple and permits storing >> "anything" in `register-alist' using `set-register'; it's just that the >> UI functions use the "c" interactive spec, so you can't really enter >> anything other than a character inputtable without an input method. > >> My question is: would you consider it too much of a hack if a package >> used registers above 255 to not clobber the standard registers, but on >> the other hand be able to use the existing infrastructure (my example >> use case would be implementing Vim-compatible registers in an emulation >> package)?=20 > > It would probably be a hack, but it would seem like a fair hack to me. ;-) > The main limitation I can see is that the "names" of registers are > compared with `eq', so cons cells wouldn't work too well, but symbols or > negative numbers would work. Yeah; I was really thinking about some numeric range above 255. > This said, I'm not sure why you'd want to use separate registers: I'd > expect it would rather be better if the Vim emulation is integrated with > the rest of Emacs's infrastructure, so being able to set a register with > Vim-emulation and then get it back using Emacs commands would seem like > a desirable feature. That's certainly one way to look at it. OTOH, there are notable differences between Vim and Emacs registers. What Vim calls "registers" includes alphabetic (ASCII) registers of which lower-case ones are overwritten every time you store anything in them and the upper-case ones are really only an "appending interface" to the corresponding lower-case ones. Then there are a few non-alphabetic registers with even more specific purpose/behaviour. Then there is what Vim calls "marks", which, again, are mostly alphabetic registers (storing file positions) and several non-alphabetic ones, also with specific purposes (for a change, the upper-case Vim "marks" are global, the lower-case ones are buffer-local). Because of these differences I think it makes more sense to leave the standard Emacs registers alone. (Viper, for example, only permits lower-case "marks", and does=20 (- char ?a) on them, so they end up being Emacs' control-char registers.) (Also, register-alist is obviously not a solution for buffer-local "marks", anyway. I'll have to think about it a bit more.) Thank you for the feedback, =C5=A0t=C4=9Bp=C3=A1n