This source file includes following definitions.
- run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.gnu.emacs;
21
22 import java.lang.Thread;
23 import java.util.Arrays;
24
25 import android.util.Log;
26
27 public final class EmacsThread extends Thread
28 {
29 private static final String TAG = "EmacsThread";
30
31
32
33 private String extraStartupArgument;
34
35
36 private Runnable paramsClosure;
37
38
39 private String fileToOpen;
40
41 public
42 EmacsThread (EmacsService service, Runnable paramsClosure,
43 String extraStartupArgument, String fileToOpen)
44 {
45 super ("Emacs main thread");
46 this.extraStartupArgument = extraStartupArgument;
47 this.paramsClosure = paramsClosure;
48 this.fileToOpen = fileToOpen;
49 }
50
51 @Override
52 public void
53 run ()
54 {
55 String args[];
56
57 if (fileToOpen == null)
58 {
59 if (extraStartupArgument == null)
60 args = new String[] { "libandroid-emacs.so", };
61 else
62 args = new String[] { "libandroid-emacs.so",
63 extraStartupArgument, };
64 }
65 else
66 {
67 if (extraStartupArgument == null)
68 args = new String[] { "libandroid-emacs.so",
69 fileToOpen, };
70 else
71 args = new String[] { "libandroid-emacs.so",
72 extraStartupArgument,
73 fileToOpen, };
74 }
75
76 paramsClosure.run ();
77
78
79 Log.d (TAG, "run: " + Arrays.toString (args));
80 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName);
81 }
82 };