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:45:39 +0300
User-agent: Mutt/1.7.1 (2016-10-04)

On Fri, Nov 25, 2016 at 12:20:45PM +0000, Rodolfo Medina wrote:
> Konstantin Shakhnov <kastian@mail.ru> writes:
> > 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
> Yes, I see.  No way to avoid that?

(defun my-indent-first-line ()
  "Indent the first line of current paragraph"
  (interactive)
  (backward-paragraph)
  (if (= (line-beginning-position) (line-end-position)) ; if line not empty
      (next-line))
  (insert ">>>>")
  (fill-paragraph))

Not very nice, but seems working.



reply via email to

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