From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.help Subject: Re: fill individual long lines Date: Wed, 21 Feb 2024 23:02:35 +0000 Message-ID: <87sf1l8lpd.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38306"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Samuel Wales Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 22 00:03:41 2024 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 1rcvcr-0009dN-6n for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Feb 2024 00:03:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcvcG-0007wZ-KH; Wed, 21 Feb 2024 18:03:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcvcE-0007w5-Fv for help-gnu-emacs@gnu.org; Wed, 21 Feb 2024 18:03:02 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcvcB-0003jd-Su for help-gnu-emacs@gnu.org; Wed, 21 Feb 2024 18:03:02 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1E15D240101 for ; Thu, 22 Feb 2024 00:02:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1708556577; bh=mIu2o5ozVAckz0tMnwqkSAU3uSy3TfnEFV0/AKAZYrc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=jgNV/GK40RPlBaUTP/uaIvvYAcCMdAxxFypqvXGa3I6ERknbxuVHAgNrD9scN1VCF 5IHrUyd0yNCjUMB9CJT97wjgpElU/nssQSBo6wbESMUmxBERc6Ik1n1TbI3xe/7hUG kjX7YFPpHjof6tbZXs8TIycaXqRsgcF7BFoeY2FE97C01lQoJcLQIpY0+Urgu5N+cq w1liDptygX71LXzbNr6UxUyHaEuC2x5s+758rM5m7e/slDoTM13Jrv0vbigYzqVqW6 nPORoY5IAP+uOPhkJRggVwmOMA6UFCSuAw0pvty+6fFVxoQbvPd6FzVmRe5WFWkjJ0 N3GlMQ8SVhmag== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TgBdD16Qbz9rxQ; Thu, 22 Feb 2024 00:02:56 +0100 (CET) Received-SPF: pass client-ip=185.67.36.66; envelope-from=mekeor@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145961 Archived-At: 2024-02-13 16:03 samologist@gmail.com: > i want a command that will fill paragraphs that are long lines and > that have no blank lines between them. Do you want us to write the code for you? Personally, I neither have enough expertise nor time for that, I'm sorry. > for example, today, i received an email, intended as list items, > which, when copied from the webmail to emacs, resulted in soemthing > like this: > > line 1 hello ajs dnfkansd fklja sndlkfj anskdj nfalksjd nflaksjn > dfkajs ndfkjn asdkjf naksjd nfkajsnd fkja sndkfj naskdj nfakjsdn fkajs > ndkfjn askdjn faksjdnfkajsndfkjansdkfjnalksdjfn another line k > naskjdfn alksj fndlkajsnd fkjans dklfjan sdklfjn aksdjnf kaljsd > nfkjasn dklfjn aksdjn fkajsdn fklaj nsdkfn aksdj fnlkasjdnfffkdnfkajn > sdkfjnaskdjfnkasjdnkfjan > > and so on. in other words, every line is too long, but if i just > filled with m-q, it would smush all list items into one long > paragraph. each line is a list item. > > what i want is for the result to be like: > > line 1 hello ajs dnfkansd fklja sndlkfj anskdj nfalksjd > nflaksjn dfkajs ndfkjn asdkjf naksjd nfkajsnd fkja sndkfj > naskdj nfakjsdn fkajs ndkfjn askdjn > faksjdnfkajsndfkjansdkfjnalksdjfn > > another line k naskjdfn alksj fndlkajsnd fkjans dklfjan > sdklfjn aksdjnf kaljsd nfkjasn dklfjn aksdjn fkajsdn fklaj > nsdkfn aksdj fnlkasjdnfffkdnfkajn sdkfjnaskdjfnkasjdnkfjan > > or even, for super duper fanciness, have each original line become an org list > item. [not always needed, but the intent of this email was bullets .] You could write such a function with these components: - replace "\n" with "\n\n" - for each paragraph, call `org-toggle-item' - for each org item, call `org-fill-paragraph'