From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#9934: 24.0.91; `region-active-p' definition Date: Tue, 1 Nov 2011 15:26:35 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1320186481 31987 80.91.229.12 (1 Nov 2011 22:28:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Nov 2011 22:28:01 +0000 (UTC) Cc: 9934@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 01 23:27:51 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RLMo7-0006Du-QY for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Nov 2011 23:27:48 +0100 Original-Received: from localhost ([::1]:33808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMo7-0007Tg-By for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Nov 2011 18:27:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMo4-0007TW-Cr for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2011 18:27:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLMo3-0002AH-95 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2011 18:27:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMo3-0002A7-7Q for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2011 18:27:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RLMqI-00049J-EY for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2011 18:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2011 22:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9934 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9934-submit@debbugs.gnu.org id=B9934.132018654615848 (code B ref 9934); Tue, 01 Nov 2011 22:30:02 +0000 Original-Received: (at 9934) by debbugs.gnu.org; 1 Nov 2011 22:29:06 +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 1RLMpO-00047V-6W for submit@debbugs.gnu.org; Tue, 01 Nov 2011 18:29:06 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RLMpL-00047G-1I for 9934@debbugs.gnu.org; Tue, 01 Nov 2011 18:29:04 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pA1MQgYn001261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Nov 2011 22:26:43 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pA1MQftI027623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Nov 2011 22:26:41 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pA1MQZeT009380; Tue, 1 Nov 2011 17:26:36 -0500 Original-Received: from dradamslap1 (/10.159.60.177) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 Nov 2011 15:26:35 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcyY0iIgqQQwS5C7RTmhnKe+8Z6YJwAAtiJQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4EB07223.003D,ss=1,re=0.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 01 Nov 2011 18:30:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53411 Archived-At: > emacs -Q > M-x transient-mark-mode > M-: mark-active RET > C-SPC > M-: mark-active RET You're right about that - my bad. And I do use (and transient-mark-mode mark-active) in my own code (cross versions). It is the name `region-active-p' that is a bit misleading. Outside t-m mode the region is neither active nor inactive. When `region-active-p' returns nil it does not necessarily mean that the region is inactive. It means that either the region is inactive or t-m mode is turned off. (not (region-active-p)) is really `region-active-or-not-t-m-mode'. Pre-Emacs 23, `deactivate-mark' had no effect outside of t-m mode (as the doc string said back then, `deactivate-mark' "makes a difference only in Transient Mark mode"). (That is still the case apart from FORCE, as the current doc string notes.) Mark activation/deactivation has no meaning outside t-m mode. (And `mark-active' does not really test whether the mark is active - see below.) Likewise region activation/deactivation. The two, region/mark active/inactive, _should_ be synonymous. Whenever one is (in)active the other should be also. That's unfortunately not necessarily the case, at least according to some function/var names. The doc should be more careful and clearer, however. `mark-active' has in fact the same kind of problem as `region-active-p': When there is _no_ mark it is logically impossible to speak of _the mark_ being active or inactive. (not mark-active) is really `mark-inactive-or-nonexistent', where "inactive" is only possible/meaningful in t-m mode. All that is really possible (i.e., with any consequence) to test for the mark outside t-m mode is existence/nonexistence. `mark-active' was (and is) a sufficient test whenever t-m-mode is on, and it makes no sense to test `mark-active' when the mode is off - other than as a test for the _existence_ of the mark (same as (mark t) in that case). The notion of "active/inactive region" simply makes no sense outside of t-m mode. You've chosen to consider the region to be always "inactive" outside of t-m mode, judging by the name `region-active-p'. But if it is _always_ inactive then there is no such thing as active in that context - there is no active/inactive state difference. Active mark and region is really a t-m mode thing.