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] : mark multi regions, kill and yank Date: Mon, 30 Oct 2023 17:32:47 +0000 Message-ID: References: <87lebkxfml.fsf@mat.ucm.es> 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="4209"; mail-complaints-to="usenet@ciao.gmane.io" To: Uwe Brauer , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 30 18:34:09 2023 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 1qxW9Q-0000op-3V for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 30 Oct 2023 18:34:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxW8S-0004Fa-NY; Mon, 30 Oct 2023 13:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxW8R-0004E2-1J for help-gnu-emacs@gnu.org; Mon, 30 Oct 2023 13:33:07 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxW8O-0007DP-PY for help-gnu-emacs@gnu.org; Mon, 30 Oct 2023 13:33:06 -0400 Original-Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39UHOIZI007266; Mon, 30 Oct 2023 17:33:02 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-2023-03-30; bh=gEhdnxUrIoteNSO7nyq8dv4CaskatRYFkrVpw/DkaLU=; b=U7D5jeOLdUt0gJUbFYF/hLnpnGzhMzlQqnxwqbXX8Y1ULPZgPCCZpkf/Rtl6iPHZPqbA PWBKHdTgFG7KgvIZ6r/u2+dNO8Zacy0HuV95L2WGgaAE8I7Ic2ckI7wAtkCJEnDiqcs4 6LEXw8jIQKwtF4soHVTqbr3Sl7b6bQgi9Z1R8YtFZmPChPif3y7RE0XoQaOGuoP2y3AG eY4WH/q7fHw4C38oPQX4tpcITsBcQCz5hAbxFs2uEGAQ1pyB+b2ldY5IPZi9++eXa5MF 0BcZlgnStln21tI+wrM+TGyYisMoCYv7GelVeilVjUziZzgqkCAZuX8iQNT1muhZsa5O CA== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0t6b39sv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Oct 2023 17:33:02 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39UHBagn009077; Mon, 30 Oct 2023 17:33:01 GMT Original-Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u14x4f15r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Oct 2023 17:33:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzwCQdwjU09mylruZa5JW+2n/W+8LRPpt3A/nqv9LW9OMMS+lDJMktQbyNJXWtYULeOLgaYrwE/Ho6La6Pj+7Q3xr2VFPLLYmHA3ONAX8xlYCdvf2C4znsuhUa1Cp4WzYezBFyMmEyv7A9WmFX0WFHf6mhVSR4irw6zJaHVsg+/CC/VGapMjT+CU4sImh1ofLcEx6UzScSPDTMW+v88EaCFCQy0nvgvTT9rmAd7GJoLK2HjdZHoDJrLv2mNnRZTN/QbVXz2ECYTjMlB67X0vZhuZMdzu3jpx4AiyHX3aZnrWZJWEO7y3y7MCwcAnL3UcIeWyZeO149xeWwrWNKKdYw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gEhdnxUrIoteNSO7nyq8dv4CaskatRYFkrVpw/DkaLU=; b=Khcg4PjVbCQQDXL7Zh5dpujFEePh1ySYDsNKVewJd95uhQAj4pBKlnOIdLulPG2emZEV94Fcu75G2Vg/b9TSL6tcxv1Q2/vqYh6QATkfvdRtIep5CJarp1fMvIeY8daVFYb1Mv6BCoLFktO6i/E+Zs43GZDab5iM/4RJUKDWn7o5yAIVNDpMerdeUClWvVtHd47LQrtfZ7+FFOgT1fRPxeWYJdPwicDSXYWq9aipZPR2Ci0duw0VDQisNe3dvUtXDeYisD/gAphgVRTPHE2zRnc1rEzuDcDPE2As7vVLJBCiXNppdrVYDhet77ZSdWF6lo2AbQHX9s3MEO+Y0odfAg== 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=gEhdnxUrIoteNSO7nyq8dv4CaskatRYFkrVpw/DkaLU=; b=GZzrlrlo5FbeRdDxknzIMQpObACU3K3IMxZT3UB2pIuW2q0HZxahq6S3prVrahr1N/74+81gtpYz3K0Za4pZFeNMZgVWAboMTv2xrfcLXx2jIRmufYLIrbdKGE9Zk41MZDjI5f3jBCkyS8Ihb3wJwn4i94NGEp5g3bVzfSbwyI4= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CH3PR10MB6714.namprd10.prod.outlook.com (2603:10b6:610:142::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 30 Oct 2023 17:32:48 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::9e11:9d8c:b7f4:f45b]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::9e11:9d8c:b7f4:f45b%6]) with mapi id 15.20.6907.032; Mon, 30 Oct 2023 17:32:47 +0000 Thread-Topic: [External] : mark multi regions, kill and yank Thread-Index: AQHaC0qef969KrSOuk6UKmrE1fIoobBikogA In-Reply-To: <87lebkxfml.fsf@mat.ucm.es> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH3PR10MB6714:EE_ x-ms-office365-filtering-correlation-id: f70f2f31-f32e-4467-641d-08dbd96e3c03 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NB15tANCzKxqKjl6vrFrGnFoVP8smp4GuULuhG6kR/2LXC3k8ustL91dKkglH5tq9ylObKB4X/uE2jbX6khSe6+kLZShchZO1M64puGF4z3r0jCq7whWXLL27f9jaI5FpRl37KvVITbM6oFNDjkhBblLgQyYxic7/xpsLJDkP1J3R//updU/Hm3oRcnWiOdIgOvLycumPKEQmmncp4fC0wrE5t1gSsFVtXQqMsC82kxPQWne+K+wMCY+Oj82mL7zgBdw5moAttMbtw8RWYl+yk/ajFiYJtZZL0I+vWltiMOjN2BUoCRbRKSaUzUVE3Y5Z8a/INVlqwtehZmcLAw2Lk4AbuHE+AjM2mOxaRDEcRAeBiexaHQv8vYE2K3FWUo4K2LQYjG5KmPiIF31ON+xFCFv2y1v8kpy5W6SXC4Xd3DsU+khkmuTOCfjsg+ticvbDDpZUuhqiNIN5qGEiotgnZ4tN/icDQ9ZnXUyzxKM+iMJ2DEeLnr0hM8s8SCp5X/+h82GRDtwrhZhAVc5ujTf8lwfUXmHtn/X8ueKCVwNB0eDH/tZ289R2s1eYvoc6Su17QlOaNmY+QCCi801Ot62LmmwwaQeKcXhfFDzK56MCS/PuONyxaWnWMTBECqA7B+x x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(39860400002)(366004)(346002)(376002)(136003)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(76116006)(55016003)(41300700001)(44832011)(2906002)(38100700002)(5660300002)(6506007)(122000001)(110136005)(66556008)(66946007)(64756008)(71200400001)(478600001)(66446008)(7696005)(66476007)(9686003)(52536014)(8676002)(86362001)(33656002)(8936002)(316002)(26005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jbcHJwmYdsj2QeVe7zeXd1do73F7sttBO4P1HUoICsai85B5dagPX6TyTvlY?= =?us-ascii?Q?jnoBV+OfviuLwQS4xST/xxkHgx5Ks8Mw/sg+nQDYI0YJ+gFt16VrDbkshgS9?= =?us-ascii?Q?SjkYT0H9ElMDBfCdbkfRGTltKCxOiIv45HnVQ4IpFeamjKBUWnjypBsaTzXE?= =?us-ascii?Q?4xi+KcakJwYp8kfA+SGw4soaIgYFnTOdIjDWQzXqCbHur6Bb+Np1TvyJkziP?= =?us-ascii?Q?+Bj5r+y51JLytV/2mfMiZHXp2fYeeiTvfI1UksH+kMZo4ulGK0gVa0bsNYLH?= =?us-ascii?Q?zYVj68kforw+N+MSpJUeRN2agoSxU/EN8MxgkCb7LAHoHa2JzDNk4a1ToWp/?= =?us-ascii?Q?Q1mE2n+7YGfJhrdvMXCFe65WjafaXtJb0Lwzp5fu44/DoZf1HpsSLzcwjzHP?= =?us-ascii?Q?gjNC1fFu2AM9oLubOGLUnql5Pv0KSEhwBTLPSpOC/M0CFbpwyeNI+RliC7iO?= =?us-ascii?Q?aWqtoLO33/BfXuAUxUq3dc7MuKG3PK+csU8NjS2yVdnxz7ZimvqHddp4gxrl?= =?us-ascii?Q?rjxug5K7Q6iec1LbkSghuZBMx5mvriq9CjunP5sylHtjp2IT31X13Y7VT6WP?= =?us-ascii?Q?/QkFcbgcMqT7vudtns0MkbsH/KA4/bLZB0viCOH+Wyv/Br8gDcSaIx/jVoSa?= =?us-ascii?Q?3Y X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 7BMZZG1m16p2ED+zk3EiXiPm2gWJXRRLgiyItjURBlhltVBi2j08eKmAgG3/frJs2q4vMvqycRC/RTU+021XOZCc9oY1jhftAd+sWBmBMvZzdw1og/cOmnE7riyYk4AFt92eSEqXeZrVqIjMM3byvvaD0+wTRiQY8WG2fXD+LrdHK/XHOd2cA1kQPe84b+Xi+hD4bVJQ/tQLAH23s1l0T8E63dQSkP+AnHP6c3lsCSrJUVcweCNIaqvu/br3p06Fk4gIOgxnqybyFQiIB6U+A2lxGW0/lt+ByE0Vn3Xu9Xe9DfUL4le8GYxQcW5lyFLPPsN9cPZGmlQkyxyETh0qBN8uqhC/3AM0/MaoIgx8C1UNMoWUBvKGlEMXLcaE7ZkjMczw4h1xexvEJZCd9BZtrruj9U+JYsK4RFG06IdfJ9kyyM8+XBiIE5penv0UjuBfui/9ChP3fhiO3+z2JwQpFoZHr7nwPENLtK/k1NJLIYn+OwkSmMUEmxITNoGGGrcFdTw+OZFIxu6Cv2EhGkA1cf7OyqEag3DbxSGj4Mf4TNMjJdv2DkuM6EiteZOYstVwX/sMJh2bYiGkEYdw9O2+BxDpHUSZ112NOTSGyiZ3h9BV8w9850mJ/atSCUG8bw2Ubc153RZviZV0UXQzNLqVk1O4nNLBetvb56bEND+elz0FB49YazwIay5+srHQ0RZtLXqcS86QQi7sRcr5F/JFhXD9eREM6mwl3P6MGLCgh41vhD bq0yLnXsA31hQTrTl4FUVc1Gh3IqRjXzz11SX1dg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f70f2f31-f32e-4467-641d-08dbd96e3c03 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2023 17:32:47.9339 (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: oAWsYfZsdqJ/TUsV5qliK4LXUlfE3uhS2bMAq4fVI2NSz4fNNgYPMSKIwPAFB8JG0oX+kohEYYdFHVxPPlU0AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6714 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-30_11,2023-10-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2310300137 X-Proofpoint-GUID: DFAIfb-my0dEs_dQN8GmsOFAHHaQdRWa X-Proofpoint-ORIG-GUID: DFAIfb-my0dEs_dQN8GmsOFAHHaQdRWa Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145424 Archived-At: > I am looking for a package that allows me > 1. to mark several regions, > 2. To kill them > 3. And then later to yank everything. `C-w' kills the region text. `C-M-w' appends the region text to the last kill. So just use `C-w' for one region, then `C-M-w C-w' for each subsequent region you want to kill. Each `C-M-w C-w' appends that region to the latest string in `kill-ring'. Then `C-y' yanks them all, as the latest string in `kill-ring'. ___ If you don't want to kill the regions, and you just want to copy them together (concatenated) to the kill-ring, you can use library zones.el for that. And it doesn't matter when you "mark" the regions of text that you want to later yank together. By default, each time you narrow the buffer, the buffer restriction (the "narrowing") is added to a list of zones, which is the value of a variable (`zz-izones', by default). You can prevent this automatic adding of narrowings as zones, by setting option `zz-narrowing-adds-zones-flag' to nil. You can instead explicitly add the active region of text as a zone using `C-x n a' (command `zz-add-zone'). So just use that any time you want to record a zone. This is like `M-w', but instead of adding the region's text to the kill-ring it adds it to the current izones variable as a zone. It's easy to define a command that copies the text of the zones together to the `kill-ring': (defun zz-copy-izones-as-kill (&optional variable) "Copy text in izones to kill-ring. The zones to use are those of VARIABLE that are in the current buffer. VARIABLE defaults to the value of `zz-izones-var'. With a prefix arg you are prompted for a different variable to use." (interactive (list (or (and current-prefix-arg (zz-read-any-variable "Variable: " zz-izones-var t)) zz-izones-var))) (let* ((var (or variable zz-izones-var)) (izones (symbol-value var)) (strings ())) (dolist (iz izones) (push (buffer-substring (cadr iz) (caddr iz)) strings)) (kill-new (apply #'concat strings)))) You can alternatively use a noncontiguous region. `zones.el' has functions for converting a set of zones to and from a noncontiguous region. (For one thing, this gives you an easy way to construct a noncontiguous region of any sort interactively.)