From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: =?UTF-8?Q?Mark_set_by_=E2=80=98mark=2D=2A=E2=80=99_not_deactivated_by_point_mo?= =?UTF-8?Q?tion?= Date: Tue, 18 Sep 2018 00:25:31 +0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1537205052 9219 195.159.176.226 (17 Sep 2018 17:24:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Sep 2018 17:24:12 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 17 19:24:08 2018 Return-path: Envelope-to: geh-help-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 1g1xFo-0002KY-2O for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Sep 2018 19:24:08 +0200 Original-Received: from localhost ([::1]:36765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1xHu-0007SR-DV for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Sep 2018 13:26:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1xHT-0007SM-NH for help-gnu-emacs@gnu.org; Mon, 17 Sep 2018 13:25:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1xHS-0005TI-T5 for help-gnu-emacs@gnu.org; Mon, 17 Sep 2018 13:25:51 -0400 Original-Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:41531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g1xHS-0005Cg-Js for help-gnu-emacs@gnu.org; Mon, 17 Sep 2018 13:25:50 -0400 Original-Received: by mail-oi0-x236.google.com with SMTP id k12-v6so19643790oiw.8 for ; Mon, 17 Sep 2018 10:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=eVW5Czk1lvLDl2jKRcCh+irUrhtcDihV97N456cgKw4=; b=TWeAaA72S3qHKWlZ4n+haaFP7K3y1al6SuLdIZPqC+i9FD7B1YOtqlrGC64QOnG/8z ZeuxXfU/mnai4X9BBimTNJw752B5esuFIuIWmseNqWxXuKUufx70LObbaU4MQ+Q5nN/t Elx3/gVuCyTScVZP25yJUcHZhovHvU9qhXpJW7wl2BqUH3ogcsxH9BszQYqDRy7w6Qv5 vBxCUcjFyUp6bcva0PqQZqGHbLMPabF7HlawmnGFkfV8R5DJFN6EpTeLtIS3QsJJ+zqw S1cGbZJAyVqDz1oUguWRCBDxtk/BWo3LkBNBokZZYrm6818bayUh7q1XUgHIgL8NFbm/ 3ixA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=eVW5Czk1lvLDl2jKRcCh+irUrhtcDihV97N456cgKw4=; b=qCD3FZ+cGT4EYQKkPh4SG9QzQGT/jUQ5MS2F9SEhpczIxb6gRdwDIshAJ86VQE1oYf njMqLTMqx/ihkALBwHCKO6a3ewBo735wXweFnvnCV2x2Tmq3tukMVM5EhVqBkiat6C7n ybdrnmB2Du0VZJLOJWMDxlO1l8Dr4b5vfVLzhEfSYydiJSz5nA9Eu51juROXnI82r7vi ChcDg1bDqlzL8b3OoC0nhqPHsSIaWOM/TdSIncGlzp8LegnbZFxK9cDgdBkOOvREU+fz VpA2GnYT2CxbSR8+1jzSvR9PmfhBYHkj80ul1tl7Sxhz5wo5VGGhpIjzh913t4Wabo8i CXGQ== X-Gm-Message-State: APzg51CztuRMY5necSFuIwfD6pM3CxVqMHv6tYXMZ6MWh1qyjenK+/Vi CzTq2CPF/y8Pl08d2kTSw91IHfXBB14ELpBNFzGOwNS+ X-Google-Smtp-Source: ANB0VdZgtZnGhVJdp5tkve+1TAZ/pp6JM0vKWuWmNqgFOfENCdhkvkdr8m7BeZfng9nxknMF9iU4jWoCx7MOWHH/cno= X-Received: by 2002:aca:e6d4:: with SMTP id d203-v6mr18290877oih.311.1537205143545; Mon, 17 Sep 2018 10:25:43 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117942 Archived-At: Hello, the raging discussion about the region models in emacs-devel reminded me of an annoyance that I never took the time to report. $ emacs -Q M-x emacs-version =E2=86=92 GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9= ) of 2018-05-29 M-: transient-mark-mode =E2=86=92 t M-: shift-select-mode =E2=86=92 t 1. Move point before the word =E2=80=9Cbuffer=E2=80=9D in the first line in= *scratch*. 2. Press M-@ for =E2=80=98mark-word=E2=80=99. Observe that the mark is set = after the word =E2=80=9Dbuffer=E2=80=9D and activated. 3. Move point with an unshifted point motion key. Observed behavior: point moves as commanded, mark remains active. Expected behavior: point moves, mark is deactivated. Carefully looking at the docstring of shift-select-mode and the implementation code in simple.el, I see that unshifted point motion keys only deactivate mark if it was activated by shift-selection, but it runs against my general expectation that selection goes away after any motion that is not specifically directed to extend/shrink selection. The only exception I=E2=80=99d make is C-SPC =E2=80=98set-mark-c= ommand=E2=80=99 because I see that as an explicit command to start marking an active region without holding down Shift (e.g. as a workaround for terminals that do not report Shift+arrows to the application). Pre-emptive counterarguments: =E2=80=9CYou could use Ctrl+Shift+ to mark a word in a way that will= be deactivate on motion.=E2=80=9D =E2=80=94 Yes, but the issue also affects ma= rk-sexp, mark-end-of-sentence, mark-paragraph, mark-defun, and mark-page, and not all of these have shift-translatable motion equivalent. (E.g. forward-paragraph is on M-} which is already shifted, and forward-page is on C-x ] whose shifted version, C-x }, is bound to enlarge-window-horizontally.) =E2=80=9CYou could advise mark-* so that they set transient-mark-mode the s= ame way as shift-selection does.=E2=80=9D =E2=80=94 Why yes, I could. Thanks. (defun yk-mark-*:after (&rest _args) (setq-local transient-mark-mode (cons 'only transient-mark-mode))) (advice-add 'mark-word :after 'yk-mark-*:after) (advice-add 'mark-sexp :after 'yk-mark-*:after) =E2=80=A6 (advice-add 'mark-whole-buffer :after 'yk-mark-*:after)