Ten artykuł wyjaśnia, dlaczego warto używać Emacsa do pisania prozy. Dlaczego warto używać Emacsa? Emacs da ci też pełną kontrolę nad twoim procesem pracy.

Dlaczego warto używać Emacsa

Peter Prevos

Peter Prevos |

2812 słów | 14 minut

Udostępnij tę treść

Większość osób uważa, że pierwszym krokiem w kierunku większej produktywności jest znalezienie idealnego zestawu narzędzi programowych do zarządzania ogromną ilością informacji, które codziennie konsumujemy. Kiedyś też przeskakiwałem z aplikacji do aplikacji, by wykonać to, czego potrzebowałem—przeskakiwałem z listy akcji do mojego harmonogramu, potem do edytora tekstu i arkusza kalkulacyjnego, czytnika PDF i tak dalej. Czy nie byłoby miło, gdyby istniał jeden program, który mógłby pomóc w prawie wszystkich zadaniach?

Witamy w systemie obliczeniowym Emacs, szwajcarskiej piłe łańcuchowej produktywności.

Ten artykuł wyjaśnia, dlaczego warto używać Emacsa do pisania i podjąć niemal każde zadanie w swoim projekcie – od pomysłu po publikację w jednym zastosowaniu. Ten artykuł jest częścią zestawu startowego Emacs Writing Studio, który wyjaśnia, jak używać Emacsa do pisania i publikowania artykułów, książek, scenariuszy teatralnych lub filmowych oraz stron internetowych.

Emacs Writing Studio

Emacs Writing Studio

Kompleksowy przewodnik dla pisarzy, którzy chcą usprawnić swój workflow za pomocą Emacsa. Książka obejmuje wszystko – od organizowania pomysłów i pisania bez rozpraszaczy po publikacje w różnych formatach. Jest idealny zarówno dla początkujących, jak i doświadczonych użytkowników Emacsa, oferując praktyczne wskazówki i dopasowaną konfigurację, która wzbogaci Twój proces pisania.

Najnowsze pliki konfiguracyjne znajdziesz na GitHubie.

Czym jest Emacs?

Oficjalnym hasłem GNU Emacs jest to, że jest to "rozszerzalny, samodokumentujący edytor tekstu". Jednak te słowa ledwo oddają sprawiedliwość Emacsowi, ponieważ skupiają się na jego pierwotnym przeznaczeniu jako narzędzia do tworzenia oprogramowania.

Emacs to wielofunkcyjne środowisko komputerowe, które pomoże Ci zarządzać informacjami, śledzić projekty, pisać i publikować artykuły, książki, strony internetowe oraz wszelkie inne aktywności tekstowe. Emacs to procesor tekstu na sterydach. Pierwsza wersja Emacsa została wydana czterdzieści lat temu, co może wydawać się przestarzałym oprogramowaniem. Jednak dynamiczna społeczność deweloperów nieustannie ulepsza system.

Emacs nie jest hackiem na produktywność; To system hakowania produktywności.

Termin edytor tekstu wymaga wyjaśnienia, ponieważ jest bardziej zbliżony do tworzenia oprogramowania. Emacs to nie tylko edytor tekstu, ale edytor tekstu, który jest czymś więcej niż tylko edytorem tekstu. Redagowanie to ostatni etap w procesie pisania artykułu lub książki. Programiści nazywają cały ten proces edycją.

Kiedy korzystasz z komputera, najprawdopodobniej piszesz notatkę w edytorze tekstu, a potem przechodzisz na arkusz kalkulacyjny, by stworzyć wykres, który kopiujesz i wklejasz do notatki. Następnie otwierasz klienta poczty, aby wysłać wiadomość do kolegi. Ostatnim krokiem jest zamknięcie akcji w narzędziu produktywności. Po tej ciężkiej pracy możesz zagrać w grę i otworzyć Tetrisa. Korzystając z tych programów, musisz nauczyć się różnych umiejętności dla każdego programu. Musisz używać oprogramowania tak, jak deweloperzy zaplanowali.

Praca z Emacsem to zupełnie inne doświadczenie. Piszesz notatkę w Emacsie, tworzysz wykres w Emacsie, wysyłasz wynik mailem i zamykasz akcję w Emacsie. Na koniec grasz w grę, zgadłeś, w Emacsie. Jeśli używasz Emacsa, musisz nauczyć się tylko jednego programu i możesz je skonfigurować i rozszerzyć tak, jak chcesz go używać, a nie tak, jak chce programista.

Na pierwszy rzut oka Emacs wygląda bardziej jak wściekła sałatka owocowa niż nowoczesne oprogramowanie. Domyślny interfejs wygląda ponuro, ale nie daj się zwieść tym prostym wyglądom. Pod maską Emacs to nowoczesne i solidne środowisko komputerowe, które można w pełni skonfigurować według własnych upodobań.

Dlaczego warto używać Emacsa?

Emacs to plastyczna platforma programowa, co oznacza, że możesz swobodnie zmieniać i ulepszać jego działanie. Ta plastyczność zapewnia, że Emacs może wykonać każde zadanie, które wykonasz za pomocą klawiatury. Emacs jest jako taki szwajcarską piłą łańcuchową pod względem wydajności.

Pierwszą zasadą oprogramowania plastycznego jest to, że łatwo je zmienić. Możesz budować aplikacje w języku Emacs LISP (Elisp). To zadanie może brzmieć przytłaczająco, ale chodzi o samą możliwość. Pisanie kodu jest opcjonalne, ponieważ większość użytkowników Emacsa udostępnia to, co stworzyli, poprzez tysiące zewnętrznych pakietów, które możesz swobodnie instalować.

Emacs Writing Studio ułatwia rozpoczęcie, ponieważ ta konfiguracja zawiera prawie wszystko, czego potrzebujesz do pisania prozy.

Użytkownicy mogą konfigurować niemal wszystko w systemie, mając niewielką wiedzę o Elisp. Ten wymóg wiedzy może wydawać się przeszkodą, ale nauka obsługi daje praktycznie nieograniczoną władzę nad tym, jak będziesz korzystać z komputera. Oprogramowanie powinno dostosowywać się do użytkownika, a nie odwrotnie, jak to ma miejsce w większości nowoczesnych pakietów.

Zaletą tego podejścia jest całkowita swoboda korzystania z tego oprogramowania. Możesz polecić mu robić prawie wszystko, co chcesz i skonfigurować go do swoich potrzeb. Minusem jest to, że wymaga innego podejścia obliczeniowego niż współczesne oprogramowanie. Korzystanie z Emacsa przywraca do pierwotnego zamysłu korzystania z komputera i prawdziwej przyjazności użytkownika.

Czy jesteś gotowy, by zmienić sposób, w jaki korzystasz z komputera? Parafrazując słynną scenę z Matrixa:

Bierzesz niebieską tabletkę Microsoftu — historia się kończy i wszystko pozostaje po staremu. Weźmiesz fioletową pigułkę Emacsa — zostajesz w Krainie Czarów, a ja pokażę ci, jak głęboko sięga królicza nora.

Redefinicja przyjazności użytkownika

Brak dopracowanego interfejsu graficznego w Emacsie może zniechęcić nowych użytkowników. Niestety, większość programistów myli przyjazność użytkownika z płynnym projektem i używaniem myszy. Jednak podejście oparte na grafice myszy nie jest przyjazne dla użytkownika, ponieważ dominująca ręka ciągle przesuwa się między myszką a klawiaturą. Oprogramowanie oparte na grafice to pozłacana klatka. Może być przyjemne, ale to wciąż klatka.

Emacs to zwykły edytor tekstu, co oznacza, że istnieje ograniczony znacznik, taki jak obrazy, pogrubione i kursywne. Tekst jawny nie jest tym samym co zwykły angielski; Odnosi się do sposobu, w jaki informacje są przechowywane na dysku. Tekst zwykły jest przeciwieństwem tekstu bogatego, który zawiera ukryte definicje rozmiarów czcionek, kolorów oraz innych atrybutów tekstu i formatowania.

Tekst zwykły nie jest sformatowany i najczęściej ma rozszerzenie. Istnieje jednak wiele innych formatów tekstu jawnego, takich jak HTML, Markdown, LaTeX i Emacs Org Mode. Użytkownicy Windows mogą znać szacowne oprogramowanie Notepad (które, nawiasem mówiąc, jest prawie tak stare jak Emacs, ale z ograniczoną funkcjonalnością)..txt

Tekst jawny jest zrozumiały na wszystkich systemach komputerowych, więc nigdy nie musisz martwić się o zablokowanie swojego tekstu w zastrzeżonym formacie i zablokowanie przez pakiet oprogramowania. Internet działa na zwykłych plikach tekstowych, co jest bardzo mało prawdopodobne, by zmieniło się w dłuższej perspektywie.

Tryby tekstowe mogą wyświetlać "grafikę". W szkole podstawowej w latach 70. nauczyciel pokazał nam dzieła sztuki wydrukowane komputerem. Grafika składała się z serii znaków klawiaturowych przypominających obrazek, takich jak ten uroczy stegozaur poniżej, zapożyczony ze strony ASCII Art.

                         .       .
                        / `.   .’ \
                .---.  <    > <    >  .---.
                |    \  \ - ~ ~ - /  /    |
                 ~-..-~             ~-..-~
             \~~~\.'                    `./~~~/
   .-~~^-.    \__/                        \__/
 _/  O    \     /               /       \  \
(_____,    `._.'               |         }  \/~~~/
 `----.          /       }     |        /    \__/
       `-.      |       /      |       /      `. ,~~|
           ~-.__|      /_ - ~ ^|      /- _      `..-'   f: f:
                |     /        |     /     ~-.     `-. _||_||_
                |_____|        |_____|         ~ - . _ _ _ _ _>

The main benefit of using plain text over rich text is that it provides a distraction-free writing environment. In word processors, the screen looks like a printed page. While this might be aesthetically pleasing, it distracts the writer from creating content and instead fiddle with the design.

Only a tiny part of written text is printed on paper, so the What You See is What You Get (WYSIWYG) approach does not make much sense in the digital age. Plain text writing follows a different philosophy and uses the What You See Is What You Mean (WYSIWYM) approach.

What You See is What You Mean

Graphical interfaces simulate the physical world by making objects on the screen look like pieces of paper and folders on a desk. You point, click and drag documents into folders; documents appear as they would on paper and when done, they go into the rubbish bin. Graphical interfaces are a magic trick that makes you believe you are doing something physical. This approach might be convenient, but it moves the user away from understanding how a computer works.

The WYSIWYG approach distracts the mind from the content and lures the user into fiddling with style instead of writing text. Office workers around the globe waste a lot of time trying to format or typeset documents. Following the Emacs way will help you become more productive by not worrying about the document’s design until you complete the text. As I write this book, it only takes a few keystrokes to convert the text into a fully formatted ebook or web page, ready for distribution.

As I write this website, I don’t see what it will look like in published form. In Emacs, I only see text, images and some instructions for the computer on what the final product should look like (the What You Mean part of WYSIWYM). This approach lets me focus on writing text instead of worrying about the end product.

The image below shows what this looks like in action. The left side shows this article while writing it. The right side shows the result after creating the content. The colours on the screen indicate the function of the text, such as headers, italic text, or metadata, instead of the actual colour. The fonts are uniform, and Org mode hides images to allow me to focus on the text. Org mode can show the images inside the text with a simple keystroke. The image and the text remain separate files. I rarely view a live preview of the eventual output, as that negates the benefits of writing in plain text.

The WYSIWYM approach with Emacs Org mode and Hugo.
The WYSIWYM approach: Left: this article as I am writing it in Emacs. Right: The exported result in Firefox.

Principles of writing plain text

When I export this document to a web page or any other format, a template and/or style sheet are attached to the text, which define the design of the published work. Another advantage of this approach is that your text can be easily exported to multiple formats.

In my workflow, the Hugo software converts the text in Emacs to a usable website using my custom template and a CSS style sheet. When I convert a text to PDF, the LaTeX software attaches a document class to the text to define the layout and typography. Each export format has its own method to convert plain text to published content.

To publish any text your text will have four elements:

  1. Content: The text itself.
  2. Semantics: Context (markers for headings, rich text, tables, images and so on).
  3. Template: Translates the structure of the document
  4. Style sheet: The design of the publication.

In a WYSIWYG word processor, all these elements are embedded in one file, but only the text is visible with the semantics and style sheet applied to show the printed result. In plain text, the content and semantics are directly visible, depending on the text format. Please note that files don’t contain any semantics; they are the simplest form of plain text. The table below shows how italic text is signified in four common plain text formats.TXT

Format Italic semantics
HTML <i>Italic Text</i>
LaTeX \emph{Italic Text}
Markdown **Italic Text**
Org mode /Italic Text/
Italic text in common plain text formats.

The style sheet exists separate from the text. This means that you can easily export your document to various formats with fine control over the end result. Org mode has a versatile export engine that allows you to convert your writings to a website, ebook or physical book with just a few keystrokes and some configuration.

These are only some example of using plain text for writing projects. Many other markup and markdown formats are available to turn your thoughts into a published work. For example, LilyPond is a plain text music notation format and Fountain is a format to write screenplays.

The Emacs learning curve

The second hurdle is the steep learning curve. To make Emacs work for you, you will need to learn the basics principles and learn some of the associated add-on packages. As Emacs is old software, some default settings and terminology differ from contemporary graphical software. For example, opening a file is 'visiting a file'. Pasting a text is' yanking'; cutting it is the same as killing. Emacs terminology is certainly more poetic than the current handicraft terms, such as cutting and pasting. Closing Emacs itself is called killing.

The steeper the learning curve, the bigger the reward.

The key to learning Emacs is to not get overwhelmed by the virtually infinite configuration options but to only learn those bits of functionality that you need to do what you need to do. Even without any configuration, you can do a lot with Emacs.

Learning some Elisp enables you to configure the software to your wishes. While that might sound daunting, you can simply copy and paste (kill and yank) examples from the Internet. Even better, Emacs Writing Studio is a starter kit to shorten this learning curve as it optimises Emacs for the writing workflow.

The articles on this website guide you through what you need to know for Emacs to become your favourite writing tool. You can also download and use the complete configuration file from these articles to get you started.

Advantages of using Emacs

In summary, these are some of the significant advantages of using Emacs to create written content:

  1. One piece of software to undertake most of your computing activities makes you more productive because you only need to master one system.
  2. You store all your information in plain text files. You will never have any problems with compatibility due to esoteric file formats.
  3. You can modify almost everything in the software to suit your workflow.
  4. Emacs runs on all major operating systems: All Linux flavours, Windows, Chrome OS, and macOS.
  5. Emacs is open source and supported by a large community willing to help.

Limitations of Emacs

After singing the praises of this multi-functional editor, you would almost think that Emacs is the omnipotent god of software. Some people even have established the Church of Emacs as a mock religion to express their admiration.

Emacs can display images and integrate them with text. Still, it has limited functionality to create or modify graphical files. If you need to create or edit pictures, consider using GIMP (GNU Image Manipulation Program). Video content is currently not supported and cannot be easily integrated with text other than hyperlinks to a file or web page.

The focus on text limits working in Emacs to serial thinking to the exclusion of visual thinking. I like to scribble little diagrams in my notebook to help me solve problems. Emacs is limited to text. But you can import your doodles as images.

The second disadvantage is that Emacs does not have a fully operational web browser. There are packages to surf the web within Emacs, but they have limited functionality.

Emacs has the risk of becoming a productivity sink. But remember that just because you can configure everything does not mean you should. Don't spend too much time worrying about the minutia of your workflow. Spend this time inside your workflow and create new things. Most productivity hacks do not affect your output because you write with your mind, not the keyboard.

The best way to learn Emacs is one step at a time. Start with a simple configuration and then build on this starting point once you need further enhancements.

Emacs Writing Studio

If you like to support my work, then please purchase the Emacs Writing Studio book.

Emacs Writing Studio

Emacs Writing Studio

A comprehensive guide for writers seeking to streamline their workflow using Emacs. The book covers everything from organising ideas and writing distraction-free to publishing in multiple formats. It’s perfect for both beginners and experienced Emacs users, offering practical tips and a tailored configuration to enhance your writing process.

You can find the source files for the book and the latest configuration files on GitHub:

Emacs is a malleable system, and everybody has personal preferences on how to undertake a task and configure Emacs. Any article on how to use Emacs is thus opinionated. If you have a different way of doing things, please complete the contact form to send me an email or contact me on social media.

The next article discusses getting started with Emacs and introduces the basic principles.

Share this content

You might also enjoy reading these articles

Improving the Emacs User Interface

Enhancing Minibuffer Completion

Configure Emacs Writing Studio