From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#25992: perform-replace leaves mark-active when not transient-mark-mode Date: Mon, 06 Mar 2017 09:06:56 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1488820095 14593 195.159.176.226 (6 Mar 2017 17:08:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Mar 2017 17:08:15 +0000 (UTC) Cc: 25992@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 06 18:08:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckw7G-0003E8-CS for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Mar 2017 18:08:11 +0100 Original-Received: from localhost ([::1]:45191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckw7M-0005rr-CG for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Mar 2017 12:08:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckw7C-0005pp-2j for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2017 12:08:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckw78-00006j-SK for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2017 12:08:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44833) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckw78-00006c-Oe for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2017 12:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ckw78-0000VN-Hi for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2017 12:08:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Mar 2017 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25992 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25992-submit@debbugs.gnu.org id=B25992.14888200751925 (code B ref 25992); Mon, 06 Mar 2017 17:08:02 +0000 Original-Received: (at 25992) by debbugs.gnu.org; 6 Mar 2017 17:07:55 +0000 Original-Received: from localhost ([127.0.0.1]:43032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckw71-0000Uz-81 for submit@debbugs.gnu.org; Mon, 06 Mar 2017 12:07:55 -0500 Original-Received: from gateway21.websitewelcome.com ([192.185.45.155]:13920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckw6y-0000Ur-Sy for 25992@debbugs.gnu.org; Mon, 06 Mar 2017 12:07:53 -0500 Original-Received: from cm6.websitewelcome.com (cm6.websitewelcome.com [108.167.139.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 74FDA400DC9EA for <25992@debbugs.gnu.org>; Mon, 6 Mar 2017 11:07:49 -0600 (CST) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cm6.websitewelcome.com with id sh6z1u0Aw1W3Awq01h7Dj7; Mon, 06 Mar 2017 11:07:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AjB0vI5KZEaZL/ZzYsQWVbmBtFzVO1paRC8VudUxgc8=; b=FSRt6cPOinz7daSCKr/+ZMLPD+ SSsamCXQDlv7UuQ8e7nRodL0084aNqQMgJFoYQLuS5DUnT7LxsCm8go5iX1+enUW6mMpf3suiHLS8 gRz+iou7ppv918XLGD2IYPnOcjMrio4lD+hnUVCMaJw/wI3T8esvsLf6Pt30LHPoHPNfixQ5e5iIv BGZXu/ssEyQA9NQxQLAl4BtR06vzImxOaiJKhirNvKpFFH+dnN4f4uGouXsQQgKTa3WARiKDqPnU5 fU/0gOmPXdlJd9qDcD4YZHkAsRFXLRdBYTayWobdBRXnv8W5qQ0fB5GJsvs2Q1Ewe8o2BrGCB59/2 C2mIZy2w==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50383 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1ckw64-0000cU-QN; Mon, 06 Mar 2017 11:06:56 -0600 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1ckw64-0000cU-QN X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50383 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:130267 Archived-At: Thank you for taking a look at issue #25992. In a custom test to determine whether the region is active, I had been testing mark-active prior to using (region-beginning) and/or (region-end) to avoid trowing an error "The mark is not set now, so there is no region". When the following is true `(and mark-active (= (region-beginning) (region-end)))`, my custom function should return nil. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: Mon, 06 Mar 2017 18:26:53 +0200 FROM: Eli Zaretskii > > transient-mark-mode > > > Date: Sun, 05 Mar 2017 18:02:23 -0800 > > From: Keith David Bershatsky > > > > When transient-mark-mode is turned off, perform-replace leaves mark-active set to `t`. > > > > Step 1: Launch emacs -q > > > > Step 2: Turn off transient-mark-mode. (transient-mark-mode -1) > > > > Step 3: Evaluate mark-active and verify it is `nil`. > > > > Step 4: Run a simple perform-replace such as: (replace-regexp ";" "@" nil 1 2) > > > > Step 5: Evaluate mark-active and see that it is now set `t`. > > > > The desired behavior is to leave `mark-active` set to `nil` if it was previously set to `nil`. > > I'm not sure why you worry about mark-active when transient-mark-mode > is off: AFAIK that flag is only meaningful when transient-mark-mode is > on. Can you describe your use case? > > Anyway, the reason for activating the mark is that replace-regexp > calls push-mark, which always activates the mark when > transient-mark-mode is turned off. Not sure why we do that, but the > code which does that has been doing it for the last 24 years, so I > don't think we should change that now, unless we have a _very_ good > reason. > > Thanks.