From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Masterson Newsgroups: gmane.emacs.help Subject: Re: Emacs Function to add dashes to leading spaces in a Selected Region Date: Wed, 04 Nov 2020 19:15:00 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 05 04:31:04 2020 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 1kaVzL-0000to-S9 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Nov 2020 04:31:03 +0100 Original-Received: from localhost ([::1]:56420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaVzK-0001hK-K9 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Nov 2020 22:31:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaVyV-0001gB-QL for help-gnu-emacs@gnu.org; Wed, 04 Nov 2020 22:30:12 -0500 Original-Received: from mail-bn8nam11olkn2101.outbound.protection.outlook.com ([40.92.20.101]:62177 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaVyT-0007NH-8u for help-gnu-emacs@gnu.org; Wed, 04 Nov 2020 22:30:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cO/fiPzyqq95MpiPgpTe3DRdvqLJwqaZ+xuTScFUfnSWZ2xnNQYO1iK3rzOQjAvRaQNltfhlmuAimhnjybFOYxT2YqGRwyXE+5JF3WClZ9zMadaipr4LPKhg0hY7Vh6oC9IyoAxRi7GAZPl3q0XrbErYgLbKBYD+mBzVUuwey27Vr6YUVS0Vo6nHJ8p+xG9NoHiy1Hqkwnj0+G3WZZsNd+UDyZI31wa7yEYlqU4QKpcgSg9X2PjPJiI9EAV88FxpIOB4elKAwmT8dBriQPlhg+xDp3ECOYkj+f4dUgoS4IM6TNW94U4XllYBsbH1/kg9EPPhXnR1pbq93rLM7faGnw== 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=jhelqAPrj+zNP5UUOg47CcorhK5FR95xqSMPhyUgu7A=; b=c9hDo3ECMqhaSTfl6ky7pmm5OcSuvSSp9CYJ7JhPRHX/8mbStb7ZD6Mpdb822RG+fytRmrO5FHSqTyz3zBhDV8j2kZAvV8eAwCMDjquVsiVZi3MVeUn1NgRpyYahHiyJe+rRLc/BCQkGRCwhIbfA3XGkLn13JXVfhkPwgu4tVIqMDdn5jxxijRlmebUdX5mUhZ+BGuzrpZ9p4z7jrdEIwEsN4TZ3tQv7LXaDNWTWbctb11GjK8OV3196mnMBNzRyJZncKuxcgq0oo1afSuefYM/Tq5xMYM5lIR4SEa+PTwdBoO/7LbLMapdBr76BhhpYyrzVVmhWf0ehMjF1o23EGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jhelqAPrj+zNP5UUOg47CcorhK5FR95xqSMPhyUgu7A=; b=FNCfNjqkn7TUe329McbDvL0+geplCjsAmCn0S9VjKwXMcANPXx7jZPvOoGf1wItf+x5F6Vg6M5O7gerq7gKo3Yh1YPEphVN9d2OY/HwdlbaP4PrzL06b1FlnQH4Lfk6tOkEUq/a9QK6O5yYXRxY40C/EbpG1IaOm7o4Rvipzq4N2MPL/eOaXRx4/YufB2AqEpN327mkFpuhwgJTyuGPGfaoXKXfkzh4EgKjzF4APKyXG3/AaJRqiotyup/7yHMJaQw+T+Ow52B+VVNpX0cP6BtDU19dIHe7F7RCJKLh26jmipfd9avoKj6Q+AF0az51ThwTxNJNFgA+49+YPIrmlAg== Original-Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::52) by CO1NAM11HT038.eop-nam11.prod.protection.outlook.com (2a01:111:e400:3861::192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Thu, 5 Nov 2020 03:15:04 +0000 Original-Received: from SJ0PR03MB5455.namprd03.prod.outlook.com (2a01:111:e400:3861::52) by CO1NAM11FT035.mail.protection.outlook.com (2a01:111:e400:3861::292) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.17 via Frontend Transport; Thu, 5 Nov 2020 03:15:04 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:E6D215AA327A4D5816D0B494621BB1803DE22F6A6934382ED4C93285DB3D7286; UpperCasedChecksum:8F726D11DBD867A66FB30A3CBB1182B1A469007BCF751C648D28A167B029B4FF; SizeAsReceived:7659; Count:46 Original-Received: from SJ0PR03MB5455.namprd03.prod.outlook.com ([fe80::e428:8fc2:f6ac:f95a]) by SJ0PR03MB5455.namprd03.prod.outlook.com ([fe80::e428:8fc2:f6ac:f95a%9]) with mapi id 15.20.3499.032; Thu, 5 Nov 2020 03:15:04 +0000 In-Reply-To: (Christopher Dimech's message of "Fri, 30 Oct 2020 00:34:16 +0100") X-TMN: [jvkYAGQ2ShLp8Nwd8y2MkAddIL2cJS37JFs+F3CNa2QuBwM4G3u0lY7YrNVSfyC6] X-ClientProxiedBy: BY3PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:217::6) To SJ0PR03MB5455.namprd03.prod.outlook.com (2603:10b6:a03:27b::11) X-Microsoft-Original-Message-ID: <87eel8o5or.fsf@outlook.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from penguin (2600:8802:500:419:216:3eff:fee7:3d5d) by BY3PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:217::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Thu, 5 Nov 2020 03:15:03 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4347e6b1-89f5-49e4-8d57-08d88138fd03 X-MS-TrafficTypeDiagnostic: CO1NAM11HT038: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M/isXDbW7R//Tv72/njTseTcSqyT1lRmkiviKbDTUM5ahYOhsHAszzsHtK7lgasK2fnD0U4CpFCVDx57rTb99yRJniJOVveFMSXnK/vUYnpovIoDY22jbhUxuIoVFufL7fy4+AGMB+G5l02KLVepct4rZmpokQ4kwwkcECZfoGPQdDFTPFPUh9vsexjZYC2aw6aHzLL3O6xym4xMvP4q7Q== X-MS-Exchange-AntiSpam-MessageData: h1yZ+OYQHfqB5qXb8/496O6Zdc6tKK0ah9ljZQCfjNFCOlxZG/vq79+KCmfDETFEjNKS2xsA8Id6FUlIXtRV+rH2DUbKkNyvlVgcMO9zGVlqi4mHoxbScjwg5npnqgw3L2RoFOG1nlyZBxRTZnTQLN+StQKrDxqfLNcl+n2Fw232C7U0KZUfW1CYvnd4kau2jWUrv9ZhsUXbpZ55nqLbMw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4347e6b1-89f5-49e4-8d57-08d88138fd03 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2020 03:15:03.9609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1NAM11HT038 Received-SPF: pass client-ip=40.92.20.101; envelope-from=dsmasterson92630@outlook.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 22:30:07 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:124999 Archived-At: Christopher Dimech writes: > I need an Emacs Function to add dashes to leading spaces in a Selected Region. > Require help to do this thing. Given that you are new, I would use re-search-forward. Figure out an RE that matches what you want, then start at the beginning of your region and step thru til you get to the end of the region. -- David Masterson