[
  {
    "path": "README.org",
    "content": "#+TITLE: Emacs for developers\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers\n\nThis document will (hopefully) help you to use Emacs as a developer.\n\n**** Disclaimer\n\n- Work in progress, so stay tuned.\n- Exports are handled by the author for the moment and do not reflect the very last changes (but are recent anyway). A scripted solution will be provided soon for contributors.\n\n**** Contributions or requests\n\nDo not hesitate to send a pull request or open an issue to fix, add, discuss, ... etc.\n\n** Who is the target of this tutorial\n\nWell, this is a good question. And I won't give an answer but some elements of answer.\n\nWhat is sure is that it is not written for the people thanked below (Bastien, Dimitri, Sacha, Nic, Avdi, and so on ...), but what is interseting with Emacs is that even if you are a beginner, an intermediate / advanced user or an every day power user, you can learn from others each time you open a web page or a manual dealing with Emacs.\n\nTherefore, this tutorial is written for people who want to improve their experience. Simple as that. Whatever is their knowledge, their feeling, their usage, their config file size (without any pun), etc ...\n\nRemember one thing: Emacs is 30+ years old and brings new users everyday. It is a clue that this is a piece of software that deserve some attention.\n\n* Table of contents\n\n- 1. [[./chapters/01-introduction.org][Introduction]]\n   - 1.1 [[./chapters/01-introduction.org#brief-history][Brief history]]\n   - 1.2 [[./chapters/01-introduction.org#how-to-get-emacs][How to get Emacs?]]\n   - 1.3 [[./chapters/01-introduction.org#more-than-an-editor][More than an editor]]\n   - 1.4 [[./chapters/01-introduction.org#the-perfect-development-tool][The perfect development tool]]\n- 2. [[./chapters/02-the-basics.org][The basics]]\n   - 2.1 [[./chapters/02-the-basics.org#config-files][Config files]]\n   - 2.2 [[./chapters/02-the-basics.org#executing-commands][Executing commands]]\n   - 2.3 [[./chapters/02-the-basics.org#key-bindings][Key bindings]]\n      - 2.3.1 [[./chapters/02-the-basics.org#manipulate-files][Manipulate files]]\n      - 2.3.2 [[./chapters/02-the-basics.org#manipulate-the-current-line][Manipulate the current line]]\n      - 2.3.3 [[./chapters/02-the-basics.org#selecting-a-region][Selecting a region]]\n      - 2.3.4 [[./chapters/02-the-basics.org#commenting][Commenting]]\n      - 2.3.5 [[./chapters/02-the-basics.org#windows][Windows]]\n      - 2.3.6 [[./chapters/02-the-basics.org#buffers][Buffers]]\n      - 2.3.7 [[./chapters/02-the-basics.org#cancel-a-command][Cancel a command]]\n      - 2.3.8 [[./chapters/02-the-basics.org#the-most-useless-command][The most useless command]]\n   - 2.4 [[./chapters/02-the-basics.org#help][Help!]]\n- 3. [[./chapters/03-building-your-own-editor.org][Building your own editor]]\n   - 3.1 [[./chapters/03-building-your-own-editor.org#first-basic-configuration][First basic configuration]]\n   - 3.2 [[./chapters/03-building-your-own-editor.org#general-basic-configuration][General basic configuration]]\n   - 3.3 [[./chapters/03-building-your-own-editor.org#backup-files][Backup files]]\n   - 3.4 [[./chapters/03-building-your-own-editor.org#setting-up-the-locales][Setting up the locales]]\n   - 3.5 [[./chapters/03-building-your-own-editor.org#more-configuration][More configuration]]\n   - 3.6 [[./chapters/03-building-your-own-editor.org#modes][Modes]]\n   - 3.7 [[./chapters/03-building-your-own-editor.org#package-managers][Package managers]]\n   - 3.8 [[./chapters/03-building-your-own-editor.org#some-useful-packages][Some useful packages]]\n   - 3.9 [[./chapters/03-building-your-own-editor.org#code-navigation][Code navigation]]\n   - 3.10 [[./chapters/03-building-your-own-editor.org#setting-a-color-theme][Setting a color theme]]\n- 4. [[./chapters/04-emacs-developing-environments.org][Emacs developing environments]]\n   - 4.1 [[./chapters/04-emacs-developing-environments.org#emacs-for-ruby-developers][Emacs for Ruby developers]]\n   - 4.2 [[./chapters/04-emacs-developing-environments.org#emacs-for-python-developers][Emacs for Python developers]]\n   - 4.3 [[./chapters/04-emacs-developing-environments.org#emacs-for-ccobjective-c][Emacs for C/C++/Objective-C developers]]\n   - 4.4 [[./chapters/04-emacs-developing-environments.org#emacs-for-go-developers][Emacs for Go developers]]\n   - 4.5 [[./chapters/04-emacs-developing-environments.org#emacs-for-php-developers][Emacs for PHP developers]]\n   - 4.6 [[./chapters/04-emacs-developing-environments.org#emacs-for-java-developers][Emacs for Java developers]]\n   - 4.7 [[./chapters/04-emacs-developing-environments.org#emacs-for-r-and-statistics][Emacs for R and statistics]]\n- 5. [[./chapters/05-special-features.org][Special features]]\n   - 5.1 [[./chapters/05-special-features.org#emacs-as-a-file-manager][Emacs as a file manager]]\n   - 5.2 [[./chapters/05-special-features.org#working-locally-vs-remotely][Working locally vs remotely]]\n   - 5.3 [[./chapters/05-special-features.org#organize-your-work-write-papers-and-manage-your-agenda][Organize your work, write papers and manage your agenda]]\n   - 5.4 [[./chapters/05-special-features.org#emails-in-emacs][Emails in Emacs]]\n   - 5.5 [[./chapters/05-special-features.org#some-great-emacs-tips-and-tricks][Some great Emacs tips and tricks]]\n   - 5.6 [[./chapters/05-special-features.org#coming-from-other-editors-ie-vim][Coming from other editors (i.e Vim or SublimeText)]]\n- 6. [[./chapters/06-readings-and-resources.org][Readings and resources]]\n\n* The demo\n\nHere is a video that covers the basics of this tutorial.\nIt is a simple, annoted but efficient demo of a session in Emacs.\n\n[[https://github.com/pierre-lecocq/emacs4developers/tree/master/demo][Here is the links, the sources and the dedicated config file!]]\n\n* The Gnus case\n\nIf you need a detailed and explained Gnus (an Emacs mail reader) configuration example, please refer to [[http://qsdfgh.com/articles/gnus-configuration-example.html][this dedicated article]]\n\n* Exports\n\nThis document is also available in [[./exports/emacs4developers.org][a single ORG file]], [[./exports/emacs4developers.pdf][PDF]], [[./exports/emacs4developers.odt][ODT]] and [[./exports/emacs4developers.html][HTML]].\n\n* License\n\nThe content of this project itself is licensed under the [[http://creativecommons.org/licenses/by/3.0/us/deed.en_US][Creative Commons Attribution 3.0 license]], and the underlying source code used to format and display that content is licensed under the [[http://opensource.org/licenses/mit-license.php][MIT license]].\n\nContributors list can be found [[https://github.com/pierre-lecocq/emacs4developers/network/members][here]].\n\n* Thanks\n\nI want to thank some of the great people who make Emacs a very intersting piece of software or make its community very active (the sort order is absolutely not important here):\n\nBastien Guerry ([[https://twitter.com/bzg2][@bzg2]]), Dimitri Fontaine ([[https://twitter.com/tapoueh][@tapoueh]]), Julien Danjou ([[https://twitter.com/juldanjou][@juldanjou]]), Sacha Chua ([[https://twitter.com/sachac][@sachac]]), Steve Purcell ([[https://twitter.com/sanityinc][@sanityinc]]), Nic Ferrier ([[https://twitter.com/nicferrier][@nicferrier]]), Avdi Grimm ([[https://twitter.com/avdi][@avdi]]), Magnars ([[https://twitter.com/magnars][@magnars]]), Steve Yegge ([[https://twitter.com/Steve_Yegge][@Steve_Yegge]]), Bozhidar Batsov ([[https://twitter.com/bbatsov][@bbatsov]]), Xah Lee ([[https://twitter.com/xah_lee][@xah_lee]]), and many more ...\n\nYou should check those people and their work over the web, twitter, youtube, ...\n\nAnd thank you for reading this !\n"
  },
  {
    "path": "chapters/01-introduction.org",
    "content": "#+TITLE: Emacs for developers - Introduction\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - Introduction\n\n** Brief history\n\n- Originally developed by Richard Stallman and Guy Steele in MIT AI lab\n- First release in 1976\n- Inspired by TECO editor\n- Based on macros (Emacs stands for Editor MACroS)\n- Written in C and Emacs Lisp\n- Part of the GNU project (therefore, we /should/ say \"GNU Emacs\", not \"Emacs\")\n\n- Despite its age, new users are still adopting Emacs as their development platform to this day!\n\n** How to get Emacs?\n\nOn every Linux distribution, packages are available.\nSo run your favorite package manager to install it:\n\n- /apt-get install emacs/\n- /yum install emacs/\n- ...\n\nAnd if you have an exotic operating system, here are the specific distributions:\n\n- Mac OS X: http://emacsformacosx.com/ (or with homebrew: /brew install emacs/)\n- Windows: http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/\n\nFor Max OS X, the Yamamoto Mitsuharu port has some nice features an can be found via this [[https://github.com/railwaycat/emacs-mac-port][github mirror]].\n\nBut, in order to get the latest version, it's _highly recommended_ that you compile Emacs yourself: http://ftp.igh.cnrs.fr/pub/gnu/emacs/\n\n\n** More than an editor\n\n- More than an editor, it is a Lisp interpreter\n- Can run any type of program written in Lisp:\n  - Email clients (like [[http://www.gnus.org/][Gnus]] or [[http://www.emacswiki.org/emacs/mu4e][mu4e]])\n  - Shell (like bash or eshell)\n  - File and directory management (with [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Dired mode]])\n  - Agenda / Notes / TODO list / Project management (with the amazing [[http://orgmode.org][OrgMode]])\n  - IRC / Twitter / Jabber / ... clients\n  - Games (like Tetris, Pong, Snake, 5x5, Dunnet, ...)\n  - Encrypt/decrypt files (like GPG files)\n  - On-the-fly archives editing (thanks to [[http://www.emacswiki.org/emacs/ArchiveMode][archive-mode]])\n  - PDF / Image / (...) viewer\n  - A powerful front end to R / S+ / SPSS / Stata (with [[http://ess.r-project.org/][EmacsSpeaksStatisics)]]\n  - An editor for multi-modal REPL's like IPython (with [[http://tkf.github.io/emacs-ipython-notebook/][EmacsIPythonNotebook]])\n  - Music player (with emms, vlc, mplayer, ...)\n  - Music programming (with [[http://vimeo.com/22798433][Overtone]])\n  - Video editing\n  - And so on ...\n  - (and of course a document editor that can automatically generate this presentation)\n\nIt goes without saying that you can do all of this at the same time with only one Emacs instance.\n\n** The perfect development tool\n\n- As Emacs is a Lisp interpreter, it is extensible. Really, really extensible.\n- The (unofficial) goal of Emacs is to be hacked\n- Therefore, your goal is to hack Emacs to make it work exactly as you want\n\n- Already provides so many development tools (also extensible, of course)\n  - Debuggers\n  - Compilers\n  - Syntax checkers\n  - Documentations\n  - Consoles\n  - ...\n\n- Also provides /modes/ (extensions) for *every* programming language for\n  - Syntax highlighting\n  - Documentation search\n  - Indentation\n  - Source code browsing\n  - Compilation commands\n  - Specific behaviour\n  - ...\n"
  },
  {
    "path": "chapters/02-the-basics.org",
    "content": "#+TITLE: Emacs for developers - The basics\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - The basics\n\n**  Config files\n\nIn order to customize Emacs, you will have to edit its configuration files.\nWhen you install the software, the configuration file does not exist (or is empty) and does nothing until you decide to tweak Emacs.\nSome people use Emacs for decades without any extra configuration because they like it out of the box.\n\nThere are several ways to manage your Emacs configuration:\n\n- Simply create and edit a *~/.emacs* file\n- Create a *~/.emacs.d/* directory with a *~/.emacs.d/init.el* file\n\nThe first solution is great if you have a small, clean and exportable configuration file.\n\nThe second solution is great if you need several configuration files (keep your configuration parts separated) or you need to install external extensions (you will install them in *~/.emacs.d* to keep them centralized and exportable).\n\n** Executing commands\n\nThe main idea of Emacs is that everything is a command. For example: opening a file with a keybinding calls a command that is executed by the Emacs' core.\nAnd all the commands are written in Lisp.\n\nTo call a command, you simply have to press *Escape* and then *x*. It could be *Alt-x* for more comfort.\nThe official name is \"/Meta x/\" and is written /M-x/\n\nIf you type this key sequence, you will see at the bottom of the editor a little prompt.\nThis part of Emacs is called the /mini buffer/ and is used for every interactive actions.\n\nLet's try something:\n\n- type *M-x*\n- Then, in the minibuffer, type *version* and *RET* (return)\n\nEmacs should display the current version number of the software.\n\n#+CAPTION: Execute the version command\n[[../images/version.gif]]\n\nCongratulations! You just called your first Emacs command.\n\n** Key bindings\n\nHere are the most useful keys in Emacs. You will use them several hundreds (or thousands) of times a day.\n\nHow does it work?\n\n- The sequence /C-something/ means that you have to press and hold the /Control/ key while pressing the /something/ key. Example: /C-a/ means /Control + a/.\n- The sequence /C-something somethingelse/ means that you press /Control + something/, then you release Control to press /somethingelse/.\n- The sequence /C-something C-somethingelse/ means that you have to press Control while pressing /something/, then releasing /something/ and pressing /somethingelse/.\n\n*** Manipulate files\n\n- *C-x C-f*: open a file, which corresponds to *M-x find-file*\n- *C-x C-s*: save a file, which corresponds to *M-x save-buffer*\n\n#+CAPTION: Open a file, modify it and save it\n[[../images/open-and-save.gif]]\n\n*** Manipulate the current line\n\n- *C-a*: go to the beginning of the current line, which corresponds to *M-x begining-of-line*\n- *C-e*: go to the end of the current line, which corresponds to *M-x end-of-line*\n- *C-k*: cut the rest of the line at the cursor position, which corresponds to *M-x kill-line*\n- *C-y*: paste what you had cut with the command above, which corresponds to *M-x yank*\n- *C-l*: center the buffer at the cursor position, which corresponds to *M-x recenter-top-bottom*\n\n#+CAPTION: Line manipulation\n[[../images/line.gif]]\n\n*** Selecting a region\n\nRegions are selections, in Emacs.\n\nThey are composed by two points. A starting one and and an ending one.\n\nTo select the starting point, move your cursor to the wanted location and simply press *C-Space*. In your minibuffer, you should have seen a message like \"Mark set\".\nNow, move your cursor to the location you wantyour selection to end.\n\nYou have now a selection (or a /region/) delimited by the place you set the first mark and your cursor. With this region, you can do what ever you want:\n\n- Copy (*M-w*)\n- Cut (*C-k*)\n- Paste (*C-y*)\n- Replace (*M-%*)\n- ... etc\n\n#+CAPTION: Selecting a region\n[[../images/selecting.gif]]\n\n*** Commenting\n\nIn order to comment a code block, select the region you want to comment and use:\n\n- *M-x comment-region* in order to comment the block\n- *M-x uncomment-region* in order to uncomment the block\n\nOf course, Emacs knows, according to the major mode loaded how to comment properly your code. If the major-mode is /ruby-mode/, it will add a \"#\" before the line; if the major-mode is /lisp-mode/, it will add \";;\", and so on and so forth.\n\n#+CAPTION: Commenting\n[[../images/comment.gif]]\n\n*** Windows\n\nThis might be confusing but a /window/ is a part of a /frame/.\n\nAn /Emacs frame/ is the window that you opened when you launched Emacs.\n\nAn /Emacs frame/ can be divided into /windows/ in itself.\n\n- *C-x 2*: open a new window horizontally, which corresponds to *M-x split-window-below*\n- *C-x 3*: open a new window vertically, which corresponds to *M-x split-window-right*\n- *C-x o*: switch to the next window, which corresponds to *M-x other-window*\n- *C-x 0*: close the current window, which corresponds to *M-x delete-window*\n- *C-x 1*: close all the windows but the one focused, which correspond to *M-x delete-other-windows*\n\n#+CAPTION: Windows manipulation\n[[../images/windows.gif]]\n\n*** Buffers\n\nA /buffer/ is displayed in a /frame/.\n\n- *C-x b*: switch to an already opened buffer, which corresponds to *M-x switch-to-buffer*\n- *C-x C-b*: list opened buffer (and jump to the selected one), which corresponds to *M-x list-buffers*\n- *C-x k*: kill a buffer, which corresponds to *M-x kill-buffer*\n\nOn most read-only buffers, press *q* to close it.\n\n#+CAPTION: Buffer navigation\n[[../images/buffers.gif]]\n\n*** Cancel a command\n\n- *C-g* or *ESC ESC ESC*: cancel the current command running in the minibuffer, which corresponds to *M-x keyboard-quit*\n\nIt also cancels all previously pressed keys.\n\n*** The most useless command\n\n- *C-x C-c*: quit emacs (use at your own risks!), which corresponds to *M-x save-buffers-kill-terminal*\n\n** Help!\n\nEmacs has a powerful built-in help system for key bindings and internal functionalities.\n\n- *C-h f <function-name>*: Find the key binding corresponding to <function-name> (ex: C-h f save-buffer)\n- *C-h k <key-sequence>*: Find the function name corresponding to <key-sequence> (ex: C-h k C-x C-s)\n- *C-h v var*: Display the documentation of the Lisp variable var (describe-variable) (ex: C-h v emacs-version)\n- *<key-sequence> C-h*: Show the next possible keys to press after the <key-sequence> (ex: C-x 4 C-h)\n\nFor more detail about Emacs help system, see: https://www.gnu.org/software/emacs/manual/html_node/emacs/Help-Summary.html\n\nWhen executing these commands, a new frame opens. To close it, switch to it (/C-x o/) and type /q/. If not, simply close it (/C-x 0/)\n\nAfter executing a command with M-x, if the command have a corresponding keybinding bound to it, a message indicating what to press will appear in the minibuffer.\n\nEmacs also includes the full manual (also available online: http://www.gnu.org/software/emacs/manual/html_node/emacs/)\n\n- *C-h r*: browse the Emacs manual within Emacs\n\nFinally, there are so many other help functions: http://www.emacswiki.org/emacs/EmacsNewbieHelpReference\n"
  },
  {
    "path": "chapters/03-building-your-own-editor.org",
    "content": "#+TITLE: Emacs for developers - Building your own editor\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - Building your own editor\n\nFrom this moment on, we will edit the configuration file.\nFor now, we will put everything in a single *~/.emacs.d/init.el* file. Create it if it does not exist.\n\n#+BEGIN_SRC sh\n# Backup old configuration\ncp .emacs dot-emacs.old\ncp -R .emacs.d dot-emacs.d.old\n\n# Create new and empty configuration\nmkdir ~/.emacs.d\ntouch ~/.emacs.d/init.el\n#+END_SRC\n\n** First basic configuration\n\nWhen you will have to change or add configuration, simply edit your *~/.emacs.d/init.el* file and add what you need.\n\nFor example, here is a tweak that does nothing visually but is useful for other packages and the Emacs engine itself.\nIt allows you to define your name and email. Emacs can use it to add author information to a file when asked.\n\n#+BEGIN_SRC lisp\n(setq user-full-name \"Your full name\")\n(setq user-mail-address \"your@email.com\")\n#+END_SRC\n\nAfter each configuration modification, two solutions:\n\n- the soft & clever way: execute *M-x eval-buffer*\n- the hard way: restart Emacs.\n\n** General basic configuration\n\nNow, let's move on to a basic set of more visual basic configurations.\nAs you did earlier, simply add this to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Ask \"y\" or \"n\" instead of \"yes\" or \"no\". Yes, laziness is great.\n(fset 'yes-or-no-p 'y-or-n-p)\n\n;; Highlight corresponding parentheses when cursor is on one\n(show-paren-mode t)\n\n;; Highlight tabulations\n(setq-default highlight-tabs t)\n\n;; Show trailing white spaces\n(setq-default show-trailing-whitespace t)\n\n;; Remove useless whitespace before saving a file\n(add-hook 'before-save-hook 'whitespace-cleanup)\n(add-hook 'before-save-hook (lambda() (delete-trailing-whitespace)))\n#+END_SRC\n\n** Backup files\n\nYou may have notice that the files you edit are duplicated and renamed with a /~/ at the end.\nThey are the backup files that Emacs creates for you with the auto-save feature.\nSometimes it is great because you can recover a file in case of error, sometimes it is annoying because you can have so many of these files.\n\nIt is up to you to keep it or disable it.\nHere is the configuration to disable it:\n\n#+BEGIN_SRC lisp\n;; Remove all backup files\n(setq make-backup-files nil)\n(setq backup-inhibited t)\n(setq auto-save-default nil)\n#+END_SRC\n\nAn alternative method is to save these backups in a centralized directory:\n\n#+BEGIN_SRC lisp\n;; Save backup files in a dedicated directory\n(setq backup-directory-alist '((\".\" . \"~/.saves\")))\n#+END_SRC\n\n** Setting up the locales\n\nYou may want to set up a specific locale for your files.\nThis will do the trick:\n\n#+BEGIN_SRC lisp\n;; Set locale to UTF8\n(set-language-environment 'utf-8)\n(set-terminal-coding-system 'utf-8)\n(setq locale-coding-system 'utf-8)\n(set-default-coding-systems 'utf-8)\n(set-selection-coding-system 'utf-8)\n(prefer-coding-system 'utf-8)\n#+END_SRC\n\n** More configuration\n\nThe best way to improve your configuration is to read the [[http://www.gnu.org/software/emacs/manual/][manual]] ...\nBut you can also (this is the unofficial method) read others Emacs users' config files.\nThere are so many people who share their configuration, comment their code, and distribute their modes!\n\nHere is mine: (https://github.com/pierre-lecocq/emacs.d)\n\nIf you are a heavy VIM user, you can bring you VIM experience to Emacs by using [[https://github.com/syl20bnr/spacemacs][Spacemacs]]. You can also\nfind [[https://github.com/emacs-tw/awesome-emacs#starter-kit][Starter Kit]] to start with Emacs.\n\n** Modes\n\n/Modes/ are Emacs /extensions/ that can be installed to extend the capabilities of Emacs. They will allow you to build a powerful tailored editor.\n\nThere are 2 kinds of modes: major and minor.\n\n*** Major modes\n\nMajor modes are modes that transform Emacs to a specialized software for editing a certain type of files (i.e c-mode) or managing special tasks (i.e reading emails, managing git repository, ...)\n\nOnly one major mode can be used at a time.\n\n*** Minor modes\n\nMinor modes are additional modes that are added transparently to the major mode. They add features and behavior (i.e parentheses matching, syntax or spelling checkers, ...)\n\nSeveral minor modes can be used at any given time.\n\n** Package managers\n\nEmacs has brilliant package managers such as /package.el/ or /el-get/ that allows you to add and update modes really easily.\n\n*** Package.el\n\n/package.el/ is the built in package manager shipped by default with Emacs 24 or later.\n\nTo list available packages, simply type this command:\n\n#+BEGIN_SRC lisp\nM-x package-list-packages\n#+END_SRC\n\nYou will see a list of packages. Simply press ENTER on the name of one of them to install it.\n\nAdditionally, you can manage the packages list by adding other sources to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Add package sources\n(setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\")\n                         (\"marmalade\" . \"http://marmalade-repo.org/packages/\")\n                         (\"melpa\" . \"http://melpa.org/packages/\")))\n#+END_SRC\n\n*** El-Get\n\n/[[https://github.com/dimitri/el-get][el-get]]/ is one of the most popular and easy-to-use package managers. It's the \"/apt-get/\" of Emacs.\nIt is written by the great [[https://github.com/dimitri][Dimitri Fontaine]] and is based on recipe files that simply describe where the package is located and how to get/compile/install it for you.\n\nTo use it, simply add this to your configuration file. It will download and set up /el-get/ for you:\n\n#+BEGIN_SRC lisp\n;; Set up el-get\n(add-to-list 'load-path \"~/.emacs.d/el-get/el-get\")\n(unless (require 'el-get nil 'noerror)\n  (with-current-buffer\n      (url-retrieve-synchronously\n       \"https://raw.github.com/dimitri/el-get/master/el-get-install.el\")\n    (let (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n#+END_SRC\n\n*** The generic method\n\nIn order to leave you the choice of the package manager you want to use, here is a function that handles several package managers. For now, it covers /package.el/ and /el-get/.\n\nIt also allows you to automatically install packages you want.\n\nIn the following snippet, two sample packages are installed\n\n- /color-theme/ in order to allow us to  change colors themes\n- /autopair/ in order to close automatically parentheses, brackets and braces when you open it\n\nSimply add this code to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Set up the package manager of choice. Supports \"el-get\" and \"package.el\"\n(setq pmoc \"el-get\")\n\n;; List of all wanted packages\n(setq\n wanted-packages\n '(\n   color-theme\n   autopair\n))\n\n;; Package manager and packages handler\n(defun install-wanted-packages ()\n  \"Install wanted packages according to a specific package manager\"\n  (interactive)\n  (cond\n   ;; package.el\n   ((string= pmoc \"package.el\")\n    (require 'package)\n    (add-to-list 'package-archives '(\"gnu\" . \"http://elpa.gnu.org/packages/\"))\n    (add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))\n    (add-to-list 'package-archives '(\"marmelade\" . \"http://marmalade-repo.org/packages/\"))\n    (package-initialize)\n    (let ((need-refresh nil))\n      (mapc (lambda (package-name)\n          (unless (package-installed-p package-name)\n        (set 'need-refresh t))) wanted-packages)\n      (if need-refresh\n        (package-refresh-contents)))\n    (mapc (lambda (package-name)\n        (unless (package-installed-p package-name)\n          (package-install package-name))) wanted-packages)\n    )\n   ;; el-get\n   ((string= pmoc \"el-get\")\n    (add-to-list 'load-path \"~/.emacs.d/el-get/el-get\")\n    (unless (require 'el-get nil 'noerror)\n      (with-current-buffer\n      (url-retrieve-synchronously\n       \"https://raw.github.com/dimitri/el-get/master/el-get-install.el\")\n    (let (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n    (el-get 'sync wanted-packages))\n   ;; fallback\n   (t (error \"Unsupported package manager\")))\n  )\n\n;; Install wanted packages\n(install-wanted-packages)\n#+END_SRC\n\nNote that some of the following package names could vary if you use /package.el/ or /el-get/.\n\n*** The modern and efficient way\n\nSome upper-level packages make package management easier and cleaner.\n\nFor example, John Wiegley's =use-package= software is an elegant and efficient way to install and tidy your external packages configurations.\n\nHere is the way to use it:\n\nFirst, setup packages sources and install =use-package=\n\n#+BEGIN_SRC lisp\n(require 'package)\n(setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\")\n                         (\"marmalade\" . \"http://marmalade-repo.org/packages/\")\n                         (\"melpa\" . \"http://melpa.org/packages/\")))\n(package-initialize)\n\n(unless (package-installed-p 'use-package)\n  (progn\n    (package-refresh-contents)\n    (package-install 'use-package)))\n\n(require 'use-package)\n#+END_SRC\n\nThen, for each package you want to install, simply add this to your configuration (replace /the-package-name/ by any package name):\n\n#+BEGIN_SRC LISP\n(use-package the-package-name\n         :ensure the-package-name\n         :init (progn\n                  ;; Do something after the package is initialized\n                ))\n#+END_SRC\n\n\n** Some useful packages\n\nAs a developer, you will need some packages that will help you to work, increase your productivity and enhance your comfort while coding.\nPlease note that even if I am a Ruby/shell/Lisp/web/PHP developer, some packages are compatible and useful for every kind of development. Therefore, the base packages are listed here but some specific packages that might be useful for your work may not be listed here. It is up to you to adapt the list according to your needs!\n\nTip: After adding packages, restart Emacs in order to let your package manager download and install it properly.\n\n*** Auto complete\n\nAuto completion is a must-have feature in the development world.\nThis package simply displays a popup at the cursor position with the available completions.\n\nTo install it, add =auto-complete= to your packages list.\n\n[[http://www.emacswiki.org/emacs/AutoComplete][Read more]]\n\n[[../images/mode-autocomplete.gif]]\n\nBUT there is a more \"modern\" mode for auto-completion: /company-mode/. I switched to it in order to try and play with it. It seems very efficient and useful.\n\nTo install it, add =company-mode= to your packages list.\n\n[[http://company-mode.github.io/][Read more about company-mode]]\n\n*** Autopair\n\nWhen you open a quote/parenthese/bracket/curly bracket, this mode automatically adds the closed one and bring your cursor between the two.\nVery useful to avoid syntax errors, for example.\n\nTo install it, add =autopair= to your packages list.\n\n[[https://github.com/capitaomorte/autopair][Read more]]\n\n[[../images/mode-autopair.gif]]\n\n*** Buffer move\n\nThis mode allows you to re-organize and move the buffers from a window to another.\nUseful if you want to switch buffer places in order to have your debugging buffer on the right side, for example.\n\nTo install it, add =buffer-move= to your packages list.\n\n[[http://www.emacswiki.org/cgi-bin/wiki/buffer-move.el][Read more]]\n\n[[../images/mode-buffermove.gif]]\n\n*** Flycheck\n\nThis mode check the syntax of a buffer. It could be used for checking code syntax or typos when writing any kind of text.\n\nTo install it, add =flycheck= to your packages list.\n\n[[http://flycheck.readthedocs.org/en/latest/][Read more]]\n\n*** Highlight symbol\n\nThis mode highlights all symbols that matches a pattern in your buffer\n\nTo install it, add =highlight-symbol= to your packages list.\n\n[[http://www.emacswiki.org/emacs/HighlightSymbol][Read more]]\n\n*** Ido\n\nIdo is a must have mode to navigate, find stuffs, and do things interactively.\nIt is for comfort, but is indispensable to go fast.\n\nMany extensions of this mode are available, therefore read and chose what you want.\n\nI personally use two of them: /vertical/ and /hack/.\n\nTo install it, add =ido-hacks= and =ido-vertical-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/InteractivelyDoThings][Read more]]\n\n[[../images/mode-ido.gif]]\n\n*** JS3\n\nThis mode is an enhanced mode for editing Javascript files. I do not use it a lot, but it is useful for some javascript-like or NPM files.\n\nTo install it, add =js3-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/Js2Mode][Read more]]\n\n*** Magit\n\nMagit is a very powerful and elegant mode for interacting with your git repository.\nIn order to understand how powerful it is, simply watch this amazing [[http://vimeo.com/2871241][video]].\n\nOnce installed, always keep the [[http://daemianmack.com/magit-cheatsheet.html][magit cheatsheet]] around.\n\nTo install it, add =magit= to your packages list.\n\n*** Git time machine\n\nIn addition to Magit, there is an interesting package that allows you to travel in time accross the different versions of a file stored in Git.\n\nHere is a demo and its repository: [[https://github.com/pidu/git-timemachine][git-timemachine on github]].\n\nTo install it, add =git-timemachine= to your packages list.\n\n[[https://github.com/magit/magit][Read more]]\n\n*** Multiple cursors\n\nThis mode is great and super powerful. Instead of explaining what it is, I'll point you to this amazing [[http://emacsrocks.com/e13.html][video]] by Magnars.\n\nTo install it, add =multiple-cursors= to your packages list.\n\n[[https://github.com/magnars/multiple-cursors.el][Read more]]\n\n*** PHP mode\n\nA basic but stable mode for editing PHP files, whatever you think about PHP ...\n\nTo install it, add =php-mode= to your packages list.\n\n[[http://php-mode.sourceforge.net/][Read more]]\n\n*** Rainbow mode\n\nA toyish but indispensable mode to add colors to your CSS files when using properties like \"color\", \"background-color\".\nIt is great because it understands every way to write a color (hex, name, ...) and gives you a preview of the color itself.\n\nTo install it, add =rainbow-mode= to your packages list.\n\n[[http://julien.danjou.info/projects/emacs-packages][Read more]]\n\n*** RHTML mode\n\nThis mode is useful for editing .rhtml files. You can also use it to edit any kind of ruby templates (i.e .erb).\n\nTo install it, add =rhtml-mode= to your packages list.\n\n[[https://github.com/eschulte/rhtml][Read more]]\n\n*** Ruby mode\n\nDo I really need to explain ?\n\nRuby mode is already installed in Emacs and is very stable.\n\n[[http://www.emacswiki.org/emacs/RubyMode][Read more]]\n\n*** Switch window\n\nThis mode is cool when you work with a lot of windows opened.\nIf you want to switch to another one, you have to press *C-x o* until you reach the wanted window.\nWith this mode, when you press *C-x o*, big numbers replace your opened windows. Simply type the corresponding number to reach the wanted window.\n\nTo install it, add =switch-window= to your packages list.\n\nThen do not forget to override the default configuration by adding this to your configuration:\n\n#+BEGIN_SRC lisp\n(global-set-key (kbd \"C-x o\") 'switch-window)\n#+END_SRC\n\n[[https://github.com/dimitri/switch-window][Read more]]\n\n[[../images/mode-switchwindow.gif]]\n\n*** Visual regexp\n\nThis mode highlights the text that matches the regexp that you are writing in the mini buffer.\n\nTo install it, add =visual-regexp= to your packages list.\n\n[[https://github.com/benma/visual-regexp.el][Read more]]\n\n*** YAML mode\n\nAllows you to edit YAML files\n\nTo install it, add =yaml-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/YamlMode][Read more]]\n\n*** Yasnippet\n\nA mode that allows you to write code faster if you are lazy.\nIt is very easy to create your own snippets and use it whatever the file you are editing (code, non-code, emails, ...)\n\nI personally do not use it, but people coming from Textmate/Sublime would love it.\n\nTo install it, add =yasnippet= to your packages list.\n\n[[http://www.emacswiki.org/emacs/Yasnippet][Read more]]\n\n*** Paredit\n\nParedit is a really cool mode to \"keep parentheses balanced\" and navigating in the S-expressions. Useful and indispensable if you write Lisp code, for example.\n\nTo install it, add =paredit= to your packages list.\n\n[[http://www.emacswiki.org/emacs/ParEdit][Read more]]\n\n** Code navigation\n\nNavigate through source code is an indispensable feature in code editors. Some other editors are focused on this (like Sublime) but the problem is that they do not leave you the choice of weapons (like every other features).\n\nEmacs, as you noticed (yes, you did) can integrate any external tool or include a large variety of internal tools to make it more efficient. Code navigation is not an exception.\n\nThere are a lot of packages that exist to navigate through code, with different methodologies and advantages:\n\n- [[http://www.emacswiki.org/emacs/EmacsTags][TAGS]] (built in. No installation required)\n- [[https://github.com/bbatsov/projectile][Projectile]] (install it by adding =projectile= to your packages list)\n- [[https://github.com/emacs-helm/helm][Helm]] (install it by adding =helm= to your packages list)\n- [[http://cedet.sourceforge.net/][Emacs CEDET]] (install it by adding =cedet= to your packages list)\n- ...\n\n(Note: use once at a time! You do not need to install them all.)\n\nAfter using /Projectile/ for a certain period of time, I gave /Helm/ a shot but finally got back to the simplicity and the efficiency of the /TAGS/ system.\nNevertheless, /Projectile/ and /Helm/ are really powerful and useful. You really should look at them.\n\nFor now, I will cover the basics of /TAGS/ since it is a standard (used by other software) and it is built-in (so if you use another Emacs without your config, you still know how to surf in the code). And other useful tricks will be shown here.\n\n*** Tags basics\n\nBasically, the TAGS rely on an index file of the content of your code source.\nIn the root folder of a project, you must generate your index.\nSeveral methods for this, but here is one command that generates the file:\n\n#+begin_src sh\ncd /path/to/your/project\nfind . -regex \".*\\.\\(c\\|h\\|rb\\|py\\|php\\|js\\|sh\\|bash\\)\" -print | xargs etags -a\n#+end_src\n\nYou now should see a \"TAGS\" file. If needed, exclude this file from your git/svn/whatever repository/.\n\nYou are now ready to surf!\n\nNow, here are the main commands to use them:\n\n- *M-.* is the equivalent of *M-x find-tag*: find a tag\n- *M-x find-tag-other-window*: find a tag, but in another window\n- *M-x tags-search*: find a tag thanks to a regexp\n- *M-x tags-query-replace*: replace a tag in all the indexed files\n- *M-x tags-apropos*: list all tags that match a regexp\n- *M-x list-tags*: list all tags in a file\n\n*** List functions or methods\n\nIn order to list and jump easily between the functions or methods of the current file, here is a little trick:\n\n#+begin_src emacs-lisp\n(global-set-key (kbd \"C-S-f\") 'imenu) ;; use iMenu\n#+end_src\n\nAfter pressing Ctrl-Shift-f (replace it by whatever you want!), a menu with all the available resources appears in the minibuffer.\nSelect the resource you want (let's say /All.methods/ if you are editing some code) and you will be able to search and jump to a method definition directly.\n\n*** Files navigation (a.k.a fuzzy matching) with TAGS and ido\n\nIn order to find and jump easily to a file in your project thanks to TAGS, you have to add a little function to your configuration.\nFor this you should have installed the =ido-mode= described above.\n\n#+begin_src emacs-lisp\n(defun ido-find-file-in-tag-files ()\n  (interactive)\n  (save-excursion\n    (let ((enable-recursive-minibuffers t))\n      (visit-tags-table-buffer))\n    (find-file\n     (expand-file-name\n      (ido-completing-read\n       \"Project file: \" (tags-table-files) nil t)))))\n\n(global-set-key (kbd \"C-S-x C-S-f\") 'ido-find-file-in-tag-files)\n#+end_src\n\nNow, in your project folder and once you generated your TAGS file, you can press *C-S-x C-S-f* to find files through the whole tree of directories just by typing a pattern.\n\n[[../images/fuzzy.gif]]\n\n*** RGrep\n\n/rgrep/ is a great tool to use in addition of the TAGS. It is a Unix tool that make /grep/ queries recursively. In Emacs, it will show you a new buffer with all the results of the command. To use it, simply type:\n\n*M-x rgrep RET yoursearchterm RET*\n\nOnce fired, you can switch to the newly created buffer, parse the results and jump to the wanted files very quickly.\n\nWhat is cool is that it is integrated in the editor, just beside your code --  it does not require you to switch to a shell and then copy-paste the file you want.\n\n[[../images/rgrep.gif]]\n\n** Setting a color theme\n\nNow, we are talking about something very touchy and that can be a long quest ...\n\nA color theme generally includes colors for:\n\n- background\n- syntax color (for code)\n- specific modes colors (gnus, dired, git, ...)\n\nThere are several ways to install a color theme, but first, we will use the Emacs' internal color-theme library.\n\nLet's try to switch between different themes:\n\n- Type *M-x load-theme RET tango-dark*\n- Then type *M-x load-theme RET wombat*\n- Finally type *M-x load-theme RET whiteboard*\n\nThere is no secret or perfect color theme. There are so many of theme and each user has its preferences in term of colors.\n\n#+CAPTION: color themes\n[[../images/colors.gif]]\n\nIn order to choose yours, try the default ones, Google a lot or why not considering making your own?\n\nTip: for an effective choice, here are two showcases:\n\n- [[http://pawelbx.github.io/emacs-theme-gallery/]]\n- http://gnuemacscolorthemetest.googlecode.com/svn/html/index-el.html\n\n\n*** Font settings\n\nAfter setting up your theme, there are some other tweaks that are \"color theme related\".\nFonts are something very important depending on your system, your screen size, your current task in Emacs, ... etc\n\nIf you want to change the font directly from your current Emacs instance, simply type *M-x set-frame-font RET*.\nAnd if you want to see all supported fonts, type *TAB* twice. It will show you a list.\n\nThe global and easy way to do it is to add a line to your configuration:\n\n#+BEGIN_SRC lisp\n(set-default-font \"DejaVu Sans Mono-10\")\n#+END_SRC\n\nBut to be safe, you'd better add this into your X resource settings file (~/.Xresources):\n\n#+BEGIN_SRC lisp\nemacs.font: DejaVu Sans Mono-10\n#+END_SRC\n\nOf course, it is possible to set a different font for any system or mode you want. It is cool since you can use different font (size) if you are on Linux or mac OR if you write a book, write code, read your emails, ... etc.\nAs an exercise, I'll let you search how to do this kind of stuff in Emacs Lisp if you need it.\n\nIf you want more about font settings and especially about font names, please see the [[http://www.emacswiki.org/emacs/SetFonts][Emacs wiki page]] or the [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html][manual]].\n\nOne last point: sometimes you want to change the font size of your current buffer. To do this, simply type:\n\n- *M-x text-scale-increase* or *C-x C-+*\n- *M-x text-scale-decrease* or *C-x C--* (Ctrl x, Ctrl dash)\n\nReally handy if you show your screen through an external display or you want to focus on a specific part of a file.\n"
  },
  {
    "path": "chapters/04-emacs-developing-environments.org",
    "content": "#+TITLE: Emacs for developers - Emacs developing environments\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - Emacs developing environments\n\nEmacs, thanks to major and minor modes, can be transformed into a powerful specific development environment.\n\nAccording to the kind of files you are editing (or a command you type), it can change and give you specific features that fit the need of a programming language (or a task like debugging, launching unit tests, ...)\n\n** Emacs for Ruby developers\n\nThere are many Ruby developers who describe their setup around the web. Here are the most popular:\n\n- [[http://devblog.avdi.org/category/emacs-reboot/][The Emacs reboot series, by Avdi Grimm]] (Avdi is a famous ruby programmer and a great Emacs hacker)\n- [[http://crypt.codemancers.com/posts/2013-09-26-setting-up-emacs-as-development-environment-on-osx/][Setting up Emacs as Ruby development environment on OSX]] (even if it is for OSX, the packages remain the same on all OSes)\n- [[http://lorefnon.me/2014/02/02/configuring-emacs-for-rails.html][Configuring Emacs as a productive development environment for Rails development]]\n- [[http://www.emacswiki.org/emacs/RubyOnRails][The EmacsWiki on Ruby and RoR]]\n\n** Emacs for Python developers\n\nHere are some resources about configuring Emacs for developing in Python:\n\n- [[http://caisah.info/emacs-for-python/][Emacs for python - on caisah.info]]\n- [[http://www.emacswiki.org/emacs/PythonProgrammingInEmacs][Python programming in Emacs - on the EmacsWiki]]\n\n** Emacs for C/C++/Objective-C\n\nC languages are very well handled by Emacs and it allows you to edit, debug and run programs with Emacs very easily, with all the control you want.\n\n- [[http://tuhdo.github.io/c-ide.html][C/C++ Development Environment for Emacs]] is a very complete article about this\n- [[http://stackoverflow.com/questions/5800317/emacs-as-a-c-programming-ide-configuration][A various tips and packages for C language(s)]] on StackOverflow\n- [[http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/][Setting up perfect environment for C/C++ Programming]] (according to its author. Good resource, though)\n- [[http://www.emacswiki.org/emacs/DebuggingWithEmacs][Debugging with Emacs]]\n- [[http://cedet.sourceforge.net/][CEDET - Collection of Emacs Development Environment Tools]] An amazing collection of tools for developing in many programming languages, especially for C/C++\n- [[http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html][How to configure CEDET]]\n\n** Emacs for Go developers\n\n- If you develop in Go, you really should refer to the great [[http://yousefourabi.com/blog/2014/05/emacs-for-go/][Emacs for Go]] article, written by Yousef Ourabi.\n- Another one, with videos, is written by Dominik Honnef: [[http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/][Writing Go in Emacs]]\n\n** Emacs for PHP developers\n\nPHP, along with all the web technologies (HTML/JS/CSS) are very well supported in Emacs. The PHP mode does almost all the work by itself.\n\n- [[http://www.emacswiki.org/emacs/PhpMode][The EmacsWiki page about php-mode and other associated packages]]\n- [[http://stackoverflow.com/questions/912671/what-is-a-good-setup-for-editing-php-in-emacs][A list of useful packages for PHP - on StackOverflow]]\n- [[https://drupal.org/node/59868][An example setup for working on Drupal]] (but can be used for PHP in general)\n- [[https://code.google.com/p/geben-on-emacs/][GEBEN - remote debugging environment for Emacs]]\n- [[http://web-mode.org/][Web Mode - focused on web templates (HTML/JS/CSS)]]\n\n** Emacs for Java developers\n\nJava development is held by Eclipse. But it is not the only editor/environment that allows you to develop in Java!\n\n- [[http://jdee.sourceforge.net/][JDEE - the Java Development Environment for Emacs]]\n- [[http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment][The EmacsWiki article on JDEE]]\n- [[http:][A video demo of a full Java environment on Emacs]]\n\n** Emacs for R and statistics\n\nEmacs is very useful for scientists and people dealing with data. Statistics, analysis, plotting, ... everything can be done within Emacs.\n\n- [[https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org][An amazing paper on working with Emacs, OrgMode and R]]\n- [[http://ess.r-project.org/][Emacs Speaks Statistics]] is a great project that adds a full statistics environment to your Emacs\n- [[http://stats.blogoverflow.com/2011/08/using-emacs-to-work-with-r/][A tutorial on using ESS]]\n"
  },
  {
    "path": "chapters/05-special-features.org",
    "content": "#+TITLE: Emacs for developers - Special features\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - Special features\n\n** Emacs as a file manager\n\nEmacs has a built-in mode named /dired/ that allows you to manage your file system directly in Emacs really easily.\nIt is very powerful and has features that graphical file managers do not have.\n\nFirst of all, to launch it, type:\n\n- *M-x dired RET* and then select a path to open (default is the directory of the file you are editing)\n- or *C-x d* if you prefer keybindings\n\nHere are a few quick shortcuts once you are in /dired mode/\n\n- *R* (capital R): rename a file\n- *D* (capital D): delete a file\n- *+*: create a new directory\n- *Z*: compress the file\n- *RET* (enter): Open the file\n- *g*: refresh\n- *q*: close the dired window\n\nOf course, files can be marked to operate on a selection of them. Use *m* to mark, *u* to unmark (*U* to unmark all), *% m* to mark according to a pattern.\n\nNote that there are so many tricks, extensions and features in /dired mode/ that I let you see around what you need.\n\n[[http://www.emacswiki.org/emacs/DiredMode][Read more about Dired]]\n\n[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Read the manual]]\n\n** Working locally vs remotely\n\nEmacs, once installed on your machine will allow you to edit your file locally, obviously.\n\nOther people (non-Emacs users) will do a dirty trick to edit remote files like they were local files. They will mount the remote directory on their machine (thanks to /sshfs/).\nBut the magic in Emacs is that you can transparently edit remote files on your development servers for example.\nTo do so, Emacs comes with an ingenious extension named \"Tramp\". It is already installed and available when you install Emacs.\n\nIf you press *C-x C-f*, you can open a file. But if you ask =myname@myserver.com:/path/to/file=, it will automatically connect to the server and let you edit the remote file. Easy as pie.\n/Tramp/ supports lots of protocols like ssh, ftp, and so on.\n\nAnd what is great is that if you are editing a remote file and you launch a shell in Emacs, it will automatically set the shell into your remote environment and open it as if you were in the remote directory the file is in.\n\nA last tip about TRAMP. If you simply add =sudo:= in front of your file path, you edit your file with higher privileges. It is a very useful feature if you need to edit your configuration files on a server, for example. Of course, it works remotely and locally.\n\n[[http://www.emacswiki.org/emacs/TrampMode][Read more about Tramp]]\n\n** Organize your work, write papers and manage your agenda\n\nIn Emacs, you can do everything. This is a fact.\n\nOne the most amazing and complete mode is the amazing [[http://orgmode.org][Org mode]], written by amazing people.\nBut when I say amazing, it is absolutely amazing. It allows you to \"live in Emacs\".\n\nHere a a few of its am... features:\n\n- A full agenda / calendar\n- TODO lists and project management\n- Writing (research papers, books, an \"Emacs for developers\" whitepaper, your shopping list ...)\n- Include code in you papers\n- Tables and spreadsheets (with formulas and calculation)\n- Mobile integration\n- ...\n\nAnd what is really cool is that every thing you do in Org is exportable in:\n\n- PDF\n- LaTex\n- HTML\n- Text\n- ODT\n- iCalendar\n- TextInfo\n- ... and many more.\n\nYou really should check their [[http://orgmode.org/features.html][list of features]].\n\nIf you want to see a good example of Org-mode capabilities, check [[http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html][that great page]].\n\n** Emails in Emacs\n\nThere are packages that let you use Emacs as a full featured MUA.\nReading emails, sending emails, filtering, archiving ... etc.\n\nEmacs can be a very powerful and fast e-mail client and as it is controlled by the keyboard, it could be more efficient than a graphical e-mail client (clicking is a loss of time).\nI've used it for years now and I can not imagine using another program to read my emails.\n\nThere are several package to do so, but the most used is [[http://www.gnus.org/][Gnus]]. It is already installed with Emacs.\n\nHere are some of its features beside the basic ones:\n\n- Gnus is in fact a newsreader used to interact with email servers. So you can use to fetch messages from newsgroups, RSS, SMTP, POP, ...\n- Easy and powerful mail splitting\n- Integration with BBDB, a contact manager\n- Message scoring\n- LDAP\n- PGP signing and encrypting\n- Customizable layout\n- Encrypted file to manage your credentials\n- ... and many more\n- ... and of course, it is extensible thanks to Lisp\n\nYou really should try it with your personal account. It is easy to configure and integrate with [[http://www.emacswiki.org/emacs/GnusGmail][Gmail]], for example.\n\nIf you want a complete configuration example with some of the most important features (imap, smtp, search, contacts, GPG signature, display customization, ...), please refer to this dedicated article: [[http://qsdfgh.com/articles/gnus-configuration-example.html][Gnus configuration example]]\n\nBut be careful! If you try it, you will love it.\n\nSome alternatives to Gnus (that I do not use, but that are popular):\n- [[http://www.emacswiki.org/emacs/WanderLust][Wanderlust]]\n- [[http://www.djcbsoftware.nl/code/mu/mu4e.html][Mu4e]]\n\n** Some great Emacs tips and tricks\n\n- Emacs is all about Macros. This is one of its most powerful feature. Record a sequence and re-play it on other lines! Here is [[http://www.thegeekstuff.com/2010/07/emacs-macro-tutorial-how-to-record-and-play/][how]].\n- Using [[http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/][shell]] inside Emacs is cool\n- You really should use the /[[http://www.emacswiki.org/emacs/BookMarks][bookmarks]]/ functionality to save your projects locations (locally or remotely)\n- When opening a file, add /sudo:/ in front of its path in order to edit it as a privileged user\n- You can edit files in hexadecimal directly in Emacs thanks to the /hexl-mode/\n- Emacs allows you to open an archive (gz, bz2, zip, ...), edit its files on-the-fly without extracting yourself the archive. To do so, simple open the file directly in Emacs (*C-x C-f* /path/to/archive.tar.bz2)\n- [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html][Rectangle regions]] edition is really easy\n- [[http://www.cs.bu.edu/teaching/tool/emacs/programming/#compile][Compilation]] and [[http://www.cs.bu.edu/teaching/tool/emacs/programming/#gdb][debugging]] is really well supported in Emacs\n- [[http://www.emacswiki.org/ERC][Erc]] is a great IRC client running in Emacs\n\n/To be continued/\n\n** Coming from other editors (i.e Vim or SublimeText)\n\nSome people use other editors and want to give Emacs a try.\nSome people are really used to use a specific editor.\nSome people do not want to lose their habits and their learning curve.\n\nI am thinking about Vim, but it is also true for other editors (textmate, sublime, ...)\nEmacs has a mode that allows you to use it exactly like Vim.\nI have personally never used this mode, but many people use it. Therefore, it allows you to switch gently and softly from Vim to Emacs.\n\n[[http://www.emacswiki.org/emacs/Evil][Read more about Evil-mode]]\n\nThere is also a package to recreate SublimeText and its GUI features that some people like (minimap, smooth scrolling, ...)\n\n[[https://github.com/zk-phi/sublimity][Read more about Sublimity]]\n"
  },
  {
    "path": "chapters/06-readings-and-resources.org",
    "content": "#+TITLE: Emacs for developers - Readings and resources\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers - Readings and resources\n\n- [[http://emacsrocks.com/][Emacs rocks videos]]\n- [[http://devblog.avdi.org/category/emacs-reboot/][Avdi Grimm Emacs reboot series]]\n- [[http://www.masteringemacs.org/][Mastering Emacs]]\n- [[http://sachachua.com/blog/category/geek/emacs/][Sacha's blog]] and her wonderful Emacs contributors interviews serie\n- [[http://emacsredux.com][Emacs redux]] by Bozhidar Batsov\n- [[http://planet.emacsen.org/][Planet Emacsen]]\n- [[http://reddit.com/r/emacs][Emacs sub-reddit]]\n- [[http://endlessparentheses.com/][Endless Parentheses]], concise emacs productivity tips\n\nAnd of course, the [[http://www.emacswiki.org/][Emacs wiki]]\n"
  },
  {
    "path": "demo/README.org",
    "content": "* The demo\n\nA (basic) annoted demo associated to this tutorial is available in video:\n\n- [[https://www.youtube.com/watch?v=oPZ8yliLYMM]] (Watch it in HD for better ... quality !)\n- [[https://vimeo.com/110356656]]\n\n** Scenario\n\n*** 1. Setup\n\n- 1.1 Launch using a dedicated config file\n- 1.2 Print the current Emacs' version (wouhou !)\n- 1.3 Open a file\n\n*** 2. Basic editing\n\n- 2.1 Go to constructor and edit arguments\n- 2.2 Select a region\n- 2.3 Copy and paste the region\n- 2.4 Comment/Uncomment a region\n- 2.5 Save the current file (buffer)\n\n*** 3. Searching\n\n- 3.1 Search in the current buffer\n- 3.2 Navigate between occurrences\n- 3.3 Search in project files with rgrep\n\n*** 4. Windows and buffers\n\n- 4.1 Open a new window\n- 4.2 Open a new buffer with a new file\n- 4.3 Close window\n- 4.4 Switch between buffers in the same window\n- 4.5 Re-open several windows with different buffers\n- 4.6 Close everything but the current window\n\n*** 5. Dired mode\n\n- 5.1 Open dired mode\n- 5.2 Create a directory (+)\n- 5.3 Create three new file (C-x C-f) and then refresh the buffer (g)\n- 5.4 Rename two file (R) one by one\n- 5.5 Mark two files (m) and delete them both (D)\n- 5.6 Compress the remaining file (Z)\n- 5.7 Change its mode (M)\n\n*** 6. Shell\n\n- 6.1 Open a shell\n- 6.2 Execute a command (ls -l)\n- 6.4 Select the output and execute a command on the selected region (M-| RET sed -e 's/e/EEE/g' > test-shell.txt)\n- 6.5 Execute a command from a buffer (M-! RET ls -l /)\n"
  },
  {
    "path": "demo/config.el",
    "content": ";;\n;; emacs4developer demo - emacs config\n;; by Pierre Lecocq\n;;\n;; See https://github.com/pierre-lecocq/emacs.d for full configuration\n;;\n\n(setq debug-on-error t)\n\n;; ----------------\n;; Install packages\n\n(when (>= emacs-major-version 24)\n\n  ;; Require the library\n  (require 'package)\n\n  ;; Set repositories\n  (setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\")\n\t\t\t   (\"marmalade\" . \"http://marmalade-repo.org/packages/\")\n\t\t\t   (\"melpa\" . \"http://melpa.milkbox.net/packages/\")))\n\n  ;; Initialize the package manager\n  (package-initialize)\n\n  ;; Install autopair package (to match parentheses, brackets, ...)\n  (unless (package-installed-p 'autopair)\n    (progn\n      (package-refresh-contents)\n      (package-install 'autopair)))\n  \n  (require 'autopair)\n  (autopair-global-mode)\n\n  ;; Install darkmine-theme package (a darkish theme)\n  (unless (package-installed-p 'darkmine-theme)\n    (progn\n      (package-refresh-contents)\n      (package-install 'darkmine-theme)))\n\n  (load-theme 'darkmine t)\n\n  )\n\n;; ------------------\n;; Some basic configs\n\n;; See matching pairs of parentheses\n(show-paren-mode t)\n;; Fontify the text in the buffer\n(global-font-lock-mode t)\n;; Selection highlighting\n(transient-mark-mode t)\n;; Display line number in the modeline\n(line-number-mode t)\n;; Display column number in the modeline\n(column-number-mode t)\n;; Layziness is the best invention, ever\n(fset 'yes-or-no-p 'y-or-n-p)\n"
  },
  {
    "path": "demo/src/dummy.rb",
    "content": "#!/usr/bin/env ruby\n\nrequire_relative 'functions'\n\n# A dummy class\nclass Dummy\n  # Accessor - author\n  attr_accessor :author\n\n  # Accessor - version\n  attr_accessor :version\n\n  # Constructor\n  #\n  # @param action_name [String]\n  def initialize(action_name)\n    # Because we are polite\n    puts 'Bonjour'\n\n    # Get a few informations\n    @author = ENV['user']\n    @version = [1, 5, 2].join '.'\n\n    # And then do something ...\n    dispatch action_name\n  end\n\n  # Dispatcher\n  #\n  # @param action [Symbol]\n  def dispatch(action)\n    case action\n    when :create\n      do_create\n    when :update\n      do_update\n    when :delete\n      do_delete\n    else\n      fail 'Unknown action'\n    end\n  end\n\n  # Create something\n  def do_create\n    puts \"Let's create something !\"\n  end\n\n  # Update something\n  def do_update\n    puts \"Let's update something !\"\n  end\n\n  # Delete something\n  def do_delete\n    puts \"Let's delete something !\"\n  end\n\n  # The most silly thing, ever\n  def compute_version\n    result = 0\n    @version.split('.').map! { |n| result += n.to_i }\n    result\n  end\nend\n"
  },
  {
    "path": "demo/src/functions.rb",
    "content": "# Just say something\n#\n# @param message [String]\n# @param prefix [String]\ndef say(message, prefix = ' => ')\n  puts \"%s%s\" % [\n         prefix,\n         message\n       ]\nend\n\n# Symbolize hash keys\n# Credits: Avdi Grimm\ndef symbolize_keys(hash)\n  hash.inject({}){|result, (key, value)|\n    new_key = case key\n              when String then key.to_sym\n              else key\n              end\n    new_value = case value\n                when Hash then symbolize_keys(value)\n                else value\n                end\n    result[new_key] = new_value\n    result\n  }\nend\n"
  },
  {
    "path": "exports/emacs4developers.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n<head>\n<title>*Org HTML Export*</title>\n<!-- 2014-10-21 Mar 13:50 -->\n<meta  http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta  name=\"generator\" content=\"Org-mode\" />\n<meta  name=\"author\" content=\"Pierre Lecocq\" />\n<style type=\"text/css\">\n <!--/*--><![CDATA[/*><!--*/\n  .title  { text-align: center; }\n  .todo   { font-family: monospace; color: red; }\n  .done   { color: green; }\n  .tag    { background-color: #eee; font-family: monospace;\n            padding: 2px; font-size: 80%; font-weight: normal; }\n  .timestamp { color: #bebebe; }\n  .timestamp-kwd { color: #5f9ea0; }\n  .right  { margin-left: auto; margin-right: 0px;  text-align: right; }\n  .left   { margin-left: 0px;  margin-right: auto; text-align: left; }\n  .center { margin-left: auto; margin-right: auto; text-align: center; }\n  .underline { text-decoration: underline; }\n  #postamble p, #preamble p { font-size: 90%; margin: .2em; }\n  p.verse { margin-left: 3%; }\n  pre {\n    border: 1px solid #ccc;\n    box-shadow: 3px 3px 3px #eee;\n    padding: 8pt;\n    font-family: monospace;\n    overflow: auto;\n    margin: 1.2em;\n  }\n  pre.src {\n    position: relative;\n    overflow: visible;\n    padding-top: 1.2em;\n  }\n  pre.src:before {\n    display: none;\n    position: absolute;\n    background-color: white;\n    top: -10px;\n    right: 10px;\n    padding: 3px;\n    border: 1px solid black;\n  }\n  pre.src:hover:before { display: inline;}\n  pre.src-sh:before    { content: 'sh'; }\n  pre.src-bash:before  { content: 'sh'; }\n  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }\n  pre.src-R:before     { content: 'R'; }\n  pre.src-perl:before  { content: 'Perl'; }\n  pre.src-java:before  { content: 'Java'; }\n  pre.src-sql:before   { content: 'SQL'; }\n\n  table { border-collapse:collapse; }\n  caption.t-above { caption-side: top; }\n  caption.t-bottom { caption-side: bottom; }\n  td, th { vertical-align:top;  }\n  th.right  { text-align: center;  }\n  th.left   { text-align: center;   }\n  th.center { text-align: center; }\n  td.right  { text-align: right;  }\n  td.left   { text-align: left;   }\n  td.center { text-align: center; }\n  dt { font-weight: bold; }\n  .footpara:nth-child(2) { display: inline; }\n  .footpara { display: block; }\n  .footdef  { margin-bottom: 1em; }\n  .figure { padding: 1em; }\n  .figure p { text-align: center; }\n  .inlinetask {\n    padding: 10px;\n    border: 2px solid gray;\n    margin: 10px;\n    background: #ffffcc;\n  }\n  #org-div-home-and-up\n   { text-align: right; font-size: 70%; white-space: nowrap; }\n  textarea { overflow-x: auto; }\n  .linenr { font-size: smaller }\n  .code-highlighted { background-color: #ffff00; }\n  .org-info-js_info-navigation { border-style: none; }\n  #org-info-js_console-label\n    { font-size: 10px; font-weight: bold; white-space: nowrap; }\n  .org-info-js_search-highlight\n    { background-color: #ffff00; color: #000000; font-weight: bold; }\n  /*]]>*/-->\n</style>\n<script type=\"text/javascript\">\n/*\n@licstart  The following is the entire license notice for the\nJavaScript code in this tag.\n\nCopyright (C) 2012-2013 Free Software Foundation, Inc.\n\nThe JavaScript code in this tag is free software: you can\nredistribute it and/or modify it under the terms of the GNU\nGeneral Public License (GNU GPL) as published by the Free Software\nFoundation, either version 3 of the License, or (at your option)\nany later version.  The code is distributed WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.\n\nAs additional permission under GNU GPL version 3 section 7, you\nmay distribute non-source (e.g., minimized or compacted) forms of\nthat code without the copy of the GNU GPL normally required by\nsection 4, provided you include this license notice and a URL\nthrough which recipients can access the Corresponding Source.\n\n\n@licend  The above is the entire license notice\nfor the JavaScript code in this tag.\n*/\n<!--/*--><![CDATA[/*><!--*/\n function CodeHighlightOn(elem, id)\n {\n   var target = document.getElementById(id);\n   if(null != target) {\n     elem.cacheClassElem = elem.className;\n     elem.cacheClassTarget = target.className;\n     target.className = \"code-highlighted\";\n     elem.className   = \"code-highlighted\";\n   }\n }\n function CodeHighlightOff(elem, id)\n {\n   var target = document.getElementById(id);\n   if(elem.cacheClassElem)\n     elem.className = elem.cacheClassElem;\n   if(elem.cacheClassTarget)\n     target.className = elem.cacheClassTarget;\n }\n/*]]>*///-->\n</script>\n<script type=\"text/javascript\" src=\"http://orgmode.org/mathjax/MathJax.js\"></script>\n<script type=\"text/javascript\">\n<!--/*--><![CDATA[/*><!--*/\n    MathJax.Hub.Config({\n        // Only one of the two following lines, depending on user settings\n        // First allows browser-native MathML display, second forces HTML/CSS\n        //  config: [\"MMLorHTML.js\"], jax: [\"input/TeX\"],\n            jax: [\"input/TeX\", \"output/HTML-CSS\"],\n        extensions: [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",\n                     \"TeX/noUndefined.js\"],\n        tex2jax: {\n            inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],\n            displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],\n            skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],\n            ignoreClass: \"tex2jax_ignore\",\n            processEscapes: false,\n            processEnvironments: true,\n            preview: \"TeX\"\n        },\n        showProcessingMessages: true,\n        displayAlign: \"center\",\n        displayIndent: \"2em\",\n\n        \"HTML-CSS\": {\n             scale: 100,\n             availableFonts: [\"STIX\",\"TeX\"],\n             preferredFont: \"TeX\",\n             webFont: \"TeX\",\n             imageFont: \"TeX\",\n             showMathMenu: true,\n        },\n        MMLorHTML: {\n             prefer: {\n                 MSIE:    \"MML\",\n                 Firefox: \"MML\",\n                 Opera:   \"HTML\",\n                 other:   \"HTML\"\n             }\n        }\n    });\n/*]]>*///-->\n</script>\n</head>\n<body>\n<div id=\"content\">\n<h1 class=\"title\">*Org HTML Export*</h1>\n<p>\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"<a href=\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>\"&gt;\n&lt;html xmlns=\"<a href=\"http://www.w3.org/1999/xhtml\">http://www.w3.org/1999/xhtml</a>\" lang=\"en\" xml:lang=\"en\"&gt;\n&lt;head&gt;\n&lt;title&gt;Emacs for developers&lt;/title&gt;\n&lt;!&#x2013; 2014-10-21 Mar 13:50 &#x2013;&gt;\n&lt;meta  http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /&gt;\n&lt;meta  name=\"generator\" content=\"Org-mode\" /&gt;\n&lt;meta  name=\"author\" content=\"Pierre Lecocq\" /&gt;\n&lt;meta  name=\"description\" content=\"Learn using Emacs as a developer\"\n /&gt;\n&lt;meta  name=\"keywords\" content=\"emacs, developer\" /&gt;\n&lt;style type=\"text/css\"&gt;\n &lt;!&#x2013;/*&#x2013;&gt;&lt;![CDATA[/*&gt;&lt;!&#x2013;*/\n  .title  { text-align: center; }\n  .todo   { font-family: monospace; color: red; }\n  .done   { color: green; }\n  .tag    { background-color: #eee; font-family: monospace;\n            padding: 2px; font-size: 80%; font-weight: normal; }\n  .timestamp { color: #bebebe; }\n  .timestamp-kwd { color: #5f9ea0; }\n  .right  { margin-left: auto; margin-right: 0px;  text-align: right; }\n  .left   { margin-left: 0px;  margin-right: auto; text-align: left; }\n  .center { margin-left: auto; margin-right: auto; text-align: center; }\n  .underline { text-decoration: underline; }\n  #postamble p, #preamble p { font-size: 90%; margin: .2em; }\n  p.verse { margin-left: 3%; }\n  pre {\n    border: 1px solid #ccc;\n    box-shadow: 3px 3px 3px #eee;\n    padding: 8pt;\n    font-family: monospace;\n    overflow: auto;\n    margin: 1.2em;\n  }\n  pre.src {\n    position: relative;\n    overflow: visible;\n    padding-top: 1.2em;\n  }\n  pre.src:before {\n    display: none;\n    position: absolute;\n    background-color: white;\n    top: -10px;\n    right: 10px;\n    padding: 3px;\n    border: 1px solid black;\n  }\n  pre.src:hover:before { display: inline;}\n  pre.src-sh:before    { content: 'sh'; }\n  pre.src-bash:before  { content: 'sh'; }\n  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }\n  pre.src-R:before     { content: 'R'; }\n  pre.src-perl:before  { content: 'Perl'; }\n  pre.src-java:before  { content: 'Java'; }\n  pre.src-sql:before   { content: 'SQL'; }\n</p>\n\n<p>\n  table { border-collapse:collapse; }\n  caption.t-above { caption-side: top; }\n  caption.t-bottom { caption-side: bottom; }\n  td, th { vertical-align:top;  }\n  th.right  { text-align: center;  }\n  th.left   { text-align: center;   }\n  th.center { text-align: center; }\n  td.right  { text-align: right;  }\n  td.left   { text-align: left;   }\n  td.center { text-align: center; }\n  dt { font-weight: bold; }\n  .footpara:nth-child(2) { display: inline; }\n  .footpara { display: block; }\n  .footdef  { margin-bottom: 1em; }\n  .figure { padding: 1em; }\n  .figure p { text-align: center; }\n  .inlinetask {\n    padding: 10px;\n    border: 2px solid gray;\n    margin: 10px;\n    background: #ffffcc;\n  }\n  #org-div-home-and-up\n   { text-align: right; font-size: 70%; white-space: nowrap; }\n  textarea { overflow-x: auto; }\n  .linenr { font-size: smaller }\n  .code-highlighted { background-color: #ffff00; }\n  .org-info-js<sub>info</sub>-navigation { border-style: none; }\n  #org-info-js<sub>console</sub>-label\n    { font-size: 10px; font-weight: bold; white-space: nowrap; }\n  .org-info-js<sub>search</sub>-highlight\n    { background-color: #ffff00; color: #000000; font-weight: bold; }\n  <i><b>]]&gt;</b></i>&#x2013;&gt;\n&lt;/style&gt;\n&lt;script type=\"text/javascript\"&gt;\n/*\n@licstart  The following is the entire license notice for the\nJavaScript code in this tag.\n</p>\n\n<p>\nCopyright (C) 2012-2013 Free Software Foundation, Inc.\n</p>\n\n<p>\nThe JavaScript code in this tag is free software: you can\nredistribute it and/or modify it under the terms of the GNU\nGeneral Public License (GNU GPL) as published by the Free Software\nFoundation, either version 3 of the License, or (at your option)\nany later version.  The code is distributed WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.\n</p>\n\n<p>\nAs additional permission under GNU GPL version 3 section 7, you\nmay distribute non-source (e.g., minimized or compacted) forms of\nthat code without the copy of the GNU GPL normally required by\nsection 4, provided you include this license notice and a URL\nthrough which recipients can access the Corresponding Source.\n</p>\n\n\n<p>\n@licend  The above is the entire license notice\nfor the JavaScript code in this tag.\n<b>/\n&lt;!&#x2013;/</b>&#x2013;&gt;&lt;![CDATA[/*&gt;&lt;!&#x2013;*/\n function CodeHighlightOn(elem, id)\n {\n   var target = document.getElementById(id);\n   if(null != target) {\n     elem.cacheClassElem = elem.className;\n     elem.cacheClassTarget = target.className;\n     target.className = \"code-highlighted\";\n     elem.className   = \"code-highlighted\";\n   }\n }\n function CodeHighlightOff(elem, id)\n {\n   var target = document.getElementById(id);\n   if(elem.cacheClassElem)\n     elem.className = elem.cacheClassElem;\n   if(elem.cacheClassTarget)\n     target.className = elem.cacheClassTarget;\n }\n<i>*]]&gt;*//</i>&#x2013;&gt;\n&lt;/script&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;div id=\"content\"&gt;\n&lt;h1 class=\"title\"&gt;Emacs for developers&lt;/h1&gt;\n&lt;div id=\"table-of-contents\"&gt;\n&lt;h2&gt;Table of Contents&lt;/h2&gt;\n&lt;div id=\"text-table-of-contents\"&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-1\"&gt;1. Emacs for developers&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-1-1\"&gt;1.1. Who is the target of this tutorial&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-2\"&gt;2. Table of contents&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-3\"&gt;3. Introduction&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-3-1\"&gt;3.1. Brief history&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-3-2\"&gt;3.2. How to get Emacs?&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-3-3\"&gt;3.3. More than an editor&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-3-4\"&gt;3.4. The perfect development tool&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4\"&gt;4. The basics&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-1\"&gt;4.1. Config files&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-2\"&gt;4.2. Executing commands&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3\"&gt;4.3. Key bindings&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-1\"&gt;4.3.1. Manipulate files&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-2\"&gt;4.3.2. Manipulate the line&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-3\"&gt;4.3.3. Selecting a region&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-4\"&gt;4.3.4. Commenting&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-5\"&gt;4.3.5. Windows&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-6\"&gt;4.3.6. Buffers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-7\"&gt;4.3.7. Cancel a command&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-3-8\"&gt;4.3.8. The most useless one&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-4-4\"&gt;4.4. Help!&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5\"&gt;5. Building your own editor&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-1\"&gt;5.1. First basic configuration&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-2\"&gt;5.2. General basic configuration&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-3\"&gt;5.3. Backup files&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-4\"&gt;5.4. Setting up the locales&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-5\"&gt;5.5. More configuration&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-6\"&gt;5.6. Modes&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-6-1\"&gt;5.6.1. Major modes&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-6-2\"&gt;5.6.2. Minor modes&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-7\"&gt;5.7. Package managers&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-7-1\"&gt;5.7.1. Package.el&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-7-2\"&gt;5.7.2. El-Get&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-7-3\"&gt;5.7.3. The generic method&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-7-4\"&gt;5.7.4. The modern and efficient way&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8\"&gt;5.8. Some useful packages&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-1\"&gt;5.8.1. Auto complete&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-2\"&gt;5.8.2. Autopair&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-3\"&gt;5.8.3. Buffer move&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-4\"&gt;5.8.4. Flycheck&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-5\"&gt;5.8.5. Highlight symbol&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-6\"&gt;5.8.6. Ido&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-7\"&gt;5.8.7. JS3&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-8\"&gt;5.8.8. Magit&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-9\"&gt;5.8.9. Multiple cursors&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-10\"&gt;5.8.10. PHP mode&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-11\"&gt;5.8.11. Rainbow mode&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-12\"&gt;5.8.12. RHTML mode&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-13\"&gt;5.8.13. Ruby mode&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-14\"&gt;5.8.14. Switch window&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-15\"&gt;5.8.15. Visual regexp&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-16\"&gt;5.8.16. Yaml mode&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-17\"&gt;5.8.17. Yasnippet&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-8-18\"&gt;5.8.18. Paredit&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-9\"&gt;5.9. Code navigation&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-9-1\"&gt;5.9.1. Tags basics&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-9-2\"&gt;5.9.2. List functions or methods&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-9-3\"&gt;5.9.3. Files navigation (a.k.a fuzzy matching) with TAGS and ido&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-9-4\"&gt;5.9.4. RGrep&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-10\"&gt;5.10. Setting a color theme&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-5-10-1\"&gt;5.10.1. Font settings&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6\"&gt;6. Emacs for developers - Emacs developing environments&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-1\"&gt;6.1. Emacs for Ruby developers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-2\"&gt;6.2. Emacs for Python developers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-3\"&gt;6.3. Emacs for C/C++/Objective-C&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-4\"&gt;6.4. Emacs for Go developers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-5\"&gt;6.5. Emacs for PHP developers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-6\"&gt;6.6. Emacs for Java developers&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-6-7\"&gt;6.7. Emacs for R and statistics&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7\"&gt;7. Special features&lt;/a&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-1\"&gt;7.1. Emacs as a file manager&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-2\"&gt;7.2. Working locally vs remotely&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-3\"&gt;7.3. Organize your work, write papers and manage your agenda&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-4\"&gt;7.4. Emails in Emacs&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-5\"&gt;7.5. Some great Emacs tips and tricks&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-7-6\"&gt;7.6. Coming from other editors (i.e Vim)&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-8\"&gt;8. Readings and resources&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-9\"&gt;9. License&lt;/a&gt;&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"#sec-10\"&gt;10. Thanks&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-1\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-1\"&gt;&lt;span class=\"section-number-2\"&gt;1&lt;/span&gt; Emacs for developers&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-1\"&gt;\n&lt;p&gt;\nThis document will (hopefully) help you to use Emacs as a developer.\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;ol class=\"org-ol\"&gt;&lt;li&gt;&lt;a id=\"sec-1-0-0-1\" name=\"sec-1-0-0-1\"&gt;&lt;/a&gt;Disclaimer&lt;br  /&gt;&lt;div class=\"outline-text-5\" id=\"text-1-0-0-1\"&gt;\n&lt;p&gt;\nWork in progress, so stay tuned.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/li&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-1-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-1-1\"&gt;&lt;span class=\"section-number-3\"&gt;1.1&lt;/span&gt; Who is the target of this tutorial&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-1-1\"&gt;\n&lt;p&gt;\nWell, this is a good question. And I won't give an answer but some elements of answer.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nWhat is sure is that it is not written for the people thanked below (Batien, Dimitri, Sacha, Nic, Avdi, and so on &amp;#x2026;), but what is interseting with Emacs is that even if you are a beginner, an intermediate / advanced user or an every day power user, you can learn from others each time you open a web page or a manual dealing with Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTherefore, this tutorial is written for people who want to improve their experience. Simple as that. Whatever is their knowledge, their feeling, their usage, their config file size (without any pun), etc &amp;#x2026;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nRemember one thing: Emacs is 30+ years old and brings new users everyday. It is a clue that this is a piece of software that deserve some attention.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-2\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-2\"&gt;&lt;span class=\"section-number-2\"&gt;2&lt;/span&gt; Table of contents&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-2\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;1. &lt;i&gt;Introduction&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;1.1 &lt;i&gt;Brief history&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;1.2 &lt;i&gt;How to get Emacs?&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;1.3 &lt;i&gt;More than an editor&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;1.4 &lt;i&gt;The perfect development tool&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;2. &lt;i&gt;The basics&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;2.1 &lt;i&gt;Config files&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.2 &lt;i&gt;Executing commands&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3 &lt;i&gt;Key bindings&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;2.3.1 &lt;i&gt;Manipulate files&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.2 &lt;i&gt;Manipulate the current line&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.3 &lt;i&gt;Selecting a region&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.4 &lt;i&gt;Commenting&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.5 &lt;i&gt;Windows&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.6 &lt;i&gt;Buffers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.7 &lt;i&gt;Cancel a command&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;2.3.8 &lt;i&gt;The most useless command&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;2.4 &lt;i&gt;Help!&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;3. &lt;i&gt;Building your own editor&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;3.1 &lt;i&gt;First basic configuration&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.2 &lt;i&gt;General basic configuration&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.3 &lt;i&gt;Backup files&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.4 &lt;i&gt;Setting up the locales&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.5 &lt;i&gt;More configuration&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.6 &lt;i&gt;Modes&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.7 &lt;i&gt;Package managers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.8 &lt;i&gt;Some useful packages&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.9 &lt;i&gt;Code navigation&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;3.10 &lt;i&gt;Setting a color theme&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;4. &lt;i&gt;Emacs developing environments&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;4.1 &lt;i&gt;Emacs for Ruby developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.2 &lt;i&gt;Emacs for Python developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.3 &lt;i&gt;Emacs for C/C++/Objective-C developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.4 &lt;i&gt;Emacs for Go developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.5 &lt;i&gt;Emacs for PHP developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.6 &lt;i&gt;Emacs for Java developers&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;4.7 &lt;i&gt;Emacs for R and statistics&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;5. &lt;i&gt;Special features&lt;/i&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;5.1 &lt;i&gt;Emacs as a file manager&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;5.2 &lt;i&gt;Working locally vs remotely&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;5.3 &lt;i&gt;Organize your work, write papers and manage your agenda&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;5.4 &lt;i&gt;Emails in Emacs&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;5.5 &lt;i&gt;Some great Emacs tips and tricks&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;5.6 &lt;i&gt;Coming from other editors (i.e Vim or SublimeText)&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;li&gt;6. &lt;i&gt;Readings and resources&lt;/i&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-3\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-3\"&gt;&lt;span class=\"section-number-2\"&gt;3&lt;/span&gt; Introduction&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-3\"&gt;\n&lt;/div&gt;&lt;div id=\"outline-container-sec-3-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-3-1\"&gt;&lt;span class=\"section-number-3\"&gt;3.1&lt;/span&gt; Brief history&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-3-1\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Originally developed by Richard Stallman and Guy Steele in MIT AI lab\n&lt;/li&gt;\n&lt;li&gt;First release in 1976\n&lt;/li&gt;\n&lt;li&gt;Inspired by TECO editor\n&lt;/li&gt;\n&lt;li&gt;Based on macros (Emacs stands for Editor MACroS)\n&lt;/li&gt;\n&lt;li&gt;Written in C and Emacs Lisp\n&lt;/li&gt;\n&lt;li&gt;Part of the GNU project (therefore, we &lt;i&gt;should&lt;/i&gt; say \"GNU Emacs\", not \"Emacs\")\n&lt;/li&gt;\n</p>\n\n<p>\n&lt;li&gt;Despite its age, new users are still adopting Emacs as their development platform to this day!\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-3-2\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-3-2\"&gt;&lt;span class=\"section-number-3\"&gt;3.2&lt;/span&gt; How to get Emacs?&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-3-2\"&gt;\n&lt;p&gt;\nOn every Linux distribution, packages are available.\nSo run your favorite package manager to install it:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;i&gt;apt-get install emacs&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;i&gt;yum install emacs&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAnd if you have an exotic operating system, here are the specific distributions:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Mac OS X: &lt;a href=\"<a href=\"http://emacsformacosx.com/\">http://emacsformacosx.com/</a>\"&gt;<a href=\"http://emacsformacosx.com/\">http://emacsformacosx.com/</a>&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;Windows: &lt;a href=\"<a href=\"http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/\">http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/</a>\"&gt;<a href=\"http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/\">http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/</a>&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nBut, in order to get the latest version, it's &lt;span class=\"underline\"&gt;highly recommended&lt;/span&gt; that you compile Emacs yourself: &lt;a href=\"<a href=\"http://ftp.igh.cnrs.fr/pub/gnu/emacs/\">http://ftp.igh.cnrs.fr/pub/gnu/emacs/</a>\"&gt;<a href=\"http://ftp.igh.cnrs.fr/pub/gnu/emacs/\">http://ftp.igh.cnrs.fr/pub/gnu/emacs/</a>&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n\n<p>\n&lt;div id=\"outline-container-sec-3-3\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-3-3\"&gt;&lt;span class=\"section-number-3\"&gt;3.3&lt;/span&gt; More than an editor&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-3-3\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;More than an editor, it is a Lisp interpretor\n&lt;/li&gt;\n&lt;li&gt;Can run any type of program written in Lisp:\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Email clients (like &lt;a href=\"<a href=\"http://www.gnus.org/\">http://www.gnus.org/</a>\"&gt;Gnus&lt;/a&gt; or &lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/mu4e\">http://www.emacswiki.org/emacs/mu4e</a>\"&gt;mu4e&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;Shell (like bash or eshell)\n&lt;/li&gt;\n&lt;li&gt;File and directory management (with &lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html\">http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html</a>\"&gt;Dired mode&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;Agenda / Notes / TODO list / Project management (with the amazing &lt;a href=\"<a href=\"http://orgmode.org\">http://orgmode.org</a>\"&gt;OrgMode&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;IRC / Twitter / Jabber / &amp;#x2026; clients\n&lt;/li&gt;\n&lt;li&gt;Games (like Tetris, Pong, Snake, 5x5, Dunnet, &amp;#x2026;)\n&lt;/li&gt;\n&lt;li&gt;Encrypt/decrypt files (like GPG files)\n&lt;/li&gt;\n&lt;li&gt;On-the-fly archives editing (thanks to &lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/ArchiveMode\">http://www.emacswiki.org/emacs/ArchiveMode</a>\"&gt;archive-mode&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;PDF / Image / (&amp;#x2026;) viewer\n&lt;/li&gt;\n&lt;li&gt;A powerful front end to R / S+ / SPSS / Stata (with &lt;a href=\"<a href=\"http://ess.r-project.org/\">http://ess.r-project.org/</a>\"&gt;EmacsSpeaksStatisics)&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;An editor for multi-modal REPL's like IPython (with &lt;a href=\"<a href=\"http://tkf.github.io/emacs-ipython-notebook/\">http://tkf.github.io/emacs-ipython-notebook/</a>\"&gt;EmacsIPythonNotebook&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;Music player (with emms, vlc, mplayer, &amp;#x2026;)\n&lt;/li&gt;\n&lt;li&gt;Music programming (with &lt;a href=\"<a href=\"http://vimeo.com/22798433\">http://vimeo.com/22798433</a>\"&gt;Overtone&lt;/a&gt;)\n&lt;/li&gt;\n&lt;li&gt;Video editing\n&lt;/li&gt;\n&lt;li&gt;And so on &amp;#x2026;\n&lt;/li&gt;\n&lt;li&gt;(and of course a document editor that can automatically generate this presentation)\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nNaturally, you can do all of that at the same time with only one Emacs instance. Don't need to say it &amp;#x2026;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-3-4\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-3-4\"&gt;&lt;span class=\"section-number-3\"&gt;3.4&lt;/span&gt; The perfect development tool&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-3-4\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;As Emacs is a Lisp interpretor, it is extensible. Really really extensible.\n&lt;/li&gt;\n&lt;li&gt;The (unofficial) goal of Emacs is to be hacked\n&lt;/li&gt;\n&lt;li&gt;Therefore your goal is to hack Emacs to make it work perfectly as you want\n&lt;/li&gt;\n</p>\n\n<p>\n&lt;li&gt;Already provides so many development tools (also extensible, of course)\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Debuggers\n&lt;/li&gt;\n&lt;li&gt;Compilers\n&lt;/li&gt;\n&lt;li&gt;Syntax checkers\n&lt;/li&gt;\n&lt;li&gt;Documentations\n&lt;/li&gt;\n&lt;li&gt;Consoles\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n</p>\n\n<p>\n&lt;li&gt;Also provides &lt;i&gt;modes&lt;/i&gt; (extensions) for &lt;b&gt;every&lt;/b&gt; programming language for\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Syntax highlighting\n&lt;/li&gt;\n&lt;li&gt;Documentation search\n&lt;/li&gt;\n&lt;li&gt;Indentation\n&lt;/li&gt;\n&lt;li&gt;Source code browsing\n&lt;/li&gt;\n&lt;li&gt;Compilation commands\n&lt;/li&gt;\n&lt;li&gt;Specific behaviour\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-4\"&gt;&lt;span class=\"section-number-2\"&gt;4&lt;/span&gt; The basics&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-4\"&gt;\n&lt;/div&gt;&lt;div id=\"outline-container-sec-4-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-4-1\"&gt;&lt;span class=\"section-number-3\"&gt;4.1&lt;/span&gt; Config files&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-4-1\"&gt;\n&lt;p&gt;\nIn order to customize Emacs, you will have to edit its configuration files.\nIt does not exist when you install the software (or is an empty file) and does nothing until you decide to tweak Emacs.\nSome people use Emacs for decades without any extra configuration because they like it out of the box.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere are several ways to manage your Emacs configuration:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Simply create and edit a &lt;b&gt;~/.emacs&lt;/b&gt; file\n&lt;/li&gt;\n&lt;li&gt;Create a &lt;b&gt;~/.emacs.d/&lt;/b&gt; directory with a &lt;b&gt;~/.emacs.d/init.el&lt;/b&gt; file\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThe first solution is great if you have a small, tidied and exportable configuration file.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThe second solution is great if you need several configuration files (keep you configuration parts separated) or you need to install external extensions (you will install them in &lt;b&gt;~/.emacs.d&lt;/b&gt; to keep them centralized and exportable).\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-2\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-4-2\"&gt;&lt;span class=\"section-number-3\"&gt;4.2&lt;/span&gt; Executing commands&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-4-2\"&gt;\n&lt;p&gt;\nThe main idea of Emacs is that everything is a command. For example: opening a file with a keybinding calls a command that is executed by the Emacs' core.\nAnd all the commands are written in Lisp.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo call a command, you simply have to press &lt;b&gt;Escape&lt;/b&gt; and then &lt;b&gt;x&lt;/b&gt;. It could be &lt;b&gt;Alt-x&lt;/b&gt; for more comfort.\nThe official name is \"&lt;i&gt;Meta x&lt;/i&gt;\" and is written &lt;i&gt;M-x&lt;/i&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIf you type this key sequence, you will see at the bottom of the editor a little prompt.\nThis part of Emacs is called the &lt;i&gt;mini buffer&lt;/i&gt; and is used for every interactive actions.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nLet's try something:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;type &lt;b&gt;M-x&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;Then, in the minibuffer, type &lt;b&gt;version&lt;/b&gt; and &lt;b&gt;RET&lt;/b&gt; (return)\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nEmacs should display the current version number of the software.\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/version.gif\" alt=\"version.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 1:&lt;/span&gt; Execute the version command&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nCongratulations! You just called your first Emacs command.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-4-3\"&gt;&lt;span class=\"section-number-3\"&gt;4.3&lt;/span&gt; Key bindings&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-4-3\"&gt;\n&lt;p&gt;\nHere are the most useful keys in Emacs. You will use them several hundreds (or thousands) times a day.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHow it works?\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;The sequence &lt;i&gt;C-something&lt;/i&gt; means that you have to press and hold the &lt;i&gt;Control&lt;/i&gt; key while hitting the &lt;i&gt;something&lt;/i&gt; key. Example: &lt;i&gt;C-a&lt;/i&gt; means &lt;i&gt;Control + a&lt;/i&gt;.\n&lt;/li&gt;\n&lt;li&gt;The sequence &lt;i&gt;C-something somethingelse&lt;/i&gt; means that you press &lt;i&gt;Control + something&lt;/i&gt;, then you release Control to hit &lt;i&gt;somethingelse&lt;/i&gt;.\n&lt;/li&gt;\n&lt;li&gt;The sequence &lt;i&gt;C-something C-somethingelse&lt;/i&gt; means that you have to press Control while hitting &lt;i&gt;something&lt;/i&gt; and &lt;i&gt;somethingelse&lt;/i&gt;.\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-1\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.1&lt;/span&gt; Manipulate files&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-1\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-x C-f&lt;/b&gt;: open a file, which corresponds to &lt;b&gt;M-x find-file&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x C-s&lt;/b&gt;: save a file, which corresponds to &lt;b&gt;M-x save-buffer&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/open-and-save.gif\" alt=\"open-and-save.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 2:&lt;/span&gt; Open a file, modify it and save it&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-2\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-2\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.2&lt;/span&gt; Manipulate the line&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-2\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-a&lt;/b&gt;: go to the beginning of the current line, which corresponds to &lt;b&gt;M-x begining-of-line&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-e&lt;/b&gt;: go to the end of the current line, which corresponds to &lt;b&gt;M-x end-of-line&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-k&lt;/b&gt;: cut the rest of the line at the cursor position, which corresponds to &lt;b&gt;M-x kill-line&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-y&lt;/b&gt;: paste what you had cut with the command above, which corresponds to &lt;b&gt;M-x yank&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-l&lt;/b&gt;: center the buffer at the cursor position, which corresponds to &lt;b&gt;M-x recenter-top-bottom&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/line.gif\" alt=\"line.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 3:&lt;/span&gt; Line manipulation&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-3\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-3\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.3&lt;/span&gt; Selecting a region&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-3\"&gt;\n&lt;p&gt;\nRegions are selections, in Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThey are composed by two points. A starting one and and an ending one.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo select the starting point, move your cursor to the wanted location and simply press &lt;b&gt;C-Space&lt;/b&gt;. In your minibuffer, you should have seen a message like \"Mark set\".\nNow, move your cursor to the location you wantyour selection to end.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou have now a selection (or a &lt;i&gt;region&lt;/i&gt;) delimited by the place you set the first mark and your cursor. With this region, you can do what ever you want:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Copy (&lt;b&gt;M-w&lt;/b&gt;)\n&lt;/li&gt;\n&lt;li&gt;Cut (&lt;b&gt;C-k&lt;/b&gt;)\n&lt;/li&gt;\n&lt;li&gt;Paste (&lt;b&gt;C-y&lt;/b&gt;)\n&lt;/li&gt;\n&lt;li&gt;Replace (&lt;b&gt;M-%&lt;/b&gt;)\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026; etc\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/selecting.gif\" alt=\"selecting.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 4:&lt;/span&gt; Selecting a region&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-4\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-4\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.4&lt;/span&gt; Commenting&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-4\"&gt;\n&lt;p&gt;\nIn order to comment a code block, select the region you want to comment and use:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;M-x comment-region&lt;/b&gt; in order to comment the block\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x uncomment-region&lt;/b&gt; in order to uncomment the block\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOf course, Emacs knows, according to the major mode loaded how to comment properly your code. If the major-mode is &lt;i&gt;ruby-mode&lt;/i&gt;, it will add a \"#\" before the line; if the major-mode is &lt;i&gt;lisp-mode&lt;/i&gt;, it will add \";;\", and so on and so forth.\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/comment.gif\" alt=\"comment.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 5:&lt;/span&gt; Commenting&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-5\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-5\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.5&lt;/span&gt; Windows&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-5\"&gt;\n&lt;p&gt;\nThis might be confusing but a &lt;i&gt;window&lt;/i&gt; is a part of a &lt;i&gt;frame&lt;/i&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAn &lt;i&gt;Emacs frame&lt;/i&gt; is the window that you opened when you launched Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAn &lt;i&gt;Emacs frame&lt;/i&gt; can be divided into &lt;i&gt;windows&lt;/i&gt; in itself.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-x 2&lt;/b&gt;: open a new window horizontally, which corresponds to &lt;b&gt;M-x split-window-below&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x 3&lt;/b&gt;: open a new window vertically, which corresponds to &lt;b&gt;M-x split-window-right&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x o&lt;/b&gt;: switch to the next window, which corresponds to &lt;b&gt;M-x other-window&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x 0&lt;/b&gt;: close the current window, which corresponds to &lt;b&gt;M-x delete-window&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/windows.gif\" alt=\"windows.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 6:&lt;/span&gt; Windows manipulation&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-6\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-6\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.6&lt;/span&gt; Buffers&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-6\"&gt;\n&lt;p&gt;\nA &lt;i&gt;buffer&lt;/i&gt; is displayed in a &lt;i&gt;frame&lt;/i&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-x b&lt;/b&gt;: switch to an already opened buffer, which corresponds to &lt;b&gt;M-x switch-to-buffer&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x C-b&lt;/b&gt;: list opened buffer (and jump to the selected one), which corresponds to &lt;b&gt;M-x list-buffers&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-x k&lt;/b&gt;: kill a buffer, which corresponds to &lt;b&gt;M-x kill-buffer&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/buffers.gif\" alt=\"buffers.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 7:&lt;/span&gt; Buffer navigation&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-7\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-7\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.7&lt;/span&gt; Cancel a command&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-7\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-g&lt;/b&gt; or &lt;b&gt;ESC ESC ESC&lt;/b&gt;: cancel the current command running in the minibuffer, which corresponds to &lt;b&gt;M-x keyboard-quit&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-3-8\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-4-3-8\"&gt;&lt;span class=\"section-number-4\"&gt;4.3.8&lt;/span&gt; The most useless one&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-4-3-8\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-x C-c&lt;/b&gt;: quit emacs (use at your own risks!), which corresponds to &lt;b&gt;M-x save-buffers-kill-terminal&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-4-4\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-4-4\"&gt;&lt;span class=\"section-number-3\"&gt;4.4&lt;/span&gt; Help!&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-4-4\"&gt;\n&lt;p&gt;\nEmacs has a powerful built-in help system for key bindings and internal functionalities.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-h f &amp;lt;function-name&amp;gt;&lt;/b&gt;: Find the key binding corresponding to &amp;lt;function-name&amp;gt; (ex: C-h f save-buffer)\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;C-h k &amp;lt;key-sequence&amp;gt;&lt;/b&gt;: Find the function name corresponding to &amp;lt;key-sequence&amp;gt; (ex: C-h k C-x C-s)\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nWhen executing these commands, a new frame opens. To close it, switch to it (&lt;i&gt;C-x o&lt;/i&gt;) and type &lt;i&gt;q&lt;/i&gt;. If not, simply close it (&lt;i&gt;C-x 0&lt;/i&gt;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nEmacs also includes the full manual (also available online: &lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/manual/html_node/emacs/\">http://www.gnu.org/software/emacs/manual/html_node/emacs/</a>\"&gt;<a href=\"http://www.gnu.org/software/emacs/manual/html_node/emacs/\">http://www.gnu.org/software/emacs/manual/html_node/emacs/</a>&lt;/a&gt;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;C-h r&lt;/b&gt;: browse the Emacs manual within Emacs\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFinally, there are so many other help functions: &lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/EmacsNewbieHelpReference\">http://www.emacswiki.org/emacs/EmacsNewbieHelpReference</a>\"&gt;<a href=\"http://www.emacswiki.org/emacs/EmacsNewbieHelpReference\">http://www.emacswiki.org/emacs/EmacsNewbieHelpReference</a>&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-5\"&gt;&lt;span class=\"section-number-2\"&gt;5&lt;/span&gt; Building your own editor&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-5\"&gt;\n&lt;p&gt;\nFrom this point, we will edit the configuration file.\nFor the moment, we will put everything in a single &lt;b&gt;~/.emacs.d/init.el&lt;/b&gt; file. Create it if it does not exist.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-sh\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;# &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Backup old configuration&lt;/span&gt;\ncp .emacs dot-emacs.old\ncp -R .emacs.d dot-emacs.d.old\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;# &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Create new and empty configuration&lt;/span&gt;\nmkdir ~/.emacs.d\ntouch ~/.emacs.d/init.el\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-1\"&gt;&lt;span class=\"section-number-3\"&gt;5.1&lt;/span&gt; First basic configuration&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-1\"&gt;\n&lt;p&gt;\nWhen you will have to change or add configuration, simply edit your &lt;b&gt;~/.emacs.d/init.el&lt;/b&gt; file and add what you need.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFor exemple, here is a tweak that does nothing visually but is useful for other packages and the Emacs engine itself.\nIt allows you to define your name and email. Emacs can use it to add author informations to a file when asked.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;(setq user-full-name &lt;span style=\"color: #aa3939;\"&gt;\"Your full name\"&lt;/span&gt;)\n(setq user-mail-address &lt;span style=\"color: #aa3939;\"&gt;\"your@email.com\"&lt;/span&gt;)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAfter each configuration modification, two solutions:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;the soft &amp;amp; clever way: execute &lt;b&gt;M-x eval-buffer&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;the hard way: restart Emacs.\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-2\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-2\"&gt;&lt;span class=\"section-number-3\"&gt;5.2&lt;/span&gt; General basic configuration&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-2\"&gt;\n&lt;p&gt;\nNow, let's move to a more visual configuration basic set.\nAs before, simply add this to your configuration file:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Ask \"y\" or \"n\" instead of \"yes\" or \"no\". Yes, laziness is great.&lt;/span&gt;\n(fset 'yes-or-no-p 'y-or-n-p)\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Highlight corresponding parenthese when cursor is on one&lt;/span&gt;\n(show-paren-mode t)\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Highlight tabulations&lt;/span&gt;\n(setq-default highlight-tabs t)\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Show trailing white spaces&lt;/span&gt;\n(setq-default show-trailing-whitespace t)\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Remove useless whitespaces before saving a file&lt;/span&gt;\n(add-hook 'before-save-hook 'whitespace-cleanup)\n(add-hook 'before-save-hook (&lt;span style=\"color: #5FB7CC;\"&gt;lambda&lt;/span&gt;() (delete-trailing-whitespace)))\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-3\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-3\"&gt;&lt;span class=\"section-number-3\"&gt;5.3&lt;/span&gt; Backup files&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-3\"&gt;\n&lt;p&gt;\nYou may have notice that the files you edit are duplicated and renamed with a &lt;i&gt;~&lt;/i&gt; at the end.\nThey are the backup files that Emacs creates for you with an auto-save feature.\nSometimes it is great because you can recover a file in case of error, sometimes it is annoying because you can have some many of these files.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIt is up to you to keep it or disable it.\nHere is the configuration for that:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Remove all backup files&lt;/span&gt;\n(setq make-backup-files nil)\n(setq backup-inhibited t)\n(setq auto-save-default nil)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAn alternative method is to save these backups in a centralized folder:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Save backup files in a dedicated directory&lt;/span&gt;\n(setq backup-directory-alist '((&lt;span style=\"color: #aa3939;\"&gt;\".\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"~/.saves\"&lt;/span&gt;)))\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-4\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-4\"&gt;&lt;span class=\"section-number-3\"&gt;5.4&lt;/span&gt; Setting up the locales&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-4\"&gt;\n&lt;p&gt;\nYou may want to set up a specific locale for your files.\nHere is the trick:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Set locale to UTF8&lt;/span&gt;\n(set-language-environment 'utf-8)\n(set-terminal-coding-system 'utf-8)\n(setq locale-coding-system 'utf-8)\n(set-default-coding-systems 'utf-8)\n(set-selection-coding-system 'utf-8)\n(prefer-coding-system 'utf-8)\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-5\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-5\"&gt;&lt;span class=\"section-number-3\"&gt;5.5&lt;/span&gt; More configuration&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-5\"&gt;\n&lt;p&gt;\nThe best way to get your configuration better, is to read the &lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/manual/\">http://www.gnu.org/software/emacs/manual/</a>\"&gt;manual&lt;/a&gt; &amp;#x2026;\nBut you can also (this is the un-official method) read the others Emacs users' config files.\nThere are so many people who share their configuration, comment their code, and distribute their modes!\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHere is mine: (&lt;a href=\"<a href=\"https://github.com/pierre-lecocq/emacs.d\">https://github.com/pierre-lecocq/emacs.d</a>\"&gt;<a href=\"https://github.com/pierre-lecocq/emacs.d\">https://github.com/pierre-lecocq/emacs.d</a>&lt;/a&gt;)\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-6\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-6\"&gt;&lt;span class=\"section-number-3\"&gt;5.6&lt;/span&gt; Modes&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-6\"&gt;\n&lt;p&gt;\n&lt;i&gt;Modes&lt;/i&gt; are Emacs' &lt;i&gt;extensions&lt;/i&gt; that can be installed to extend the capabilities of Emacs. They will allow you to build a powerful tailored editor.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere are 2 kind of modes: minor and major.\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-6-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-6-1\"&gt;&lt;span class=\"section-number-4\"&gt;5.6.1&lt;/span&gt; Major modes&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-6-1\"&gt;\n&lt;p&gt;\nMajor modes are modes that transform Emacs to a specialized software for editing a certain type of files (i.e c-mode) or managing special tasks (i.e reading emails, managing git repository, &amp;#x2026;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOnly one major mode can be used at a time.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-6-2\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-6-2\"&gt;&lt;span class=\"section-number-4\"&gt;5.6.2&lt;/span&gt; Minor modes&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-6-2\"&gt;\n&lt;p&gt;\nMinor modes are additionnal modes that are added transparently to the major mode. They add more features to the main one (i.e parentheses matching, syntax or spelling checkers, &amp;#x2026;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nSeveral minor modes can be used at a time.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-7\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-7\"&gt;&lt;span class=\"section-number-3\"&gt;5.7&lt;/span&gt; Package managers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-7\"&gt;\n&lt;p&gt;\nEmacs has brilliant package managers such as &lt;i&gt;package.el&lt;/i&gt; or &lt;i&gt;el-get&lt;/i&gt; that allows you to add and update modes really easily.\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-7-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-7-1\"&gt;&lt;span class=\"section-number-4\"&gt;5.7.1&lt;/span&gt; Package.el&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-7-1\"&gt;\n&lt;p&gt;\n&lt;i&gt;package.el&lt;/i&gt; is the built in package manager shipped by default with Emacs 24 or later.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo list available packages, simply type this command:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;M-x package-list-packages\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou will have a list of packages. Simply press ENTER on the name of one of it to install it.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAdditionnaly, you can manage the packages list by adding other sources to your configuration file:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Add package sources&lt;/span&gt;\n(setq package-archives '((&lt;span style=\"color: #aa3939;\"&gt;\"gnu\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://elpa.gnu.org/packages/\">http://elpa.gnu.org/packages/</a>\"&lt;/span&gt;)\n                         (&lt;span style=\"color: #aa3939;\"&gt;\"marmalade\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://marmalade-repo.org/packages/\">http://marmalade-repo.org/packages/</a>\"&lt;/span&gt;)\n                         (&lt;span style=\"color: #aa3939;\"&gt;\"melpa\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://melpa.milkbox.net/packages/\">http://melpa.org/packages/</a>\"&lt;/span&gt;)))\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-7-2\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-7-2\"&gt;&lt;span class=\"section-number-4\"&gt;5.7.2&lt;/span&gt; El-Get&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-7-2\"&gt;\n&lt;p&gt;\n&lt;i&gt;&lt;a href=\"<a href=\"https://github.com/dimitri/el-get\">https://github.com/dimitri/el-get</a>\"&gt;el-get&lt;/a&gt;&lt;/i&gt; is one of the most popular and easy to use package manager. The \"&lt;i&gt;apt-get&lt;/i&gt;\" of Emacs.\nIt is written by the great &lt;a href=\"<a href=\"https://github.com/dimitri\">https://github.com/dimitri</a>\"&gt;Dimitri Fontaine&lt;/a&gt; and is based on recipe files that simply describe where is located the package and how to get/compile/install it for you.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo use it, simply add this to your configuration file. It will download and set up &lt;i&gt;el-get&lt;/i&gt; for you:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Set up el-get&lt;/span&gt;\n(add-to-list 'load-path &lt;span style=\"color: #aa3939;\"&gt;\"~/.emacs.d/el-get/el-get\"&lt;/span&gt;)\n(&lt;span style=\"color: #5FB7CC;\"&gt;unless&lt;/span&gt; (&lt;span style=\"color: #5FB7CC;\"&gt;require&lt;/span&gt; '&lt;span style=\"color: #8dd7e9;\"&gt;el-get&lt;/span&gt; nil 'noerror)\n  (with-current-buffer\n      (url-retrieve-synchronously\n       &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"https://raw.github.com/dimitri/el-get/master/el-get-install.el\">https://raw.github.com/dimitri/el-get/master/el-get-install.el</a>\"&lt;/span&gt;)\n    (&lt;span style=\"color: #5FB7CC;\"&gt;let&lt;/span&gt; (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-7-3\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-7-3\"&gt;&lt;span class=\"section-number-4\"&gt;5.7.3&lt;/span&gt; The generic method&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-7-3\"&gt;\n&lt;p&gt;\nIn order to leave you the choice of the package manager you want to use, here is a function that handles several package managers. For now, it covers &lt;i&gt;package.el&lt;/i&gt; and &lt;i&gt;el-get&lt;/i&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIt also allows you to automatically install packages you want.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIn the following snippet, two sample packages are installed\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;i&gt;color-theme&lt;/i&gt; in order to allow us to  change colors themes\n&lt;/li&gt;\n&lt;li&gt;&lt;i&gt;autopair&lt;/i&gt; in order to close automatically parentheses, brackets and braces when you open it\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nSimply add this code to your configuration file:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Set up the package manager of choice. Supports \"el-get\" and \"package.el\"&lt;/span&gt;\n(setq pmoc &lt;span style=\"color: #aa3939;\"&gt;\"el-get\"&lt;/span&gt;)\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;List of all wanted packages&lt;/span&gt;\n(setq\n wanted-packages\n '(\n   color-theme\n   autopair\n))\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Package manager and packages handler&lt;/span&gt;\n(&lt;span style=\"color: #5FB7CC;\"&gt;defun&lt;/span&gt; &lt;span style=\"color: #1D68C4;\"&gt;install-wanted-packages&lt;/span&gt; ()\n  &lt;span style=\"color: #aa3939;\"&gt;\"Install wanted packages according to a specific package manager\"&lt;/span&gt;\n  (interactive)\n  (&lt;span style=\"color: #5FB7CC;\"&gt;cond&lt;/span&gt;\n   &lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;package.el&lt;/span&gt;\n   ((string= pmoc &lt;span style=\"color: #aa3939;\"&gt;\"package.el\"&lt;/span&gt;)\n    (&lt;span style=\"color: #5FB7CC;\"&gt;require&lt;/span&gt; '&lt;span style=\"color: #8dd7e9;\"&gt;package&lt;/span&gt;)\n    (add-to-list 'package-archives '(&lt;span style=\"color: #aa3939;\"&gt;\"gnu\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://elpa.gnu.org/packages/\">http://elpa.gnu.org/packages/</a>\"&lt;/span&gt;))\n    (add-to-list 'package-archives '(&lt;span style=\"color: #aa3939;\"&gt;\"melpa\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://melpa.milkbox.net/packages/\">http://melpa.org/packages/</a>\"&lt;/span&gt;))\n    (add-to-list 'package-archives '(&lt;span style=\"color: #aa3939;\"&gt;\"marmelade\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://marmalade-repo.org/packages/\">http://marmalade-repo.org/packages/</a>\"&lt;/span&gt;))\n    (package-initialize)\n    (&lt;span style=\"color: #5FB7CC;\"&gt;let&lt;/span&gt; ((need-refresh nil))\n      (mapc (&lt;span style=\"color: #5FB7CC;\"&gt;lambda&lt;/span&gt; (package-name)\n          (&lt;span style=\"color: #5FB7CC;\"&gt;unless&lt;/span&gt; (package-installed-p package-name)\n        (set 'need-refresh t))) wanted-packages)\n      (&lt;span style=\"color: #5FB7CC;\"&gt;if&lt;/span&gt; need-refresh\n        (package-refresh-contents)))\n    (mapc (&lt;span style=\"color: #5FB7CC;\"&gt;lambda&lt;/span&gt; (package-name)\n        (&lt;span style=\"color: #5FB7CC;\"&gt;unless&lt;/span&gt; (package-installed-p package-name)\n          (package-install package-name))) wanted-packages)\n    )\n   &lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;el-get&lt;/span&gt;\n   ((string= pmoc &lt;span style=\"color: #aa3939;\"&gt;\"el-get\"&lt;/span&gt;)\n    (add-to-list 'load-path &lt;span style=\"color: #aa3939;\"&gt;\"~/.emacs.d/el-get/el-get\"&lt;/span&gt;)\n    (&lt;span style=\"color: #5FB7CC;\"&gt;unless&lt;/span&gt; (&lt;span style=\"color: #5FB7CC;\"&gt;require&lt;/span&gt; '&lt;span style=\"color: #8dd7e9;\"&gt;el-get&lt;/span&gt; nil 'noerror)\n      (with-current-buffer\n      (url-retrieve-synchronously\n       &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"https://raw.github.com/dimitri/el-get/master/el-get-install.el\">https://raw.github.com/dimitri/el-get/master/el-get-install.el</a>\"&lt;/span&gt;)\n    (&lt;span style=\"color: #5FB7CC;\"&gt;let&lt;/span&gt; (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n    (el-get 'sync wanted-packages))\n   &lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;fallback&lt;/span&gt;\n   (t (&lt;span style=\"color: #ffc0cb; font-weight: bold;\"&gt;error&lt;/span&gt; &lt;span style=\"color: #aa3939;\"&gt;\"Unsupported package manager\"&lt;/span&gt;)))\n  )\n</p>\n\n<p>\n&lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;Install wanted packages&lt;/span&gt;\n(install-wanted-packages)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nNote that some of the following package names could vary if you use &lt;i&gt;package.el&lt;/i&gt; or &lt;i&gt;el-get&lt;/i&gt;.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-7-4\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-7-4\"&gt;&lt;span class=\"section-number-4\"&gt;5.7.4&lt;/span&gt; The modern and efficient way&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-7-4\"&gt;\n&lt;p&gt;\nSome upper-level packages make package management easier and cleaner.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFor example, John Wiegley's &lt;code&gt;use-package&lt;/code&gt; software is an elegant and efficient way to install and tidy your external packages configurations.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHere is the way to use it:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFirst, setup packages sources and install &lt;code&gt;use-package&lt;/code&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;(&lt;span style=\"color: #5FB7CC;\"&gt;require&lt;/span&gt; '&lt;span style=\"color: #8dd7e9;\"&gt;package&lt;/span&gt;)\n(setq package-archives '((&lt;span style=\"color: #aa3939;\"&gt;\"gnu\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://elpa.gnu.org/packages/\">http://elpa.gnu.org/packages/</a>\"&lt;/span&gt;)\n                         (&lt;span style=\"color: #aa3939;\"&gt;\"marmalade\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://marmalade-repo.org/packages/\">http://marmalade-repo.org/packages/</a>\"&lt;/span&gt;)\n                         (&lt;span style=\"color: #aa3939;\"&gt;\"melpa\"&lt;/span&gt; . &lt;span style=\"color: #aa3939;\"&gt;\"<a href=\"http://melpa.milkbox.net/packages/\">http://melpa.org/packages/</a>\"&lt;/span&gt;)))\n(package-initialize)\n</p>\n\n<p>\n(&lt;span style=\"color: #5FB7CC;\"&gt;unless&lt;/span&gt; (package-installed-p 'use-package)\n  (&lt;span style=\"color: #5FB7CC;\"&gt;progn&lt;/span&gt;\n    (package-refresh-contents)\n    (package-install 'use-package)))\n</p>\n\n<p>\n(&lt;span style=\"color: #5FB7CC;\"&gt;require&lt;/span&gt; '&lt;span style=\"color: #8dd7e9;\"&gt;use-package&lt;/span&gt;)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThen, for each package you want to install, simply add this to your configuration (replace &lt;i&gt;the-package-name&lt;/i&gt; by any package name):\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-LISP\"&gt;(use-package the-package-name\n</p>\n<p>\n:ensure the-package-name\n</p>\n<p>\n         :init (progn\n                  ;; Do something after the package is initialized\n                ))\n&lt;/pre&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-8\"&gt;&lt;span class=\"section-number-3\"&gt;5.8&lt;/span&gt; Some useful packages&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-8\"&gt;\n&lt;p&gt;\nAs a developer, you will need some packages that will help you to work, increase your productivity and enhance your confort while coding.\nPlease note that even if I am a Ruby/shell/Lisp/web/PHP developer, some packages are compatible and useful for every kind of development. Therefore, the base packages are listed here but some specific packages that might be useful for your work are eventually not listed here. It is up to you to adapt the list according to your needs!\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTip: After adding packages, restart Emacs in order to let &lt;i&gt;el-get&lt;/i&gt; download and install it properly.\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-1\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.1&lt;/span&gt; Auto complete&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-1\"&gt;\n&lt;p&gt;\nAuto completion is a must-have feature in the development world.\nThis package simply displays a popup at the cursor position with the available completions.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;auto-complete&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/AutoComplete\">http://www.emacswiki.org/emacs/AutoComplete</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/mode-autocomplete.gif\" alt=\"mode-autocomplete.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-2\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-2\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.2&lt;/span&gt; Autopair&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-2\"&gt;\n&lt;p&gt;\nWhen you open a quote/parenthese/bracket/curly bracket, this mode automatically adds the closed one and bring your cusror between the two.\nVery useful to avoid syntax errors, for example.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;autopair&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/capitaomorte/autopair\">https://github.com/capitaomorte/autopair</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/mode-autopair.gif\" alt=\"mode-autopair.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-3\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-3\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.3&lt;/span&gt; Buffer move&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-3\"&gt;\n&lt;p&gt;\nThis mode allows you to re-organize and move the buffers from a window to another.\nUseful if you want to switch buffer places in order to have your debugging buffer on the right side, for example.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;buffer-move&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/cgi-bin/wiki/buffer-move.el\">http://www.emacswiki.org/cgi-bin/wiki/buffer-move.el</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/mode-buffermove.gif\" alt=\"mode-buffermove.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-4\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-4\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.4&lt;/span&gt; Flycheck&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-4\"&gt;\n&lt;p&gt;\nThis mode check the syntax of a buffer. It could be used for checking code syntax or typos when writing any kind of text.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;flycheck&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/flycheck/flycheck\">https://github.com/flycheck/flycheck</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-5\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-5\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.5&lt;/span&gt; Highlight symbol&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-5\"&gt;\n&lt;p&gt;\nThis mode highlights all symbols that matches a pattern in your buffer\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;highlight-symbol&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/HighlightSymbol\">http://www.emacswiki.org/emacs/HighlightSymbol</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-6\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-6\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.6&lt;/span&gt; Ido&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-6\"&gt;\n&lt;p&gt;\nIdo is a must have mode to navigate, find stuffs, and do things interactively.\nIt is for comfort, but is indispensable to go fast.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nMany extensions of this mode are available, therefore read and chose what you want.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nI personnaly use two of them: &lt;i&gt;vertical&lt;/i&gt; and &lt;i&gt;hack&lt;/i&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;ido-hacks&lt;/code&gt; and &lt;code&gt;ido-vertical-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/InteractivelyDoThings\">http://www.emacswiki.org/emacs/InteractivelyDoThings</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/mode-ido.gif\" alt=\"mode-ido.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-7\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-7\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.7&lt;/span&gt; JS3&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-7\"&gt;\n&lt;p&gt;\nThis mode is an enhanced mode for editing Javascript files. I do not use it a lot, but it is useful for some javascript-like or NPM files.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;js3-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/Js2Mode\">http://www.emacswiki.org/emacs/Js2Mode</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-8\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-8\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.8&lt;/span&gt; Magit&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-8\"&gt;\n&lt;p&gt;\nMagit is a very powerful and elegant mode for intercating with your git repository.\nIn order to understand how powerful it is, simply watch this amazing &lt;a href=\"<a href=\"http://vimeo.com/2871241\">http://vimeo.com/2871241</a>\"&gt;video&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;magit&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/magit/magit\">https://github.com/magit/magit</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-9\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-9\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.9&lt;/span&gt; Multiple cursors&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-9\"&gt;\n&lt;p&gt;\nThis mode is great and super powerful. Instead of explaining what it is, check this amazing &lt;a href=\"<a href=\"http://emacsrocks.com/e13.html\">http://emacsrocks.com/e13.html</a>\"&gt;video&lt;/a&gt; by Magnars.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;multiple-cursors&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/magnars/multiple-cursors.el\">https://github.com/magnars/multiple-cursors.el</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-10\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-10\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.10&lt;/span&gt; PHP mode&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-10\"&gt;\n&lt;p&gt;\nA basic but stable mode for editing PHP files, whatever you think about PHP &amp;#x2026;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;php-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://php-mode.sourceforge.net/\">http://php-mode.sourceforge.net/</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-11\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-11\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.11&lt;/span&gt; Rainbow mode&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-11\"&gt;\n&lt;p&gt;\nA useless but indispensable mode to add colors to your CSS files when using properties like \"color\", \"background-color\".\nIt is cool since it understands every way to write a color (hex, name, &amp;#x2026;) and gives you a preview of the color itself.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;rainbow-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://julien.danjou.info/projects/emacs-packages\">http://julien.danjou.info/projects/emacs-packages</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-12\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-12\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.12&lt;/span&gt; RHTML mode&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-12\"&gt;\n&lt;p&gt;\nThis mode is useful for editing .rhtml files. You can also use it to edit any kinf of ruby templates (i.e .erb).\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;rhtml-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/eschulte/rhtml\">https://github.com/eschulte/rhtml</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-13\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-13\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.13&lt;/span&gt; Ruby mode&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-13\"&gt;\n&lt;p&gt;\nDo I really need to explain ?\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nRuby mode is already installed in Emacs and is very stable.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/RubyMode\">http://www.emacswiki.org/emacs/RubyMode</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-14\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-14\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.14&lt;/span&gt; Switch window&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-14\"&gt;\n&lt;p&gt;\nThis mode is cool when you work with a lot of windows opened.\nIf you want to switch to another one, you have to press &lt;b&gt;C-x o&lt;/b&gt; until you reach the wanted window.\nWith this mode, when you press &lt;b&gt;C-x o&lt;/b&gt;, big numbers replace your opened windows. Simply type the corresponding number to reach the wanted window.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;switch-window&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThen do not forget to override the defaut configuration by adding this to your configuration:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;(global-set-key (kbd &lt;span style=\"color: #aa3939;\"&gt;\"C-x o\"&lt;/span&gt;) 'switch-window)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/dimitri/switch-window\">https://github.com/dimitri/switch-window</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/mode-switchwindow.gif\" alt=\"mode-switchwindow.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-15\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-15\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.15&lt;/span&gt; Visual regexp&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-15\"&gt;\n&lt;p&gt;\nThis mode highlights the text that matches the regexp that you are writing in the mini buffer.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;visual-regexp&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://github.com/benma/visual-regexp.el\">https://github.com/benma/visual-regexp.el</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-16\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-16\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.16&lt;/span&gt; Yaml mode&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-16\"&gt;\n&lt;p&gt;\nAlows you to edit .yml files\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;yaml-mode&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/YamlMode\">http://www.emacswiki.org/emacs/YamlMode</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-17\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-17\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.17&lt;/span&gt; Yasnippet&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-17\"&gt;\n&lt;p&gt;\nA mode that allows you to write code faster if you are lazy.\nIt is very easy to create your own snippets and use it whatever the file you are editing (code, non-code, emails, &amp;#x2026;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nI personnaly do not use it, but people coming from Textmate/Sublime would love it.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;yasnippet&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/Yasnippet\">http://www.emacswiki.org/emacs/Yasnippet</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-8-18\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-8-18\"&gt;&lt;span class=\"section-number-4\"&gt;5.8.18&lt;/span&gt; Paredit&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-8-18\"&gt;\n&lt;p&gt;\nParedit is a really cool mode to \"keep parentheses balanced\" and navigating in the S-expressions. Useful and indispensable if you write Lisp code, for example.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nTo install it, add &lt;code&gt;paredit&lt;/code&gt; to your packages list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/ParEdit\">http://www.emacswiki.org/emacs/ParEdit</a>\"&gt;Read more&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-9\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-9\"&gt;&lt;span class=\"section-number-3\"&gt;5.9&lt;/span&gt; Code navigation&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-9\"&gt;\n&lt;p&gt;\nNavigate through source code is an indispensable feature in code editors. Some of other editors are focused on this (like Sublime) but the problem is that they do not leave you the choices of the weapons (like every other features).\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nEmacs, as you noticed (yes, you did) can integrate any external tool or include a large variety of internal tools to make it more efficient. Code navigation is not an exception.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere are a lot of packages in order to navigate through code, with different methodologies and advantages:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/EmacsTags\">http://www.emacswiki.org/emacs/EmacsTags</a>\"&gt;TAGS&lt;/a&gt; (built in. No installation required)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"https://github.com/bbatsov/projectile\">https://github.com/bbatsov/projectile</a>\"&gt;Projectile&lt;/a&gt; (install it by adding &lt;code&gt;projectile&lt;/code&gt; to your packages list)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"https://github.com/emacs-helm/helm\">https://github.com/emacs-helm/helm</a>\"&gt;Helm&lt;/a&gt; (install it by adding &lt;code&gt;heml&lt;/code&gt; to your packages list)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://cedet.sourceforge.net/\">http://cedet.sourceforge.net/</a>\"&gt;Emacs CEDET&lt;/a&gt; (install it by adding &lt;code&gt;cedet&lt;/code&gt; to your packages list)\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\n(Note: use once at a time! You do not need to install them all)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAfter using &lt;i&gt;Projectile&lt;/i&gt; for a certain period of time, I gave &lt;i&gt;Helm&lt;/i&gt; a shot but finally got back to the simplicity and the efficiency of the &lt;i&gt;TAGS&lt;/i&gt; system.\nNevertheless, &lt;i&gt;Projectile&lt;/i&gt; and &lt;i&gt;Helm&lt;/i&gt; are really powerful and useful. You really should look at them.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFor now, I will cover the basics of &lt;i&gt;TAGS&lt;/i&gt; since it is a standard (used by other softwares) and it is built-in (so if you use another Emacs without your config, you still know how to surf in the code). And other useful tricks will be shown here.\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-9-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-9-1\"&gt;&lt;span class=\"section-number-4\"&gt;5.9.1&lt;/span&gt; Tags basics&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-9-1\"&gt;\n&lt;p&gt;\nBasically, the TAGS rely on an index file of the content of your code source.\nIn the root folder of a project, you must generate your index.\nSeveral methods for this, but here is one command that generates the file:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-sh\"&gt;&lt;span style=\"color: #7FFFD4;\"&gt;cd&lt;/span&gt; /path/to/your/project\nfind . -regex &lt;span style=\"color: #aa3939;\"&gt;\".*\\.\\(c\\|h\\|rb\\|py\\|php\\|js\\|sh\\|bash\\)\"&lt;/span&gt; -print | xargs etags -a\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou now should see a \"TAGS\" file. If needed, exclude this file from your git/svn/whatever repository/.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou are now ready to surf!\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nNow, here are the main commands to use them:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;M-.&lt;/b&gt; is the equivalent of &lt;b&gt;M-x find-tag&lt;/b&gt;: find a tag\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x find-tag-other-window&lt;/b&gt;: find a tag, but in another window\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x tags-search&lt;/b&gt;: find a tag thanks to a regexp\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x tags-query-replace&lt;/b&gt;: replace a tag in all the indexed files\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x tags-apropos&lt;/b&gt;: list all tags that match a regexp\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x list-tags&lt;/b&gt;: list all tags in a file\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-9-2\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-9-2\"&gt;&lt;span class=\"section-number-4\"&gt;5.9.2&lt;/span&gt; List functions or methods&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-9-2\"&gt;\n&lt;p&gt;\nIn order to list and jump easily between the functions or methods of the current file, here is a little trick:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-emacs-lisp\"&gt;(global-set-key (kbd &lt;span style=\"color: #aa3939;\"&gt;\"C-S-f\"&lt;/span&gt;) 'imenu) &lt;span style=\"color: #a5a5a5;\"&gt;;; &lt;/span&gt;&lt;span style=\"color: #a5a5a5;\"&gt;use iMenu&lt;/span&gt;\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAfter pressing Ctrl-Shift-f (replace it by whatever you want!), a menu with all the available resources appears in the minibuffer.\nSelect the resource you want (let's say &lt;i&gt;All.methods&lt;/i&gt; if you are editing some code) and you will be able to search and jump to a method definition directly.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-9-3\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-9-3\"&gt;&lt;span class=\"section-number-4\"&gt;5.9.3&lt;/span&gt; Files navigation (a.k.a fuzzy matching) with TAGS and ido&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-9-3\"&gt;\n&lt;p&gt;\nIn order to find and jump easily to a file in your project thanks to TAGS, you have to add a little function to your confiugration.\nFor this you should have installed the &lt;code&gt;ido-mode&lt;/code&gt; described above.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-emacs-lisp\"&gt;(&lt;span style=\"color: #5FB7CC;\"&gt;defun&lt;/span&gt; &lt;span style=\"color: #1D68C4;\"&gt;ido-find-file-in-tag-files&lt;/span&gt; ()\n  (interactive)\n  (&lt;span style=\"color: #5FB7CC;\"&gt;save-excursion&lt;/span&gt;\n    (&lt;span style=\"color: #5FB7CC;\"&gt;let&lt;/span&gt; ((enable-recursive-minibuffers t))\n      (visit-tags-table-buffer))\n    (find-file\n     (expand-file-name\n      (ido-completing-read\n       &lt;span style=\"color: #aa3939;\"&gt;\"Project file: \"&lt;/span&gt; (tags-table-files) nil t)))))\n</p>\n\n<p>\n(global-set-key (kbd &lt;span style=\"color: #aa3939;\"&gt;\"C-S-x C-S-f\"&lt;/span&gt;) 'ido-find-file-in-tag-files)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nNow, in your project folder and once you generated your TAGS file, you can press &lt;b&gt;C-S-x C-S-f&lt;/b&gt; to find files through the whole tree of directories just by typing a pattern.\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/fuzzy.gif\" alt=\"fuzzy.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-9-4\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-9-4\"&gt;&lt;span class=\"section-number-4\"&gt;5.9.4&lt;/span&gt; RGrep&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-9-4\"&gt;\n&lt;p&gt;\n&lt;i&gt;rgrep&lt;/i&gt; is a great tool to use in addition of the TAGS. It is a Unix tool that make &lt;i&gt;grep&lt;/i&gt; queries recursively. In Emacs, it will bring you a new buffer with all the results of the command. To use it, simply type:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;b&gt;M-x rgrep RET yoursearchterm RET&lt;/b&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOnce fired, you can swith to the newly created buffer, parse the results and jump to the wanted files very quickly.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nWhat is cool is that it is integrated in the editor, just beside your code and does not require to switch to a shell and then copy-paste the files path you want.\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/rgrep.gif\" alt=\"rgrep.gif\" /&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n\n<p>\n&lt;div id=\"outline-container-sec-5-10\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-5-10\"&gt;&lt;span class=\"section-number-3\"&gt;5.10&lt;/span&gt; Setting a color theme&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-5-10\"&gt;\n&lt;p&gt;\nNow, we are talking about something very touchy and that can be a long quest &amp;#x2026;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nA color theme generally includes colors for:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;background\n&lt;/li&gt;\n&lt;li&gt;syntax color (for code)\n&lt;/li&gt;\n&lt;li&gt;specific modes colors (gnus, dired, git, &amp;#x2026;)\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere are several ways to install a color theme, but first, we will use the Emacs' internal color-theme library.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nLet's try to switch between different themes:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Type &lt;b&gt;M-x load-theme RET tango-dark&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;Then type &lt;b&gt;M-x load-theme RET wombat&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;Finally type &lt;b&gt;M-x load-theme RET whiteboard&lt;/b&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere is no secret or perfect color theme. There are so many of theme and each user has its preferences in term of colors.\n&lt;/p&gt;\n</p>\n\n\n<p>\n&lt;div class=\"figure\"&gt;\n&lt;p&gt;&lt;img src=\"../images/colors.gif\" alt=\"colors.gif\" /&gt;\n&lt;/p&gt;\n&lt;p&gt;&lt;span class=\"figure-number\"&gt;Figure 15:&lt;/span&gt; color themes&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIn order to choose yours, try the default ones, see this &lt;a href=\"<a href=\"http://gnuemacscolorthemetest.googlecode.com/svn/html/index-el.html\">http://gnuemacscolorthemetest.googlecode.com/svn/html/index-el.html</a>\"&gt;showcase&lt;/a&gt;, make your own or google a lot !\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-5-10-1\" class=\"outline-4\"&gt;\n&lt;h4 id=\"sec-5-10-1\"&gt;&lt;span class=\"section-number-4\"&gt;5.10.1&lt;/span&gt; Font settings&lt;/h4&gt;\n&lt;div class=\"outline-text-4\" id=\"text-5-10-1\"&gt;\n&lt;p&gt;\nAfter setting up your theme, there are some other tweaks that are \"color theme related\".\nFonts is something very important depending on your system, your screen size, your current task in Emacs, &amp;#x2026; etc\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIf you want to change the font directly from your current Emacs instance, simply type &lt;b&gt;M-x set-frame-font RET&lt;/b&gt;.\nAnd if you want to see all supported fonts, type &lt;b&gt;TAB&lt;/b&gt; twice. It will show you a list.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThe global and easy way to do it is to add a line to your configuration:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;(set-default-font &lt;span style=\"color: #aa3939;\"&gt;\"DejaVu Sans Mono-10\"&lt;/span&gt;)\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nBut to be safe, you'd better add this into your X resource settings file (~/.Xresources):\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;div class=\"org-src-container\"&gt;\n</p>\n\n<p>\n&lt;pre class=\"src src-lisp\"&gt;emacs.font: DejaVu Sans Mono-10\n&lt;/pre&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOf course, it is possible to set a different font for any system or mode you want. It is cool since you can use different font (size) if you are on Linux or mac OR if you write a book, write code, read your emails, &amp;#x2026; etc.\nAs an exercise, I'll let you search how to do this kind of stuff in Emacs Lisp if you need it.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIf you want more about font settings and especially about font names, please see the &lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/SetFonts\">http://www.emacswiki.org/emacs/SetFonts</a>\"&gt;Emacs wiki page&lt;/a&gt; or the &lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html\">http://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html</a>\"&gt;manual&lt;/a&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nA last point: sometimes you want to change the font size of your current buffer. To do this, simply type:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;M-x text-scale-increase&lt;/b&gt; or &lt;b&gt;C-x C-+&lt;/b&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;M-x text-scale-decrease&lt;/b&gt; or &lt;b&gt;C-x C&#x2013;&lt;/b&gt; (Ctrl x, Ctrl dash)\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nReally handy if you show your screen through an external display or you want to focus on a specific part of a file.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-6\"&gt;&lt;span class=\"section-number-2\"&gt;6&lt;/span&gt; Emacs for developers - Emacs developing environments&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-6\"&gt;\n&lt;p&gt;\nEmacs, thanks to major or minor modes can be transformed into a powerful specific environment.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAccording to the kind of files you are editing (or a command you type), it can mutate and give you specific features that fits the need of a programming language (or a task like debugging, launching unit tests, &amp;#x2026;)\n&lt;/p&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-1\"&gt;&lt;span class=\"section-number-3\"&gt;6.1&lt;/span&gt; Emacs for Ruby developers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-1\"&gt;\n&lt;p&gt;\nThere are many ruby developer who decribe their set up around the web. Here are the most popular:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://devblog.avdi.org/category/emacs-reboot/\">http://devblog.avdi.org/category/emacs-reboot/</a>\"&gt;The Emacs reboot serie, by Avdi Grimm&lt;/a&gt; (Avdi is a famous ruby programmer and a great Emacs hacker)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://crypt.codemancers.com/posts/2013-09-26-setting-up-emacs-as-development-environment-on-osx/\">http://crypt.codemancers.com/posts/2013-09-26-setting-up-emacs-as-development-environment-on-osx/</a>\"&gt;Setting up Emacs as Ruby development environment on OSX&lt;/a&gt; (even if it is for OSX, the packages remain the same on all OSes)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://lorefnon.me/2014/02/02/configuring-emacs-for-rails.html\">http://lorefnon.me/2014/02/02/configuring-emacs-for-rails.html</a>\"&gt;Configuring Emacs as a productive development environment for Rails development&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/RubyOnRails\">http://www.emacswiki.org/emacs/RubyOnRails</a>\"&gt;The EmacsWiki on Ruby and RoR&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-2\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-2\"&gt;&lt;span class=\"section-number-3\"&gt;6.2&lt;/span&gt; Emacs for Python developers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-2\"&gt;\n&lt;p&gt;\nHere are some resources about setting Emacs for developing in python:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://caisah.info/emacs-for-python/\">http://caisah.info/emacs-for-python/</a>\"&gt;Emacs for python - on caisah.info&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/PythonProgrammingInEmacs\">http://www.emacswiki.org/emacs/PythonProgrammingInEmacs</a>\"&gt;Python programming in Emacs - on the EmacsWiki&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-3\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-3\"&gt;&lt;span class=\"section-number-3\"&gt;6.3&lt;/span&gt; Emacs for C/C++/Objective-C&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-3\"&gt;\n&lt;p&gt;\nC languages are very well handled by Emacs and it allows you to edit, debug and run programs with Emacs very easily, with all the control you want.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://tuhdo.github.io/c-ide.html\">http://tuhdo.github.io/c-ide.html</a>\"&gt;C/C++ Development Environment for Emacs&lt;/a&gt; is a very complete article about this\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://stackoverflow.com/questions/5800317/emacs-as-a-c-programming-ide-configuration\">http://stackoverflow.com/questions/5800317/emacs-as-a-c-programming-ide-configuration</a>\"&gt;A various tips and packages for C language(s)&lt;/a&gt; on StackOverflow\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/\">http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/</a>\"&gt;Setting up perfect environment for C/C++ Programming&lt;/a&gt; (according to its auhor. Good resource, though)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/DebuggingWithEmacs\">http://www.emacswiki.org/emacs/DebuggingWithEmacs</a>\"&gt;Debugging with Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://cedet.sourceforge.net/\">http://cedet.sourceforge.net/</a>\"&gt;CEDET - Collection of Emacs Development Environment Tools&lt;/a&gt; An amazing collection of tools for developping in many programming languages, especially for C/C++\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html\">http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html</a>\"&gt;How to configure CEDET&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-4\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-4\"&gt;&lt;span class=\"section-number-3\"&gt;6.4&lt;/span&gt; Emacs for Go developers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-4\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;If you develop in Go, you really should refer to the great &lt;a href=\"<a href=\"http://yousefourabi.com/blog/2014/05/emacs-for-go/\">http://yousefourabi.com/blog/2014/05/emacs-for-go/</a>\"&gt;Emacs for Go&lt;/a&gt; article, written by Yousef Ourabi.\n&lt;/li&gt;\n&lt;li&gt;Another one, with videos, is written by Dominik Honnef: &lt;a href=\"<a href=\"http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/\">http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/</a>\"&gt;Writing Go in Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-5\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-5\"&gt;&lt;span class=\"section-number-3\"&gt;6.5&lt;/span&gt; Emacs for PHP developers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-5\"&gt;\n&lt;p&gt;\nPHP, along with all the web technologies (HTML/JS/CSS) are very well supported in Emacs. The PHP mode does almost all the job by itself.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/PhpMode\">http://www.emacswiki.org/emacs/PhpMode</a>\"&gt;The EmacsWiki page about php-mode and other assicated packages&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://stackoverflow.com/questions/912671/what-is-a-good-setup-for-editing-php-in-emacs\">http://stackoverflow.com/questions/912671/what-is-a-good-setup-for-editing-php-in-emacs</a>\"&gt;A list of useful packages for PHP - on StackOverflow&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"https://drupal.org/node/59868\">https://drupal.org/node/59868</a>\"&gt;An example setup for working on Drupal&lt;/a&gt; (but can be used for PHP in general)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"https://code.google.com/p/geben-on-emacs/\">https://code.google.com/p/geben-on-emacs/</a>\"&gt;GEBEN - remote debugging environment for Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://web-mode.org/\">http://web-mode.org/</a>\"&gt;Web Mode - focused on web templates (HTML/JS/CSS)&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-6\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-6\"&gt;&lt;span class=\"section-number-3\"&gt;6.6&lt;/span&gt; Emacs for Java developers&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-6\"&gt;\n&lt;p&gt;\nJava development is held by Eclipse. But it is not the only editor/environment that allows you to develop in Java !\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://jdee.sourceforge.net/\">http://jdee.sourceforge.net/</a>\"&gt;JDEE - the Java Development Environment for Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment\">http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment</a>\"&gt;The EmacsWiki article on JDEE&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"http:\"&gt;A video demo of a full Java environment on Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-6-7\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-6-7\"&gt;&lt;span class=\"section-number-3\"&gt;6.7&lt;/span&gt; Emacs for R and statistics&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-6-7\"&gt;\n&lt;p&gt;\nEmacs is very useful for scientists and people dealing with data. Statistics, analysis, plotting, &amp;#x2026; everything can be done within Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org\">https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org</a>\"&gt;An amazing paper on working with Emacs, OrgMode and R&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://ess.r-project.org/\">http://ess.r-project.org/</a>\"&gt;Emacs Speaks Statistics&lt;/a&gt; is a great project that adds a full statistics environment to your Emacs\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://stats.blogoverflow.com/2011/08/using-emacs-to-work-with-r/\">http://stats.blogoverflow.com/2011/08/using-emacs-to-work-with-r/</a>\"&gt;A tutorial on using ESS&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-7\"&gt;&lt;span class=\"section-number-2\"&gt;7&lt;/span&gt; Special features&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-7\"&gt;\n&lt;/div&gt;&lt;div id=\"outline-container-sec-7-1\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-1\"&gt;&lt;span class=\"section-number-3\"&gt;7.1&lt;/span&gt; Emacs as a file manager&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-1\"&gt;\n&lt;p&gt;\nEmacs has a built-in mode named &lt;i&gt;dired&lt;/i&gt; that allows you to manage your file system directly in Emacs really easily.\nIt is very powerful and has features that graphical file managers do not have.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nFirst of all, to launch it, type:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;M-x dired RET&lt;/b&gt; and then select a path to open (default is the directory of the file you are editing)\n&lt;/li&gt;\n&lt;li&gt;or &lt;b&gt;C-x d&lt;/b&gt; if you prefer keybindings\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHere are a few quick shortcuts once you are in &lt;i&gt;dired mode&lt;/i&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;b&gt;R&lt;/b&gt; (capital R): rename a file\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;D&lt;/b&gt; (capital D): delete a file\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;+&lt;/b&gt;: create a new directory\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;Z&lt;/b&gt;: compress the file\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;RET&lt;/b&gt; (enter): Open the file\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;g&lt;/b&gt;: refresh\n&lt;/li&gt;\n&lt;li&gt;&lt;b&gt;q&lt;/b&gt;: close the dired window\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOf course, files can be marked to operate on a selection of them. Use &lt;b&gt;m&lt;/b&gt; to mark, &lt;b&gt;u&lt;/b&gt; to unmark (&lt;b&gt;U&lt;/b&gt; to unmark all), &lt;b&gt;% m&lt;/b&gt; to mark according to a pattern.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nNote that there are so many tricks, extensions and features in &lt;i&gt;dired mode&lt;/i&gt; that I let you see around what you need.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/DiredMode\">http://www.emacswiki.org/emacs/DiredMode</a>\"&gt;Read more about Dired&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html\">https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html</a>\"&gt;Read the manual&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7-2\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-2\"&gt;&lt;span class=\"section-number-3\"&gt;7.2&lt;/span&gt; Working locally vs remotely&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-2\"&gt;\n&lt;p&gt;\nEmacs, once installed on your machine will allow you to edit your file locally, obviously.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOther people (non-Emacs users) will do a dirty trick to edit remote files like they were local files. They will mount the remote directory on their machine (thanks to &lt;i&gt;sshfs&lt;/i&gt;).\nBut the magic in Emacs is that you can transparently edit remote files on your development servers for example.\nTo do so, Emacs comes with a genious extension named \"Tramp\". It is alreay installed and available when you install Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIf you press &lt;b&gt;C-x C-f&lt;/b&gt;, you can open a file. But if you ask &lt;code&gt;myname@myserver.com:/path/to/file&lt;/code&gt;, it will automatically connect to the server and let you edit the remote file. Easy as pie.\n&lt;i&gt;Tramp&lt;/i&gt; supports lots of protocols like ssh, ftp, and so on.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAnd what is great is that if you are editing a remote file and you launch a shell in Emacs, it will automatically set the shell into your remote environment and open it as if you were in the remote directory the file is in.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nA last tip about TRAMP. If you simply add &lt;code&gt;sudo:&lt;/code&gt; in front of your file path, you edit your file with higher privileges. It is a very useful feature if you need to edit your configuration files on a server, for example. Of course, it works remotely and locally.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/TrampMode\">http://www.emacswiki.org/emacs/TrampMode</a>\"&gt;Read more about Tramp&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7-3\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-3\"&gt;&lt;span class=\"section-number-3\"&gt;7.3&lt;/span&gt; Organize your work, write papers and manage your agenda&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-3\"&gt;\n&lt;p&gt;\nIn Emacs, you can do everything. This is a fact.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nOne the most amazing and complete mode is the amazing &lt;a href=\"<a href=\"http://orgmode.org\">http://orgmode.org</a>\"&gt;Org mode&lt;/a&gt;, written by amazing people.\nBut when I say amazing, it is absolutly amazing. It allows you to \"live in Emacs\".\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHere a a few of its am&amp;#x2026; features:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;A full agenda / calendar\n&lt;/li&gt;\n&lt;li&gt;TODO lists and project management\n&lt;/li&gt;\n&lt;li&gt;Writing (research papers, books, an \"Emacs for developers\" whitepaper, your shopping list &amp;#x2026;)\n&lt;/li&gt;\n&lt;li&gt;Include code in you papers\n&lt;/li&gt;\n&lt;li&gt;Tables and spreadsheets (with formulas and calculation)\n&lt;/li&gt;\n&lt;li&gt;Mobile integration\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAnd what is really cool is that every thing you do in Org is exportable in:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;PDF\n&lt;/li&gt;\n&lt;li&gt;LaTex\n&lt;/li&gt;\n&lt;li&gt;HTML\n&lt;/li&gt;\n&lt;li&gt;Text\n&lt;/li&gt;\n&lt;li&gt;ODT\n&lt;/li&gt;\n&lt;li&gt;iCalendar\n&lt;/li&gt;\n&lt;li&gt;TextInfo\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026; and many more.\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou really should check their &lt;a href=\"<a href=\"http://orgmode.org/features.html\">http://orgmode.org/features.html</a>\"&gt;list of features&lt;/a&gt;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nIf you want to see a good example of Org-mode capabilities, check &lt;a href=\"<a href=\"http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html\">http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html</a>\"&gt;that great page&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7-4\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-4\"&gt;&lt;span class=\"section-number-3\"&gt;7.4&lt;/span&gt; Emails in Emacs&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-4\"&gt;\n&lt;p&gt;\nThere are packages that let you use Emacs as a full featured MUA.\nReading emails, sending emails, filtering, archiving &amp;#x2026; etc.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nEmacs can be a very powerful and fast e-mail client and as it is controlled by the keyboard, it could be more efficient than a graphical e-mail client (clicking is a loss of time).\nI use it for years now and I can not imagine using another program to read my emails.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nThere are several package to do so, but the most used is &lt;a href=\"<a href=\"http://www.gnus.org/\">http://www.gnus.org/</a>\"&gt;Gnus&lt;/a&gt;. It is already installed with Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nHere are some of its features beside the basic ones:\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Gnus is in fact a newsreader used to interact with email servers. So you can use to fetch messages from newsgroups, RSS, SMTP, POP, &amp;#x2026;\n&lt;/li&gt;\n&lt;li&gt;Easy and powerful mail splitting\n&lt;/li&gt;\n&lt;li&gt;Integration with BBDB, a contact manager\n&lt;/li&gt;\n&lt;li&gt;Message scoring\n&lt;/li&gt;\n&lt;li&gt;LDAP\n&lt;/li&gt;\n&lt;li&gt;PGP signing and encrypting\n&lt;/li&gt;\n&lt;li&gt;Customizable layout\n&lt;/li&gt;\n&lt;li&gt;Encrypted file to manage your credentials\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026; and many more\n&lt;/li&gt;\n&lt;li&gt;&amp;#x2026; and of course, it is extensible thanks to Lisp\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou really should try it with your personnal account. It is easy to configure and integrate with &lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/GnusGmail\">http://www.emacswiki.org/emacs/GnusGmail</a>\"&gt;Gmail&lt;/a&gt;, for example.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nBut be careful! If you try it, you will love it.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nSome alternatives to Gnus (that I do not use, but that are popular):\n&lt;/p&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/WanderLust\">http://www.emacswiki.org/emacs/WanderLust</a>\"&gt;Wanderlust&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.djcbsoftware.nl/code/mu/mu4e.html\">http://www.djcbsoftware.nl/code/mu/mu4e.html</a>\"&gt;Mu4e&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7-5\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-5\"&gt;&lt;span class=\"section-number-3\"&gt;7.5&lt;/span&gt; Some great Emacs tips and tricks&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-5\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;Emacs is all about Macros. This is one of its most powerful feature. Record a sequence and re-play it on other lines! Here is &lt;a href=\"<a href=\"http://www.thegeekstuff.com/2010/07/emacs-macro-tutorial-how-to-record-and-play/\">http://www.thegeekstuff.com/2010/07/emacs-macro-tutorial-how-to-record-and-play/</a>\"&gt;how&lt;/a&gt;.\n&lt;/li&gt;\n&lt;li&gt;Using &lt;a href=\"<a href=\"http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/\">http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/</a>\"&gt;shell&lt;/a&gt; inside Emacs is cool\n&lt;/li&gt;\n&lt;li&gt;You really should use the &lt;i&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/BookMarks\">http://www.emacswiki.org/emacs/BookMarks</a>\"&gt;bookmarks&lt;/a&gt;&lt;/i&gt; functionnality to save your projects locations (locally or remotely)\n&lt;/li&gt;\n&lt;li&gt;When opening a file, add &lt;i&gt;sudo:&lt;/i&gt; in front of its path in order to edit it as a privileged user\n&lt;/li&gt;\n&lt;li&gt;You can edit files in hexadecimal directly in Emacs thanks to the &lt;i&gt;hexl-mode&lt;/i&gt;\n&lt;/li&gt;\n&lt;li&gt;Emacs allows you to open an archive (gz, bz2, zip, &amp;#x2026;), edit its files on-the-fly without extracting yourself the archive. To do so, simple open the file directly in Emacs (&lt;b&gt;C-x C-f&lt;/b&gt; /path/to/archive.tar.bz2)\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html\">http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html</a>\"&gt;Rectangle regions&lt;/a&gt; edition is really easy\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.cs.bu.edu/teaching/tool/emacs/programming/#compile\">http://www.cs.bu.edu/teaching/tool/emacs/programming/#compile</a>\"&gt;Compilation&lt;/a&gt; and &lt;a href=\"<a href=\"http://www.cs.bu.edu/teaching/tool/emacs/programming/#gdb\">http://www.cs.bu.edu/teaching/tool/emacs/programming/#gdb</a>\"&gt;debugging&lt;/a&gt; is really well supported in Emacs\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.emacswiki.org/ERC\">http://www.emacswiki.org/ERC</a>\"&gt;Erc&lt;/a&gt; is a great IRC client running in Emacs\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;i&gt;To be continued&lt;/i&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-7-6\" class=\"outline-3\"&gt;\n&lt;h3 id=\"sec-7-6\"&gt;&lt;span class=\"section-number-3\"&gt;7.6&lt;/span&gt; Coming from other editors (i.e Vim)&lt;/h3&gt;\n&lt;div class=\"outline-text-3\" id=\"text-7-6\"&gt;\n&lt;p&gt;\nSome people use other editors and want to give Emacs a try.\nSome people are really used to use a specific editor.\nSome people do not want to lose their habits and their learning curve.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nI am thinking about Vim, but it is also true for other editors (textmate, sublime, &amp;#x2026;)\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nEmacs has a mode that allows you to use it exactly like Vim.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nI personnaly never used this mode, but many people use it. Therefore, it allows you to switch gently and softly from Vim to Emacs.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\n&lt;a href=\"<a href=\"http://www.emacswiki.org/emacs/Evil\">http://www.emacswiki.org/emacs/Evil</a>\"&gt;Read more about Evil-mode&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-8\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-8\"&gt;&lt;span class=\"section-number-2\"&gt;8&lt;/span&gt; Readings and resources&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-8\"&gt;\n&lt;ul class=\"org-ul\"&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://emacsrocks.com/\">http://emacsrocks.com/</a>\"&gt;Emacs rocks videos&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://devblog.avdi.org/category/emacs-reboot/\">http://devblog.avdi.org/category/emacs-reboot/</a>\"&gt;Avdi Grimm Emacs reboot series&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://www.masteringemacs.org/\">http://www.masteringemacs.org/</a>\"&gt;Mastering Emacs&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://sachachua.com/blog/category/geek/emacs/\">http://sachachua.com/blog/category/geek/emacs/</a>\"&gt;Sacha's blog&lt;/a&gt; and her wonderful Emacs contributors interviews serie\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://emacsredux.com\">http://emacsredux.com</a>\"&gt;Emacs redux&lt;/a&gt; by Bozhidar Batsov\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://planet.emacsen.org/\">http://planet.emacsen.org/</a>\"&gt;Planet Emacsen&lt;/a&gt;\n&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"<a href=\"http://reddit.com/r/emacs\">http://reddit.com/r/emacs</a>\"&gt;Emacs sub-reddit&lt;/a&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAnd of course, the &lt;a href=\"<a href=\"http://www.emacswiki.org/\">http://www.emacswiki.org/</a>\"&gt;Emacs wiki&lt;/a&gt;\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-9\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-9\"&gt;&lt;span class=\"section-number-2\"&gt;9&lt;/span&gt; License&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-9\"&gt;\n&lt;p&gt;\nThe content of this project itself is licensed under the &lt;a href=\"<a href=\"http://creativecommons.org/licenses/by/3.0/us/deed.en_US\">http://creativecommons.org/licenses/by/3.0/us/deed.en_US</a>\"&gt;Creative Commons Attribution 3.0 license&lt;/a&gt;, and the underlying source code used to format and display that content is licensed under the &lt;a href=\"<a href=\"http://opensource.org/licenses/mit-license.php\">http://opensource.org/licenses/mit-license.php</a>\"&gt;MIT license&lt;/a&gt;.\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nContributors list can be found &lt;a href=\"<a href=\"https://github.com/pierre-lecocq/emacs4developers/network/members\">https://github.com/pierre-lecocq/emacs4developers/network/members</a>\"&gt;here&lt;/a&gt;.\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n</p>\n\n<p>\n&lt;div id=\"outline-container-sec-10\" class=\"outline-2\"&gt;\n&lt;h2 id=\"sec-10\"&gt;&lt;span class=\"section-number-2\"&gt;10&lt;/span&gt; Thanks&lt;/h2&gt;\n&lt;div class=\"outline-text-2\" id=\"text-10\"&gt;\n&lt;p&gt;\nI want to thank some of the great people who make Emacs a very intersting piece of software or make its community very active (the sort order is absolutly not important here):\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nBastien Guerry, Dimitri Fontaine, Julien Danjou, Sacha Chua, Steve Purcell, Nic Ferrier, Avdi Grimm, Magnars, Steve Yegge, Bozhidar Batsov, Xah Lee, and many more &amp;#x2026;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nYou should check those people and their work over the web, twitter, youtube, &amp;#x2026;\n&lt;/p&gt;\n</p>\n\n<p>\n&lt;p&gt;\nAnd thank you for reading this !\n&lt;/p&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;\n&lt;div id=\"postamble\" class=\"status\"&gt;\n&lt;p class=\"author\"&gt;Author: Pierre Lecocq&lt;/p&gt;\n&lt;p class=\"date\"&gt;Created: 2014-10-21 Mar 13:50&lt;/p&gt;\n&lt;p class=\"creator\"&gt;&lt;a href=\"<a href=\"http://www.gnu.org/software/emacs/\">http://www.gnu.org/software/emacs/</a>\"&gt;Emacs&lt;/a&gt; 24.4.1 (&lt;a href=\"<a href=\"http://orgmode.org\">http://orgmode.org</a>\"&gt;Org&lt;/a&gt; mode 8.2.10)&lt;/p&gt;\n&lt;p class=\"validation\"&gt;&lt;a href=\"<a href=\"http://validator.w3.org/check?uri=referer\">http://validator.w3.org/check?uri=referer</a>\"&gt;Validate&lt;/a&gt;&lt;/p&gt;\n&lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;</p>\n</div>\n<div id=\"postamble\" class=\"status\">\n<p class=\"author\">Author: Pierre Lecocq</p>\n<p class=\"date\">Created: 2014-10-21 Mar 13:50</p>\n<p class=\"creator\"><a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> 24.4.1 (<a href=\"http://orgmode.org\">Org</a> mode 8.2.10)</p>\n<p class=\"validation\"><a href=\"http://validator.w3.org/check?uri=referer\">Validate</a></p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "exports/emacs4developers.org",
    "content": "#+TITLE: Emacs for developers\n#+AUTHOR: Pierre Lecocq\n#+DESCRIPTION: Learn using Emacs as a developer\n#+KEYWORDS: emacs, developer\n#+STARTUP: showall\n\n* Emacs for developers\n\nThis document will (hopefully) help you to use Emacs as a developer.\n\n**** Disclaimer\n\nWork in progress, so stay tuned.\n\n** Who is the target of this tutorial\n\nWell, this is a good question. And I won't give an answer but some elements of answer.\n\nWhat is sure is that it is not written for the people thanked below (Batien, Dimitri, Sacha, Nic, Avdi, and so on ...), but what is interseting with Emacs is that even if you are a beginner, an intermediate / advanced user or an every day power user, you can learn from others each time you open a web page or a manual dealing with Emacs.\n\nTherefore, this tutorial is written for people who want to improve their experience. Simple as that. Whatever is their knowledge, their feeling, their usage, their config file size (without any pun), etc ...\n\nRemember one thing: Emacs is 30+ years old and brings new users everyday. It is a clue that this is a piece of software that deserve some attention.\n\n* Table of contents\n\n- 1. [[#introduction][Introduction]]\n   - 1.1 [[#brief-history][Brief history]]\n   - 1.2 [[#how-to-get-emacs][How to get Emacs?]]\n   - 1.3 [[#more-than-an-editor][More than an editor]]\n   - 1.4 [[#the-perfect-development-tool][The perfect development tool]]\n- 2. [[#the-basics][The basics]]\n   - 2.1 [[#config-files][Config files]]\n   - 2.2 [[#executing-commands][Executing commands]]\n   - 2.3 [[#key-bindings][Key bindings]]\n      - 2.3.1 [[#manipulate-files][Manipulate files]]\n      - 2.3.2 [[#manipulate-the-current-line][Manipulate the current line]]\n      - 2.3.3 [[#selecting-a-region][Selecting a region]]\n      - 2.3.4 [[#commenting][Commenting]]\n      - 2.3.5 [[#windows][Windows]]\n      - 2.3.6 [[#buffers][Buffers]]\n      - 2.3.7 [[#cancel-a-command][Cancel a command]]\n      - 2.3.8 [[#the-most-useless-command][The most useless command]]\n   - 2.4 [[#help][Help!]]\n- 3. [[#building-your-own-editor][Building your own editor]]\n   - 3.1 [[#first-basic-configuration][First basic configuration]]\n   - 3.2 [[#general-basic-configuration][General basic configuration]]\n   - 3.3 [[#backup-files][Backup files]]\n   - 3.4 [[#setting-up-the-locals][Setting up the locales]]\n   - 3.5 [[#more-configuration][More configuration]]\n   - 3.6 [[#modes][Modes]]\n   - 3.7 [[#package-managers][Package managers]]\n   - 3.8 [[#some-useful-packages][Some useful packages]]\n   - 3.9 [[#code-navigation][Code navigation]]\n   - 3.10 [[#setting-a-color-theme][Setting a color theme]]\n- 4. [[#emacs-developing-environments][Emacs developing environments]]\n   - 4.1 [[#emacs-for-ruby-developers][Emacs for Ruby developers]]\n   - 4.2 [[#emacs-for-python-developers][Emacs for Python developers]]\n   - 4.3 [[#emacs-for-ccobjective-c][Emacs for C/C++/Objective-C developers]]\n   - 4.4 [[#emacs-for-go-developers][Emacs for Go developers]]\n   - 4.5 [[#emacs-for-php-developers][Emacs for PHP developers]]\n   - 4.6 [[#emacs-for-java-developers][Emacs for Java developers]]\n   - 4.7 [[#emacs-for-r-and-statistics][Emacs for R and statistics]]\n- 5. [[#special-features][Special features]]\n   - 5.1 [[#emacs-as-a-file-manager][Emacs as a file manager]]\n   - 5.2 [[#working-locally-vs-remotely][Working locally vs remotely]]\n   - 5.3 [[#organize-your-work-write-papers-and-manage-your-agenda][Organize your work, write papers and manage your agenda]]\n   - 5.4 [[#emails-in-emacs][Emails in Emacs]]\n   - 5.5 [[#some-great-emacs-tips-and-tricks][Some great Emacs tips and tricks]]\n   - 5.6 [[#coming-from-other-editors-ie-vim][Coming from other editors (i.e Vim or SublimeText)]]\n- 6. [[#readings-and-resources][Readings and resources]]\n\n* Introduction\n\n** Brief history\n\n- Originally developed by Richard Stallman and Guy Steele in MIT AI lab\n- First release in 1976\n- Inspired by TECO editor\n- Based on macros (Emacs stands for Editor MACroS)\n- Written in C and Emacs Lisp\n- Part of the GNU project (therefore, we /should/ say \"GNU Emacs\", not \"Emacs\")\n\n- Despite its age, new users are still adopting Emacs as their development platform to this day!\n\n** How to get Emacs?\n\nOn every Linux distribution, packages are available.\nSo run your favorite package manager to install it:\n\n- /apt-get install emacs/\n- /yum install emacs/\n- ...\n\nAnd if you have an exotic operating system, here are the specific distributions:\n\n- Mac OS X: http://emacsformacosx.com/\n- Windows: http://ftp.igh.cnrs.fr/pub/gnu/emacs/windows/\n\nBut, in order to get the latest version, it's _highly recommended_ that you compile Emacs yourself: http://ftp.igh.cnrs.fr/pub/gnu/emacs/\n\n\n** More than an editor\n\n- More than an editor, it is a Lisp interpretor\n- Can run any type of program written in Lisp:\n  - Email clients (like [[http://www.gnus.org/][Gnus]] or [[http://www.emacswiki.org/emacs/mu4e][mu4e]])\n  - Shell (like bash or eshell)\n  - File and directory management (with [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Dired mode]])\n  - Agenda / Notes / TODO list / Project management (with the amazing [[http://orgmode.org][OrgMode]])\n  - IRC / Twitter / Jabber / ... clients\n  - Games (like Tetris, Pong, Snake, 5x5, Dunnet, ...)\n  - Encrypt/decrypt files (like GPG files)\n  - On-the-fly archives editing (thanks to [[http://www.emacswiki.org/emacs/ArchiveMode][archive-mode]])\n  - PDF / Image / (...) viewer\n  - A powerful front end to R / S+ / SPSS / Stata (with [[http://ess.r-project.org/][EmacsSpeaksStatisics)]]\n  - An editor for multi-modal REPL's like IPython (with [[http://tkf.github.io/emacs-ipython-notebook/][EmacsIPythonNotebook]])\n  - Music player (with emms, vlc, mplayer, ...)\n  - Music programming (with [[http://vimeo.com/22798433][Overtone]])\n  - Video editing\n  - And so on ...\n  - (and of course a document editor that can automatically generate this presentation)\n\nNaturally, you can do all of that at the same time with only one Emacs instance. Don't need to say it ...\n\n** The perfect development tool\n\n- As Emacs is a Lisp interpretor, it is extensible. Really really extensible.\n- The (unofficial) goal of Emacs is to be hacked\n- Therefore your goal is to hack Emacs to make it work perfectly as you want\n\n- Already provides so many development tools (also extensible, of course)\n  - Debuggers\n  - Compilers\n  - Syntax checkers\n  - Documentations\n  - Consoles\n  - ...\n\n- Also provides /modes/ (extensions) for *every* programming language for\n  - Syntax highlighting\n  - Documentation search\n  - Indentation\n  - Source code browsing\n  - Compilation commands\n  - Specific behaviour\n  - ...\n\n* The basics\n\n**  Config files\n\nIn order to customize Emacs, you will have to edit its configuration files.\nIt does not exist when you install the software (or is an empty file) and does nothing until you decide to tweak Emacs.\nSome people use Emacs for decades without any extra configuration because they like it out of the box.\n\nThere are several ways to manage your Emacs configuration:\n\n- Simply create and edit a *~/.emacs* file\n- Create a *~/.emacs.d/* directory with a *~/.emacs.d/init.el* file\n\nThe first solution is great if you have a small, tidied and exportable configuration file.\n\nThe second solution is great if you need several configuration files (keep you configuration parts separated) or you need to install external extensions (you will install them in *~/.emacs.d* to keep them centralized and exportable).\n\n** Executing commands\n\nThe main idea of Emacs is that everything is a command. For example: opening a file with a keybinding calls a command that is executed by the Emacs' core.\nAnd all the commands are written in Lisp.\n\nTo call a command, you simply have to press *Escape* and then *x*. It could be *Alt-x* for more comfort.\nThe official name is \"/Meta x/\" and is written /M-x/\n\nIf you type this key sequence, you will see at the bottom of the editor a little prompt.\nThis part of Emacs is called the /mini buffer/ and is used for every interactive actions.\n\nLet's try something:\n\n- type *M-x*\n- Then, in the minibuffer, type *version* and *RET* (return)\n\nEmacs should display the current version number of the software.\n\n#+CAPTION: Execute the version command\n[[../images/version.gif]]\n\nCongratulations! You just called your first Emacs command.\n\n** Key bindings\n\nHere are the most useful keys in Emacs. You will use them several hundreds (or thousands) times a day.\n\nHow it works?\n\n- The sequence /C-something/ means that you have to press and hold the /Control/ key while hitting the /something/ key. Example: /C-a/ means /Control + a/.\n- The sequence /C-something somethingelse/ means that you press /Control + something/, then you release Control to hit /somethingelse/.\n- The sequence /C-something C-somethingelse/ means that you have to press Control while hitting /something/ and /somethingelse/.\n\n*** Manipulate files\n\n- *C-x C-f*: open a file, which corresponds to *M-x find-file*\n- *C-x C-s*: save a file, which corresponds to *M-x save-buffer*\n\n#+CAPTION: Open a file, modify it and save it\n[[../images/open-and-save.gif]]\n\n*** Manipulate the line\n\n- *C-a*: go to the beginning of the current line, which corresponds to *M-x begining-of-line*\n- *C-e*: go to the end of the current line, which corresponds to *M-x end-of-line*\n- *C-k*: cut the rest of the line at the cursor position, which corresponds to *M-x kill-line*\n- *C-y*: paste what you had cut with the command above, which corresponds to *M-x yank*\n- *C-l*: center the buffer at the cursor position, which corresponds to *M-x recenter-top-bottom*\n\n#+CAPTION: Line manipulation\n[[../images/line.gif]]\n\n*** Selecting a region\n\nRegions are selections, in Emacs.\n\nThey are composed by two points. A starting one and and an ending one.\n\nTo select the starting point, move your cursor to the wanted location and simply press *C-Space*. In your minibuffer, you should have seen a message like \"Mark set\".\nNow, move your cursor to the location you wantyour selection to end.\n\nYou have now a selection (or a /region/) delimited by the place you set the first mark and your cursor. With this region, you can do what ever you want:\n\n- Copy (*M-w*)\n- Cut (*C-k*)\n- Paste (*C-y*)\n- Replace (*M-%*)\n- ... etc\n\n#+CAPTION: Selecting a region\n[[../images/selecting.gif]]\n\n*** Commenting\n\nIn order to comment a code block, select the region you want to comment and use:\n\n- *M-x comment-region* in order to comment the block\n- *M-x uncomment-region* in order to uncomment the block\n\nOf course, Emacs knows, according to the major mode loaded how to comment properly your code. If the major-mode is /ruby-mode/, it will add a \"#\" before the line; if the major-mode is /lisp-mode/, it will add \";;\", and so on and so forth.\n\n#+CAPTION: Commenting\n[[../images/comment.gif]]\n\n*** Windows\n\nThis might be confusing but a /window/ is a part of a /frame/.\n\nAn /Emacs frame/ is the window that you opened when you launched Emacs.\n\nAn /Emacs frame/ can be divided into /windows/ in itself.\n\n- *C-x 2*: open a new window horizontally, which corresponds to *M-x split-window-below*\n- *C-x 3*: open a new window vertically, which corresponds to *M-x split-window-right*\n- *C-x o*: switch to the next window, which corresponds to *M-x other-window*\n- *C-x 0*: close the current window, which corresponds to *M-x delete-window*\n\n#+CAPTION: Windows manipulation\n[[../images/windows.gif]]\n\n*** Buffers\n\nA /buffer/ is displayed in a /frame/.\n\n- *C-x b*: switch to an already opened buffer, which corresponds to *M-x switch-to-buffer*\n- *C-x C-b*: list opened buffer (and jump to the selected one), which corresponds to *M-x list-buffers*\n- *C-x k*: kill a buffer, which corresponds to *M-x kill-buffer*\n\n#+CAPTION: Buffer navigation\n[[../images/buffers.gif]]\n\n*** Cancel a command\n\n- *C-g* or *ESC ESC ESC*: cancel the current command running in the minibuffer, which corresponds to *M-x keyboard-quit*\n\n*** The most useless one\n\n- *C-x C-c*: quit emacs (use at your own risks!), which corresponds to *M-x save-buffers-kill-terminal*\n\n** Help!\n\nEmacs has a powerful built-in help system for key bindings and internal functionalities.\n\n- *C-h f <function-name>*: Find the key binding corresponding to <function-name> (ex: C-h f save-buffer)\n- *C-h k <key-sequence>*: Find the function name corresponding to <key-sequence> (ex: C-h k C-x C-s)\n\nWhen executing these commands, a new frame opens. To close it, switch to it (/C-x o/) and type /q/. If not, simply close it (/C-x 0/)\n\nEmacs also includes the full manual (also available online: http://www.gnu.org/software/emacs/manual/html_node/emacs/)\n\n- *C-h r*: browse the Emacs manual within Emacs\n\nFinally, there are so many other help functions: http://www.emacswiki.org/emacs/EmacsNewbieHelpReference\n\n* Building your own editor\n\nFrom this point, we will edit the configuration file.\nFor the moment, we will put everything in a single *~/.emacs.d/init.el* file. Create it if it does not exist.\n\n#+BEGIN_SRC sh\n# Backup old configuration\ncp .emacs dot-emacs.old\ncp -R .emacs.d dot-emacs.d.old\n\n# Create new and empty configuration\nmkdir ~/.emacs.d\ntouch ~/.emacs.d/init.el\n#+END_SRC\n\n** First basic configuration\n\nWhen you will have to change or add configuration, simply edit your *~/.emacs.d/init.el* file and add what you need.\n\nFor exemple, here is a tweak that does nothing visually but is useful for other packages and the Emacs engine itself.\nIt allows you to define your name and email. Emacs can use it to add author informations to a file when asked.\n\n#+BEGIN_SRC lisp\n(setq user-full-name \"Your full name\")\n(setq user-mail-address \"your@email.com\")\n#+END_SRC\n\nAfter each configuration modification, two solutions:\n\n- the soft & clever way: execute *M-x eval-buffer*\n- the hard way: restart Emacs.\n\n** General basic configuration\n\nNow, let's move to a more visual configuration basic set.\nAs before, simply add this to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Ask \"y\" or \"n\" instead of \"yes\" or \"no\". Yes, laziness is great.\n(fset 'yes-or-no-p 'y-or-n-p)\n\n;; Highlight corresponding parenthese when cursor is on one\n(show-paren-mode t)\n\n;; Highlight tabulations\n(setq-default highlight-tabs t)\n\n;; Show trailing white spaces\n(setq-default show-trailing-whitespace t)\n\n;; Remove useless whitespaces before saving a file\n(add-hook 'before-save-hook 'whitespace-cleanup)\n(add-hook 'before-save-hook (lambda() (delete-trailing-whitespace)))\n#+END_SRC\n\n** Backup files\n\nYou may have notice that the files you edit are duplicated and renamed with a /~/ at the end.\nThey are the backup files that Emacs creates for you with an auto-save feature.\nSometimes it is great because you can recover a file in case of error, sometimes it is annoying because you can have some many of these files.\n\nIt is up to you to keep it or disable it.\nHere is the configuration for that:\n\n#+BEGIN_SRC lisp\n;; Remove all backup files\n(setq make-backup-files nil)\n(setq backup-inhibited t)\n(setq auto-save-default nil)\n#+END_SRC\n\nAn alternative method is to save these backups in a centralized folder:\n\n#+BEGIN_SRC lisp\n;; Save backup files in a dedicated directory\n(setq backup-directory-alist '((\".\" . \"~/.saves\")))\n#+END_SRC\n\n** Setting up the locales\n\nYou may want to set up a specific locale for your files.\nHere is the trick:\n\n#+BEGIN_SRC lisp\n;; Set locale to UTF8\n(set-language-environment 'utf-8)\n(set-terminal-coding-system 'utf-8)\n(setq locale-coding-system 'utf-8)\n(set-default-coding-systems 'utf-8)\n(set-selection-coding-system 'utf-8)\n(prefer-coding-system 'utf-8)\n#+END_SRC\n\n** More configuration\n\nThe best way to get your configuration better, is to read the [[http://www.gnu.org/software/emacs/manual/][manual]] ...\nBut you can also (this is the un-official method) read the others Emacs users' config files.\nThere are so many people who share their configuration, comment their code, and distribute their modes!\n\nHere is mine: (https://github.com/pierre-lecocq/emacs.d)\n\n** Modes\n\n/Modes/ are Emacs' /extensions/ that can be installed to extend the capabilities of Emacs. They will allow you to build a powerful tailored editor.\n\nThere are 2 kind of modes: minor and major.\n\n*** Major modes\n\nMajor modes are modes that transform Emacs to a specialized software for editing a certain type of files (i.e c-mode) or managing special tasks (i.e reading emails, managing git repository, ...)\n\nOnly one major mode can be used at a time.\n\n*** Minor modes\n\nMinor modes are additionnal modes that are added transparently to the major mode. They add more features to the main one (i.e parentheses matching, syntax or spelling checkers, ...)\n\nSeveral minor modes can be used at a time.\n\n** Package managers\n\nEmacs has brilliant package managers such as /package.el/ or /el-get/ that allows you to add and update modes really easily.\n\n*** Package.el\n\n/package.el/ is the built in package manager shipped by default with Emacs 24 or later.\n\nTo list available packages, simply type this command:\n\n#+BEGIN_SRC lisp\nM-x package-list-packages\n#+END_SRC\n\nYou will have a list of packages. Simply press ENTER on the name of one of it to install it.\n\nAdditionnaly, you can manage the packages list by adding other sources to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Add package sources\n(setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\")\n                         (\"marmalade\" . \"http://marmalade-repo.org/packages/\")\n                         (\"melpa\" . \"http://melpa.org/packages/\")))\n#+END_SRC\n\n*** El-Get\n\n/[[https://github.com/dimitri/el-get][el-get]]/ is one of the most popular and easy to use package manager. The \"/apt-get/\" of Emacs.\nIt is written by the great [[https://github.com/dimitri][Dimitri Fontaine]] and is based on recipe files that simply describe where is located the package and how to get/compile/install it for you.\n\nTo use it, simply add this to your configuration file. It will download and set up /el-get/ for you:\n\n#+BEGIN_SRC lisp\n;; Set up el-get\n(add-to-list 'load-path \"~/.emacs.d/el-get/el-get\")\n(unless (require 'el-get nil 'noerror)\n  (with-current-buffer\n      (url-retrieve-synchronously\n       \"https://raw.github.com/dimitri/el-get/master/el-get-install.el\")\n    (let (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n#+END_SRC\n\n*** The generic method\n\nIn order to leave you the choice of the package manager you want to use, here is a function that handles several package managers. For now, it covers /package.el/ and /el-get/.\n\nIt also allows you to automatically install packages you want.\n\nIn the following snippet, two sample packages are installed\n\n- /color-theme/ in order to allow us to  change colors themes\n- /autopair/ in order to close automatically parentheses, brackets and braces when you open it\n\nSimply add this code to your configuration file:\n\n#+BEGIN_SRC lisp\n;; Set up the package manager of choice. Supports \"el-get\" and \"package.el\"\n(setq pmoc \"el-get\")\n\n;; List of all wanted packages\n(setq\n wanted-packages\n '(\n   color-theme\n   autopair\n))\n\n;; Package manager and packages handler\n(defun install-wanted-packages ()\n  \"Install wanted packages according to a specific package manager\"\n  (interactive)\n  (cond\n   ;; package.el\n   ((string= pmoc \"package.el\")\n    (require 'package)\n    (add-to-list 'package-archives '(\"gnu\" . \"http://elpa.gnu.org/packages/\"))\n    (add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))\n    (add-to-list 'package-archives '(\"marmelade\" . \"http://marmalade-repo.org/packages/\"))\n    (package-initialize)\n    (let ((need-refresh nil))\n      (mapc (lambda (package-name)\n          (unless (package-installed-p package-name)\n        (set 'need-refresh t))) wanted-packages)\n      (if need-refresh\n        (package-refresh-contents)))\n    (mapc (lambda (package-name)\n        (unless (package-installed-p package-name)\n          (package-install package-name))) wanted-packages)\n    )\n   ;; el-get\n   ((string= pmoc \"el-get\")\n    (add-to-list 'load-path \"~/.emacs.d/el-get/el-get\")\n    (unless (require 'el-get nil 'noerror)\n      (with-current-buffer\n      (url-retrieve-synchronously\n       \"https://raw.github.com/dimitri/el-get/master/el-get-install.el\")\n    (let (el-get-master-branch)\n      (goto-char (point-max))\n      (eval-print-last-sexp))))\n    (el-get 'sync wanted-packages))\n   ;; fallback\n   (t (error \"Unsupported package manager\")))\n  )\n\n;; Install wanted packages\n(install-wanted-packages)\n#+END_SRC\n\nNote that some of the following package names could vary if you use /package.el/ or /el-get/.\n\n*** The modern and efficient way\n\nSome upper-level packages make package management easier and cleaner.\n\nFor example, John Wiegley's =use-package= software is an elegant and efficient way to install and tidy your external packages configurations.\n\nHere is the way to use it:\n\nFirst, setup packages sources and install =use-package=\n\n#+BEGIN_SRC lisp\n(require 'package)\n(setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\")\n                         (\"marmalade\" . \"http://marmalade-repo.org/packages/\")\n                         (\"melpa\" . \"http://melpa.org/packages/\")))\n(package-initialize)\n\n(unless (package-installed-p 'use-package)\n  (progn\n    (package-refresh-contents)\n    (package-install 'use-package)))\n\n(require 'use-package)\n#+END_SRC\n\nThen, for each package you want to install, simply add this to your configuration (replace /the-package-name/ by any package name):\n\n#+BEGIN_SRC LISP\n(use-package the-package-name\n         :ensure the-package-name\n         :init (progn\n                  ;; Do something after the package is initialized\n                ))\n#+END_SRC\n\n** Some useful packages\n\nAs a developer, you will need some packages that will help you to work, increase your productivity and enhance your confort while coding.\nPlease note that even if I am a Ruby/shell/Lisp/web/PHP developer, some packages are compatible and useful for every kind of development. Therefore, the base packages are listed here but some specific packages that might be useful for your work are eventually not listed here. It is up to you to adapt the list according to your needs!\n\nTip: After adding packages, restart Emacs in order to let /el-get/ download and install it properly.\n\n*** Auto complete\n\nAuto completion is a must-have feature in the development world.\nThis package simply displays a popup at the cursor position with the available completions.\n\nTo install it, add =auto-complete= to your packages list.\n\n[[http://www.emacswiki.org/emacs/AutoComplete][Read more]]\n\n[[../images/mode-autocomplete.gif]]\n\n*** Autopair\n\nWhen you open a quote/parenthese/bracket/curly bracket, this mode automatically adds the closed one and bring your cusror between the two.\nVery useful to avoid syntax errors, for example.\n\nTo install it, add =autopair= to your packages list.\n\n[[https://github.com/capitaomorte/autopair][Read more]]\n\n[[../images/mode-autopair.gif]]\n\n*** Buffer move\n\nThis mode allows you to re-organize and move the buffers from a window to another.\nUseful if you want to switch buffer places in order to have your debugging buffer on the right side, for example.\n\nTo install it, add =buffer-move= to your packages list.\n\n[[http://www.emacswiki.org/cgi-bin/wiki/buffer-move.el][Read more]]\n\n[[../images/mode-buffermove.gif]]\n\n*** Flycheck\n\nThis mode check the syntax of a buffer. It could be used for checking code syntax or typos when writing any kind of text.\n\nTo install it, add =flycheck= to your packages list.\n\n[[https://github.com/flycheck/flycheck][Read more]]\n\n*** Highlight symbol\n\nThis mode highlights all symbols that matches a pattern in your buffer\n\nTo install it, add =highlight-symbol= to your packages list.\n\n[[http://www.emacswiki.org/emacs/HighlightSymbol][Read more]]\n\n*** Ido\n\nIdo is a must have mode to navigate, find stuffs, and do things interactively.\nIt is for comfort, but is indispensable to go fast.\n\nMany extensions of this mode are available, therefore read and chose what you want.\n\nI personnaly use two of them: /vertical/ and /hack/.\n\nTo install it, add =ido-hacks= and =ido-vertical-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/InteractivelyDoThings][Read more]]\n\n[[../images/mode-ido.gif]]\n\n*** JS3\n\nThis mode is an enhanced mode for editing Javascript files. I do not use it a lot, but it is useful for some javascript-like or NPM files.\n\nTo install it, add =js3-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/Js2Mode][Read more]]\n\n*** Magit\n\nMagit is a very powerful and elegant mode for intercating with your git repository.\nIn order to understand how powerful it is, simply watch this amazing [[http://vimeo.com/2871241][video]]\n\nTo install it, add =magit= to your packages list.\n\n[[https://github.com/magit/magit][Read more]]\n\n*** Multiple cursors\n\nThis mode is great and super powerful. Instead of explaining what it is, check this amazing [[http://emacsrocks.com/e13.html][video]] by Magnars.\n\nTo install it, add =multiple-cursors= to your packages list.\n\n[[https://github.com/magnars/multiple-cursors.el][Read more]]\n\n*** PHP mode\n\nA basic but stable mode for editing PHP files, whatever you think about PHP ...\n\nTo install it, add =php-mode= to your packages list.\n\n[[http://php-mode.sourceforge.net/][Read more]]\n\n*** Rainbow mode\n\nA useless but indispensable mode to add colors to your CSS files when using properties like \"color\", \"background-color\".\nIt is cool since it understands every way to write a color (hex, name, ...) and gives you a preview of the color itself.\n\nTo install it, add =rainbow-mode= to your packages list.\n\n[[http://julien.danjou.info/projects/emacs-packages][Read more]]\n\n*** RHTML mode\n\nThis mode is useful for editing .rhtml files. You can also use it to edit any kinf of ruby templates (i.e .erb).\n\nTo install it, add =rhtml-mode= to your packages list.\n\n[[https://github.com/eschulte/rhtml][Read more]]\n\n*** Ruby mode\n\nDo I really need to explain ?\n\nRuby mode is already installed in Emacs and is very stable.\n\n[[http://www.emacswiki.org/emacs/RubyMode][Read more]]\n\n*** Switch window\n\nThis mode is cool when you work with a lot of windows opened.\nIf you want to switch to another one, you have to press *C-x o* until you reach the wanted window.\nWith this mode, when you press *C-x o*, big numbers replace your opened windows. Simply type the corresponding number to reach the wanted window.\n\nTo install it, add =switch-window= to your packages list.\n\nThen do not forget to override the defaut configuration by adding this to your configuration:\n\n#+BEGIN_SRC lisp\n(global-set-key (kbd \"C-x o\") 'switch-window)\n#+END_SRC\n\n[[https://github.com/dimitri/switch-window][Read more]]\n\n[[../images/mode-switchwindow.gif]]\n\n*** Visual regexp\n\nThis mode highlights the text that matches the regexp that you are writing in the mini buffer.\n\nTo install it, add =visual-regexp= to your packages list.\n\n[[https://github.com/benma/visual-regexp.el][Read more]]\n\n*** Yaml mode\n\nAlows you to edit .yml files\n\nTo install it, add =yaml-mode= to your packages list.\n\n[[http://www.emacswiki.org/emacs/YamlMode][Read more]]\n\n*** Yasnippet\n\nA mode that allows you to write code faster if you are lazy.\nIt is very easy to create your own snippets and use it whatever the file you are editing (code, non-code, emails, ...)\n\nI personnaly do not use it, but people coming from Textmate/Sublime would love it.\n\nTo install it, add =yasnippet= to your packages list.\n\n[[http://www.emacswiki.org/emacs/Yasnippet][Read more]]\n\n*** Paredit\n\nParedit is a really cool mode to \"keep parentheses balanced\" and navigating in the S-expressions. Useful and indispensable if you write Lisp code, for example.\n\nTo install it, add =paredit= to your packages list.\n\n[[http://www.emacswiki.org/emacs/ParEdit][Read more]]\n\n** Code navigation\n\nNavigate through source code is an indispensable feature in code editors. Some of other editors are focused on this (like Sublime) but the problem is that they do not leave you the choices of the weapons (like every other features).\n\nEmacs, as you noticed (yes, you did) can integrate any external tool or include a large variety of internal tools to make it more efficient. Code navigation is not an exception.\n\nThere are a lot of packages in order to navigate through code, with different methodologies and advantages:\n\n- [[http://www.emacswiki.org/emacs/EmacsTags][TAGS]] (built in. No installation required)\n- [[https://github.com/bbatsov/projectile][Projectile]] (install it by adding =projectile= to your packages list)\n- [[https://github.com/emacs-helm/helm][Helm]] (install it by adding =heml= to your packages list)\n- [[http://cedet.sourceforge.net/][Emacs CEDET]] (install it by adding =cedet= to your packages list)\n- ...\n\n(Note: use once at a time! You do not need to install them all)\n\nAfter using /Projectile/ for a certain period of time, I gave /Helm/ a shot but finally got back to the simplicity and the efficiency of the /TAGS/ system.\nNevertheless, /Projectile/ and /Helm/ are really powerful and useful. You really should look at them.\n\nFor now, I will cover the basics of /TAGS/ since it is a standard (used by other softwares) and it is built-in (so if you use another Emacs without your config, you still know how to surf in the code). And other useful tricks will be shown here.\n\n*** Tags basics\n\nBasically, the TAGS rely on an index file of the content of your code source.\nIn the root folder of a project, you must generate your index.\nSeveral methods for this, but here is one command that generates the file:\n\n#+begin_src sh\ncd /path/to/your/project\nfind . -regex \".*\\.\\(c\\|h\\|rb\\|py\\|php\\|js\\|sh\\|bash\\)\" -print | xargs etags -a\n#+end_src\n\nYou now should see a \"TAGS\" file. If needed, exclude this file from your git/svn/whatever repository/.\n\nYou are now ready to surf!\n\nNow, here are the main commands to use them:\n\n- *M-.* is the equivalent of *M-x find-tag*: find a tag\n- *M-x find-tag-other-window*: find a tag, but in another window\n- *M-x tags-search*: find a tag thanks to a regexp\n- *M-x tags-query-replace*: replace a tag in all the indexed files\n- *M-x tags-apropos*: list all tags that match a regexp\n- *M-x list-tags*: list all tags in a file\n\n*** List functions or methods\n\nIn order to list and jump easily between the functions or methods of the current file, here is a little trick:\n\n#+begin_src emacs-lisp\n(global-set-key (kbd \"C-S-f\") 'imenu) ;; use iMenu\n#+end_src\n\nAfter pressing Ctrl-Shift-f (replace it by whatever you want!), a menu with all the available resources appears in the minibuffer.\nSelect the resource you want (let's say /All.methods/ if you are editing some code) and you will be able to search and jump to a method definition directly.\n\n*** Files navigation (a.k.a fuzzy matching) with TAGS and ido\n\nIn order to find and jump easily to a file in your project thanks to TAGS, you have to add a little function to your confiugration.\nFor this you should have installed the =ido-mode= described above.\n\n#+begin_src emacs-lisp\n(defun ido-find-file-in-tag-files ()\n  (interactive)\n  (save-excursion\n    (let ((enable-recursive-minibuffers t))\n      (visit-tags-table-buffer))\n    (find-file\n     (expand-file-name\n      (ido-completing-read\n       \"Project file: \" (tags-table-files) nil t)))))\n\n(global-set-key (kbd \"C-S-x C-S-f\") 'ido-find-file-in-tag-files)\n#+end_src\n\nNow, in your project folder and once you generated your TAGS file, you can press *C-S-x C-S-f* to find files through the whole tree of directories just by typing a pattern.\n\n[[../images/fuzzy.gif]]\n\n*** RGrep\n\n/rgrep/ is a great tool to use in addition of the TAGS. It is a Unix tool that make /grep/ queries recursively. In Emacs, it will bring you a new buffer with all the results of the command. To use it, simply type:\n\n*M-x rgrep RET yoursearchterm RET*\n\nOnce fired, you can swith to the newly created buffer, parse the results and jump to the wanted files very quickly.\n\nWhat is cool is that it is integrated in the editor, just beside your code and does not require to switch to a shell and then copy-paste the files path you want.\n\n[[../images/rgrep.gif]]\n\n\n** Setting a color theme\n\nNow, we are talking about something very touchy and that can be a long quest ...\n\nA color theme generally includes colors for:\n\n- background\n- syntax color (for code)\n- specific modes colors (gnus, dired, git, ...)\n\nThere are several ways to install a color theme, but first, we will use the Emacs' internal color-theme library.\n\nLet's try to switch between different themes:\n\n- Type *M-x load-theme RET tango-dark*\n- Then type *M-x load-theme RET wombat*\n- Finally type *M-x load-theme RET whiteboard*\n\nThere is no secret or perfect color theme. There are so many of theme and each user has its preferences in term of colors.\n\n#+CAPTION: color themes\n[[../images/colors.gif]]\n\nIn order to choose yours, try the default ones, see this [[http://gnuemacscolorthemetest.googlecode.com/svn/html/index-el.html][showcase]], make your own or google a lot !\n\n*** Font settings\n\nAfter setting up your theme, there are some other tweaks that are \"color theme related\".\nFonts is something very important depending on your system, your screen size, your current task in Emacs, ... etc\n\nIf you want to change the font directly from your current Emacs instance, simply type *M-x set-frame-font RET*.\nAnd if you want to see all supported fonts, type *TAB* twice. It will show you a list.\n\nThe global and easy way to do it is to add a line to your configuration:\n\n#+BEGIN_SRC lisp\n(set-default-font \"DejaVu Sans Mono-10\")\n#+END_SRC\n\nBut to be safe, you'd better add this into your X resource settings file (~/.Xresources):\n\n#+BEGIN_SRC lisp\nemacs.font: DejaVu Sans Mono-10\n#+END_SRC\n\nOf course, it is possible to set a different font for any system or mode you want. It is cool since you can use different font (size) if you are on Linux or mac OR if you write a book, write code, read your emails, ... etc.\nAs an exercise, I'll let you search how to do this kind of stuff in Emacs Lisp if you need it.\n\nIf you want more about font settings and especially about font names, please see the [[http://www.emacswiki.org/emacs/SetFonts][Emacs wiki page]] or the [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html][manual]].\n\nA last point: sometimes you want to change the font size of your current buffer. To do this, simply type:\n\n- *M-x text-scale-increase* or *C-x C-+*\n- *M-x text-scale-decrease* or *C-x C--* (Ctrl x, Ctrl dash)\n\nReally handy if you show your screen through an external display or you want to focus on a specific part of a file.\n\n* Emacs for developers - Emacs developing environments\n\nEmacs, thanks to major or minor modes can be transformed into a powerful specific environment.\n\nAccording to the kind of files you are editing (or a command you type), it can mutate and give you specific features that fits the need of a programming language (or a task like debugging, launching unit tests, ...)\n\n** Emacs for Ruby developers\n\nThere are many ruby developer who decribe their set up around the web. Here are the most popular:\n\n- [[http://devblog.avdi.org/category/emacs-reboot/][The Emacs reboot serie, by Avdi Grimm]] (Avdi is a famous ruby programmer and a great Emacs hacker)\n- [[http://crypt.codemancers.com/posts/2013-09-26-setting-up-emacs-as-development-environment-on-osx/][Setting up Emacs as Ruby development environment on OSX]] (even if it is for OSX, the packages remain the same on all OSes)\n- [[http://lorefnon.me/2014/02/02/configuring-emacs-for-rails.html][Configuring Emacs as a productive development environment for Rails development]]\n- [[http://www.emacswiki.org/emacs/RubyOnRails][The EmacsWiki on Ruby and RoR]]\n\n** Emacs for Python developers\n\nHere are some resources about setting Emacs for developing in python:\n\n- [[http://caisah.info/emacs-for-python/][Emacs for python - on caisah.info]]\n- [[http://www.emacswiki.org/emacs/PythonProgrammingInEmacs][Python programming in Emacs - on the EmacsWiki]]\n\n** Emacs for C/C++/Objective-C\n\nC languages are very well handled by Emacs and it allows you to edit, debug and run programs with Emacs very easily, with all the control you want.\n\n- [[http://tuhdo.github.io/c-ide.html][C/C++ Development Environment for Emacs]] is a very complete article about this\n- [[http://stackoverflow.com/questions/5800317/emacs-as-a-c-programming-ide-configuration][A various tips and packages for C language(s)]] on StackOverflow\n- [[http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/][Setting up perfect environment for C/C++ Programming]] (according to its auhor. Good resource, though)\n- [[http://www.emacswiki.org/emacs/DebuggingWithEmacs][Debugging with Emacs]]\n- [[http://cedet.sourceforge.net/][CEDET - Collection of Emacs Development Environment Tools]] An amazing collection of tools for developping in many programming languages, especially for C/C++\n- [[http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html][How to configure CEDET]]\n\n** Emacs for Go developers\n\n- If you develop in Go, you really should refer to the great [[http://yousefourabi.com/blog/2014/05/emacs-for-go/][Emacs for Go]] article, written by Yousef Ourabi.\n- Another one, with videos, is written by Dominik Honnef: [[http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/][Writing Go in Emacs]]\n\n** Emacs for PHP developers\n\nPHP, along with all the web technologies (HTML/JS/CSS) are very well supported in Emacs. The PHP mode does almost all the job by itself.\n\n- [[http://www.emacswiki.org/emacs/PhpMode][The EmacsWiki page about php-mode and other assicated packages]]\n- [[http://stackoverflow.com/questions/912671/what-is-a-good-setup-for-editing-php-in-emacs][A list of useful packages for PHP - on StackOverflow]]\n- [[https://drupal.org/node/59868][An example setup for working on Drupal]] (but can be used for PHP in general)\n- [[https://code.google.com/p/geben-on-emacs/][GEBEN - remote debugging environment for Emacs]]\n- [[http://web-mode.org/][Web Mode - focused on web templates (HTML/JS/CSS)]]\n\n** Emacs for Java developers\n\nJava development is held by Eclipse. But it is not the only editor/environment that allows you to develop in Java !\n\n- [[http://jdee.sourceforge.net/][JDEE - the Java Development Environment for Emacs]]\n- [[http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment][The EmacsWiki article on JDEE]]\n- [[http:][A video demo of a full Java environment on Emacs]]\n\n** Emacs for R and statistics\n\nEmacs is very useful for scientists and people dealing with data. Statistics, analysis, plotting, ... everything can be done within Emacs.\n\n- [[https://github.com/vikasrawal/orgpaper/blob/master/orgpapers.org][An amazing paper on working with Emacs, OrgMode and R]]\n- [[http://ess.r-project.org/][Emacs Speaks Statistics]] is a great project that adds a full statistics environment to your Emacs\n- [[http://stats.blogoverflow.com/2011/08/using-emacs-to-work-with-r/][A tutorial on using ESS]]\n\n* Special features\n\n** Emacs as a file manager\n\nEmacs has a built-in mode named /dired/ that allows you to manage your file system directly in Emacs really easily.\nIt is very powerful and has features that graphical file managers do not have.\n\nFirst of all, to launch it, type:\n\n- *M-x dired RET* and then select a path to open (default is the directory of the file you are editing)\n- or *C-x d* if you prefer keybindings\n\nHere are a few quick shortcuts once you are in /dired mode/\n\n- *R* (capital R): rename a file\n- *D* (capital D): delete a file\n- *+*: create a new directory\n- *Z*: compress the file\n- *RET* (enter): Open the file\n- *g*: refresh\n- *q*: close the dired window\n\nOf course, files can be marked to operate on a selection of them. Use *m* to mark, *u* to unmark (*U* to unmark all), *% m* to mark according to a pattern.\n\nNote that there are so many tricks, extensions and features in /dired mode/ that I let you see around what you need.\n\n[[http://www.emacswiki.org/emacs/DiredMode][Read more about Dired]]\n\n[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Read the manual]]\n\n** Working locally vs remotely\n\nEmacs, once installed on your machine will allow you to edit your file locally, obviously.\n\nOther people (non-Emacs users) will do a dirty trick to edit remote files like they were local files. They will mount the remote directory on their machine (thanks to /sshfs/).\nBut the magic in Emacs is that you can transparently edit remote files on your development servers for example.\nTo do so, Emacs comes with a genious extension named \"Tramp\". It is alreay installed and available when you install Emacs.\n\nIf you press *C-x C-f*, you can open a file. But if you ask =myname@myserver.com:/path/to/file=, it will automatically connect to the server and let you edit the remote file. Easy as pie.\n/Tramp/ supports lots of protocols like ssh, ftp, and so on.\n\nAnd what is great is that if you are editing a remote file and you launch a shell in Emacs, it will automatically set the shell into your remote environment and open it as if you were in the remote directory the file is in.\n\nA last tip about TRAMP. If you simply add =sudo:= in front of your file path, you edit your file with higher privileges. It is a very useful feature if you need to edit your configuration files on a server, for example. Of course, it works remotely and locally.\n\n[[http://www.emacswiki.org/emacs/TrampMode][Read more about Tramp]]\n\n** Organize your work, write papers and manage your agenda\n\nIn Emacs, you can do everything. This is a fact.\n\nOne the most amazing and complete mode is the amazing [[http://orgmode.org][Org mode]], written by amazing people.\nBut when I say amazing, it is absolutly amazing. It allows you to \"live in Emacs\".\n\nHere a a few of its am... features:\n\n- A full agenda / calendar\n- TODO lists and project management\n- Writing (research papers, books, an \"Emacs for developers\" whitepaper, your shopping list ...)\n- Include code in you papers\n- Tables and spreadsheets (with formulas and calculation)\n- Mobile integration\n- ...\n\nAnd what is really cool is that every thing you do in Org is exportable in:\n\n- PDF\n- LaTex\n- HTML\n- Text\n- ODT\n- iCalendar\n- TextInfo\n- ... and many more.\n\nYou really should check their [[http://orgmode.org/features.html][list of features]]\n\nIf you want to see a good example of Org-mode capabilities, check [[http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html][that great page]]\n\n** Emails in Emacs\n\nThere are packages that let you use Emacs as a full featured MUA.\nReading emails, sending emails, filtering, archiving ... etc.\n\nEmacs can be a very powerful and fast e-mail client and as it is controlled by the keyboard, it could be more efficient than a graphical e-mail client (clicking is a loss of time).\nI use it for years now and I can not imagine using another program to read my emails.\n\nThere are several package to do so, but the most used is [[http://www.gnus.org/][Gnus]]. It is already installed with Emacs.\n\nHere are some of its features beside the basic ones:\n\n- Gnus is in fact a newsreader used to interact with email servers. So you can use to fetch messages from newsgroups, RSS, SMTP, POP, ...\n- Easy and powerful mail splitting\n- Integration with BBDB, a contact manager\n- Message scoring\n- LDAP\n- PGP signing and encrypting\n- Customizable layout\n- Encrypted file to manage your credentials\n- ... and many more\n- ... and of course, it is extensible thanks to Lisp\n\nYou really should try it with your personnal account. It is easy to configure and integrate with [[http://www.emacswiki.org/emacs/GnusGmail][Gmail]], for example.\n\nBut be careful! If you try it, you will love it.\n\nSome alternatives to Gnus (that I do not use, but that are popular):\n- [[http://www.emacswiki.org/emacs/WanderLust][Wanderlust]]\n- [[http://www.djcbsoftware.nl/code/mu/mu4e.html][Mu4e]]\n\n** Some great Emacs tips and tricks\n\n- Emacs is all about Macros. This is one of its most powerful feature. Record a sequence and re-play it on other lines! Here is [[http://www.thegeekstuff.com/2010/07/emacs-macro-tutorial-how-to-record-and-play/][how]].\n- Using [[http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/][shell]] inside Emacs is cool\n- You really should use the /[[http://www.emacswiki.org/emacs/BookMarks][bookmarks]]/ functionnality to save your projects locations (locally or remotely)\n- When opening a file, add /sudo:/ in front of its path in order to edit it as a privileged user\n- You can edit files in hexadecimal directly in Emacs thanks to the /hexl-mode/\n- Emacs allows you to open an archive (gz, bz2, zip, ...), edit its files on-the-fly without extracting yourself the archive. To do so, simple open the file directly in Emacs (*C-x C-f* /path/to/archive.tar.bz2)\n- [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html][Rectangle regions]] edition is really easy\n- [[http://www.cs.bu.edu/teaching/tool/emacs/programming/#compile][Compilation]] and [[http://www.cs.bu.edu/teaching/tool/emacs/programming/#gdb][debugging]] is really well supported in Emacs\n- [[http://www.emacswiki.org/ERC][Erc]] is a great IRC client running in Emacs\n\n/To be continued/\n\n** Coming from other editors (i.e Vim)\n\nSome people use other editors and want to give Emacs a try.\nSome people are really used to use a specific editor.\nSome people do not want to lose their habits and their learning curve.\n\nI am thinking about Vim, but it is also true for other editors (textmate, sublime, ...)\n\nEmacs has a mode that allows you to use it exactly like Vim.\n\nI personnaly never used this mode, but many people use it. Therefore, it allows you to switch gently and softly from Vim to Emacs.\n\n[[http://www.emacswiki.org/emacs/Evil][Read more about Evil-mode]]\n\n* Readings and resources\n\n- [[http://emacsrocks.com/][Emacs rocks videos]]\n- [[http://devblog.avdi.org/category/emacs-reboot/][Avdi Grimm Emacs reboot series]]\n- [[http://www.masteringemacs.org/][Mastering Emacs]]\n- [[http://sachachua.com/blog/category/geek/emacs/][Sacha's blog]] and her wonderful Emacs contributors interviews serie\n- [[http://emacsredux.com][Emacs redux]] by Bozhidar Batsov\n- [[http://planet.emacsen.org/][Planet Emacsen]]\n- [[http://reddit.com/r/emacs][Emacs sub-reddit]]\n\nAnd of course, the [[http://www.emacswiki.org/][Emacs wiki]]\n\n* License\n\nThe content of this project itself is licensed under the [[http://creativecommons.org/licenses/by/3.0/us/deed.en_US][Creative Commons Attribution 3.0 license]], and the underlying source code used to format and display that content is licensed under the [[http://opensource.org/licenses/mit-license.php][MIT license]].\n\nContributors list can be found [[https://github.com/pierre-lecocq/emacs4developers/network/members][here]].\n\n* Thanks\n\nI want to thank some of the great people who make Emacs a very intersting piece of software or make its community very active (the sort order is absolutly not important here):\n\nBastien Guerry, Dimitri Fontaine, Julien Danjou, Sacha Chua, Steve Purcell, Nic Ferrier, Avdi Grimm, Magnars, Steve Yegge, Bozhidar Batsov, Xah Lee, and many more ...\n\nYou should check those people and their work over the web, twitter, youtube, ...\n\nAnd thank you for reading this !\n"
  }
]