SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
НазадМетки: python
If you want an editing system with support for restructured text, one choice is the free text editor emacs, which has an add-on mode for restructured text. Emacs has a long and venerable history, and is an extremely powerful editor. Emacs also has versions that are customized for operating systems to make it much more familiar.
Here’s a simple introduction to emacs and a useful introductory help guide. For Windows, there’s a special FAQ.
Mac OSX: Comes with built-in emacs which you can invoke from the command line. For a nicer version, install Aquamacs, which looks and feels like a native Mac application.
Windows: You can download the latest windows installer here (choose the highest numbered zip file with “bin” in the name). This blog gives useful tips to make emacs on Windows even friendlier (in particular, it puts emacs on the right-click menu and improves the startup settings).
Linux: It’s virtually guaranteed that you already have emacs preinstalled on your Linux distribution, which you can start from a command prompt. However, there may also be more “windowy” versions that you can install separately.
Todo
Someone who knows more about emacs for Linux please add more specific information about the windowed version(s).
Finally, here’s the documentation for installing and using the emacs restructured-text mode. The elisp code it refers to is in the file rst.el.
To customize your emacs, you need to open the .emacs file. The above Windows FAQ tells you how to put your .emacs file somewhere else, but the easiest thing to do is just open emacs and inside it type C-x C-f ~/.emacs, which will open your default .emacs file if you have one, or create a new one if you don’t.
You’ll need to install rst.el someplace emacs will find it. Here’s an example .emacs file which adds a local directory called ~/emacs/ to the search path, (so you can put .el files there) and also automatically starts rst mode for files with extensions of rst and .rest:
(require 'cl) (defvar emacs-directory "~/emacs/" "The directory containing the emacs configuration files.") (pushnew (expand-file-name emacs-directory) load-path) (require 'rst) (setq auto-mode-alist (append '(("\\.rst$" . rst-mode) ("\\.rest$" . rst-mode)) auto-mode-alist))