|
From: | Stephen Berman |
Subject: | Re: Emacs Function to add dashes to leading spaces in a Selected Region |
Date: | Fri, 30 Oct 2020 01:12:11 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On Fri, 30 Oct 2020 00:34:16 +0100 Christopher Dimech <dimech@gmx.com> 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
[Prev in Thread] | Current Thread | [Next in Thread] |