From 34bfb32ecf2cea5e5de95980beedb681139d9c01 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 10 Apr 2009 00:00:00 +0200 Subject: new minor version --- fm | 57 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 13 deletions(-) (limited to 'fm') diff --git a/fm b/fm index 7133192f..1129a9d4 100755 --- a/fm +++ b/fm @@ -1,4 +1,12 @@ -#!/usr/bin/ruby +#!/usr/bin/ruby -Ku + +# Log details +# 0 = do not log +# 1 = log fatalities +# 2 = log errors +# 3 = log everything +LOG_LEVEL = 3 +#LOG_LEVEL = 0 def File::resolve_symlink( path = __FILE__ ) path = readlink(path) while symlink?(path) @@ -11,31 +19,54 @@ end $: << FM_DIR = File::dirname(File::resolve_symlink) -require 'ftools' +PID = Process.pid + +if ARGV.size > 0 + pwd = ARGV.first + if pwd =~ /^file:\/\// + pwd = $' + end +else + pwd = nil +end + +#require 'ftools' require 'pp' +require 'thread' require_from_here 'interface/ncurses.rb' require_from_here 'code/fm.rb' require_from_here 'code/keys.rb' require_from_here 'code/types.rb' +require_from_here 'code/draw.rb' require_from_here 'code/extensions.rb' +require_from_here 'code/debug.rb' include Interface +include Debug ERROR_STREAM = File.open('/tmp/errorlog', 'a') -def log(obj) - $stdout = ERROR_STREAM - pp obj - $stdout.flush - $stdout = STDOUT - obj -end -END { +#def log(obj) +# $stdout = ERROR_STREAM +# pp caller +# pp obj +# $stdout.flush +# $stdout = STDOUT +# obj +#end + +begin + Fm.initialize( pwd ) + Fm.main_loop +ensure closei Fm.dump ERROR_STREAM.close -} -Fm.initialize -Fm.main_loop + for thr in Thread.list + unless thr == Thread.current + thr.kill + end + end +end -- cgit 1.4.1-2-gfad0 lass='right' method='get' action='/akspecs/aerc/log/Makefile'>
path: root/Makefile
blob: 0ad13e03c1995e4c73a2330e60e4b081d301f08a (plain) (blame)
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
mp;id=85fd52880db93c6cd01f2c459eb46e6dd35d777c'>85fd5288 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15