-
Notifications
You must be signed in to change notification settings - Fork 139
/
setup-emacs-windows.html
392 lines (342 loc) · 11.9 KB
/
setup-emacs-windows.html
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2016-07-26 Tue 20:25 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Setup Emacs with PDF Tools and Xwidgets web browser on Windows</title>
<meta name="generator" content="Org-mode" />
<meta name="author" content="Tu Do" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-java:before { content: 'Java'; }
pre.src-sql:before { content: 'SQL'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
/*]]>*/-->
</style>
<link rel="stylesheet" href="./static/worg.css">
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="preamble" class="status">
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=9874755;
var sc_invisible=1;
var sc_security="c2028bb7";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" + scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="hit counter"
href="http://statcounter.com/free-hit-counter/" target="_blank"><img
class="statcounter" src="http://c.statcounter.com/9874755/0/c2028bb7/1/"
alt="hit counter"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
<h2><a href="index.html">Back to Table of Contents</a></h2>
</div>
<div id="content">
<h1 class="title">Setup Emacs with PDF Tools and Xwidgets web browser on Windows</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgheadline1">Prerequisite</a></li>
<li><a href="#orgheadline2">With PDF reader</a></li>
<li><a href="#orgheadline3">With Xwidgets browser</a></li>
</ul>
</div>
</div>
<p>
Installation instructions:
</p>
<div id="outline-container-orgheadline1" class="outline-2">
<h2 id="orgheadline1">Prerequisite</h2>
<div class="outline-text-2" id="text-orgheadline1">
<ul class="org-ul">
<li>Download <code>Cywing</code> setup from <a href="https://cygwin.com/install.html">Cygwin's Install page</a>.</li>
<li>If you want only the PDF reader, you can install the Emacs shipped by Cygwin.
However, if you also want the web browser, then you need to compile your own
Emacs 25 from source.</li>
</ul>
</div>
</div>
<div id="outline-container-orgheadline2" class="outline-2">
<h2 id="orgheadline2">With PDF reader</h2>
<div class="outline-text-2" id="text-orgheadline2">
<p>
<a href="./static/setup-emacs-windows/pdf_tools_windows_latex.gif">DEMO</a> (Notice how I press some text in PDF file and Latex buffer jumps to
corresponding automatically).
</p>
<p>
First, don’t use MELPA; you must install pdf-tools manually from this
repository. Then, you need to install Cygwin. The following dependencies are
needed:
</p>
<p>
If you don't plan to use Xwidget browser, just install Emacs from Cygwin:
</p>
<ul class="org-ul">
<li>emacs-w32 (Editors category)</li>
</ul>
<p>
Then install the tool chain for PDF Tools:
</p>
<ul class="org-ul">
<li>make (<b>Devel</b> category)</li>
<li>gcc-core (<b>Devel</b> category)</li>
<li>gcc-g++ (<b>Devel</b> category)</li>
<li>autoconf (<b>Devel</b> category)</li>
<li>automake (<b>Devel</b> category)</li>
<li>perl (<b>Perl</b> category)</li>
</ul>
<p>
Then install Poppler development library:
</p>
<ul class="org-ul">
<li>libpoppler-devel (<b>Lib</b> category)</li>
<li>libpoppler-glib-devel (<b>Lib</b> category)</li>
</ul>
<p>
Just type the dependency name above and click to choose. For example, enter
libpoppler-devel into the search box.
</p>
<p>
After all dependencies installed, clone <code>pdf-tools</code>:
</p>
<div class="org-src-container">
<pre class="src src-sh">git clone https://github.com/politza/pdf-tools
</pre>
</div>
<p>
Then, go into <code>pdf-tools</code> directory and build it:
</p>
<div class="org-src-container">
<pre class="src src-sh">make
</pre>
</div>
<p>
When the compilation is done, from your Cygwin Terminal, copy
the file <code>server/epdfinfo.exe</code> into <code>/usr/bin/</code>:
</p>
<div class="org-src-container">
<pre class="src src-sh">cp server/epdfinfo.exe /usr/bin/
</pre>
</div>
<p>
Then, also within <b>Cygwin</b>, run <b>emacs</b> command. Within Emacs, run the Emacs
command:
</p>
<ul class="org-ul">
<li><code>M-x package-install-file</code></li>
<li>Press <code>RET</code></li>
<li>Select pdf-tools-${VERSION}.tar RET (the tar file is in your repository).</li>
</ul>
<p>
Finally, run pdf-tools-install and enjoy. Here is the configuration you can put
in your init file:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #707183;">(</span>pdf-tools-install<span style="color: #707183;">)</span>
<span style="color: #707183;">(</span><span style="color: #a020f0;">setq</span> pdf-info-epdfinfo-program <span style="color: #8b2252;">"/usr/bin/epdfinfo.exe"</span><span style="color: #707183;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgheadline3" class="outline-2">
<h2 id="orgheadline3">With Xwidgets browser</h2>
<div class="outline-text-2" id="text-orgheadline3">
<p>
<a href="./static/setup-emacs-windows/emacs_xwidgets_windows.png">DEMO</a>
</p>
<p>
Development libraries for building Emacs that supports Xwidgets:
</p>
<ul class="org-ul">
<li>libgif-devel (<b>Graphics</b> category)</li>
<li>libtiff-devel (<b>Lib</b> category)</li>
<li>libjpeg-devel (<b>Devel</b> category)</li>
<li>libxpm-devel (<b>Devel</b> category)</li>
<li>libgnutls-devel (<b>Devel</b> category)</li>
<li>libpng-devel (<b>Devel</b> category)</li>
<li>libncurses-devel (<b>Lib</b> category)</li>
<li>libgtk3-drivel (<b>Lib</b> category)</li>
<li>libwebkitgtk3.0-devel (<b>Lib</b> category)</li>
</ul>
<p>
Then, install X11 server for displaying Emacs:
</p>
<ul class="org-ul">
<li>xorg-server (<b>X11</b> category)</li>
<li>xinit (<b>X11</b> category)</li>
</ul>
<p>
Then, open Cygwin terminal and compile Emacs:
</p>
<div class="org-src-container">
<pre class="src src-sh">./configure --with-xwidgets
make
make install
</pre>
</div>
<p>
Finally, set your display:
</p>
<div class="org-src-container">
<pre class="src src-sh"><span style="color: #483d8b;">echo</span> <span style="color: #8b2252;">"export DISPLAY=:0.0"</span> >> .bash_profile
</pre>
</div>
<p>
Then, from your Start Menu, open the X server:
</p>
<div class="figure">
<p><a href="static/setup-emacs-windows/xserver_example.png"><img src="static/setup-emacs-windows/xserver_example.png" alt="xserver_example.png" /></a>
</p>
</div>
<p>
Then, run your compiled Emacs 25 from Cygwin terminal:
</p>
<div class="org-src-container">
<pre class="src src-sh">emacs
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'emacs-tutor'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</body>
</html>