From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Emacs Function to add dashes to leading spaces in a Selected Region Date: Fri, 30 Oct 2020 01:12:11 +0100 Message-ID: <87zh44efms.fsf@rub.de> 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="18899"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (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 Fri Oct 30 02:07:56 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 1kYItX-0004pS-Dc for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 02:07:55 +0100 Original-Received: from localhost ([::1]:46344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYItW-0001YO-FN for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 21:07:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYI1j-00076y-1f for help-gnu-emacs@gnu.org; Thu, 29 Oct 2020 20:12:20 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:39581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYI1h-00060q-3d for help-gnu-emacs@gnu.org; Thu, 29 Oct 2020 20:12:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1604016735; bh=Nfm50WjTvqGOokbdxf/uo1qaRFFxxn2xf+BosspVL1M=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=lkRDksDYqU/WbcKssyqtje3+w1KMFVgl67sEqOug6mXBwWSxTVWEKHPoExRwhuuaU VUBZXVPzGN+M5RJZGginCSmeYpNaizGHAsCD1Ol2DvlgRmiszJRbLAZ47jpceJsjjN UE8cEQN8S+bl5v1jDul4w1q+tfpVZWlSTpDtQyQY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([178.6.218.181]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOA3P-1kiv7H3Xj7-00OVrM; Fri, 30 Oct 2020 01:12:14 +0100 In-Reply-To: (Christopher Dimech's message of "Fri, 30 Oct 2020 00:34:16 +0100") X-Provags-ID: V03:K1:txoZGFVgL9W4G47wen8IoJ9g9TGYcjeEucNZB1VWa42+t2sEB/+ BmfGHGF4PiSDgxjs+OcIRI4Vk4dmj9ymbQTHN/to9EnSLh5VwIjpM9s0jEojwCzOCAA30R2 MYnk/hEitaurSa9BZifU9fDoguf+qKb9zxTjvdKDKkH0XDfpX9qqq0zWZ2kZ8Ujnoeg9FdY zir03EGD/L8+89cRFNRRw== X-UI-Out-Filterresults: notjunk:1;V03:K0:tyOry7Gb2I0=:YfnSiGFvjnlrtmd/ZeejOo dz3f2o0BOzSGMJ3+GrmeCo0gAmugGQcFZZfkcnE190uPovWicJZQfecsbDotM7iv5fcLvAhlH 1SlUw9bYoCLHsQpEI7HM2cnvcIsgxYJ4BEp4f8z3VwazXasfcOkPePZcqCbnlaGbh1P4tU914 AsT7OJSsJEiZ6g7f+sC4LXcH0OOVlYjuTInwhuGn4wLfsXQ/qXxvu/WBGqSqM9ECv3L3Wc5J1 BquhCR425mS0NfIzKh++1nxC5dGKR1qTcnbGoBq3zaRiEzJnoNZADh3PgBWguf/Wp9pIzpCpj eJw1y4qri1WT+qaPeWe0s7UDnRV80HGcOA2Yw0J5g5a38kkuO6QocBGqpf/j5hyIe2BHjxTVo Hrq2HO1bXai/Tgf1HGHcMfryJn54CTSoXWx62JgTeLn0zp+ygM3+v6Qn57Dkz+qx++jB1Av57 lsqbVq923kV0vWzCbB63QeFhLexJwqE4OOrl4yl6e3mDbB8/ifOmiPUoGuQLA/wsOyeqeua0A slxJEqg9lcLHIl80vmfbsFwc3deivW5OzbTKQeorvElwE+FE5pmSAN9ctfTzWykttUEhjl8Gr WDsIKbzaH4dN1idxvX+uSwFmid9Ky/9lOi2WqXgICNzG6NjCLab5+HTRZCDAGJJ/vZqcbfsgO 1JJTWVqH2wV92gDISpBBoBIbm4+RbyPykHiAa9tMKwMyXMFjmc29Eev8v5YqxmmhQO0XnFBsG i9zoBKxnx4HBsrZmfucYoLQnMyFoEcFeF13fYmJhkqT3+8qyDkghD4OaJUtVsoWG2R/5OgkM Received-SPF: pass client-ip=212.227.15.15; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/29 20:12:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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.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:124801 Archived-At: On Fri, 30 Oct 2020 00:34:16 +0100 Christopher Dimech wrote: > I need an Emacs Function to add dashes to leading spaces in a Selected Region. > Require help to do this thing. (defun space-to-dash (beg end) "Replace spaces by dashes in region." (interactive "r") (goto-char beg) (while (< (point) end) (when (looking-at "^ +") (let ((rep (make-string (length (match-string 0)) ?-))) (replace-match rep))) (forward-line))) Steve Berman