From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: [patch] minor patch for register.el Date: Mon, 11 Mar 2013 13:46:33 -0700 Message-ID: <3B7E09C32F29482CA7ACA0EC7AE880C5@us.oracle.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363034806 15724 80.91.229.3 (11 Mar 2013 20:46:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Mar 2013 20:46:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Stefan Monnier'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 21:47:11 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UF9ck-0006OS-7M for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2013 21:47:10 +0100 Original-Received: from localhost ([::1]:40568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9cO-00040h-2q for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2013 16:46:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9cI-0003zX-Ee for emacs-devel@gnu.org; Mon, 11 Mar 2013 16:46:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UF9cE-0005yy-C2 for emacs-devel@gnu.org; Mon, 11 Mar 2013 16:46:42 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:23260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF9cE-0005yV-57 for emacs-devel@gnu.org; Mon, 11 Mar 2013 16:46:38 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r2BKkasa002051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Mar 2013 20:46:36 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r2BKkZ8h021829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Mar 2013 20:46:35 GMT Original-Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r2BKkZCK016446; Mon, 11 Mar 2013 15:46:35 -0500 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 Mar 2013 13:46:35 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac4egm1huMOXqVPkTzK1ChgVbkkE4QABFw+A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157749 Archived-At: See my reply to Bastien. If you or he wants to patch register.el along the lines I suggested before he makes his more substantial (and welcome, IMO) changes, please feel free to do so. > [ BTW, I think "register is empty" is more correct than "no such > register". ] It's all about the ambiguity of nil as the return value of `get-register'. It can mean that there is no such register or that the contents are empty (e.g., the register has an entry in `register-alist' but its value is (REGISTER . nil)). As long as we do not distinguish those two cases we cannot tell the user which is the case for a given input char. "Register is empty" really makes sense (is helpful) only if the register previously was not empty. Otherwise it can be misleading. "No such register" is more useful in general, IMO, since there is no simple way (see above) to tell whether a given register previously was non-empty. When you type a character that has never been defined as a register, the message should tell you that. This is the more likely cause of a nil `get-register' value, IMO: you hit the wrong char. And in any case it is the more important cause for a newbie. The message should target this easy-to-make mistake. Put differently, we do not distinguish an empty register from a non-existent register. And given that, it is more helpful for users, IMO, to speak of both cases as non-existence. Note that we already use more specific error msgs for an empty register when the command is to insert ("Register doesn't contain text") or to jump ("Register doesn't contain a buffer position or configuration") or to increment ("Register doesn't contain a number or text"). That is helpful because it emphasizes what the command is for. However, it could also be argued that these messages can also be misleading when `get-register' returns nil, because they really suggest a type error, rather than an empty or non-existent register. Such a message makes more sense when the contents are not empty but are of the wrong type - e.g., a number as content when you try to `C-x r i'. But again, please do whatever you like. And I hope that Bastien will soon find the time to finish his intended update. That will be useful.