From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#35177: 27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark Date: Mon, 08 Apr 2019 00:39:04 +0200 Message-ID: <877ec5wid3.fsf@metalevel.at> References: <831s2dakjz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="68652"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Emacs/24.5 Cc: 35177@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 08 00:40:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDGSY-000HjO-Q9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Apr 2019 00:40:18 +0200 Original-Received: from localhost ([127.0.0.1]:44490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDGSX-0001yv-HS for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Apr 2019 18:40:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDGSL-0001xF-Be for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 18:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDGSJ-0001GF-Ht for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 18:40:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDGSI-0001Fa-5D for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 18:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDGSH-0001vy-S4 for bug-gnu-emacs@gnu.org; Sun, 07 Apr 2019 18:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Apr 2019 22:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35177 X-GNU-PR-Package: emacs Original-Received: via spool by 35177-submit@debbugs.gnu.org id=B35177.15546767487367 (code B ref 35177); Sun, 07 Apr 2019 22:40:01 +0000 Original-Received: (at 35177) by debbugs.gnu.org; 7 Apr 2019 22:39:08 +0000 Original-Received: from localhost ([127.0.0.1]:48829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDGRP-0001ul-Su for submit@debbugs.gnu.org; Sun, 07 Apr 2019 18:39:08 -0400 Original-Received: from metalevel.at ([78.46.218.83]:43028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDGRO-0001uc-LK for 35177@debbugs.gnu.org; Sun, 07 Apr 2019 18:39:07 -0400 Original-Received: by metalevel.at (Postfix, from userid 1000) id 2229AA03BE; Mon, 8 Apr 2019 00:39:04 +0200 (CEST) In-Reply-To: <831s2dakjz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Apr 2019 18:42:40 +0300") 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: 209.51.188.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:157330 Archived-At: Eli Zaretskii writes: > I think you need to put the entire progn inside the binding of > deactivate-mark. IOW, the binding should be in effect when the > command terminates. Please consider the following additional test cases: Both of the following forms keep the mark activated, while neither of them has the binding in effect when the commond terminates. Form 1: (progn (let (deactivate-mark) (switch-to-buffer (get-buffer-create "t")) (erase-buffer) (insert "hello")) (set-mark-command nil) (move-beginning-of-line nil)) Form 2: (progn (let (deactivate-mark) (switch-to-buffer (get-buffer-create "t")) (erase-buffer) (insert "hello")) (let (deactivate-mark-1) (set-mark-command nil) (move-beginning-of-line nil))) So, it seems very unexpected to me that an additional let-binding of deactivate-mark (to nil) causes deactivation of the mark, whereas both of these forms keep the mark activated (when evaluated with C-x C-e). If anything, I expect an additional let-binding of deactivate-mark to nil to retain the active mark "all the more". In other words, if: (progn (let (deactivate-mark) (switch-to-buffer (get-buffer-create "t")) (erase-buffer) (insert "hello")) (let (deactivate-mark-1) (set-mark-command nil) (move-beginning-of-line nil))) keeps the mark activated, then I expect the following to do too: (progn (let (deactivate-mark) (switch-to-buffer (get-buffer-create "t")) (erase-buffer) (insert "hello")) (let (deactivate-mark) (set-mark-command nil) (move-beginning-of-line nil))) Note that I only changed deactivate-mark-1 to deactivate-mark. So, in other words, binding deactivate-mark to nil deactivates the mark, which is the opposite of what I expect it to do.