LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2016, 10:48 PM   #1
TheLexx
Member
 
Registered: Apr 2013
Distribution: Gentoo
Posts: 77

Rep: Reputation: Disabled
Emacs: writing an anti fill-paragraph function


I am looking for a Emacs function that does sort of the opposite of the fill-paragraph function. I would like something that takes a paragraph and makes it into a single line. For the purpose of this post, a paragraph is any block of text ending with two consecutive carriage returns.

I am quite the neophyte when it comes to elisp, however, I started writing my own function. I was able to set variables to the start and end position of the "paragraph". I would like to replace all carriage returns with spaces within this region. I would like to know if Emacs already has a range enabled replace function, or will I also have to write a function for that? I thought about writing search but I don't know how to repeat the search I am a long-time Python programmer, but the loops in lisp totally baffling to me.

Any help would be appreciated.


Example Curser at the point *

Code:
*This is
my example
paragraph one.

This is
my example
paragraph two.
execute function
Code:
*This is my example paragraph one.

This is
my example
paragraph two.

GoogleWords: neophyte

LocalWords: elisp
 
Old 05-15-2016, 01:46 PM   #2
Myk267
Member
 
Registered: Apr 2012
Location: California
Posts: 422
Blog Entries: 16

Rep: Reputation: Disabled
Have you searched for any of the `unfill-paragraph` solutions on the web?

https://www.emacswiki.org/emacs/UnfillParagraph
 
Old 06-15-2016, 08:12 PM   #3
TheLexx
Member
 
Registered: Apr 2013
Distribution: Gentoo
Posts: 77

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Myk267 View Post
Have you searched for any of the `unfill-paragraph` solutions on the web?
Thanks!! Unfill was the term I needed to search for. I found my favorite solution here. http://blog.chrislowis.co.uk/2010/03...ion-emacs.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs lisp: define function to be used inside emacs stateless Programming 1 03-01-2013 06:04 PM
writing data to fill a 1 TB disk zackmax Linux - General 6 08-04-2012 02:43 PM
Fill paragraph in Abiword ciden Linux - Newbie 1 09-30-2009 10:00 PM
LXer: GNU Emacs 23.1 Provides Anti-Aliasing LXer Syndicated Linux News 0 07-30-2009 04:40 PM
LXer: Writing and publishing with Emacs Muse LXer Syndicated Linux News 0 04-09-2007 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration