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: Wed, 20 Feb 2013 15:15:25 -0800 Message-ID: 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 1361402133 12909 80.91.229.3 (20 Feb 2013 23:15:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 23:15:33 +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 Feb 21 00:15:56 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 1U8ItG-0008QQ-Pl for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2013 00:15:54 +0100 Original-Received: from localhost ([::1]:40404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Isw-0004my-BB for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 18:15:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Ist-0004mq-OS for emacs-devel@gnu.org; Wed, 20 Feb 2013 18:15:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8Iss-0001Go-JA for emacs-devel@gnu.org; Wed, 20 Feb 2013 18:15:31 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Iss-0001Gj-C6 for emacs-devel@gnu.org; Wed, 20 Feb 2013 18:15:30 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r1KNFS0D019570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Feb 2013 23:15:28 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r1KNFRWD027989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Feb 2013 23:15:27 GMT Original-Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r1KNFRq5016612; Wed, 20 Feb 2013 17:15:27 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Feb 2013 15:15:26 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac4PjG9zrI4jbKSkQDS7bbea5wr8mAAMAi6Q X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:157226 Archived-At: > > Adds functions `register-insertable-p', > > `register-jumpable-p', and `register-printable-p'. > > Why are these needed? The text description of the change sounds good, > but the corresponding code ends up duplicating a lot of > `cond' code with no obvious direct benefit. General predicates usable elsewhere also. Unified error msg if register does not satisfy the predicate. > Using cl-assert indeed sounds wrong. It should probably be > a user-error instead. And the same error msg is appropriate even for cases where `registerv-p' is not true. > But what is the benefit of moving the test? Moving what test? Doing a `get-register' test outside the cond? Testing jumpability outside the cond? In both cases: to raise the right error msg. E.g., do this with the current code: `C-x r j w'. The error msg you get is not appropriate: "Register doesn't contain a buffer position or configuration". Dunno whether that msg is really appropriate for `file' or `file-query'. But even if it is, the real error in this case is that `w' is not a register. Do you want a patch with a change that indents the cond clauses as before and uses `user-error' instead of `error'? Or do you prefer to make whatever changes you want yourself?