summaryrefslogtreecommitdiff
path: root/README.org
blob: e4f1c2a9e93a471a046269befa1255489a478563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
* Restart Emacs

** Table of contents                                              :TOC_3_gh:
 - [[#restart-emacs][Restart Emacs]]
   - [[#what-is-this][What is this?]]
   - [[#installation][Installation]]
     - [[#elpa][ELPA]]
     - [[#el-get][El-get]]
   - [[#usage][Usage]]
   - [[#compatibility][Compatibility]]
     - [[#restarting-gui-emacs][Restarting GUI Emacs]]
     - [[#restarting-emacs-running-in-a-terminal][Restarting Emacs running in a terminal]]

** What is this?
   This is a simple package to restart Emacs for within Emacs. Inspired by [[http://emacs.stackexchange.com/questions/5428/restart-emacs-from-within-emacs][this]]
   stackoverflow question.

** Installation
*** ELPA
    ~restart-emacs~ is available on [[http://melpa.org/#/restart-emacs][MELPA]] and [[http://stable.melpa.org/#/restart-emacs][MELPA Stable]]. Please follow the instructions on
    MELPA [[http://melpa.org/#/getting-started][website]] to enable it, if you haven't already.

    You can then install ~restart-emacs~ from the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html][package menu]]. Alternatively install it by doing the following

    Refresh the package index
    #+BEGIN_QUOTE
    M-x package-refresh-contents RET
    #+END_QUOTE

    And then install it by doing
    #+BEGIN_QUOTE
    M-x package-install RET restart-emacs
    #+END_QUOTE

*** El-get
    ~restart-emacs~ can also be installed using ~el-get~. Assuming you have latest version of el-get installing it by doing something similar to
    #+BEGIN_QUOTE
    M-x el-get-install RET restart-emacs
    #+END_QUOTE

** Usage
   It offers only one command ~restart-emacs~ which kills current Emacs session
   and starts a new session.

   Additional arguments to be passed to the new instance can be specified using
   prefix arguments

   - with a single ~universal-argument~ (=C-u=) Emacs is restarted with ~--debug-init~ flag
   - with two ~universal-argument~ (=C-u= =C-u=) Emacs is restarted with ~-Q~ flag
   - with three ~universal-argument~ (=C-u= =C-u= =C-u=) the user is prompted for the arguments

** Compatibility
*** Restarting GUI Emacs
    Restarting graphical Emacs should work on any UNIXy system with ~sh~ and on
    Windows.

*** Restarting Emacs running in a terminal
    This requires that the shell from which Emacs was launched supports job
    control.  This has been tested to work on ~sh~, ~bash~, ~zsh~, ~fish~, ~csh~
    and ~tcsh~, however this does not work on Windows.