From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: [External] : What is the difference between (deactivate-mark) and (setq deactivate-mark t)? Date: Wed, 7 Apr 2021 14:54:47 +0000 Message-ID: References: <87pmzc825q.fsf@mbork.pl> <87v98ybrrn.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3687"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 07 16:55:46 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lU9aq-0000pJ-PX for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 16:55:44 +0200 Original-Received: from localhost ([::1]:35424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU9ap-0007BO-Mg for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Apr 2021 10:55:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU9aB-0007BI-Oo for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 10:55:03 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:47082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU9a9-0001pc-Iw for help-gnu-emacs@gnu.org; Wed, 07 Apr 2021 10:55:03 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 137EmwXI078335; Wed, 7 Apr 2021 14:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=TnNrK1VLZ6t0O1G56u8SC3X53EkFgaL3VCWX5zxhzjU=; b=AMpcRmvDXetE1bY170dNIztHNUWhodGi8P/bCvoZX+i7YP5vaf0FLT0sta0AbvqoA/ia eQOuA+NUhvdqgjsbemn5+nbqW6b8RHXvtlcQaiFI4ZqJ3AdXxb8gfX1yod0RMkVfn/j7 UyB1kIYcgMpQgeb6Za6SS/uTMfsSuRFKwA/PK6jsVnb1wMv9FIQ8WZcvso1DmWul7cVj W8vovPlAVd3sO3ApqSrMkxe4GPryDZ8thYTrvqckAL9dV4nhXukrGUq6twEer827DXYq 5YjH2Pvnmk3qG1l4suAJuTk5C4a5XQzko3l0eyCRuWdxZ/QONhdkA2zT/LOKbWgeqyRS sA== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 37rvas2tke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Apr 2021 14:54:51 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 137EpQxC149047; Wed, 7 Apr 2021 14:54:50 GMT Original-Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2175.outbound.protection.outlook.com [104.47.57.175]) by aserp3020.oracle.com with ESMTP id 37rvb43hha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Apr 2021 14:54:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k42lggIQunpN8zj5jAEcjw3Mil995PwnXP2IHMylHomEY9uSSPwohNFMu6uSW/wVBkcFU/o1AFXRN6QIEgBM9Q7Qk9zLCdQduxZ5i5sPjcvPYysVThS8zCIniFx00fl4Wv7v0Q8ni5QidHZ7VSaNiZLV7DdyXA4YgPbmeRz3s/J4rQQhd+1Jv4zyrDOwtWpvWzWFxekrWyzDUWtuVxr4x3U1xto23ZqZayTC/zpiGVssu8g6OvgPw1wjfe1R96VDgfxCEWaIcLtwUm2bMBdYsh3/jiRVtBrRPlh7JFuN6qdLjEc+tKQaMBmdaf4Z2JLVnLztDGfkTYhJJ4tbCAZ4QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TnNrK1VLZ6t0O1G56u8SC3X53EkFgaL3VCWX5zxhzjU=; b=TowY9pFbSvaAfbjASllNhxTKu+pIl1AA7cpGaAjWO+kYq1Yh6/PM5jUYnDw1TUnmCpT40eFg8fsMCOFLcMQzoyXz2GGpR6yyXsxDoIbSh6BjV2pgGzm5y2ciwN77woKYXhRXM3EpJXkETjkOk7iueGlyPjLt+Acdve8fkG8vILNqD0DcPP+rB2xB5fxvwOyow2yMuE3olqn2529Iq7bBvFxYEsVOLqyjLzDksCr3fJANtJP4Z0oevEaNcKN7QXm09nj6G00eWd6R8TeJe7IV6BMCLJK6J4XVv2zQV8qTytIlTaGTYksKJrzrv7BBvC6B4FcWeEsYXgvtt0NltN+83Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TnNrK1VLZ6t0O1G56u8SC3X53EkFgaL3VCWX5zxhzjU=; b=lOqmJf0waixcTfTUZLmYL+YsKhJCkfFuu7OKDQjRxl0C223PNkZux1tVeBuX4yW7znG7GAuJH47ISDvBEm4NK4k82W7kK/7lEQ+MpLPbAbXNxiWZze+UtLQ2HdZzb3Y8jZWaAuEobFaYxx8kwoK1wKeZGtYaqopSxIIjzTNi0KM= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB3069.namprd10.prod.outlook.com (2603:10b6:805:cd::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16; Wed, 7 Apr 2021 14:54:47 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315%5]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 14:54:47 +0000 Thread-Topic: [External] : What is the difference between (deactivate-mark) and (setq deactivate-mark t)? Thread-Index: AQHXK20DoXyEW1QTLkuu4YC4RbrD6KqpItgw In-Reply-To: <87v98ybrrn.fsf@mbork.pl> Accept-Language: en-US Content-Language: en-US authentication-results: mbork.pl; dkim=none (message not signed) header.d=none;mbork.pl; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fe8a8d0-bfb0-462a-5e2f-08d8f9d516c0 x-ms-traffictypediagnostic: SN6PR10MB3069: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iB06maRTQBBZO+BP7aplie4ziyJFhj0nRMKTiDEOJ+LiU50RAzftCp669vB+QF2nH+VLjutl35sqk2+88tv+ZnGtKrsNTmYvRzDmFRKr0lqQL8IFYrrBdZFT6ym+F/1hQGbUnD1lBNJlIfHK3tQTNVw8WaJEDvkOyd6Qn9fRs4CljXJ980AvH0voXYKesraejbIx23ndc0+jHZSaPmNCtAZXSyQKaz4uceYX6kqJWB8PsVI/k2qh1p2G69e+4jEr3lay7WcB6+iGXpfz4B5F+xn9s3rUNpMNLJUPfXAUa+f37hmjtLOgtyrp+q76dZRXBULN/xIKR+J9fj+7TzglAHiGeDT+SVmBOc4FXcbXbYfTou9JosvDBKYfW82DP1T9G0o+iZ8g8cxRxHYLBYU1uORLvUdwd1f0f3fDQW+Ng/4YZWsjiBBHz6ZCsb2gok0yawFQiU9QnPsB82wJGR+96UISJoRDjGjf98WTuLQoA4Ybb4TlxkTjiN8hiRnyT7fH5w3Cp2KEEvSXALbfgLA0YQEovq4Xog5GW5+qQIfxaEpkkkCk+CKPROLtXli4mifyuOWMgqNw5ndnoVsN3BdptB9ioZPEwk09+r0Gqir4LiVOVIqy+8+uLFPu4q1zt4KBUH4AgBdaSaU3Wp2Yb6AkiaAodvCwo1pEPdqEngNH7SY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(346002)(366004)(376002)(136003)(55016002)(5660300002)(186003)(6916009)(9686003)(26005)(2906002)(52536014)(478600001)(86362001)(33656002)(71200400001)(83380400001)(44832011)(6506007)(4326008)(8936002)(64756008)(66556008)(66476007)(66446008)(66946007)(316002)(7696005)(38100700001)(76116006)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?NikqCzV2p95ECflsxkmNRT1wT9ZhqgXdHDTDxf7qh7E6H1+2LFoJXt0Wwave?= =?us-ascii?Q?BCb0hu8xg6oaw2TbhGZ/pXDnhRVCij0TjQdZ+We92bDmVXYMfx8/b9IHd05j?= =?us-ascii?Q?2hqdFq+SyIWDkU2jTbPeDojFSTqIDULAKLMEkzJX/j1kdfuWM8CNTxxhlwXh?= =?us-ascii?Q?rrSpwL9b6HenFy/vyjbk6X6pMp6vYtBHRws2XNVbZpdv+kB3Aj7AMhSliT1q?= =?us-ascii?Q?1KE5J5tSSNBUQYeoOz6XeFXGOZTRVgYggQLdFCe7nrJUgePiIKSmPTKjlV0Y?= =?us-ascii?Q?vH+QjGTOtVYZ4wi34J/8aJo7O67JMB0IkD54hFH+IQkrluDaQPI6x88Jup9F?= =?us-ascii?Q?kjndnbldTe84zT5q0Qpkvsq3itcUMJ2zhTlnrv/x3rMIQOyi7u70memqQK2a?= =?us-ascii?Q?QW8G5dfLgDMgHkTGnq1IQo79ktpil+qOE/r2EdpclK+6+g2OyPBTD1WKlUst?= =?us-ascii?Q?+ubJ4XXZOJhhnW63Ddv7VLGbpnAZNdcFgpRH8b0x1RwkvHhiV0WlTlA9IoCo?= =?us-ascii?Q?kksBVXh/YmAJ00FqutiTOicIrBRq71ng3pmAItoKUoJsx36wdiUOFvHkdnek?= =?us-ascii?Q?bg1mX7qSUavEXg51NZHg1lsWJT2zPccbUtt6FddetBipWkZXSWERKA1POa8Q?= =?us-ascii?Q?drtO x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fe8a8d0-bfb0-462a-5e2f-08d8f9d516c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2021 14:54:47.7413 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 84Gn652UHdTx8AvlCssBgM0D4O5JmbhVr71MiRAfX3z2AV/ogcYRl899Rmqp1t/imxjRDTzLA0Wt6n5q0dD5fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB3069 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9947 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104070106 X-Proofpoint-GUID: 6SnReHZwGYL9RVmTZ56hvzZ9AEu4VqZN X-Proofpoint-ORIG-GUID: 6SnReHZwGYL9RVmTZ56hvzZ9AEu4VqZN X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9947 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104070106 Received-SPF: pass client-ip=156.151.31.85; envelope-from=drew.adams@oracle.com; helo=userp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128885 Archived-At: > > Function `deactivate-mark' deactivates the mark > > (duh), and it does so right away. > > > > After a command finishes and returns, the command > > loop normally automatically deactivates the mark. > > IOW, for the next command the mark is inactive. >=20 > Well, I don't think that's the case... > > I think I now know the reason - while experimenting with this and > studying the docs, I probably found out. Can anyone correct me if I'm > wrong? It seems that its main use is to actually _prevent_ the code > from deactivating the region _if_ it would do it otherwise, by means of > _modifying_ the buffer. Yes. I should have said just what the doc says: If an editor command sets this variable non-'nil', then the editor command loop deactivates the mark after the command returns (if Transient Mark mode is enabled). What I said gave the impression that that is always the case. The point is that it is often the case, or sometimes the case. And as you say, the real point is that your command can't know whether it will be the case. Setting the variable to nil makes sure it won't be deactivated by the command loop. The doc, which I pointed to, is very clear about all of this, I think. > Since every primitive that changes the buffer > (like `insert') sets it to `t', you can say `(setq deactivate-mark nil)` > at the end of a buffer-modifying command and the region will remain > active if it was before running it. Yes, I believe I said that. And not just if it was active before running your command. Your command can intentionally activate the region and use the variable (non-nil) to tell the command loop not to deactivate it. I gave examples of that.