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: Sat, 3 Apr 2021 04:24:22 +0000 Message-ID: References: <87pmzc825q.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="38337"; mail-complaints-to="usenet@ciao.gmane.io" To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 03 06:24:56 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 1lSXqB-0009tI-Kz for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 03 Apr 2021 06:24:55 +0200 Original-Received: from localhost ([::1]:40946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSXqA-0001Oi-N3 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 03 Apr 2021 00:24:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSXpl-0001Oa-Kt for help-gnu-emacs@gnu.org; Sat, 03 Apr 2021 00:24:29 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:50980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSXpj-0000w9-RX for help-gnu-emacs@gnu.org; Sat, 03 Apr 2021 00:24:29 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1334OQG5140644; Sat, 3 Apr 2021 04:24:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=AWHx7PI+zeirs60DMdFJBqPfh/jzQ6QExymEm8WmXig=; b=o3hM338dKRfijIymCUwi8w+2kpxP1b+nkz3zqtf0asAo6560vg3fFJMleVeGHkIYDReI r3lIeLie0bgHShEXsKG4Wy8mdl0osJzzSC29zF6xrLYs41V4oUsd7DtxaQhWLgqNYtW2 MiV6sW0Y/BHcZMW6okbjNkUbX5Y1xHXP3hV6mdj1tvnrrJEPOHQQVVYZdkrlEAf7bkgs nR70ehURkwa92BZXNeVC4OP3Q5luzyPve3kXazhbYJhKCU6NV9PlwJ9QBPIqT4UcQ++U ULX8y6jXmiynZKZfPrrxQQ8JM89WzRX6vrCV/45BG+t+vldeKhVx6V9c2mWcIoxmtk3l 9g== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 37pgam80t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 03 Apr 2021 04:24:25 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1334EnrC089953; Sat, 3 Apr 2021 04:24:25 GMT Original-Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by userp3020.oracle.com with ESMTP id 37pfpjss01-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 03 Apr 2021 04:24:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YeMmHNXaFG2Ytav92L/RwigXbEy8tIWOkQO0dQCAmzat/IIdbhDGm5kj/568b1zk2c1O6BVDIca+NE3lHTZWVeP2dmGNxylRPoBlUNsIScIgWZVOpx1N9ZUR01Ob50LOtxr95ys/g+1/2j12BvaDK0TnWgPeoPEkG3c5V6tTKBqiGatOMXMtSF1t5Htpmj3vHJqyLBpGftRk5R2T1Sv4iU7PPLRzvTa91hRmv/VyHnfeVRdlvTRTAc4AJ4Y8k7vMHnqblFBJlnjmx952ahLuxsu03bIjw7EqCZgu/ASM4SpNsdn/yANoOGTQV73jXPI7o3PNGoAsqvmA5FtkIh21AA== 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=AWHx7PI+zeirs60DMdFJBqPfh/jzQ6QExymEm8WmXig=; b=GUDE0kFuY+2k0dmVubKUUed8axyyGH1yQ6ETZhM50lvA7assHbcCx+EXGODDPU8trpqDKJFlaTjLXQ53MlKWfppDo172L1FszL+KaDkvmGAnQXAXX900kPKTtzrCQiFcfqbpWj7k1OJvAfRM6GEivoSsZWiLoU8OuiI80fvu7A8UYOueLYauZSXPa2Gpzpz2WyY5NDVEnnLEDDaQOkZF7fbfCPg0jLE0NXnLWZ0GmLrEcbf8nIP+9wSEhJ2DuyJ6wsrlU6/rpArTl8xkbxy4H+JZc8eE+Zuf5niw9ITHvBu/Lu9TZPP1kHvAk6EtgJUwOHTo73bxDxgoGal1IHw0gw== 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=AWHx7PI+zeirs60DMdFJBqPfh/jzQ6QExymEm8WmXig=; b=hmeZibPI2tYSr8thLRgW3yBexu6x/ckFwnemA/dEClnUp8fSPVbsTCE7Gang3zsjO3k3+xh2Oq0rpDBHaqabg87l/3yB7x75gKYlWsLOKdufAmp7d44cb2Q5bOqeVz6EUpSdZuOF7tVM+3Dk4yhUL/GQkyosQRZled1gUkWOLl0= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2800.namprd10.prod.outlook.com (2603:10b6:805:db::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Sat, 3 Apr 2021 04:24:23 +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.030; Sat, 3 Apr 2021 04:24:23 +0000 Thread-Topic: [External] : What is the difference between (deactivate-mark) and (setq deactivate-mark t)? Thread-Index: AQHXKDthqSNi4uUFpEePYPI0nAaEwKqiLJ3wgAAB5mCAAAGEEA== In-Reply-To: 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: c335db68-d140-438f-941f-08d8f6585bc8 x-ms-traffictypediagnostic: SN6PR10MB2800: 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: osINOV2DFvj9aF+RLtrWMEH/JwFJZtaJH+v3Gun2FRcrJ/N+Ug+CTu1LXh1NkNBPHJUasOxF7SnfiZuZKFuyfAmc1+scIkzKhDa7jiiRsssIKCC76Li4IeTI1L0lgBvQYBJaW2EZpd1TjWa/tlQBFMldLGUbODoau2lvXC9bJl4FxYJJvqxTSVS4QMPk6e6BvYDJwl/v5+2ZOWRk4/ko87+dWHjp0nnBxflBD9JEhlsA24c5rVCiid7XL15GjAbdTqlahX7skGqW3yC2NnDbD1LIYKYZCPZcurNkrDrMFdFI63E2gxAwg+rqm5ap7Fnm+B2VNwChcnDaihqHePZAxpJt0ok6tVxZHGHa6/qxuodpYwebk6jiaSy/l8UbXjOXtIMcAo+ubmDKsgN/PI3FzlojbiTl76Bq0b3ER2Q0sImzJcXeVbZKwhiW02HI+g3IbAQ4qBuDSoObPKI4jEk1zM/YpTFj+/6X/Fh/s3Got1zZxcXSlgrpBNHSBDQGFNxQl8XEHAx9XMdfssD0z3c+Y9X4gc82DL3vwLWWe6zQcH+isGaYcDcK/PYyqBc6AH55GOjiartCyXyRULE5QRE9GWae7Ee+6Z5+rW9wVbW3mwvwq0tYTqM80DdVFvbBkvw3hE+RpSBtxixadG9hwSfh11rtF4fL+8LiNmhFbJVXfnQ= 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:(366004)(346002)(396003)(376002)(136003)(39860400002)(86362001)(83380400001)(52536014)(66946007)(8936002)(8676002)(5660300002)(7696005)(186003)(6506007)(2906002)(66556008)(66446008)(66476007)(33656002)(316002)(71200400001)(9686003)(76116006)(478600001)(44832011)(64756008)(2940100002)(26005)(38100700001)(110136005)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?+tuC3GjhSSfbE2WCvZr1VLk92leE/WD1PWSraeX+dUMw7eTMTurrAKNzJeBU?= =?us-ascii?Q?2YSZ4xbemgNeRvnkeaTkJh6xJK+/rfNFkBZQ5p1bA8/79/frwRrFWpVSI7Z8?= =?us-ascii?Q?oXDigTWaLBWimpBCpDDawQYf50x2z1i12/2aLfUm9LsyMDiuStjysbGLuO1u?= =?us-ascii?Q?yIDA1t/E8U6Fne6Kawo5KU1aTsqnbW+D9M4HRID2RQ8+VtNkdfnW9/V6kRrM?= =?us-ascii?Q?McLtUVD9nS6kH4JNvdF6u9A5ndhj2JNiVrfqGaU+fGSJ58yA0cliaESYJRVJ?= =?us-ascii?Q?8Tuk0p9HDb6LCR3QUTpJlXdwfCOUb5KhnPXCHuAfp5qOyanuN7xtO01wydfF?= =?us-ascii?Q?eEHveUruqC5eSPvLnKAgp8I74ayGCDtQIgVDHZvBjFAedpzbAPUge54bbHCB?= =?us-ascii?Q?HTNa02nPG79A0SGHx/i/YXj2vI2CEv7EEFDa11TnGFsuG5Gb33D1pR6Rebca?= =?us-ascii?Q?6Coa9A4zCIIhc847nHsE/4XO7v3yhPXDxaLbtRhbqNk4rqoEBqUSNo8RD9Q+?= =?us-ascii?Q?KcX/1U8JL5tkUwf4tBEokCXKmEm4kVup5B8T+v9hOvBnpUkDzP5Dfn6sZtpO?= =?us-ascii?Q?XnpMxwQS5lA+N3f7BKExafQ2HHkeGKYCF+Hvwhj8gum71HSWQzWdkOXRMifT?= =?us-ascii?Q?Dgys 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: c335db68-d140-438f-941f-08d8f6585bc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2021 04:24:22.9465 (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: gEsGXkausrycpbEoawouRUUdmyw4xik/Vk60AD2FguQbt7CD7A/oJ1Ot+i01jA0fgWaFsg5ca9aKVJrepY0KvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2800 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9942 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103310000 definitions=main-2104030027 X-Proofpoint-ORIG-GUID: vLsBu4u2-m5-XNjYjyXgq0w-e03YuOuo X-Proofpoint-GUID: vLsBu4u2-m5-XNjYjyXgq0w-e03YuOuo X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9942 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 spamscore=0 bulkscore=0 clxscore=1015 phishscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103310000 definitions=main-2104030028 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.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, RCVD_IN_MSPIKE_H2=-0.001, 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:128832 Archived-At: Here are some examples from my code: 1. `mark-buffer-after-point'. The purpose of the command is precisely to select some text as the region. (defun mark-buffer-after-point (reversep) "Select the part of the buffer after point. With a prefix argument, select the part before point." (interactive "P") (push-mark (if reversep (point-min) (point-max)) nil t) (setq deactivate-mark nil)) 2. `isearchp-set-region-around-search-target'. Again, the purpose is to select some text (the search hit) and leave it selected. (defun isearchp-set-region-around-search-target () "Set the region around the last search or query-replace target." (interactive) (case last-command ((isearch-forward isearch-backward isearch-forward-regexp isearch-backward-regexp) (push-mark isearch-other-end t 'activate)) (t (push-mark (match-beginning 0) t 'activate))) (setq deactivate-mark nil)) 3. `Info-change-visited-status'. Do stuff, but first record whether the region was active at the outset. When done, if it was active then re-activate it; if it wasn't then deactivate it. (Info-change-visited-status START END &optional ARG) Change whether the nodes in the region have been visited. If the region is not active then act on only the node at point. No prefix arg means toggle the visited status of each node. A non-negative prefix arg means consider the nodes visited. A negative prefix arg means consider the nodes not visited. The command does stuff, but it ends with this, where variable `active' is non-nil if the region was active at the outset. (if (not active) (deactivate-mark) (activate-mark) (setq deactivate-mark nil))