help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indent first line of each paragraph of file in one hit


From: Konstantin Shakhnov
Subject: Re: Indent first line of each paragraph of file in one hit
Date: Fri, 25 Nov 2016 15:15:52 +0300
User-agent: Mutt/1.7.1 (2016-10-04)

On Fri, Nov 25, 2016 at 11:52:55AM +0000, Rodolfo Medina wrote:
> This seems to work:
>
> (defun my-indent-first-line1 ()
>   "Indent the first line of each paragraph"
>   (interactive)
>     (backward-paragraph)
>     (next-line)
>     (insert "        ")
>     (fill-paragraph)
>     )


Yes, I've just made something similar. But there is a trap - if your
file doesn't starts with '\n' you'll get wrong indentation of the
first paraghaph
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
The Shire at this time had hardly any 'government'. Families for the
>>>>>most part managed their own affairs. Growing food and eating it
occupied most of their time. In other matters they were, as a rule,
....
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]