From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Konstantin Shakhnov Newsgroups: gmane.emacs.help Subject: Re: Indent first line of each paragraph of file in one hit Date: Fri, 25 Nov 2016 15:15:52 +0300 Message-ID: <20161125121552.GA11459@eee.birulevo.net> References: <877f7ssxfz.fsf@gmail.com> <20161125104812.GA8781@eee.birulevo.net> <87lgw7lrx3.fsf@gmail.com> <87k2brpyi0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1480085980 32617 195.159.176.226 (25 Nov 2016 14:59:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2016 14:59:40 +0000 (UTC) User-Agent: Mutt/1.7.1 (2016-10-04) Cc: help-gnu-emacs@gnu.org To: Rodolfo Medina Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 25 15:59:37 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAHyR-0007rD-QK for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 15:59:35 +0100 Original-Received: from localhost ([::1]:46446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAHyV-0004XO-Aw for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 09:59:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAFJI-0000iT-E5 for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 07:08:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAFJE-00070d-E1 for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 07:08:56 -0500 Original-Received: from smtp36.i.mail.ru ([94.100.177.96]:34537) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAFJE-0006zI-37 for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 07:08:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=1Ay5wBNMHXjdRrpzyPWqa4YqngZDNAOztZbg2JLRx+0=; b=IbZLSXxRVJ2S+3g79BjHsSBm6Z4qK5W4ypORu0st0jllq0poZJQf2Ud+QZdrURsPfbalfHDu4lXszEr11vYuA3cdI3H63yZslt/VN839SRoL0Nlh98xKrpWNcWHqaGT42fCK8Rn9GsuNXwKaeQPXV6c1XgtLC+bOr7MpIgGKp8E=; Original-Received: from [94.158.176.77] (port=38354 helo=eee.birulevo.net) by smtp36.i.mail.ru with esmtpa (envelope-from ) id 1cAFJB-0001Og-8T; Fri, 25 Nov 2016 15:08:49 +0300 Content-Disposition: inline In-Reply-To: <87k2brpyi0.fsf@gmail.com> Authentication-Results: smtp36.i.mail.ru; auth=pass smtp.auth=kastian@mail.ru smtp.mailfrom=kastian@mail.ru X-E1FCDC63: E1776D79A2F64F137CED5823D083F9AFFEDCCBD3DDE7F493 X-E1FCDC64: 436C202A1D1EDE2C54E01A1A8B1B88B0E2901DDAB7AC728787625380F352B669 X-Mailru-Sender: FD668448AC40568882DD66648ECA686281414E2EB0ABB4FF93C1CFB574ABE36F25FE3BD8EF42899224DAF05A372A3159 X-Mras: OK X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 94.100.177.96 X-Mailman-Approved-At: Fri, 25 Nov 2016 09:58:52 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111805 Archived-At: 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, .... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;