From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: region-active-p Date: Thu, 01 Nov 2007 11:33:53 +0900 Message-ID: References: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193884462 31577 80.91.229.12 (1 Nov 2007 02:34:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2007 02:34:22 +0000 (UTC) Cc: reinersteib+gmane@imap.cc, andreas.roehler@online.de, emacs-devel@gnu.org, juri@jurta.org, monnier@iro.umontreal.ca, stephen@xemacs.org, drew.adams@oracle.com To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 01 03:34:24 2007 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.50) id 1InPt0-0000Jd-Cn for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2007 03:34:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InPsq-0004hM-JW for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 22:34:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InPsn-0004h1-4a for emacs-devel@gnu.org; Wed, 31 Oct 2007 22:34:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InPsl-0004fc-Na for emacs-devel@gnu.org; Wed, 31 Oct 2007 22:34:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InPsl-0004fK-H7 for emacs-devel@gnu.org; Wed, 31 Oct 2007 22:34:07 -0400 Original-Received: from tyo202.gate.nec.co.jp ([202.32.8.206]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InPsb-0002h0-Pf; Wed, 31 Oct 2007 22:33:58 -0400 Original-Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id lA12Xans019493; Thu, 1 Nov 2007 11:33:54 +0900 (JST) Original-Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay21.aps.necel.com with ESMTP; Thu, 1 Nov 2007 11:33:54 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay11.aps.necel.com with ESMTP; Thu, 1 Nov 2007 11:33:54 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 8CF59434; Thu, 1 Nov 2007 11:33:53 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (Richard Stallman's message of "Wed\, 31 Oct 2007 19\:58\:13 -0400") Original-Lines: 55 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) 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:82277 Archived-At: Richard Stallman writes: > > That name seems ok to me. But I think that `region-overrides-p' > > hits it more accurately. > > Overrides what? > > Overrides the command's usual behavior. Perhaps that's how it's usually used, but to name the predicate based on that seems sort of weird. If I see code like: (if (region-active-p) ...do-this... ...do-that...) It seems fairly clear to me what's going on (I'm assuming that people can intuitively grasp the idea of an active region -- given the commonness of this concept, and the suggestivenss of the term, I think they can). But this: (if (region-overrides-p) ...do-this... ...do-that...) (1) Obscures the fact that the _reason_ for overriding the is that the region is active. It sounds "arbitrary". In fact, upon first seeing it, it sounds like maybe there might be a "region-override" flag somewhere which controls the behavior, or that the rules were too complex to find a good intuitive name, and one must examine `region-override-p' to see what the actual rules are (I don't think this is true -- I think the _concept_ is pretty concise). This makes the code harder to understand. (2) It requires the concept of "usual" behavior to be understood, whereas a name phrased in terms. Perhaps in many cases that's OK, but it seems like an unnecessary bit of extra information one is required to know. One can imagine a command where the "usual" case the active-region case, but which also has a useful non-active behavior. For a command like this, the name "overrides" is awkward. Anyway, what I'm trying to say is that a name like `region-override-p' makes code harder to understand. -Miles -- "Whatever you do will be insignificant, but it is very important that you do it." Mahatma Gandhi