summaryrefslogtreecommitdiffstats
path: root/articles/emacs.org
blob: f76a51acd364e1529116f0309ce2c16e9bf59c54 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#+TITLE: Emacs
#+STYLE: <link rel="stylesheet" type="text/css" href="../../stylesheet.css" />
#+LINK_UP: ../index.html
#+LINK_HOME: ../index.html
#+OPTIONS: H:5

* General Emacs Tips

  Tips might be the wrong word here, but the way I use Emacs has
  resulted into looking at some things that others might not think of
  or see.

** Emacs Init File

   Your Emacs init file can be any of the following:

   - ~$HOME/.emacs~
   - ~$HOME/.emacs.el~
   - ~$HOME/.emacs.d/init.el~

   I personally use ~$HOME/.emacs.d/init.el~ because that way I can
   keep *everything* Emacs related in a single directory
   (~$HOME/.emacs.d~).

** Displaying time

   I've seriously minimized the use of my window manager's task
   bar. It only shows which tags there are, some important daemons'
   status (running or not) and whether or not I have mail. This makes
   it difficult to tell time when I need it. That why it's useful to
   see what time it is in Emacs, since that is on 99.99% of the time
   I'm behind my computer, and it's very easy:

   #+BEGIN_SRC emacs-lisp
     (display-time-mode t)
   #+END_SRC

   That is all. When you have that in your [[Emacs Init File]], you will
   always have the time in your modeline.

** Automatically compile startup files

   I know that for 99% of the things you might have in your having a
   compiled init files won't make much of a difference, but still I
   like having my init files compiled. This gets messy when you share
   your init files across multiple PCs and the source files become
   newer than the compiled ones.

   To fix this I've put only a very little bit of code in my actual
   [[Emacs Init File]]:

   #+BEGIN_SRC emacs-lisp
     (require 'bytecomp)

     (defvar startup-files
       (directory-files "~/.emacs.d/startup/" t "^[^.].*\\.el$")
       "A list of the files that should be loaded during startup.")

     (while startup-files
       (let ((filename (car startup-files))
             (byte-compile-warnings nil))
         (if (not (eq (byte-recompile-file filename nil 0) nil))
             (load (substring filename 0 -3))))
       (setq startup-files (cdr startup-files)))
   #+END_SRC

   It gets all the files in the ~$HOME/.emacs.d/startup/~ directory
   that end with ~.el~. It loops through all these files and compiles
   them, and then loads them. I use ~byte-recompile-file~ instead of
   ~byte-recompile-directory~ because the directory one didn't work
   quite right. It doesn't recompile anything if the source file is
   still up to date, so it only slows down when you have a lot of new
   files in the ~startup~ directory.  It also disables warnings so
   that you're not bothered by them during startup.

* Emacs as...

  There are *many* things Emacs[fn:emacs] is useful for, not just
  coding and writing, but certainly very much for these uses as well.

** ... An IDE...

   Emacs features many modes for a lot of different languages.

# *** ... For PHP

#     Coming soon...

# *** ... For Python

#     Coming soon...

# **** ... With django

#      Coming soon...

# *** ... For C

#     Coming soon...

# *** ... For Java on Android

#     Coming soon...

# *** ... For Go

#     Coming soon...

# *** ... For Guile (Scheme)

#     Coming soon...

# ** ... A web authoring tool

#    Coming soon...

# ** ... An organizational tool

#    Coming soon...

# ** ... A social network interface

#    Coming soon...

# ** ... A notifier

#    Coming soon...