9

I want to use Emacs to write prose (specifically, fiction).

I have used Scrivener and Ulysses in the past but I am not happy with them. I want to try Emacs, but don't know how to replicate the workflow I am used to.

I use writeroom-mode to get a distraction-free environment, but it's just one piece of the puzzle. I like the way Ulysses and Scrivener allow you to focus on a chunk of text, and I'd like to know how to replicate this functionality. I would like org-mode or another outliner to allow me to focus on a piece of text and hide the rest. Ideally, I'd like to have a sidebar (like Ulysses), in which I can arrange pieces of text manually, like in this screenshot:

ulysses

PS I have read the "Emacs for Writers PDF but it doesn't address the need to organize and structure your text.

Dan
  • 32,584
  • 6
  • 98
  • 168
Jason Mirk
  • 713
  • 3
  • 15
  • 4
    Please clarify your post with a question about what you actually need (better still, ask one discrete question per post and do multiple posts if necessary). `org-mode` does outlining, which allows you to focus on particular pieces of text and move the rest around. Narrowing removes text from the screen. – Dan Jul 08 '15 at 14:22
  • 1
    This could be a candidate for one of those "big-list" questions :) (there was a discussion on Meta regarding whether or not this kind of questions are appropriate on SE: http://meta.emacs.stackexchange.com/questions/305/should-we-have-a-big-list-tag-similar-to-tex-se ). More on topic: you should probably revisit Org mode. It's huge and in terms of structuring text, it knows to do a lot. Emacs is, however, lacking in understanding the grammar of the text you write. Spellchecking is all it has to offer in this regard. – wvxvw Jul 08 '15 at 15:34
  • Why can't fiction writers just block/copy/paste to move text around instead of having fancy gizmos like sidebars, etc.? Fiction writers existed before sidebars were ever invented. That being said, Emacs requires a user with an interest of learning some to a lot of `elisp` -- the time that it would take to become proficient in `elisp` could be time better spent writing fiction and just block/copy/paste the old fashioned way. – lawlist Jul 08 '15 at 15:40
  • 1
    @lawlist writers have always used "sidebars" in the form of notes. this is just the digital version of it. – Jason Mirk Jul 08 '15 at 15:43
  • So far, the question seems unclear, to me. I see one somewhat specific question embedded in it: How to get something like a side-bar TOC for a buffer of text. Try to make a specific request such as that. Or else make a general, What's-good-for-writers question that just asks for names or links to outside references (e.g., blog or package names/links). – Drew Jul 08 '15 at 15:46
  • FWIW: Wrt a side-bar TOC: the closest thing I can think of are the various outline capabilities that Emacs offers. IOW, instead of a side-bar TOC, a TOC as outline. But perhaps Speedbar or some other library has something that can act as a side-bar TOC? – Drew Jul 08 '15 at 15:47
  • thanks @drew i think using org-mode would give me a TOC functionality. The problem with this approach is that you have to expand and collapse your outline all the time. – Jason Mirk Jul 08 '15 at 16:06
  • 2
    Here is an interesting article entitled **How to write a book in emacs.** https://www.masteringemacs.org/article/how-to-write-a-book-in-emacs As an example to the `elisp` and time-investment, I spent a couple of days to just get basic movement to mimic the various word processors that I had used over the years in my profession(s) -- e.g., left/right word, up/down paragraph, and delete word. The nice thing about Emacs is that it is perfect for anyone with a little to a lot of Obsessive Compulsive Disorder, who need things to be a specific way and it must be just right, not just about right. – lawlist Jul 08 '15 at 16:12
  • Yes, I know. Perhaps someone will provide a better solution. I really suggest that you edit your question, however, to make it specific (e.g. only about the side-bar TOC). Otherwise, it risks being closed. – Drew Jul 08 '15 at 16:12
  • But there are super helpful modes that fiction writers don't know they need, but once they try them they can't live without them. Like [palimpsest-mode](https://github.com/danielsz/Palimpsest). I happened upon it by accident, but I for one would love to see a list of packages that fiction writers find useful. – incandescentman Jul 08 '15 at 22:56
  • @JasonMirk In what ways did Scrivener and Ulysses fall short for you? What would you like to do in Emacs that they couldn't do? – incandescentman Jul 08 '15 at 23:16
  • 1
    Scrivener has too much stuff and you dont write in plain text as far as i remember. Ulysses 3 is pretty good but it crashes a lot. Also, you cant split the buffer, move paragraphs of text around without using the mouse and tons of other things that you end up missing once you know they exist. – Jason Mirk Jul 09 '15 at 03:54
  • @JasonMirk Same reasons I switched to org-mode. – incandescentman Jul 09 '15 at 04:18

3 Answers3

11

I think this is a great question. I'm sure there are tons of super helpful modes that fiction writers don't know they need. I happened upon palimpsest-mode by accident, but now I couldn't live without it. I'd love to see what packages other fiction writers find useful.

Here are some that I use every day:

  • palimpsest-mode. Sends selected text to the bottom of the file. I use it probably 20 times an hour.
  • Deft. Incremental search of text files in a directory, similar to @ttscoff's nvALT.
  • Olivetti. Make the text area smaller and nicer.
  • Fountain. If you're a screenwriter.
  • Helm-swoop for finding things quickly.
  • Auto-capitalize. No need to write capital letters yourself.
  • Org-pomodoro to keep yourself on track.
  • wc-mode to count words if you need to.
  • And most of all, org-mode to outline. My trick is that I write notes to myself (e.g. "this section needs a better intro") using org-mode comments, so they don't get included when I export. Oh, and use the command org-narrow-to-subtree to focus just on the section you're working on.
incandescentman
  • 4,111
  • 16
  • 53
6

Here is what I take to be your goal:

  • The ability to focus on a particular chunk of text while getting the rest of it out of your way,
  • The ability to move big chunks of text around quickly.

This solution uses only out-of-the-box Emacs functionality:

  • org-mode
  • narrowing
  • split windows
  • indirect buffers

First of all, if you write your document in org-mode (or any mode that makes use of Emacs' outline facilities), you'll be able to structure your document with headings, sub-headings, etc., and then hide or show the bodies of those elements. For prose, you may find it helpful to be very elemental: a header for a chapter, a sub-header for a section, a sub-sub-header for a subsection, all the way down to a sub-sub-...-header for each individual paragraph.

Second, even though org-mode will allow you to hide the bodies of your headers and focus only on the body in front of you, it will leave the section headers on the screen. You may or may not find that distracting. If you do, you can narrow the buffer just to that header (making all of the rest of the headers disappear temporarily from view) and then widen again when you want to see the other text again.

Third, to get an easy outline view and the ability to move text around quickly, you can use a combination of split windows and indirect buffers. Make your Emacs frame wide enough to accommodate two windows (see this post for frame/window terminology). Do M-x split-window-horizontally to get two windows side-by-side in your frame. In the window that has your document, do M-x clone-indirect-buffer.

Now you have two linked copies of the same document in two different buffers. Put them in your two windows. Although they will both contain identical text, you can make them look different in the two windows.

One very useful way to use this facility is to have a main editing window in which you actually enter and edit your prose, and use the other window as your outline view: hide the bodies to show only the headers in a given section/subsection/whatever to give yourself an overview of the document's structure. You can then move chunks around quickly -- if you're using org-mode, M-<up> and M-<down> run org-metaup and org-metadown, respectively, which, in this context, will move subtrees (a header and everything below it) up or down in the document.

Dan
  • 32,584
  • 6
  • 98
  • 168
  • 1
    this is almost perfect. I wrote some elisp and customized everything to my taste too. Wasn't that hard after all. One more thing would be how to be on the sidebar, hit a key and make it load on the main buffer. But I guess that's a different question. – Jason Mirk Jul 09 '15 at 13:25
  • 2
    You might also enjoy `clone-indirect-buffer-other-window`. – incandescentman Jul 09 '15 at 14:14
1

This answer is not exhaustive, but I cannot post this in the comments because it has an image. May the table of contents you are talking about look something like below?

enter image description here

Another ad hoc way to have an outline is to run M-s o^\s-*\* (which is equivalent to M-xoccur). Even though this isn't a proper outline, more often than not, I find this to be an adequate solution for the problem of locating and navigating sections of the document.

wvxvw
  • 11,222
  • 2
  • 30
  • 55
  • 1
    Yes i tried speedbar but i don't like that it's a floating window. It seems outdated. – Jason Mirk Jul 08 '15 at 20:25
  • 2
    @JasonMirk there was a project to make Speedbar a buffer rather than a window, but it's hard to get it to work "properly" due to various buffer commands that may eventually bury it or replace the contents. There used to be buffer configuration managers, like ECB, which made a fixed buffer layout and could also display the outline in the fixed location, but my experience of working with ECB is that more often than not it gets in my way. But maybe something like that will work for you, if you don't need to manipulate buffers too often. – wvxvw Jul 08 '15 at 20:46
  • 1
    http://www.emacswiki.org/emacs/SrSpeedbar this is the project I was talking about. – wvxvw Jul 08 '15 at 20:47
  • 1
    If the speedbar concept is something the original poster is fond of, then it may be worth investing time to make it behave as the original poster would like. It took me about an hour (with two years `elisp` monkeying under my belt) to make the library my own custom setup, strip out all that frame stuff, and turn it into an on demand buffer that can be displayed in any window. This is where the time investment comes in when dealing with Emacs -- you find something you like (i.e., can work with) and change it to whatever suits your exact needs. E.g., `generate-speedbar-noselect`+display – lawlist Jul 08 '15 at 22:55
  • I haven't used it, but what about [neotree](http://www.emacswiki.org/emacs/NeoTree)? – incandescentman Jul 09 '15 at 04:15
  • On further inspection, it looks like neotree is just a file explorer, and can't navigate org-mode outlines like Speedbar can. – incandescentman Jul 09 '15 at 04:22