~ubuntu-branches/ubuntu/jaunty/edbrowse/jaunty-security

« back to all changes in this revision

Viewing changes to edbdoc.html

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2006-10-20 10:47:30 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061020104730-o7vxbrypwaz932dt
Tags: 3.1.2-1
* New upstream version (3.1.2). Closes: #306486.
  - programs now written in C
  - support for javascript.
* debian/control:
  - added Kapil Hari Paranjape to Uploaders.
  - Build-depends on "libssl-dev", "libmozjs-dev", "libpcre3-dev".
  - Standards-Version to 3.7.2. No changes required.
* debian/rules:
  - add "noopt" feature.
  - set CFLAGS and LIBS.
  - Put $(MAKE) into the build rules.
* debian/copyright: Edited to add the current copyright which
  is GPL with the exception for linking with OpenSSL.
* debian/docs: added "README".
* debian/examples: added "jsrt".

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
<meta name=keywords content="
6
6
text based, command line, interactive,
7
7
editor, browser, mail client,
8
 
portable, perl,
 
8
portable, C,
 
9
javascript,
 
10
secure, ssl,
9
11
blind, script, accessible">
10
12
<TITLE> edbrowse documentation </TITLE>
11
13
<LINK REL="SHORTCUT ICON" href="pc.ico">
14
16
 
15
17
<H2 align=center> edbrowse Documentation </H2>
16
18
 
17
 
<H4 align=center> Author </H4>
18
 
 
19
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>
20
 
Karl Dahlke
 
19
<H3 align=center> <A NAME=top> Contents </A> </H3>
 
20
 
 
21
<H4> Chapter 1, Preface </H4>
 
22
 
 
23
<UL>
 
24
<LI><A HREF=#auth> Author </A>
 
25
<LI><A HREF=#copy> Copyright Notice </A>
 
26
<LI><A HREF=#ack> Acknowledgements </A>
 
27
<LI><A HREF=#over> Overview </A>
 
28
</UL>
 
29
 
 
30
<H4> Chapter 2, Quick Reference Guide </H4>
 
31
 
 
32
<UL>
 
33
<LI><A HREF=#guide> Quick Reference Guide </A>
 
34
<LI><A HREF=#tips> Tips for Avoiding Line Numbers </A>
 
35
<LI><A HREF=#mlist> Mailing List </A>
 
36
</UL>
 
37
 
 
38
<H4> Chapter 3, The Editor </H4>
 
39
 
 
40
<UL>
 
41
<LI><A HREF=#dev> Important Deviations From /bin/ed </A>
 
42
<LI><A HREF=#brace> Balancing Braces </A>
 
43
<LI><A HREF=#cx> Context Switch </A>
 
44
<LI><A HREF=#usage> Usage </A>
 
45
<LI><A HREF=#bin> Binary Characters </A>
 
46
<LI><A HREF=#bfile> Binary Files </A>
 
47
<LI><A HREF=#dir> Directory Scan, File Manager </A>
 
48
<LI><A HREF=#case> Upper/Lower Case </A>
 
49
<LI><A HREF=#bl> Break Line </A>
 
50
<LI><A HREF=#race> Race Conditions </A>
 
51
</UL>
 
52
 
 
53
<H4> Chapter 4, Web Browser </H4>
 
54
 
 
55
<UL>
 
56
<LI><A HREF=#url> Accessing A URL </A>
 
57
<LI><A HREF=#browse> Browse Mode </A>
 
58
<LI><A HREF=#math> Technical, Math </A>
 
59
<LI><A HREF=#title> Title, Description, Keywords </A>
 
60
<LI><A HREF=#rf> The Refresh Command </A>
 
61
<LI><A HREF=#hlink> Hyperlinks </A>
 
62
<LI><A HREF=#ilink> Internal Links </A>
 
63
<LI><A HREF=#back> The Back Key </A>
 
64
<LI><A HREF=#move> The M Command </A>
 
65
<LI><A HREF=#music> Background Music </A>
 
66
<LI><A HREF=#input> Input Fields </A>
 
67
<LI><A HREF=#entry> Data Entry </A>
 
68
<LI><A HREF=#textarea> Text Areas </A>
 
69
<LI><A HREF=#button> Push The Button </A>
 
70
<LI><A HREF=#addr> Web And Email Addresses </A>
 
71
<LI><A HREF=#cook> Cookies </A>
 
72
<LI><A HREF=#ssl> Secure Connections </A>
 
73
<LI><A HREF=#ftp> FTP Retrievals </A>
 
74
<LI><A HREF=#frame> Frames </A>
 
75
</UL>
 
76
 
 
77
<H4> Chapter 5, Javascript </H4>
 
78
 
 
79
<UL>
 
80
<LI><A HREF=#js> Introduction to Javascript </A>
 
81
<LI><A HREF=#valid> Validating and Modifying Forms </A>
 
82
<LI><A HREF=#popup> Popups and Popunders </A>
 
83
<LI><A HREF=#onc> Onchange and Undo </A>
 
84
</UL>
 
85
 
 
86
<H4> Chapter 6, Edbrowse Scripts and the Configuration File </H4>
 
87
 
 
88
<UL>
 
89
<LI><A HREF=#cfg> The Config File </A>
 
90
<LI><A HREF=#keyval> Keyword = Value </A>
 
91
<LI><A HREF=#agent> User Agent </A>
 
92
<LI><A HREF=#script> Edbrowse Functions </A>
 
93
<LI><A HREF=#init> The Init Script </A>
 
94
<LI><A HREF=#ma> Mail Accounts </A>
 
95
<LI><A HREF=#mt> Mime Descriptors </A>
 
96
<LI><A HREF=#sampcfg> A Sample Config File </A>
 
97
</UL>
 
98
 
 
99
<H4> Chapter 7, Mail Client </H4>
 
100
 
 
101
<UL>
 
102
<LI><A HREF=#sm> Send Mail </A>
 
103
<LI><A HREF=#smc> Send Mail Client </A>
 
104
<LI><A HREF=#fmc> Fetch Mail Client </A>
 
105
<LI><A HREF=#mailfmt> Formatted Mail </A>
 
106
<LI><A HREF=#filter> Mail Filtering </A>
 
107
</UL>
 
108
 
 
109
<H3 align=center> <A NAME=auth> Author </A> </H3>
 
110
 
 
111
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>Karl Dahlke
21
112
<A HREF=mailto:karl@eklhad.net>karl@eklhad.net</A>
22
113
248-524-1004 (during regular business hours)
23
114
</font></PRE>
24
115
 
25
 
<H4 align=center> Copyright Notice </H4>
 
116
<H3 align=center> <A NAME=copy> Copyright Notice </A> </H3>
26
117
 
27
 
This program is copyright (C) (C) Karl Dahlke, 2000-2003.
28
 
It is made available, by the author, under the terms of the General Public License (GPL),
29
 
as articulated by the Free Software Foundation.
 
118
This program is copyright (C) (C) Karl Dahlke, 2000-2006.&nbsp;
 
119
It is made available by the author under the terms of the GNU General Public License (GPL),
 
120
as articulated by the Free Software Foundation.&nbsp;
30
121
It may be used for any purpose, and redistributed, provided this copyright notice is included.
31
122
 
32
 
<H4 align=center> Overview </H4>
33
 
 
34
 
This program is, at first glance, a reimplementation of /bin/ed.
 
123
<P>
 
124
As a special exception, I hereby grant permission to link
 
125
the code of this program with the OpenSSL library
 
126
(or with modified versions of OpenSSL that use the same license as OpenSSL),
 
127
and distribute linked combinations including the two.&nbsp;
 
128
You must obey the GNU General Public License in all respects
 
129
for all of the code used other than OpenSSL.&nbsp;
 
130
If you modify this program, you may extend this exception to your version of the
 
131
program, but you are not obligated to do so.&nbsp;
 
132
If you do not wish to do so, delete this exception statement from your version.
 
133
 
 
134
<H3 align=center> <A NAME=ack> Acknowledgements </A> </H3>
 
135
 
 
136
This program borrows some code and design concepts from the
 
137
<A HREF=http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/>
 
138
links project</A>,
 
139
which is also freely available under the terms of the GPL.&nbsp;
 
140
My thanks to the authors for all their hard work.
 
141
 
 
142
<P>
 
143
I would be dead in the water if it weren't for a cadres of excellent online tutorials.&nbsp;
 
144
Their technical writing puts mine to shame.&nbsp;
 
145
Please look through some of these web pages; you'll be glad you did.
 
146
 
 
147
<P>
 
148
<A HREF=http://www.mcli.dist.maricopa.edu/tut/>
 
149
Writing html
 
150
</A>
 
151
<br><A HREF=http://www.htmlcodetutorial.com>
 
152
An html Code Tutorial
 
153
</A>
 
154
<br><A HREF=http://www.htmlgoodies.com/tutors/>
 
155
So You Want to Write some html...
 
156
</A>
 
157
<br><A HREF=http://hotwired.lycos.com/webmonkey/javascript/tutorials/tutorial1.html>
 
158
Javascript for Webmasters
 
159
</A>
 
160
<br><A HREF=http://safari.oreilly.com>
 
161
Javascript, the Definitive Guide
 
162
</A>
 
163
 
 
164
<P>
 
165
This package requires Spider Monkey Javascript, released by Mozilla under the MPL.&nbsp;
 
166
You can
 
167
<A HREF=ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5.tar.gz>
 
168
download it here</A>.&nbsp;
 
169
Programmers and maintainers of this package should take advantage of the
 
170
<a href=http://developer.mozilla.org/en/docs/Category:JSAPI_Reference>
 
171
online documentation</A>.
 
172
 
 
173
<H3 align=center> <A NAME=over> Overview </A> </H3>
 
174
 
 
175
This program is, at first glance, a reimplementation of /bin/ed.&nbsp;
35
176
In fact you might issue a few ed commands and not realize that you are
36
 
actually running my perl script.
 
177
actually running my program.&nbsp;
37
178
But as you proceed
38
179
you will eventually discover some discrepancies,
39
 
areas where my program differs from ed.
40
 
These are discussed in the next section.
 
180
areas where my program differs from ed.&nbsp;
 
181
(These are discussed below.)
41
182
 
42
183
<P>
43
 
At first, reinventing ed seems a complete waste of time,
44
 
until you realize that this program also acts as a browser --
45
 
a browser embedded inside ed.
 
184
Reinventing ed <em>seems</em> like a complete waste of time,
 
185
until you realize that this program also acts as a browser -
 
186
a browser embedded inside ed.&nbsp;
46
187
You can edit a URL as easily as a local file,
47
188
and activate browse mode to render the html tags
48
 
in a manner that is appropriate for a command-response program such as this.
 
189
in a manner that is appropriate for a command-response program such as this.&nbsp;
49
190
In other words, we discard most of the formatting information
50
 
and retain the links and fill-out forms.
 
191
and retain the links and fill-out forms.&nbsp;
51
192
This allows blind  users to access the Internet
52
193
via an application that is entirely compatible with the linear nature of speech or braille.
53
194
 
54
195
<P>
55
196
I find this approach superior to the "quick fix"
56
197
of pasting an adaptor onto a preexisting screen browser (lynx)
57
 
or graphical browser (Netscape).
58
 
Of course that's just my opinion.
59
 
To be fair, many blind users, even totally blind users, are satisfied with their auditory screen scrapers.
60
 
I'm glad it works for them, but this approach frustrates the hell out of me.
 
198
or graphical browser (Netscape).&nbsp;
 
199
Of course that's just my opinion.&nbsp;
 
200
To be fair, many blind users, even totally blind users, are satisfied with their auditory screen scrapers.&nbsp;
 
201
I'm glad it works for them, but this approach frustrates the hell out of me.&nbsp;
61
202
If you also prefer linear applications,
62
203
give this browser a try.
63
204
 
64
205
<P>
65
 
This documentation assumes you are familiar with ed.
66
 
In fact it helps if you are fluent in ed.
67
 
Experience with internet browsers and the associated terminology is also valuable.
68
 
 
69
 
<H4 align=center> Important Deviations From /bin/ed </H4>
70
 
 
71
 
Certain search/substitute commands may behave differently under this editor.
72
 
This is because the regular expressions are passed
73
 
directly to perl for evaluation, hence they have more features and more power
74
 
than the regular expressions employed by /bin/ed.
75
 
The syntax is also somewhat different.
 
206
This documentation assumes you are familiar with ed.&nbsp;
 
207
In fact it helps if you are fluent in ed.&nbsp;
 
208
Experience with internet browsers and the associated terminology is also helpful.
 
209
 
 
210
<H3 align=center> <A NAME=guide> Quick Reference Guide </A> </H3>
 
211
 
 
212
Here are the ed and edbrowse commands, all in one place.&nbsp;
 
213
This is a quick reference guide.&nbsp;
 
214
Most of these commands will not make sense until you read the rest of the documentation.
 
215
 
 
216
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>q: quit the current session
 
217
qt: quit the program completely, whether you've written your files or not
 
218
!command: shell escape
 
219
p: print the current line
 
220
4,7p: print lines 4 through 7
 
221
'a,'bp: print a range of lines, marked with labels a and b
 
222
kb: mark the current line as b
 
223
l: list the current line, showing nonascii chars in hex
 
224
n: print the current line with its line number
 
225
=: print the number of lines in the file
 
226
z22: print the next 22 lines
 
227
s/x/y/: replace x with y on the current line
 
228
s/x/y/2: replace the second instance of x with y on the current line
 
229
4,7s/x/y/g: replace all instances of x with y, on lines 4 through 7
 
230
/x/: look for the line containing x
 
231
/x/i: look for the line containing x or X
 
232
ci: searches and substitutions are case insensitive
 
233
cs: searches and substitutions are case sensitive
 
234
sg: substitution strings are global across sessions
 
235
sl: substitution strings are local to their sessions
 
236
lc: convert line to lower case
 
237
mc: convert line to mixed case
 
238
uc: convert line to upper case
 
239
h: help, explain the last question mark
 
240
f: print the name of the current file
 
241
f foo: set the file name to foo
 
242
f/: retain only the lass component of the filename
 
243
e: print the number of the current session
 
244
e3: move to session 3
 
245
e foo: edit the file named foo
 
246
r foo: read the contents of foo into the current buffer
 
247
w foo: write the current buffer to foo
 
248
w+ foo: append to foo
 
249
w/: write to the lass component of the filename
 
250
d: delete the current line
 
251
1,$d: delete all the lines, 1 through eof
 
252
u: undo the last command
 
253
i: insert text before the current line, end with a period
 
254
c: change the current line, enter a new block of text, end with period
 
255
a: add text after the current line, end with a period
 
256
a+: include the line you just typed in, when you thought you were in append mode
 
257
4,7m11: move lines 4 through 7 to line 11
 
258
4,7t11: copy lines 4 through 7 to line 11
 
259
3,4j: join lines 3 and 4 together
 
260
3,4J: join lines 3 and 4 together with a space between
 
261
g/x/ p: print every line that has an x
 
262
v/x/ p: print every line that does not have an x
 
263
B: find the line with the balancing brace
 
264
b: brouse the current file, which is assumed to be in html
 
265
b foo.html: edit the file foo.html and browse it
 
266
b url: fetch url from the internet and browse it
 
267
ub: unbrowse a file
 
268
g: go to the link on the current line
 
269
g2: go to the second link on the current line
 
270
^: the back key, go back to the web page you were looking at before
 
271
i=xyz: set the input field on the current line to xyz
 
272
i2=xyz: set the second input field on the current line to xyz
 
273
i2*: push the second button on the current line, usually submit or reset
 
274
i3?: describe the third input field on the current line
 
275
db: set debug level [0-7]
 
276
cd: change directory
 
277
bl: break line into sentences and phrases
 
278
dr: directory is readonly
 
279
dw: directory is writable, and d moves files to your recycle bin
 
280
dx: directory is writable, and d deletes files
 
281
hf: show hidden files in directory listing (toggle)
 
282
bd: binary detection on files (toggle)
 
283
eo: end markers off
 
284
el: show end markers ^$ when a line is listed
 
285
ep: show end markers when a line is listed or printed
 
286
pb: play buffer
 
287
ft: show the title of the current web page
 
288
fd: show the description of the current web page
 
289
fk: show the keywords of the current web page
 
290
hr: http redirection (toggle)
 
291
js: allow javascript (toggle)
 
292
sr: send referrer (toggle)
 
293
tn: send dos-style newlines on lines in textareas (toggle)
 
294
fma: ftp mode active
 
295
fmp: ftp mode passive
 
296
fmd: ftp mode default, passive then active
 
297
rf: refresh the web page or directory listing
 
298
et: edit this web page as pure text
 
299
vs: verify ssl connections (toggle)
 
300
ip: show referenced ip numbers, usually for saved mail messages
 
301
sm: send mail [account number]
 
302
</font></PRE>
 
303
 
 
304
<H3 align=center> <A NAME=tips> Tips for Avoiding Line Numbers </A> </H3>
 
305
 
 
306
If you're new to ed, you may find this program awkward.&nbsp;
 
307
I often receive complaints about line numbers.&nbsp;
 
308
People hate line numbers.&nbsp;
 
309
They don't want to read the first page line by line,
 
310
1p 2p 3p 4p 5p etc.&nbsp;
 
311
Well I hate line numbers too, and I never use them.&nbsp;
 
312
Haven't for years.
 
313
 
 
314
<P>
 
315
If you just want to read the whole document, type ,p.&nbsp;
 
316
That works, if you use a command line speech adapter.&nbsp;
 
317
The whole document is in buffer, and you can read through it using the function keys on your adapter.&nbsp;
 
318
Now I realize most people still use screen readers, so this won't work.&nbsp;
 
319
Still, there's an easy way to step through screen by screen.&nbsp;
 
320
Start with 1z20 to get the first 20 lines.&nbsp;
 
321
Then the z command will give you the next 20, and the next 20, and so on.&nbsp;
 
322
You may want to use 22, or 24, or whatever makes sense relative to your screen.
 
323
 
 
324
<P>
 
325
Another approach is to simply hit return, again and again, and proceed line by line.&nbsp;
 
326
You may need to hit a function key to "read" each line,
 
327
after you hit return,
 
328
or maybe not, if your adapter has an autoread feature.
 
329
 
 
330
<P>
 
331
Once you are use to the regular expressions, you can jump to any part of the document,
 
332
even a large document, in record time simply by searching for a unique text fragment.&nbsp;
 
333
This comes with practice.&nbsp;
 
334
Sometimes I guess wrong, and my search string is not unique.&nbsp;
 
335
I wind up somewhere else and have to search again.&nbsp;
 
336
This doesn't happen very often.&nbsp;
 
337
I usually get to the right place in one or two tries.
 
338
 
 
339
<P>
 
340
If you want to mark certain lines of text, please don't try to remember the line numbers.&nbsp;
 
341
Use the k command to mark them.&nbsp;
 
342
I usually use ka and kb to mark the start and end of a block of text,
 
343
while kc marks the new location.&nbsp;
 
344
The move command is then 'a,'bm'c - with absolutely no line numbers.&nbsp;
 
345
(This is standard ed fair, though most people never take advantage of it.)
 
346
 
 
347
<P>
 
348
To look for links on a web page, search for the right brace.&nbsp;
 
349
Yes, you may stumble across a literal right brace in the text, but this doesn't happen very often.&nbsp;
 
350
You might access a particular link by typing /{Next}/g.&nbsp;
 
351
Similarly, you can look for input fields by searching for the greater than sign.&nbsp;
 
352
(This will make sense as you read about the representation of web pages.)&nbsp;
 
353
And of course, multiple operations can be scripted, a feature unique to this browser.
 
354
 
 
355
<P>
 
356
These are just some of the tips and tricks that will make you as fast and efficient as anybody using a screen editor or browser,
 
357
provided you are familiar with the page.&nbsp;
 
358
(You will never be faster than your sighted colleague when traveling through unfamiliar territory,
 
359
no matter what system you use.)&nbsp;
 
360
My wife is always amazed at how quickly I can negotiate websites,
 
361
or edit the common documents that we work on together.
 
362
 
 
363
<H3 align=center> <A NAME=mlist> Mailing List </A> </H3>
 
364
 
 
365
There is a mailing list for users of edbrowse and other command line utilities.&nbsp;
 
366
You can join by sending mail to
 
367
<A HREF=mailto:commandline-subscribe@yahoogroups.com?subject=Subscribe>
 
368
commandline-subscribe@yahoogroups.com</A>.
 
369
 
 
370
<H3 align=center> <A NAME=dev> Important Deviations From /bin/ed </A> </H3>
 
371
 
 
372
Certain search/substitute commands may behave differently under this editor.&nbsp;
 
373
This is because the regular expressions are interpreted
 
374
by the perl compatible regular expression (pcre) library,
 
375
rather than the traditional regexp library.&nbsp;
 
376
Hence regular expressions have more features, and more power,
 
377
than the regular expressions employed by /bin/ed.&nbsp;
 
378
The syntax is also somewhat different.&nbsp;
76
379
For instance, perl uses bare parentheses where ed uses escaped braces --
77
 
to delimit sections of matched text.
 
380
to delimit sections of matched text.&nbsp;
78
381
And perl uses $1 ... $9 to reference the matched substrings,
79
 
whereas ed uses \1 ... \9.
 
382
whereas ed uses \1 ... \9.&nbsp;
80
383
Also, perl supports the i suffix, for case insensitive search,
81
 
along with the traditional g (global) suffix.
82
 
There is no reason to describe all the nuances here.
 
384
along with the traditional g suffix for global substitute.&nbsp;
 
385
There is no reason to describe all the nuances here.&nbsp;
83
386
Please read the perlre man page `man perlre' for a full description
84
 
of regular expressions under perl.
85
 
Once you are accustomed to their power and flexibility
 
387
of regular expressions under perl.&nbsp;
 
388
Once you are accustomed to their power and flexibility,
86
389
you'll never go back to ed.
87
390
 
88
391
<P>
89
 
Great!  You've read the perlre man page, and you're back.
90
 
Here are a few changes that I've made to perl regular expressions.
 
392
Great!  You've read the perlre man page, and you're back.&nbsp;
 
393
Here are a few changes that I've made to perl regular expressions.&nbsp;
91
394
I have found that ( and ) are almost always meant to be literal,
92
395
as in searching for myFunction(),
93
 
so I reverse the sense of escaped parentheses in perl.
 
396
so I reverse the sense of escaped parentheses in perl.&nbsp;
94
397
That is, ( and ) now match the literal characters,
95
 
and \( and \) are used to demark substrings of the matched text.
96
 
These substrings are then referenced, in the replacement string, by $1 through $9.
97
 
Similarly, | means a literal |, and \| is alternation.
 
398
and \( and \) are used to demark substrings of the matched text.&nbsp;
 
399
These substrings are then referenced, in the replacement string, by $1 through $9.&nbsp;
 
400
Similarly, | means a literal |, and \| is alternation.&nbsp;
98
401
I also change the sense of &amp;, on the right hand side,
99
 
to mean what it means in ed.
100
 
I leave ^ $ . [ ] + * ? and {n} alone, to be interpreted by perl,
101
 
as described in the perlre man page.
102
 
My changes to regexp, to look more like ed, may be confusing
103
 
if you are a perl expert.
 
402
to mean what it means in ed.&nbsp;
 
403
I leave ^ $ . [ ] + * ? and {m,n} alone, to be interpreted by perl,
 
404
as described in the perlre man page.&nbsp;
 
405
However, if * is the first character, it is treated as a literal star.&nbsp;
 
406
This makes sense, as there is no previous character to modify.&nbsp;
 
407
Some versions of ed do this, some don't.&nbsp;
 
408
But I find it convenient; when I want to replace * + or ?, I don't have to escape it, just because it is a modifier.&nbsp;
 
409
Similarly, an open bracket by itself is treated as literal.&nbsp;
 
410
These changes to regexp, to look more like ed, may be confusing
 
411
if you are a perl expert.&nbsp;
104
412
Sorry about that, but I think these changes make this
105
 
editor much easier to use, for everyone,
106
 
especially the experienced ed users.
 
413
editor much easier to use for everyone,
 
414
especially the experienced ed users.&nbsp;
107
415
Below are some additional differences between this program and /bin/ed.
108
416
 
109
417
<UL>
110
418
<P><LI>
111
 
Lines beginning with # are ignored, making it easier to comment your edbrowse scripts.
 
419
Lines beginning with # are ignored, making it easier to comment your edbrowse scripts.&nbsp;
112
420
The # character has no special significance in the middle of a line.
113
421
 
114
422
<P><LI>
115
 
Lines beginning with ! implement a shell escape.
116
 
The ! character has no special significance in the middle of a line.
117
 
The ! alone spawns an interactive subshell - type exit to return to edbrowse.
 
423
Lines beginning with ! implement a shell escape.&nbsp;
 
424
The ! character has no special significance in the middle of a line.&nbsp;
 
425
The ! alone spawns an interactive subshell - type exit to return to edbrowse.&nbsp;
118
426
The work "ok" is printed when the shell command is finished -
119
427
thus you can tell when a no-output command is done.
120
428
 
121
429
<P><LI>
122
 
Type `cd dirname' to change directories.
123
 
The new directory is always printed.
124
 
Type cd alone to find out where you are.
 
430
Type `cd dirname' to change directories.&nbsp;
 
431
The new directory is always printed.&nbsp;
 
432
Type cd alone to find out where you are.&nbsp;
125
433
I don't know what happens under dos
126
434
if you type cd f:/this/that, I never tested it.
127
 
Type "cd -" to go back to the directory you were in before.
128
435
 
129
436
<P>
130
 
Unlike bash, edbrowse does not retrace your steps back through symbolic links.
 
437
Unlike bash, edbrowse does not retrace your steps back through symbolic links.&nbsp;
131
438
Thus .. is always the physical parent directory.
132
439
 
133
440
<P>
134
 
environment variables are expanded before the cd command is applied, including the leading ~.
 
441
environment variables are expanded before the cd command is applied, including the leading ~.&nbsp;
135
442
Thuse cd ~/work takes you to the work directory under your home directory.
136
443
 
137
444
<P>
138
 
This command does not change any filenames that may be active.
 
445
This command does not change any filenames that may be active.&nbsp;
139
446
You can edit foo, cd .., and write,
140
 
and foo will be copied to the parent directory.
 
447
and foo will be copied to the parent directory.&nbsp;
141
448
That's probably not what you want, so be careful.
142
449
 
143
450
<P><LI>
144
451
r operates on the current line by default,
145
 
rather then the last line.
 
452
rather then the last line.&nbsp;
146
453
Use $r to read a file at the end of your working text.
147
454
 
148
455
<P><LI>
149
 
The w+ command appends to the file.
 
456
The w+ command appends to the file.&nbsp;
150
457
Some versions of ed use w&gt; for this operation,
151
458
but for 40 years &gt; has been the industry standard for write with truncate,
152
 
so using &gt; for append is somewhat confusing.
 
459
so using &gt; for append is somewhat confusing.&nbsp;
153
460
And w&gt;&gt; is just too clunky, so I use w+.
154
461
 
155
462
<P><LI>
156
463
w/ writes the data into a file whose name is the last component
157
 
of the current file name.
 
464
of the current file name.&nbsp;
158
465
This is useful when you've just downloaded this.that.com/foo/bar/package-2.7.7-22.tar.gz,
159
 
and you want to write the file locally, but don't want to retype the stuff at the end.
 
466
and you want to write the file locally, but don't want to retype the stuff at the end.&nbsp;
160
467
Alternatively, f/ changes the filename, keeping only the last component.
161
468
 
162
469
<P><LI>
163
470
Whenever a file is read from or written to disk,
164
 
$var, in the filename, is replaced with the corresponding environment variable.
 
471
$var, in the filename, is replaced with the corresponding environment variable.&nbsp;
165
472
Thus you can edit your address book at any time via `e $adbook',
166
 
provided $adbook has been set in your environment.
 
473
provided $adbook has been set in your environment.&nbsp;
167
474
Also, a leading ~/ is replaced with $HOME/,
168
475
making it easy to edit files in your home directory
169
476
such as ~/.profile.
170
477
 
171
478
<P>
172
 
Shell metta characters are also expanded, provided the result is one file name.
173
 
You can read or write a file by typing a minimal portion of its name.
 
479
Shell metta characters are also expanded, provided the result is one file name.&nbsp;
 
480
You can read or write a file by typing a minimal portion of its name.&nbsp;
174
481
Neither $variables nor stars are expanded for files on the command line,
175
 
as this expansion is already done by the shell.
176
 
Of course, if you're on DOS or Windows, that expansion is not performed,
177
 
so this program performs the expansion for you.
178
 
This is an attempt to remain portable.
179
 
You should be able to edit *.c in any operating system
 
482
as this expansion is already done by the Unix shell.&nbsp;
 
483
Windows users should compile using the setargv.obj utility,
 
484
which performs wildcard expansion on command line arguments.&nbsp;
 
485
Thus you should be able to edit *.c in any operating system
180
486
and get all the C source files in the current directory.
181
487
 
182
488
<P><LI>
183
489
Many versions of ed place a $ at the end of a listed line,
184
 
but this is not one of them, at least not by default.
 
490
but this is not one of them, at least not by default.&nbsp;
185
491
I use a linear speech adapter, rather than a screen reader,
186
 
so the embedded newlines tell me exactly where the line boundaries are.
 
492
so the embedded newlines tell me exactly where the line boundaries are.&nbsp;
187
493
The extraneous $ character just gets in my way.
188
494
 
189
495
<P>
190
496
However, I realize most people still use screen readers,
191
497
where trailing whitespace is indistinguishable from the blank screen,
192
 
and a wrapped fragment is sometimes mistaken for a second line.
193
 
Therefore, you can use the command `el' to place end markers around listed lines.
194
 
Listed lines begin with ^ and end with $.
195
 
Enter `ep' to place end markers around all printed lines.
 
498
and a wrapped fragment is sometimes mistaken for a second line.&nbsp;
 
499
Therefore, you can use the command `el' to place end markers around listed lines.&nbsp;
 
500
Listed lines begin with ^ and end with $.&nbsp;
 
501
Enter `ep' to place end markers around all printed lines.&nbsp;
196
502
Use `eo' to turn end markers off.
197
503
 
198
504
<P><LI>
200
506
has never been associated with a file.
201
507
 
202
508
<P><LI>
203
 
Capital Q does not quit the editor absolutely.
 
509
Capital Q does not quit the editor absolutely.&nbsp;
204
510
This is because I often hit caps lock by mistake,
205
511
or even shift q by mistake,
206
512
and if I've forgotten about some important changes that I've made,
207
 
those changes are gone!
 
513
those changes are gone!&nbsp;
208
514
I know, this seems contrived, like it would never happen,
209
515
but it has happened to me many times,
210
 
so I disabled capital Q.
 
516
so I disabled capital Q.&nbsp;
211
517
Type qt to quit absolute.
212
518
 
213
519
<P><LI>
220
526
P (prompt) is not implemented.
221
527
 
222
528
<P><LI>
223
 
missing line numbers before or after the comma are assumed to be 1 and $.
 
529
missing line numbers before or after the comma are assumed to be 1 and $.&nbsp;
224
530
This is consistent with ,p -- to print the entire file.
225
531
 
226
532
<P><LI>
227
533
You cannot enter one command across two physical lines
228
 
by putting a backslash at the end of the first line.
229
 
And there's no need to in any case, because perl supports \n translation.
 
534
by putting a backslash at the end of the first line.&nbsp;
 
535
And there's no need to in any case, because perl supports \n translation.&nbsp;
230
536
To split a line in the middle of the word doghouse, you would type
231
537
<br>
232
538
s/doghouse/dog-\nhouse/
233
539
 
234
540
<P><LI>
235
 
Only the first 500 characters of a line are displayed.
 
541
Only the first 500 characters of a line are displayed.&nbsp;
236
542
The rest of the line is in the buffer, and can even be modified via a substitute command,
237
543
but if you want to see it, you will need to split it,
238
544
as in the doghouse example above.
242
548
when you thought you were in append mode, but you weren't.
243
549
 
244
550
<P><LI>
245
 
this program is less tolerant of whitespace than /bin/ed.
 
551
This program is less tolerant of whitespace than /bin/ed.
246
552
<br>
247
553
57 , 63 p      will not fly.
248
554
 
249
555
<P><LI>
250
 
A single % on the right hand side of a substitution is replaced with the last right hand side.
 
556
A single % on the right hand side of a substitution is replaced with the last right hand side.&nbsp;
251
557
Some versions of ed do this, some don't; I find it a convenient feature.
252
558
 
253
559
<P><LI>
254
560
s, is shorthand for s/, +/,\n
255
 
This is used to split lines at phrase boundaries.
256
 
You can also use s. to split a line after the first period -- at a sentence boundary.
257
 
s; s: s) and s" can also be used.
258
 
s,3 splits the line after the third comma.
 
561
This is used to split lines at phrase boundaries.&nbsp;
 
562
You can also use s. to split a line after the first period -- at a sentence boundary.&nbsp;
 
563
s; s: s) and s" can also be used.&nbsp;
 
564
s,3 splits the line after the third comma.&nbsp;
259
565
You might need to use s.2 if the sentence begins with Mr. Flintstone.
260
566
 
261
567
<P><LI>
262
 
The commands sg and sl make the remembered substitution and replacement strings global and local respectively.
 
568
Type s by itself for s//%.
 
569
 
 
570
<P><LI>
 
571
The commands sg and sl make the remembered substitution and replacement strings global and local respectively.&nbsp;
263
572
If you want to look at all instances of "foo" in all the files in the current directory,
264
573
and change some of them to bar at your discretion,
265
 
edit *, then enter sg to make substitution strings global to all edit sessions.
266
 
In the first session, search for foo, and replace some of them with bar.
 
574
edit *, then enter sg to make substitution strings global to all edit sessions.&nbsp;
 
575
In the first session, search for foo, and replace some of them with bar.&nbsp;
267
576
Type e2 to move to the next session, whence you can search using slash alone,
268
 
because the string "foo" is applied to all sessions.
269
 
Similarly, you can use % to refer to "bar".
 
577
because the string "foo" is applied to all sessions.&nbsp;
 
578
Similarly, you can use % to refer to "bar".&nbsp;
270
579
The sl command returns this editor to its local behavior,
271
580
where each file has its own search/replace strings.
272
581
 
273
582
<P><LI>
274
583
Errors associated with reading or writing files, or switching sessions,
275
584
are always printed.  Other errors elicit the usual question mark,
276
 
whence you must type h to read the explanation.
 
585
whence you must type h to read the explanation.&nbsp;
277
586
Type capital H if you always want to see the error messages.
278
587
 
279
588
<P><LI>
280
589
In most versions of ed, the command z7 means .,+6p,
281
 
making the current line +7.
 
590
making the current line +7.&nbsp;
282
591
I think this is inconsistent, having one and only one ed command that leaves dot
283
 
somewhere other than the last line printed.
 
592
somewhere other than the last line printed.&nbsp;
284
593
The confusion is compounded when z prints the last lines in the file,
285
 
whence dot actually is the last line printed.
286
 
So I have changed the z command slightly.
 
594
whence dot actually is the last line printed.&nbsp;
 
595
So I have changed the z command slightly.&nbsp;
287
596
In this program z7 means +,+7p,
288
 
and the current line becomes the last line printed, just like the other commands.
289
 
Without a number, z prints the previous number of lines.
 
597
and the current line becomes the last line printed, just like the other commands.&nbsp;
 
598
Without a number, z prints the previous number of lines.&nbsp;
290
599
Thus you can read your file a chunk or screen at a time.
291
600
 
292
601
</UL>
293
602
 
294
603
<P>
295
604
Subsequent sections describe
296
 
new and interesting features, completely foreign to ed.
 
605
new and interesting features, completely foreign to ed.&nbsp;
297
606
These include the simultaneous edit of multiple files
298
607
similar to emacs and vi,
299
 
and the ability to browse an html file and "edit" its fill-out form.
 
608
and the ability to browse an html file and "edit" its fill-out form.&nbsp;
300
609
That's why I wrote the program in the first place.
301
610
 
302
 
<H4 align=center> Balancing Braces </H4>
 
611
<H3 align=center> <A NAME=brace> Balancing Braces </A> </H3>
303
612
 
304
613
The capital B command is of interest to programmers,
305
 
and will probably not be used by casual home users.
306
 
It locates the line with the balancing brace, parenthesis, or bracket.
 
614
and will probably not be used by casual home users.&nbsp;
 
615
It locates the line with the balancing brace, parenthesis, or bracket.&nbsp;
307
616
Consider the following code fragment.
308
617
 
309
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif><code>    if(x == 3 &&
 
618
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif><code>    if(x == 3 &&
310
619
    y == 7) {
311
620
        printf("hello\n");
312
621
    } else {
318
627
<P>
319
628
The capital B command, on either the second or the last line,
320
629
moves to the middle line "} else {",
321
 
because that balances the open brace.
 
630
because that balances the open brace.&nbsp;
322
631
On the first line, B moves to the second line,
323
 
which balances the open parenthesis.
 
632
which balances the open parenthesis.&nbsp;
324
633
The second line balances {, rather than ),
325
634
because braces have precedence over parentheses,
326
 
which have precedence over brackets.
 
635
which have precedence over brackets.&nbsp;
327
636
You can force a parenthesis match by typing B),
328
637
which moves from line 2 back to line 1.
329
638
 
330
639
<P>
331
640
The B command on the else line is ambiguous -
332
 
I don't know whether to look backwards or forwards.
 
641
I don't know whether to look backwards or forwards.&nbsp;
333
642
You must type B{ or B}.
334
643
 
335
644
<P>
336
 
You can explicitly balance <>, as in multiline html tags,
 
645
You can explicitly balance &lt;&gt;, as in multiline html tags,
337
646
or `', used in some preprocessors such as m4.
338
647
 
339
648
<P>
340
649
Comments or literal strings that contain balancing punctuation marks will
341
 
definitely throw edbrowse off the track.
 
650
definitely throw edbrowse off the track.&nbsp;
342
651
If you are the author of the source,
343
652
you might want to avoid braces in comments,
344
653
or use comments to keep braces in balance.
346
655
<P>
347
656
static char openstring[] = "{block"; /* closing } is found elsewhere */
348
657
 
349
 
<H4 align=center> Context Switch </H4>
 
658
<H3 align=center> <A NAME=cx> Context Switch </A> </H3>
350
659
 
351
660
This program allows you to edit multiple files at the same time,
352
 
and transfer text between them.
 
661
and transfer text between them.&nbsp;
353
662
This is similar to the world of virtual terminals (Linux),
354
 
where you switch between sessions via alt-f1 through alt-f6.
 
663
where you switch between sessions via alt-f1 through alt-f6.&nbsp;
355
664
In this case you switch to a different editing session via the commands
356
 
e1 through e6.
 
665
e1 through e6.&nbsp;
357
666
Note that `e 2' edits a file whose name is "2",
358
 
whereas `e2' switches to session 2.
 
667
whereas `e2' (without the space) switches to session 2.&nbsp;
359
668
Similarly, you can read the contents of session 3 into the current buffer
360
 
via r3, and you can write the current buffer into session 5 via w5.
 
669
via r3, and you can write the current buffer into session 5 via w5.&nbsp;
361
670
The latter command will produce a warning if session five already exists,
362
 
and you have made changes to its text, but have not saved those changes.
363
 
In other words, you are about to lose your edits in session 5.
 
671
and you have made changes to its text, but have not saved those changes.&nbsp;
 
672
In other words, you are about to lose your edits in session 5.&nbsp;
364
673
Typing h will produce the explanation:
365
674
"Expecting `w' on session 5".
366
675
 
367
676
<P>
368
677
If you quit a session you are moved to the next valid editing session,
369
 
wrapping around to session 1 if necessary.
 
678
wrapping around to session 1 if necessary.&nbsp;
370
679
The program exits when the last session quits.
371
680
 
372
681
<P>
373
 
Warning, the program contains a bug regarding the undo command.
 
682
Warning, the program contains a bug regarding the undo command.&nbsp;
374
683
If you switch to another session, then switch back,
375
 
you cannot undo your last edit.
 
684
you cannot undo your last edit.&nbsp;
376
685
You'd think this would be easy to fix,
377
 
but it is trickier than it seems, so I haven't gotten rround to it.
378
 
I just wanted you to know.
 
686
but it is trickier than it seems, so I haven't gotten rround to it.&nbsp;
 
687
I just wanted you to know.&nbsp;
379
688
Make sure everything is copasetic before you switch to another session.
380
689
 
381
690
<P>
382
 
Let's run through a cut&amp;paste example.
 
691
Let's run through a cut&amp;paste example.&nbsp;
383
692
You are editing file foo in session 1, and you realize
384
 
that a paragraph from file bar would fit perfectly right here.
385
 
Here is how it might look.
 
693
that a paragraph from file bar would fit perfectly right here.&nbsp;
 
694
Here is how it might look.&nbsp;
386
695
Lines beginning with &lt; are the user's input,
387
 
and lines beginning with &gt; form the program's responses.
 
696
and lines beginning with &gt; form the program's responses.&nbsp;
388
697
The # sign delimits my injected comments.
389
698
 
390
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>
391
 
&lt; e2   # switch to session 2
 
699
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>&lt; e2   # switch to session 2
392
700
&gt; new session
393
701
#  Unlike ed, the r command does not establish a file name, even if the
394
702
#  buffer is empty.
416
724
<P>
417
725
The following moves the data from one file to another.
418
726
 
419
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>
420
 
&lt; e2
 
727
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>&lt; e2
421
728
&gt; new session
422
729
&lt; e bar  # this time I'm going to change bar
423
730
&gt; 28719
444
751
</font></PRE>
445
752
 
446
753
<P>
447
 
An e command, by itself, tells you the current session, in case you've forgotten.
 
754
An e command, by itself, tells you the current session, in case you've forgotten.&nbsp;
448
755
This is similar to f, by itself, which tells you the current file.
449
756
 
450
 
<H4 align=center> Usage </H4>
451
 
 
452
 
This perl program has no options.
453
 
Well actually there is a -m# option for fetchmail, but we'll get to that later.
454
 
And there's a -d# option to set the debug level.
455
 
And the -v option prints the version.
456
 
But other than that, there's no options.
457
 
 
458
 
<P>
459
 
The arguments are the files to edit.
460
 
Edbrowse reads these files into corresponding sessions
461
 
and starts you off in session 1.
 
757
<H3 align=center> <A NAME=usage> Usage </A> </H3>
 
758
 
 
759
type `edbrowse -h' to produce the usage message.&nbsp;
 
760
You will see the -m option, used in several different ways.&nbsp;
 
761
Try to ignore this for now.&nbsp;
 
762
The -m option causes edbrowse to run as an interactive mail client,
 
763
rather than an editor.&nbsp;
 
764
This will be discussed later.
 
765
 
 
766
<P>
 
767
The -dx option sets the debug level to x, where x is between 0 and 9.&nbsp;
 
768
The default is -d1,
 
769
which prints the sizes of files as they are written and read.&nbsp;
 
770
Some people like -d2, which prints the URLs
 
771
as you jump to new web pages or submit forms online.&nbsp;
 
772
Unless you are debugging the program, you probably don't want to go any higher than -d3.&nbsp;
 
773
On rare occasions you might want to set -d4, to see the http headers in and out.&nbsp;
 
774
Remember, the debug level can be changed on the fly by using the dbx command (x between 0 and 9).
 
775
 
 
776
<P>
 
777
The -e option causes edbrowse to exit when it encounters an error.&nbsp;
 
778
This is usually used by batch scripts.&nbsp;
 
779
If there is a problem, you don't want to march on, executing the rest of the edbrowse commands.
 
780
 
 
781
<P>
 
782
Use -c to suppress processing of, and edit, the .ebrc configuration file.&nbsp;
 
783
(This config file will be described later.)&nbsp;
 
784
And why would you want to do this?&nbsp;
 
785
Suppose you have made a change to this file,
 
786
and thereby produced a syntax error, so that edbrowse cannot even get started.&nbsp;
 
787
Now you can't use edbrowse to fix your config file.&nbsp;
 
788
Of course you could rename the config file to something else, fix it, and put it back;
 
789
but then you might discover another syntax error, and so on.&nbsp;
 
790
Instead, use the -c option to edit the config file directly.&nbsp;
 
791
It is automatically loaded into buffer 1.&nbsp;
 
792
Note that -c must be the first option.
 
793
 
 
794
<P>
 
795
The arguments are the files to edit.&nbsp;
 
796
Edbrowse reads these files into corresponding sessions,
 
797
and starts you off in session 1.&nbsp;
462
798
If there are no arguments, you start in session 1,
463
799
but there is no text and no associated file.
464
800
 
465
801
<P>
466
802
If you like this program, and you want it to be your primary editor,
467
 
you can set the following alias.
468
 
 
469
 
<P>
470
 
alias e="perl -w /usr/local/bin/edbrowse"
471
 
 
472
 
<H4 align=center> Binary Characters </H4>
 
803
you can set the following Unix alias.
 
804
 
 
805
<P>
 
806
alias e="/usr/local/bin/edbrowse"
 
807
 
 
808
<P>
 
809
If you do this, you can use `e filename',
 
810
to edit a new file, whether you are inside edbrowse or at the shell prompt.&nbsp;
 
811
Very convenient.
 
812
 
 
813
<H3 align=center> <A NAME=bin> Binary Characters </A> </H3>
473
814
 
474
815
At all times, even when entering a file name, this program scans its input
475
 
for binary codes.
476
 
Sorry, but I like hex better than octal.
477
 
I know it's not standard, but there it is.
 
816
for binary codes.&nbsp;
 
817
Sorry, but I like hex better than octal.&nbsp;
 
818
I know it's not standard, but there it is.&nbsp;
478
819
Use the three character sequence ~bd to enter the nonascii character 0xbd,
479
 
which is the code for 1/2.
 
820
which is the code for 1/2.&nbsp;
480
821
Similarly, if you list a line, with the l command, the 1/2 character
481
 
is displayed as ~bd.
 
822
is displayed as ~bd.&nbsp;
482
823
All nonascii and most control characters
483
 
are entered and displayed in this manner.
484
 
Tab and newline must be entered directly from the keyboard.
485
 
Tab and backspace are displayed as &gt; and &lt; respectively.
 
824
are entered and displayed in this manner.&nbsp;
 
825
Tab and newline must be entered directly from the keyboard.&nbsp;
 
826
Tab and backspace are displayed as &gt; and &lt; respectively.&nbsp;
486
827
If the following line is entered,
487
828
 
488
829
<P>
490
831
 
491
832
<P>
492
833
And then listed, you will see the very same text,
493
 
but there is a bell and a 1/2 character inside.
494
 
The ~x is not encoded into anything, because x is not a hex digit.
 
834
but there is a bell and a 1/2 character inside.&nbsp;
 
835
The ~x is not encoded into anything, because x is not a hex digit.&nbsp;
495
836
If you want to force a ~, even though there are hex digits following,
496
837
use two tildes, ~~.
497
838
 
498
839
<P>
499
 
When you are entering a regular expression, you have the choice, hex or octal.
500
 
My program converts ~xx, as a hex value,
501
 
and the perl regexp machinery converts \nnn, as octal.
502
 
Thus any of the following will undos a file.
 
840
When you are entering a regular expression, you have the choice, hex or octal.&nbsp;
 
841
This program converts ~xx, as a hex value,
 
842
and the perl regexp machinery converts \nnn, as octal.&nbsp;
 
843
Thus any of the following will undos a file.&nbsp;
503
844
The first is translated via my software, the second and third by perl regexp.
504
845
 
505
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>,s/~0d$//
 
846
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>,s/~0d$//
506
847
,s/\15$//
507
848
,s/\r$//
508
849
</font></PRE>
509
850
 
510
851
<P>
511
852
Embedded escape characters are always displayed in hex,
512
 
whether the line is listed or not.
 
853
whether the line is listed or not.&nbsp;
513
854
Most terminals and terminal emulaters, including the Linux console
514
855
and my speech adapter,
515
 
interpret various escape sequences as control commands.
 
856
interpret various escape sequences as control commands.&nbsp;
516
857
Thus an errant escape sequence from a binary file could send your terminal or your speech adapter into an unexpected state,
517
 
making recovery difficult.
518
 
It seems prudent to render escapes as visible characters all the time.
 
858
making recovery difficult.&nbsp;
 
859
It seems prudent to render escapes as visible characters all the time.&nbsp;
519
860
If you have no idea where that ~1b came from, it's probably a literal escape character.
520
861
 
521
862
<P>
522
 
Returns and nulls are also converted into hex all the time.
523
 
Thus an embedded return will not make one line look like two lines.
524
 
You will usually see this when importing a dos text file.
525
 
Every line ends in ~0d.
 
863
Returns and nulls are also converted into hex all the time.&nbsp;
 
864
Thus an embedded return will not make one line look like two lines.&nbsp;
 
865
You will usually see this when importing a dos text file.&nbsp;
 
866
Every line ends in ~0d.&nbsp;
526
867
Issue one of the three commands shown above to undos the file.
527
868
 
528
 
<H4 align=center> Binary Files </H4>
 
869
<H3 align=center> <A NAME=bfile> Binary Files </A> </H3>
529
870
 
530
871
Data is considered binary if it is sufficiently large
531
872
(more than 50 bytes)
532
 
and it contains a significant fraction of non-ascii or null characters (more than 25%).
 
873
and it contains a significant fraction of non-ascii or null characters (more than 25%).&nbsp;
533
874
International text may contain scattered binary codes, for accented letters etc,
534
 
but most of the characters should still be ascii.
535
 
Therefore binary data is not international text.
 
875
but most of the characters should still be ascii.&nbsp;
 
876
Therefore binary data is not international text.&nbsp;
536
877
In fact you probably won't be able to display or edit binary data effectively,
537
 
at least not by this program.
538
 
But don't let that stop you.
 
878
at least not by this program.&nbsp;
 
879
But don't let that stop you.&nbsp;
539
880
As an exercise, create an executable program that prints "hello world",
540
 
then edit the executable using this editor.
541
 
Look for the string "hello world" and replace world with jorld.
542
 
Write the file and run the executable.
 
881
then edit the executable using this editor.&nbsp;
 
882
Look for the string "hello world" and replace world with jorld.&nbsp;
 
883
Write the file and run the executable.&nbsp;
543
884
You should now see "hello jorld".
544
885
 
545
886
<P>
546
 
When binary data is first read into the buffer, you will see the words "binary data".
547
 
After that the buffer remains "binary", even if you delete all the data and read in ascii text.
 
887
When binary data is first read into the buffer, you will see the words "binary data".&nbsp;
 
888
After that the buffer remains "binary", even if you delete all the data and read in ascii text.&nbsp;
548
889
You must use the `e' command to get a fresh, ascii buffer.
549
890
 
550
891
<P>
551
 
For the most part it doesn't really matter if the data is considered binary or ascii.
 
892
For the most part it doesn't really matter if the data is considered binary or ascii.&nbsp;
552
893
Either way you can display and edit the data, and write it to a file.
553
894
 
554
895
<P>
555
 
This program tries to "do the right thing" under DOS/Windows.
 
896
This program tries to "do the right thing" under DOS/Windows.&nbsp;
556
897
That is, it converts crlf to and from newline if it believes the file is text;
557
 
otherwise it leaves the file alone.
558
 
 
559
 
<H4 align=center> Accessing A URL </H4>
 
898
and it leaves binary data alone.&nbsp;
 
899
These distinctions are not relevant on Unix/Linux.
 
900
 
 
901
<P>
 
902
Although this approach is satisfactory for English and most European languages,
 
903
it fails miserably for Asian languages, which definitely look like binary data.&nbsp;
 
904
You can disable binary detection by entering the `bd' command.&nbsp;
 
905
If you speak an Asian language,
 
906
you may want to put this command in your init script,
 
907
so edbrowse comes up the way you want -
 
908
treating your international files as text files.
 
909
 
 
910
<P>
 
911
If you speak an Asian language, and you are running Windows,
 
912
and binary detection is disabled,
 
913
<em>don't</em> use this program to manipulate binary files,
 
914
as they will get corrupted!&nbsp;
 
915
Better still, say goodbye to Windows and start using a real operating system.
 
916
 
 
917
<H3 align=center> <A NAME=dir> Directory Scan, File Manager </A> </H3>
 
918
 
 
919
If you edit a directory
 
920
you will see a list of all the visible files in that directory,
 
921
in alphabetical order.&nbsp;
 
922
(Use the `hf' option if you want to see the hidden files too.)&nbsp;
 
923
Type g to go to one of these files or sub directories.&nbsp;
 
924
Type ^ to return to the parent directory.&nbsp;
 
925
(Note, g is the "go" command, and ^ is the back key; more on this later.)&nbsp;
 
926
Thus you can traverse an entire directory tree
 
927
as though you were inside a file manager.
 
928
 
 
929
<P>
 
930
Like `ls -F', a subdirectory is indicated by a trailing slash.&nbsp;
 
931
This slash is not part of the filename.&nbsp;
 
932
Similarly, named pipe is indicated by |,
 
933
symbolic link by @,
 
934
block special by *, character special by &lt;,
 
935
and socket by ^.&nbsp;
 
936
If a regular file ends in one of these characters, it may confuse you,
 
937
but it won't confuse this program.&nbsp;
 
938
Edbrowse knows whether that trailing | is part of the filename
 
939
or a pipe indicator.&nbsp;
 
940
Since each file is represented by a single line of text,
 
941
files with newlines embedded in their names cannot be accessed.
 
942
 
 
943
<P>
 
944
If you read a directory into a preexisting file it is just text.&nbsp;
 
945
You can't visit any of the underlying files, because they are just words.&nbsp;
 
946
You must edit a directory in its own session
 
947
or read a directory into an empty session
 
948
if you want to access the underlying files.&nbsp;
 
949
Note that you can write the buffer to another editting session,
 
950
and in that session the words are just words.&nbsp;
 
951
This distinction is important as we start to edit the text.
 
952
 
 
953
<P>
 
954
By default, directories are readonly.&nbsp;
 
955
If you try to delete a line, and hence the associated file,
 
956
it will tell you that you are still in directory read mode.&nbsp;
 
957
I'm trying to save you from yourself!&nbsp;
 
958
Type dw to enable directory writes,
 
959
and dr to make directories readonly again.
 
960
 
 
961
<P>
 
962
When directory writes are enabled,
 
963
you can remove files using the d command.&nbsp;
 
964
For instance, g/\.o$/d removes all the object files.&nbsp;
 
965
Since these edits have implications outside the scope of this program,
 
966
there is no undo capability.&nbsp;
 
967
When you make a change it is made.&nbsp;
 
968
With this in mind, I borrowed a good idea from Microsoft.&nbsp;
 
969
(That's one.)&nbsp;
 
970
The deleted file isn't actually deleted;
 
971
it is moved to your recycle bin,
 
972
located in $HOME/.recycle.&nbsp;
 
973
So if you accidentally type ,d and remove all your files,
 
974
you can recover them from your recycle bin.&nbsp;
 
975
You may want to set up a cron job that removes
 
976
all the files from your recycle bin once a week.&nbsp;
 
977
This directory is created mode 700, so nobody else can look at your deleted files.&nbsp;
 
978
If you create this directory yourself, please make it 700.&nbsp;
 
979
After all, some of your files might be private.
 
980
 
 
981
<P>
 
982
Because this operation is a move, rather than a true delete,
 
983
there are a few restrictions based on your operating system.&nbsp;
 
984
If your OS can move directories,
 
985
this program will be able to delete a subdirectory as easily as a file.&nbsp;
 
986
The entire subtree is moved to your recycle bin.&nbsp;
 
987
Make sure your cleanup cron job is capable of removing directory trees, not just files.
 
988
 
 
989
<P>
 
990
Depending on your OS, you may not be able to move files across file systems.&nbsp;
 
991
From /disk2 to /disk1, or from the D drive to the C drive.&nbsp;
 
992
In this case you might want to issue the dx command,
 
993
which makes directories writable, like dw, but actually deletes the files.&nbsp;
 
994
You'll need this if you're trying to free up space on the disk.&nbsp;
 
995
Note that symbolic links are always deleted;
 
996
there isn't much point in moving a link to the recycle bin.
 
997
 
 
998
<P>
 
999
"What's the point of all this?" you may ask.&nbsp;
 
1000
"What's wrong with the shell?"
 
1001
 
 
1002
<P>
 
1003
Nothing, as long as the file names are small and familiar.&nbsp;
 
1004
But sometimes the file names are long and cumbersome,
 
1005
and it is nearly impossible to type those names into the shell,
 
1006
character for character, upper and lower case, with no mistakes.&nbsp;
 
1007
Meta characters such as the * can help,
 
1008
but only when the file you want has a name radically different from the other files in the directory.&nbsp;
 
1009
This isn't always the case.&nbsp;
 
1010
Suppose an application generates log files as follows.
 
1011
 
 
1012
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>ProgramFooBar.-04-04-1998.06:31:59.log
 
1013
ProgramFooBar.-04-11-1998.11:37:14.log
 
1014
ProgramFooBar.-04-18-1998.16:22:51.log
 
1015
</font></PRE>
 
1016
 
 
1017
<P>
 
1018
How do you delete the old ones and keep the most recent,
 
1019
or rename them to something more manageable?&nbsp;
 
1020
Stars are a bit risky; you can access multiple files without realizing it.&nbsp;
 
1021
And we're not even talking about those pesky files with spaces or invisible control characters in their names.&nbsp;
 
1022
Our sighted friend calls up his file manager and simply clicks on the file he wants to view or edit or remove.&nbsp;
 
1023
Sometimes I want/need that kind of power.
 
1024
 
 
1025
<P>
 
1026
When the substitute command changes text, it renames the underlying file.&nbsp;
 
1027
This won't move the file on top of another existing file,
 
1028
so you can't lose any data this way.&nbsp;
 
1029
Again, I'm saving you from yourself.
 
1030
 
 
1031
<P>
 
1032
The search and substitute commands ignore the trailing filetype characters.&nbsp;
 
1033
If you want to rename a directory from foo/ to foobar/,
 
1034
you can type s/$/bar/.&nbsp;
 
1035
The bar will be placed at the end of the word foo, because the trailing / isn't really there.
 
1036
 
 
1037
<P>
 
1038
Now suppose you want to run an arbitrary program on some of these files.&nbsp;
 
1039
This could be a print utility,a compiler, whatever.&nbsp;
 
1040
Sometimes you can rename the files for your convenience, then work in the shell.&nbsp;
 
1041
But sometimes you don't own the files,
 
1042
and sometimes they must retain their original names.&nbsp;
 
1043
This happens when several html documents reference each other through hyperlinks,
 
1044
using their existing filenames.&nbsp;
 
1045
So you can't rename the files, yet you still want to run your program on one or two of them.
 
1046
 
 
1047
<P>
 
1048
You can run any program on any file without retyping that filename via the shell escape.&nbsp;
 
1049
Use kx to assign the label x to the file you are interested in.&nbsp;
 
1050
(This is standard ed syntax.)&nbsp;
 
1051
Then run !program 'x
 
1052
to invoke your program on that file.&nbsp;
 
1053
This sounds involved, but it is merely macro substitution, implemented in a few lines of code.&nbsp;
 
1054
If 'x is present in a shell escape, and is not next to any letters or digits,
 
1055
we replace it with the text on the line labeled x.&nbsp;
 
1056
Thus if your filename contains spaces, you'd better run !program "'x",
 
1057
to make sure the entire file name is one argument to the running program.
 
1058
 
 
1059
<P>
 
1060
The token '. is replaced with the text on the current line,
 
1061
and the token '_ is replaced with the current filename.&nbsp;
 
1062
If you try to write a file, and remember that you left it readonly,
 
1063
you can make it writable via !chmod +w '_,
 
1064
then write the text to the file.
 
1065
 
 
1066
<P>
 
1067
You can expand multiple tokens in one shell command.&nbsp;
 
1068
Use kx and ky to mark two files that you want to compare, then run !diff 'x 'y.
 
1069
 
 
1070
<P>
 
1071
This feature is not limited to directory scans.&nbsp;
 
1072
You may be editing a simple file,
 
1073
but you can still paste the contents of a line into your shell command.&nbsp;
 
1074
Off hand I don't know why you'd want to do this,
 
1075
but you can.
 
1076
 
 
1077
<H3 align=center> <A NAME=case> Upper/Lower Case </A> </H3>
 
1078
 
 
1079
The `lc' command converts a line to lower case,
 
1080
and `uc' converts it to upper case.&nbsp;
 
1081
Perl users will recognize these directives.&nbsp;
 
1082
As an extension, `mc' converts to mixed case, capitalizing the first letter of each word,
 
1083
and the d in mcdonald.
 
1084
 
 
1085
<P>
 
1086
This is especially useful in a directory scan.&nbsp;
 
1087
The last thing a blind person wants to worry about is whether some of the letters in a file name are upper case.&nbsp;
 
1088
If directory write mode is enabled,
 
1089
type ,lc to convert all the file names to lower case.&nbsp;
 
1090
It's that simple.
 
1091
 
 
1092
<P>
 
1093
If you want to upcase a particular word, type s/word/uc/.&nbsp;
 
1094
This converts the word to upper case.&nbsp;
 
1095
All the other substitution suffixes apply.&nbsp;
 
1096
To change foo, Foo, FOo, and FOO to FOO, everywhere,
 
1097
type ,s/\bfoo\b/uc/ig.
 
1098
 
 
1099
<H3 align=center> <A NAME=bl> Break Line </A> </H3>
 
1100
 
 
1101
The `bl' command breaks the current line into sentences and phrases,
 
1102
each about 70 characters long.&nbsp;
 
1103
It also compresses white space and strips white space from the end of the line.&nbsp;
 
1104
If the line contains return characters,
 
1105
these are turned into line separaters -
 
1106
places where the line will definitely be cut.&nbsp;
 
1107
The only white space that is preserved is the tabs or spaces
 
1108
at the beginning of the line, or after each return character.&nbsp;
 
1109
This is a modest attemp to keep indented text indented,
 
1110
if that makes any sense?
 
1111
 
 
1112
<P>
 
1113
I use this feature in two different ways.&nbsp;
 
1114
If I am familiar with the document,
 
1115
(I probably wrote it),
 
1116
I may use the bl command on a line of text that seems rather long.&nbsp;
 
1117
I typed it in quickly, as an uninterrupted thought, and now I want to break it up.&nbsp;
 
1118
But I don't want to count punctuation marks and say,
 
1119
"I think we need a break after the third comma
 
1120
and the period following that and then at the next comma",
 
1121
issuing the s punctuation commands along the way.&nbsp;
 
1122
Oh I like the s commands well enough - they put you in complete contrl -
 
1123
but it's easier to type bl - and bl usually does the right thing.&nbsp;
 
1124
Also, bl compresses accidental double spaces,
 
1125
a typo that I will never hear if I simply read the line as a whole.
 
1126
 
 
1127
<P>
 
1128
When the document comes in from the outside,
 
1129
usually from another word processor such as MS-Word,
 
1130
bl serves a completely different function.&nbsp;
 
1131
Paragraphs are often stored on a single physical line.&nbsp;
 
1132
Sometimes the entire document is on a single line,
 
1133
with return characters, \r, separating paragraphs.&nbsp;
 
1134
Wysiwyg word processors don't worry about separating sentences and phrases -
 
1135
that's what word wrap is for.&nbsp;
 
1136
Well - bl is our version of word wrap.&nbsp;
 
1137
It doesn't try to conform to any screen;
 
1138
it merely cuts the text into manageable chunks,
 
1139
each piece a separate semantic unit.&nbsp;
 
1140
When bl is issued,
 
1141
physical lines will contain sentences or phrases, as delimited by punctuation,
 
1142
or by the newline/return characters embedded in the original document.
 
1143
 
 
1144
<P>
 
1145
If one of the original lines, delimited by newline or return,
 
1146
is long, i.e. more than 120 characters,
 
1147
it is assumed to be a self-contained paragraph,
 
1148
and a blank line is added before and after.&nbsp;
 
1149
Thus a disassembled paragraph containing 20 sentences
 
1150
does not simply flow into the next disassembled paragraph containing 18 more sentences.&nbsp;
 
1151
An empty line separates the two paragraphs.&nbsp;
 
1152
This is only applicable if bl is applied to a range of lines,
 
1153
or the entire document,
 
1154
as might occur when making an outside document readable.
 
1155
 
 
1156
<P>
 
1157
Don't apply the bl command to a preformatted section,
 
1158
such as a table or ascii art.&nbsp;
 
1159
If you're not sure what to expect,
 
1160
i.e. you didn't write the file,
 
1161
scan through it first,
 
1162
and apply bl to the range of lines that actually represents text.&nbsp;
 
1163
Often this is the entire document (,bl).&nbsp;
 
1164
The following commands do a pretty good job of cleaning up a typical Microsoft Word document.
 
1165
 
 
1166
<P>
 
1167
<PRE><font size=3 face=Arial,Helvetica,sans-serif>e whatever.doc or whatever.wps
 
1168
# change filename, so you don't accidently overwrite the microsoft document
 
1169
f _
 
1170
,s/[~80-~ff~00-~0c~0e-~1f]//g  # strip out non ascii control/formatting codes
 
1171
g/^\s*$/d  # these blank lines use to contain non ascii codes
 
1172
,bl  # break lines and paragraphs
 
1173
1,20p  # first couple lines are often garbage, but then the text begins.
 
1174
</font></PRE>
 
1175
 
 
1176
<P>
 
1177
Of course the program catdoc does a better job of converting word documents into text.&nbsp;
 
1178
This is often bundled with xls2cvs.&nbsp;
 
1179
These are must-have programs for people who want a command line environment.
 
1180
 
 
1181
<H3 align=center> <A NAME=race> Race Conditions </A> </H3>
 
1182
 
 
1183
Suppose you are writing a file,
 
1184
and edbrowse truncates the existing file,
 
1185
then the computer crashes before edbrowse can write the new data.&nbsp;
 
1186
When you bring your computer back to life,
 
1187
your file is empty, zero bytes, and all your work is lost.
 
1188
 
 
1189
<P>
 
1190
This is a narrow window to be sure;
 
1191
the computer has to fail at precisely the wrong millisecond.&nbsp;
 
1192
To guard against this improbable calamity,
 
1193
some editors write your data to a temp file,
 
1194
remove the true file, and move the temp file over to the true file.&nbsp;
 
1195
This way your data cannot be lost.&nbsp;
 
1196
Either the new or the old file will survive.
 
1197
 
 
1198
<P>
 
1199
Then links came on the scene, hard links, and then symbolic links.&nbsp;
 
1200
Authors of ed, and other editors, had to scramble.&nbsp;
 
1201
You can't remove a link, write to temp,
 
1202
and move the temp file over to the link.&nbsp;
 
1203
It isn't a link any more, it's a regular file,
 
1204
and your filesystem is not what it use to be.&nbsp;
 
1205
For one thing, the true file, pointed to by the (symbolic) link,
 
1206
has not been changed at all.&nbsp;
 
1207
This is not what you want!&nbsp;
 
1208
So people rewrote there editors to disable this feature if the named file is
 
1209
a link to some other file.&nbsp;
 
1210
They had to revert back to the old truncate and write paradigm,
 
1211
and hope that nothing bad happens in between.&nbsp;
 
1212
And you know what, it never does.&nbsp;
 
1213
The window is just too small.
 
1214
 
 
1215
<P>
 
1216
With this in mind, edbrowse doesn't mess with temp files at all.&nbsp;
 
1217
I just don't bother.&nbsp;
 
1218
I truncate the file and write out the data,
 
1219
and I don't expect anything to go wrong during the critical millisecond.
 
1220
 
 
1221
<P>
 
1222
Another race condition is more subtle.&nbsp;
 
1223
Suppose you are editing a file and your friend,
 
1224
or a system program, edits the same file.&nbsp;
 
1225
Your file has actually been changed out from under you,
 
1226
while you held it in memory.&nbsp;
 
1227
When you go to write your changes,
 
1228
they will clobber any changes made by your friend, or the system utility.&nbsp;
 
1229
Most text editors guard against this by watching the timestamp.&nbsp;
 
1230
When you first edit the file foo,
 
1231
an editor might remember the timestamp on foo.&nbsp;
 
1232
then, when you are ready to write your changes,
 
1233
it checks the timestamp, and if foo has been updated in the interim,
 
1234
it issues a warning message.&nbsp;
 
1235
"File has been updated by someone else -
 
1236
do you really want to write?"
 
1237
 
 
1238
<P>
 
1239
This is a good feature,
 
1240
but edbrowse doesn't have it, simply because I haven't gotten round to writing it.&nbsp;
 
1241
I'm the only user on my PC,
 
1242
and you're probably the only user on your PC too,
 
1243
so this feature is not in high demand.&nbsp;
 
1244
Still, I should implement it some day.
 
1245
 
 
1246
<H3 align=center> <A NAME=url> Accessing A URL </A> </H3>
560
1247
 
561
1248
Instead of invoking `e filename', you can invoke `e http://this.that.com/file.html',
562
 
and the editor will retrieve the named file using the http protocol.
563
 
The source (i.e. raw html) is made available for edit.
564
 
You can modify it and save it on your local machine.
 
1249
and the editor will retrieve the named file using the http protocol.&nbsp;
 
1250
The source (i.e. raw html) is made available for edit.&nbsp;
 
1251
You can modify it and save it on your local machine.&nbsp;
565
1252
Because the text was retrieve from another machine,
566
1253
it cannot be written back to that machine,
567
 
hence the `w' command will not work.
 
1254
hence the `w' command will not work.&nbsp;
568
1255
You must specify a local file `w myfile.html',
569
1256
or another editing session `w3'.
570
1257
 
571
1258
<P>
572
1259
Note that this is not browsing, we are simply retrieving text from
573
 
another machine and editing it locally.
574
 
The text need not be html, it could be (for instance) a plain ascii document.
 
1260
another machine and editing it locally.&nbsp;
 
1261
The text need not be html, it could be (for instance) a plain ascii document.&nbsp;
575
1262
Many people, myself included, put various types of files, even executables,
576
 
on their web sites for retrieval.
 
1263
on their websites for retrieval.&nbsp;
577
1264
Of course you wouldn't want to edit a binary file,
578
1265
but you can still use this editor to retrieve the file and save it locally,
579
1266
thus implementing an http download.
581
1268
<P>
582
1269
While inside the editor, you can type `e URL'
583
1270
to leave the current buffer and
584
 
retrieve text from a remote machine.
585
 
Or you can type `r URL' to retrieve remote text and add it to the current buffer.
 
1271
retrieve text from a remote machine.&nbsp;
 
1272
Or you can type `r URL' to retrieve remote text and add it to the current buffer.&nbsp;
586
1273
There is no `w URL' command, because the http protocol
587
 
does not allow you to "write" html source onto a remote machine.
 
1274
does not allow you to "write" html source back to a remote machine.
588
1275
 
589
1276
<P>
590
1277
As a convenience, any filename with two or more embedded dots
591
1278
and a standard suffix (such as .com or .net)
592
 
is treated as a URL.
593
 
You can usually omit the http:// prefix.
594
 
Try invoking `e www.whitehouse.gov'
595
 
to view the home page of the capitol of  the United States.
596
 
But again, you are looking at html source, which probably isn't what you want.
 
1279
is treated as a URL.&nbsp;
 
1280
You can usually omit the http:// prefix.&nbsp;
 
1281
Try invoking `e www.space.com',
 
1282
as an example.&nbsp;
 
1283
But again, you are looking at html source, which probably isn't what you want.&nbsp;
597
1284
Browsing will be discussed later.
598
1285
 
599
1286
<P>
600
1287
Whenever you retrieve data from a URL, the editor, directed by the http protocol,
601
 
might change the filename out from under you.
 
1288
might change the filename out from under you.&nbsp;
602
1289
This is because the resource has moved,
603
 
and the original computer was kind enough to give you the new address.
604
 
If debugging is set to 1 or higher,
605
 
you will see a series of three or four different URLs
606
 
as the editor is redirected across the internet.
 
1290
and the original computer was kind enough to give you the new address.&nbsp;
 
1291
If debugging is set to 2 or higher,
 
1292
you might see a series of three or four different URLs
 
1293
as the editor is redirected across the internet.&nbsp;
607
1294
Finally it retrieves your document,
608
 
and the current file name holds the correct URL.
609
 
You might want to update your bookmark file accordingly.
610
 
Then again, you might not.
 
1295
and the current file name holds the correct (latest) URL.&nbsp;
 
1296
You might want to update your bookmark file accordingly.&nbsp;
 
1297
Then again, you might not.&nbsp;
611
1298
Sometimes the initial url is the "public" location of the web page,
612
 
and subsequent redirections occur inside the company.
 
1299
and subsequent redirections occur inside the company.&nbsp;
613
1300
In this case you'll want to retain the public url,
614
 
which will always work, even if the company relocates its web server.
 
1301
which will always work, even if the company relocates its web server.&nbsp;
615
1302
Use youre best judgment.
616
1303
 
617
 
<H4 align=center> Browse Mode </H4>
 
1304
<H3 align=center> <A NAME=browse> Browse Mode </A> </H3>
618
1305
 
619
1306
If the editor contains html text, from any source,
620
 
you can type `b' to activate browse mode.
 
1307
you can type `b' to activate browse mode.&nbsp;
621
1308
The command will be rejected only if the buffer is lacking in common html tags,
622
 
or the editor is already in browse mode.
623
 
You can force its hand by adding &lt;html&gt; at the top -
624
 
it will always try to convert such a file.
625
 
Now the transformed text is readable, without any visible html tags.
 
1309
or the editor is already in browse mode.&nbsp;
 
1310
You can force its hand by adding &lt;html&gt; at the top,
 
1311
or any other tag we recognize -
 
1312
it will always try to convert such a file.&nbsp;
 
1313
Now the transformed text is readable, without any visible html tags.&nbsp;
626
1314
In other words, &lt;P&gt; has been turned into a paragraph break,
627
 
&lt;OL&gt; has become an ordered (numbered) list, and so on.
628
 
The filename is also changed; a .browse suffix has been appended.
 
1315
&lt;OL&gt; has become an ordered (numbered) list, and so on.&nbsp;
 
1316
The filename is also changed; a .browse suffix has been appended.&nbsp;
629
1317
If you write the transformed data, deliberately or accidentally,
630
1318
the reformatted text will be saved in a new file,
631
 
without disturbing the original html.
632
 
This protects you if you are developing your own web pages.
 
1319
whatever.html.browse,
 
1320
without disturbing the original html.&nbsp;
 
1321
This protects you if you are developing your own web pages.&nbsp;
633
1322
BTW, I believe blind people should write raw html,
634
 
rather than wielding a wysiwyg web development tool such as Front Page.
635
 
In fact I write all my documents in html, even short business letters.
 
1323
rather than wielding a wysiwyg web development tool such as Front Page.&nbsp;
 
1324
In fact I write all my documents in html, even short business letters.&nbsp;
636
1325
I can create headings, lists, tables, etc,
637
 
without using a wysiwyg editor or a screen reader.
 
1326
without using a wysiwyg editor or a screen reader.&nbsp;
638
1327
This
639
 
<A HREF=http://www.mcli.dist.maricopa.edu/tut/>
 
1328
<A HREF=http://www.htmlcodetutorial.com>
640
1329
excellent tutorial</A>
641
1330
will get you started.
642
1331
 
643
1332
<P>
644
1333
When the browse conversion is executed, the system checks for
645
 
common syntax errors, such as a numbered list that is never closed.
646
 
If the file name is a URL, these syntax errors are not reported.
647
 
After all, it's not your web page, and there's nothing you can do about it.
 
1334
common syntax errors, such as a numbered list that is never closed.&nbsp;
 
1335
If the file name is a URL, these syntax errors are not reported.&nbsp;
 
1336
After all, it's not your web page, and there's nothing you can do about it.&nbsp;
648
1337
However, if the web page is yours, as indicated by a local filename,
649
1338
the first syntax error is displayed,
650
 
whence you can return to the html source and fix it.
651
 
Type `ub' to undo the browse conversion.
652
 
This takes you back to the raw html text under its original filename.
653
 
Now you can coorect the error and try the `b' command again.
654
 
For your convenience, the label 'e is set to the line containing the error.
 
1339
whence you can return to the html source and fix it.&nbsp;
 
1340
Type `ub' to undo the browse conversion.&nbsp;
 
1341
This takes you back to the raw html text under its original filename.&nbsp;
 
1342
Now you can coorect the error and try the `b' command again.&nbsp;
 
1343
For your convenience, the label 'e is set to the line containing the error.&nbsp;
655
1344
Repeat this process until `b' runs without errors.
656
1345
 
657
1346
<P>
658
1347
If you try to quit, and the editor says "expecting `w'",
659
 
remember that you should be back in raw html before you issue the write command.
660
 
You could write the browsable text into file.browse,
 
1348
remember that you should be back in raw html before you issue the write command.&nbsp;
 
1349
You could write the browsed text into file.browse,
661
1350
and that will satisfy the "write" criteria,
662
 
but this isn't really what you want.
 
1351
but this isn't really what you want.&nbsp;
663
1352
You've corrected errors in the html source, and that's what you need to save,
664
1353
so remember to undo the browse reformatting before you write the file.
665
1354
 
666
1355
<P>
667
 
Note that you can issue the unbrowse command even if there were no errors.
 
1356
Note that you can issue the unbrowse command even if there were no errors.&nbsp;
668
1357
If, for instance, you are looking at a well-constructed page
669
 
on some other web site,
670
 
and you'd like to read or save the raw html, just type ub.
671
 
As an exercise, invoke `e www.whitehouse.gov',
 
1358
on some other website,
 
1359
and you'd like to read or save the raw html, just type ub.&nbsp;
 
1360
As an exercise, invoke `e www.space.com',
672
1361
and use the `b' and `ub' commands to switch between
673
1362
the raw html and the browsable text.
674
1363
 
675
1364
<P>
676
1365
The browse reformatting is relatively simple,
677
 
because a blind person doesn't want complexity.
 
1366
because a blind person doesn't want complexity.&nbsp;
678
1367
We don't care about fonts and italics etc, and if we do,
679
 
the best way to obtain this information is by reading the raw html.
 
1368
the best way to obtain this information is by reading the raw html.&nbsp;
680
1369
So most tags are discarded, except those related to headers, paragraphs, and lists.
681
 
I don't indent subsections or list items.
 
1370
 
 
1371
<P>
 
1372
I don't indent subsections or list items.&nbsp;
682
1373
The visual effect is lost on us,
683
 
and sometimes the extra spaces really get in the way.
 
1374
and sometimes the extra spaces get in the way.
684
1375
 
685
1376
<P>
686
1377
Because the physical line is, for us, the unit of thought,
687
1378
i.e. the atomic construct that is modified or moved or copied,
688
1379
lines are cut at approximately 80 characters, give or take a few,
689
 
usually at a sentence or phrase boundary.
 
1380
usually at a sentence or phrase boundary.&nbsp;
690
1381
Thus reading line by line often reveals a sequence of sentences,
691
 
or at least self-contained phrases within a larger sentence.
 
1382
or at least self-contained phrases within a larger sentence.&nbsp;
692
1383
I consider this the optimal way to view or edit a document --
693
 
any document.
694
 
If you read these words raw, without doing the browse on the file,
695
 
you'll see what I mean.
 
1384
any document.&nbsp;
 
1385
If you read this manual raw, without doing the browse on the file,
 
1386
you'll see what I mean.&nbsp;
 
1387
Review the <A HREF=#bl>break line</A> command above.
696
1388
 
697
1389
<P>
698
1390
The layout of a preformatted section, &lt;pre&gt;, is honored,
699
1391
although sequences of blank lines are compressed down to one blank line,
700
 
and whitespace at the end of lines is stripped.
 
1392
and whitespace at the end of lines is stripped.&nbsp;
701
1393
This preserves the structure of street addresses,
702
1394
and other preformatted blocks.
703
1395
 
704
1396
<P>
705
 
Tables are formatted like an ascii unload from a spreadsheet or sql database.
706
 
Pipes separate the fields on each row.
 
1397
Tables are formatted like an ascii unload from a spreadsheet or sql database.&nbsp;
 
1398
Pipes separate the fields on each row.&nbsp;
707
1399
There is no whitespace around the pipes,
708
 
and the fields of a given row probably won't line up with the fields from the previous row.
 
1400
and the fields of a given row probably won't line up with the fields below.&nbsp;
709
1401
It isn't pretty,
710
1402
but a blind user can't really trace down a column in any case,
711
 
especially when using a line editor such as this.
712
 
Better to write the table to a local file and use cut, sort, join, etc.
 
1403
especially when using a line editor such as this.&nbsp;
 
1404
Better to write the table to a local file and use cut, sort, join, etc.&nbsp;
713
1405
Here is a sample table.
714
1406
 
715
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>part number|quantity|price
 
1407
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>part number|quantity|price
716
1408
2635|2|$34.80
717
1409
1398|1|$67.50
718
1410
8118|5|$125.00
719
1411
</font></PRE>
720
1412
 
721
1413
<P>
722
 
Empty fields at the end of a row are dropped.
 
1414
Empty fields at the end of a row are dropped.&nbsp;
723
1415
These are almost always images -- sometimes an entire row of images --
724
 
sometimes an entire table of images.
725
 
The blind user doesn't need to read the zero-content pipes.
 
1416
sometimes an entire table of images.&nbsp;
 
1417
The blind user doesn't need to read the no-content pipes.
726
1418
 
727
1419
<P>
728
 
Note that the browsable text is readonly.
729
 
After all, it's not the "source" -- why should you edit it?
 
1420
Note that the browsable text is readonly.&nbsp;
 
1421
After all, it's not the "source" -- why should you edit it?&nbsp;
730
1422
There are ways to enter and edit the input fields of an on-line form,
731
 
but this will be discussed later.
732
 
For now, you can think of the text as readonly.
733
 
Issue a move or copy or insert or substitute command,
 
1423
but this will be discussed later.&nbsp;
 
1424
For now, you can think of the text as readonly.&nbsp;
 
1425
Issue a copy or insert or substitute command,
734
1426
and you'll get an error.
735
1427
 
736
1428
<P>
737
 
If you do want to edit the text, as text,
738
 
enter the `et' command (edit as text).
739
 
You will not be able to return to the html that produced this page.
740
 
Nor can you follow a hyperlink or submit a fill-out form.
 
1429
If you do want to edit the text, as pure text,
 
1430
enter the `et' command (edit as text).&nbsp;
 
1431
You will not be able to return to the html that produced this page.&nbsp;
 
1432
Nor can you follow a hyperlink or submit a fill-out form.&nbsp;
741
1433
The browsable text has become plain text, with no internet semantics.
742
1434
 
743
1435
<P>
744
 
The command `b file.html' is shorthand for `e file.html', followed by `b'.
 
1436
The command `b file.html' is shorthand for `e file.html', followed by `b'.&nbsp;
745
1437
Remember that the ub command reverses the browse conversion, and reproduces the original html text,
746
 
as though you had entered `e file.html'.
 
1438
as though you had entered `e file.html' alone.
747
1439
 
748
1440
<P>
749
1441
If a url is opened from the command line,
750
 
as in "edbrowse www.google.com", it is automatically browsed.
 
1442
as in `e www.google.com', it is automatically browsed.&nbsp;
751
1443
Type `ub' to revert back to the raw html.
752
1444
 
753
 
<H4 align=center> Technical, Math </H4>
 
1445
<H3 align=center> <A NAME=math> Technical, Math </A> </H3>
754
1446
 
755
1447
Most people never read technical web pages, but if you do...
756
1448
 
757
1449
<P>
758
 
A subscript, as indicated by html tags, is enclosed in brackets.
759
 
Thus x&lt;sub&gt;n&lt;/sub&gt; becomes x[n].
760
 
This transformation is not done if the subscript is a one or two digit number.
761
 
Thus x subscript 1 is rendered x1, just like your professor would say it.
 
1450
A subscript, as indicated by html tags, is enclosed in brackets.&nbsp;
 
1451
Thus x&lt;sub&gt;n&lt;/sub&gt; becomes x[n].&nbsp;
 
1452
This transformation is not done if the subscript is a one or two digit number.&nbsp;
 
1453
Thus x subscript 1 is rendered x1, just like your professor would say it.&nbsp;
762
1454
This is not ambiguous, as you might first think;
763
 
only programmers use x1 as a variable name, not mathematicians.
764
 
If you see x1 in a formula, it means x subscript 1.
 
1455
only programmers use x1 as a variable name, not mathematicians.&nbsp;
 
1456
If you see x1 in a formula, it means x subscript 1.&nbsp;
765
1457
Even 17a3b3 is not ambiguous;
766
1458
it is a translation of 17 times a[3] times b[3].
767
1459
 
768
1460
<P>
769
 
Superscripts are enclosed in parentheses, with a preceeding arrow.
770
 
The parentheses are omited if the superscript is a number or letter.
 
1461
Superscripts are enclosed in parentheses, with a preceeding arrow.&nbsp;
 
1462
The parentheses are omited if the superscript is a number.&nbsp;
771
1463
Thus x cubed looks like x^3,
772
1464
while x to the n-1 power looks like x^(n-1).
773
1465
 
774
1466
<P>
775
1467
There are, sad to say, three different ways to encode mathematical symbols
776
 
in html.
 
1468
in html.&nbsp;
777
1469
At present edbrowse only supports one of them,
778
 
though it is the most common, and the most portable among all browsers.
779
 
This is the symbolic font face,
 
1470
though it is the most common, and the most portable among all browsers.&nbsp;
 
1471
This is the unicode system,
780
1472
where the Greek letter theta is specified as
781
 
&lt;font face=symbol&gt;q&lt;/font&gt;.
782
 
Explorer turns this expression into <font face=symbol>q</font>,
 
1473
&amp;#952;.&nbsp;
 
1474
Explorer turns this expression into &#952;,
783
1475
one character on the screen,
784
 
while edbrowse turns it into the word theta.
785
 
It also puts spaces around the word
786
 
if its neighbors are also words.
787
 
This is illustrated by the circumfrence of a circle, which is 2 times pi times r.
 
1476
while edbrowse turns it into the word theta.&nbsp;
 
1477
We also put spaces around the word
 
1478
if its neighbors are also words.&nbsp;
 
1479
This is illustrated by the circumfrence of a circle, which is 2 times pi times r.&nbsp;
788
1480
These three tokens are usually squashed together,
789
1481
and there is no confusion in the sighted world,
790
 
where pi is a separate Greek letter.
 
1482
where pi is a separate Greek letter.&nbsp;
791
1483
But if pi is spelled out,
792
1484
and the tokens are left together,
793
 
the result is 2pir.
794
 
Now pir looks like a three letter word.
 
1485
the result is 2pir.&nbsp;
 
1486
Now pir looks like a three letter word.&nbsp;
795
1487
To avoid this, edbrowse inserts spaces, giving 2 pi r.
796
 
Other symbols, such as degrees, one half, times, etc,
797
 
are also expanded into words, with the same whitespace considerations.
798
1488
 
799
1489
<P>
800
1490
These translations are designed to work with the pages of the
801
 
<A HREF=http://www.mathreference.com> on-line math project</A>,
 
1491
<A HREF=http://www.mathreference.com> Math Reference Project</A>,
802
1492
an archive of advanced mathematics
803
 
that atemps to be both sighted and blind friendly at the same time.
 
1493
that atemps to be both sighted and blind friendly at the same time.&nbsp;
804
1494
This may be impossible,
805
 
but I'm giving it a shot.
 
1495
but I'm giving it a whirl.
806
1496
 
807
 
<H4 align=center> Title, Description, Keywords </H4>
 
1497
<H3 align=center> <A NAME=title> Title, Description, Keywords </A> </H3>
808
1498
 
809
1499
While in browse mode, the commands ft, fd, and fk
810
 
produce the title, description, and keywords of the current web page respectively.
811
 
These are normally not visible to the user.
812
 
The title describes the web page in 80 characters or less.
 
1500
produce the title, description, and keywords of the current web page respectively.&nbsp;
 
1501
These are normally not visible to the user.&nbsp;
 
1502
The title describes the web page in 80 characters or less.&nbsp;
813
1503
The description is a more complete explanation,
814
 
which is displayed by a search engine such as yahoo or altavista.
815
 
The user reads the description via the search engine and decides whether to read that web page.
816
 
Finally, the keywords are used by search engines to facilitate keyword searches.
 
1504
which is displayed by a search engine such as yahoo or altavista.&nbsp;
 
1505
The user reads the description via the search engine and decides whether to read that web page.&nbsp;
 
1506
Finally, the keywords are used by search engines to facilitate keyword searches.&nbsp;
817
1507
Like the rest of the browsable text,
818
 
these three attributes are readonly.
 
1508
these three attributes are readonly.&nbsp;
819
1509
If it is your web page,
820
 
you can modify them by returning to the raw html.
 
1510
you can modify them by returning to the raw html.&nbsp;
821
1511
Web designers should pay close attention to the description and the keywords,
822
1512
else your pages will not be accessible via the standard search engines.
823
1513
 
824
1514
<P>
825
1515
Note that `ft' prints the title of the web page,
826
 
whereas `f t' renames the current file to "t".
827
 
 
828
 
<H4 align=center> Hyperlinks </H4>
829
 
 
830
 
A link to another web page is enclosed in braces, as in:
831
 
 
832
 
<P>
833
 
{Recent reports} suggest a connection between ADHD and food additives.
 
1516
whereas `f t' (with a space) renames the current file to "t",
 
1517
which is probably not what you want.
 
1518
 
 
1519
<H3 align=center> <A NAME=rf> The Refresh Command </A> </H3>
 
1520
 
 
1521
Type `rf' to refresh the current file.&nbsp;
 
1522
This rereads the file or url into the current buffer.&nbsp;
 
1523
It does not push a new editing session onto the stack.&nbsp;
 
1524
This is analogous to the refresh button on Netscape and Explorer.
 
1525
 
 
1526
<P>
 
1527
If a web page is updated every minute, e.g. with the latest stock prices for your favorite companies,
 
1528
you can type rf to fetch the latest copy of this web page.&nbsp;
 
1529
This assumes the intervening internet servers are not caching the web page
 
1530
and handing you the same out-of-date copy over and over again.
 
1531
 
 
1532
<P>
 
1533
On your local machine,
 
1534
you can use this feature to read the latest version of a dynamic file,
 
1535
such as a log file.&nbsp;
 
1536
Or you can reread a directory,
 
1537
to incorporate any new files that have been placed in that directory.&nbsp;
 
1538
For example, you might use the shell escape to execute
 
1539
`cat x y &gt;z',
 
1540
yet z will not appear in your directory scan until you type rf.
 
1541
 
 
1542
<H3 align=center> <A NAME=hlink> Hyperlinks </A> </H3>
 
1543
 
 
1544
A link to another web page is enclosed in braces, like this:
 
1545
 
 
1546
<P>
 
1547
{Recent reports} suggest a connection between autism and intestinal bacteria.
834
1548
 
835
1549
<P>
836
1550
Behind the scenes, "recent reports" is linked to
837
 
www.feingold.org/research.shtml,
 
1551
www.pecanbread.com/BTVCautismchapter.html,
838
1552
but you don't see that unless you activate the link
839
1553
or view the raw html.
840
1554
 
841
1555
<P>
842
1556
Of course the browsable text might also contain words inside braces,
843
 
especially if the web page is technical in nature.
844
 
Hence there is some ambiguity.
845
 
However, I believe it is clear from context.
 
1557
especially if the web page is technical in nature.&nbsp;
 
1558
Hence there is some ambiguity.&nbsp;
 
1559
However, I believe it is clear from context.&nbsp;
846
1560
{More information} is probably a link,
847
1561
whereas ${HOME}/.profile is probably not.
848
1562
 
849
1563
<P>
850
1564
Some web pages present a series of icons
851
 
that are actually links to other pages.
852
 
That is, you click on an icon, rather than a phrase, to go somewhere else.
853
 
These icons are suppose to be intuitive.
854
 
Sometimes they are -- sometimes they're not.
855
 
In any case, they aren't much use to the blind.
 
1565
that are actually links to other pages.&nbsp;
 
1566
That is, you click on an icon, rather than a phrase, to go somewhere else.&nbsp;
 
1567
These icons are suppose to be intuitive.&nbsp;
 
1568
Sometimes they are -- sometimes they're not.&nbsp;
 
1569
In any case, they aren't much use to the blind.&nbsp;
856
1570
Sometimes the web designer is kind enough to supply
857
 
a text phrase that roughly describes the image.
858
 
In this case the phrase is used as the link.
859
 
It appears in braces, as though there were no image at all.
 
1571
a text phrase that roughly describes the image.&nbsp;
 
1572
In this case the phrase is used as the link.&nbsp;
 
1573
It appears in braces, as though there were no image at all.&nbsp;
860
1574
If there is no alternate phrase,
861
 
the filename of the hyperlink reference is used.
 
1575
the filename of the hyperlink reference is used.&nbsp;
862
1576
This name can be surprisingly helpful,
863
 
or it can be utterly useless, as in "index.html".
 
1577
or it can be utterly useless, as in "index.html".&nbsp;
864
1578
If this name canot be determined,
865
 
the generic link {image} is used.
 
1579
the generic link {image} is used.&nbsp;
 
1580
In this case you will have to go to the web page to find out what it contains.
866
1581
 
867
1582
<P>
868
 
To follow a link, enter the `g' (go) command.
 
1583
To follow a link, enter the `g' (go) command.&nbsp;
869
1584
Yes, `g' also initiates a global command,
870
1585
such as a global substitute,
871
 
but only when it is followed by a regular expression.
 
1586
but only when it is followed by a regular expression.&nbsp;
872
1587
By itself, g follows the link on the current line,
873
 
4g follows the link on line 4,
874
 
and g2 follows the second link on the current line.
 
1588
g2 follows the second link on the current line,
 
1589
and 4g follows the link on line 4.&nbsp;
875
1590
If a link spreads across multiple lines, you must be on the first of these lines,
876
1591
the line containing the left brace.
877
1592
 
878
1593
<P>
879
 
The g command can also follow a link that is written in raw text,
880
 
as long as it "looks" like a valid url.
 
1594
The g command can also act on a link that is written in raw text,
 
1595
as long as it "looks" like a valid url.&nbsp;
881
1596
If your friend sends you an interesting url via email,
882
1597
and you save it to a text file,
883
1598
you can "go" to that link,
884
 
even though the file is not html
 
1599
even though the file is not html,
885
1600
and you've never issued a browse command.
886
1601
 
887
 
<H4 align=center> Internal Links </H4>
 
1602
<H3 align=center> <A NAME=ilink> Internal Links </A> </H3>
888
1603
 
889
1604
Although most links lead to other web pages,
890
 
some links point to other sections within the current document.
891
 
Again, you will be able to tell by context.
 
1605
some links point to other sections within the current document.&nbsp;
 
1606
Again, you will be able to tell by context.&nbsp;
892
1607
Links in the table of contents are usually
893
 
shortcuts to chapters in the current document.
 
1608
shortcuts to chapters in the current document.&nbsp;
894
1609
The same holds for links that look like:
895
1610
see {Appendix I},
896
1611
or, see the section on {Hardware Configuration}.
897
1612
 
898
1613
<P>
899
 
The g command follows an internal link or an external link.
900
 
Either way you find yourself in a different place.
 
1614
The g command follows an internal link or an external link.&nbsp;
 
1615
Either way you find yourself in a different place.&nbsp;
901
1616
However, if the link is internal,
902
 
you are still browsing the same file.
903
 
In fact, the only thing that has changed is the current line number.
 
1617
you are still browsing the same file.&nbsp;
 
1618
In fact, the only thing that has changed is the current line number.&nbsp;
904
1619
The new line is displayed,
905
 
and should correspond to the link you activated.
906
 
Often the words are the same.
907
 
Activate {Appendix I}, and you'll probably see the section heading "Appendix I".
 
1620
and should correspond to the link you activated.&nbsp;
 
1621
Often the words are the same.&nbsp;
 
1622
Activate {Appendix I}, and you'll probably see the section heading "Appendix I".&nbsp;
908
1623
Enter z10 to read the first few lines of the appendix.
909
1624
 
910
 
<H4 align=center> The Back Key </H4>
 
1625
<H3 align=center> <A NAME=back> The Back Key </A> </H3>
911
1626
 
912
1627
If you edit a new file via the `e', `b', or `g' commands,
913
1628
and you already have text in the buffer,
914
 
that text is bundled up and pushed onto an internal stack.
915
 
You can pop the stack by issuing the `^' command.
 
1629
that text is bundled up and pushed onto an internal stack.&nbsp;
 
1630
You can pop the stack by issuing the `^' command.&nbsp;
916
1631
This is suppose to be intuitive --
917
1632
the up arrow pointing to the previous page that rolled off your screen.
918
1633
 
919
1634
<P>
920
1635
This feature seems rather silly if you're just editing files,
921
 
but it makes sense when surfing the net.
 
1636
but it makes sense when surfing the net.&nbsp;
922
1637
Often we descend through two or three links,
923
 
only to find ourselves at a dead end.
924
 
"I didn't want to go here."
925
 
So we hit the back key again and again, until we reach familiar territory.
926
 
We can now proceed in a new direction.
927
 
The command ^3 or ^^^ backs up through three pages.
 
1638
only to find ourselves at a dead end.&nbsp;
 
1639
"I didn't want to go here."&nbsp;
 
1640
So we hit the back key again and again, until we reach familiar territory.&nbsp;
 
1641
We can now proceed in a new direction.&nbsp;
 
1642
The command ^3 or ^^^ backs up through three pages.&nbsp;
928
1643
Don't use this iterative feature unless you know exactly how many times you need to back up.
929
1644
 
930
1645
<P>
931
1646
Note that the entire state of an editing session is saved and reproduced,
932
 
including the file name, the last change (for undo),
933
 
the last search/replace strings for substitutions, etc.
934
 
The only bit that is cleared is the "write pending" bit.
935
 
After all, the program asked you if you wanted to save the changes
936
 
when you first edited the new file.
937
 
Apparently you didn't (having issued the edit command again),
938
 
so we may as well clear that bit.
939
 
You can still pop the stack and save the prior changes to disk,
940
 
but you don't have to.
 
1647
including the file name,
 
1648
the last search/replace strings for substitutions,
 
1649
the hyperlinks and forms,
 
1650
the compiled javascript,
 
1651
everything!
941
1652
 
942
1653
<P>
943
 
Unlike lynx, I don't keep a running history of every web page visited.
944
 
I never really saw a need for this feature.
 
1654
Unlike lynx, I don't keep a running history of every web page visited.&nbsp;
 
1655
I never really saw a need for this feature.&nbsp;
945
1656
99% of the time I simply want to back up one or two pages,
946
 
and that's it.
947
 
Unfortunately this high-runner operation requires two somersaults and a back flip under lynx.
 
1657
and that's it.&nbsp;
 
1658
Unfortunately this high-runner operation requires two somersaults and a back flip under lynx.&nbsp;
948
1659
It is a one key command in my browser.
949
1660
 
950
1661
<P>
951
1662
The stack should not be confused with parallel edits,
952
 
as described in an earlier section.
953
 
In fact each editing session, e1 e2 e3 ..., has its own internal stack.
 
1663
as described in an earlier section.&nbsp;
 
1664
In fact each editing session, e1 e2 e3 ..., has its own internal stack.&nbsp;
954
1665
Parallel sessions are appropriate when you need to move back and forth between two files,
955
 
or cut&amp;paste between them.
 
1666
or cut&amp;paste between them.&nbsp;
956
1667
However, one session, with its internal stack,
957
1668
is usually sufficient to surf the net.
958
1669
 
960
1671
If a browse command fails completely,
961
1672
giving you a rather uninteresting empty buffer,
962
1673
the stack is popped automatically,
963
 
taking you back to the previous web page.
 
1674
taking you back to the previous web page.&nbsp;
964
1675
Now you can retry the link by typing `g' again,
965
 
or follow a different link on the page.
 
1676
or follow a different link on the page.&nbsp;
966
1677
Note that a browse command can fail, and still give you text explaining why it failed,
967
 
if the remote server is well-designed.
 
1678
if the remote server is well-designed.&nbsp;
968
1679
In this case you may see the error message "file not found",
969
 
yet you will be viewing a new web page, which explains the problem.
970
 
After you've read the explanation, type ^ to back up and try again.
 
1680
yet you will be viewing a new web page, which explains the problem.&nbsp;
 
1681
After you've read the explanation,
 
1682
follow its directions,
 
1683
or type ^ to back up and try again.
971
1684
 
972
1685
<P>
973
 
If you are presented with a number, even 0, the stack has been pushed, and you are in a new file or url.
974
 
Use the ^ command to get back.
 
1686
If you are presented with a number, even 0, the stack has been pushed, and you are in a new file or url.&nbsp;
 
1687
The number is the size of the new file.&nbsp;
 
1688
Use the ^ command to get back.&nbsp;
975
1689
If there is no number, merely an error message,
976
 
then edbrowse did not create a new buffer.
977
 
(It didn't get that far.)
 
1690
then edbrowse did not create a new buffer.&nbsp;
 
1691
It probably didn't get that far.&nbsp;
978
1692
Typing . will produce the same line you saw before.
979
1693
 
980
1694
<P>
981
1695
Following an internal link to another section in the current document
982
 
does not push anything onto the stack.
983
 
In other words, ^ will not take you back to where you were.
984
 
In fact, it will take you up to the previous web page, which is not what you want.
 
1696
does not push anything onto the stack.&nbsp;
 
1697
In other words, ^ will not take you back to where you were.&nbsp;
 
1698
In fact, it will take you up to the previous web page, which is not what you want.&nbsp;
985
1699
If you want to take a glance at Appendix I, and then return,
986
 
mark the current position with `kr'.
 
1700
mark the current position with `kr'.&nbsp;
987
1701
After you've visited the appendix, use the label 'r to return to your original location in the file.
988
1702
 
989
 
<P>
990
 
If you want to follow several web pages in parallel,
991
 
you can save each one to another session using the w command.
992
 
The tags and links are transferred along with the rendered text.
993
 
For example, suppose a web page presents
 
1703
<H3 align=center> <A NAME=move> The M Command </A> </H3>
 
1704
 
 
1705
If you want to read and/or interact with several web pages in parallel,
 
1706
pages that would normally stack up,
 
1707
you can move each one to another session using the capital M command.&nbsp;
 
1708
The tags and links are transferred along with the rendered text.&nbsp;
 
1709
Once the web page has moved to another session,
 
1710
edbrowse issues the ^ command for you.&nbsp;
 
1711
Now you are back to the previous page.
 
1712
 
 
1713
<P>
 
1714
It is generally unsafe to make a copy of a running web page,
 
1715
with all its javascript objects etc,
 
1716
so the M command <em>moves</em> the page out of the way,
 
1717
and takes you back to the previous page.&nbsp;
 
1718
Note, this command works just as well with files.
 
1719
 
 
1720
<P>
 
1721
Suppose a web page presents
994
1722
<P>
995
1723
{planes}
996
1724
<br>
1002
1730
If you are curious about all three topics,
1003
1731
issue these commands in this order.
1004
1732
 
1005
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>1g
1006
 
w2
1007
 
^
 
1733
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>1g
 
1734
M2
1008
1735
2g
1009
 
w3
1010
 
^
 
1736
M3
1011
1737
3g
1012
 
w4
1013
 
^
 
1738
M4
1014
1739
</font></PRE>
1015
1740
 
1016
1741
<P>
1017
 
Now sessions 2 3 and 4 are the subpages about plains trains and automobiels respectively.
 
1742
Now sessions 2 3 and 4 are the subpages about plains trains and automobiels respectively.&nbsp;
1018
1743
You can fill out forms or follow hyperlinks in any of them,
1019
1744
or stay in session 1 and do something else.
1020
1745
 
1021
 
<H4 align=center> Input Fields </H4>
1022
 
 
1023
 
The input fields of an on-line form are usually indicated by angle brackets.
 
1746
<H3 align=center> <A NAME=music> Background Music </A> </H3>
 
1747
 
 
1748
If you are trying to listen to a speech synthesizer,
 
1749
the last thing you need is background music.&nbsp;
 
1750
Instead of playing the song, I make it available to you through a hyperlink.
 
1751
<P>
 
1752
{Background Music}
 
1753
<P>
 
1754
This always appears at or near the top of the page.&nbsp;
 
1755
Click on this link and download the wave or mp3 file,
 
1756
and play it at your convenience.&nbsp;
 
1757
Use the play buffer `pb' command.&nbsp;
 
1758
Normally pb uses the name of the file to infer the audio format.&nbsp;
 
1759
If the filename ends in .wav, it's a wave file, and so on.&nbsp;
 
1760
If the filename is not particularly helpful, and you know the audio format, you can specify it by typing
 
1761
pb.wav for a wave file, pb.mp3 for an mp3 file, and so on.
 
1762
 
 
1763
<P>
 
1764
The config file (described below)
 
1765
includes mime type descriptors,
 
1766
which tell edbrowse how to play wave and mp3 files etc.&nbsp;
 
1767
These must be set up, or the pb command won't work.&nbsp;
 
1768
It will say something like,
 
1769
"I don't know how to process an mp3 file".&nbsp;
 
1770
This is consistent with other browsers, which use "plugins" to play multimedia files that are retrieved from the internet.
 
1771
 
 
1772
<H3 align=center> <A NAME=input> Input Fields </A> </H3>
 
1773
 
 
1774
The input fields of an on-line form are usually indicated by angle brackets.&nbsp;
1024
1775
For example, a search engine might present the following form.
1025
1776
 
1026
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>Keywords: &lt;&gt;
 
1777
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>Keywords: &lt;&gt;
1027
1778
Advanced parsing: &lt;-&gt;
1028
1779
Language: &lt;en&gt;
1029
1780
Search now: &lt;GO&gt;
1031
1782
</font></PRE>
1032
1783
 
1033
1784
<P>
1034
 
The first line in this sample form is a simple text field, which is initially empty.
1035
 
You supply the keywords to search for.
 
1785
The first line in this sample form is a simple text field, which is initially empty.&nbsp;
 
1786
You supply the keywords to search for.&nbsp;
1036
1787
Entering and editing input fields is discussed later.
1037
1788
 
1038
1789
<P>
1039
 
The second line is a checkbox.
 
1790
The second line is a checkbox.&nbsp;
1040
1791
This field tells the search engine to use advanced boolean features,
1041
 
such as this keyword and that, or this, but not that, etc.
1042
 
The feature is disabled, indicated by -.
1043
 
(Most people don't know how to use advanced search anyways.)
 
1792
such as this keyword and that, or this, but not that, etc.&nbsp;
 
1793
The feature is disabled, indicated by -.&nbsp;
 
1794
(Most people don't know how to use advanced search anyways.)&nbsp;
1044
1795
A + means the checkbox is on.
1045
1796
 
1046
1797
<P>
1047
 
The third line determines the language of the keywords, English by default.
1048
 
This isn't a free text field, you can't just type in anything you want.
 
1798
The third line determines the language of the keywords, English by default.&nbsp;
 
1799
This isn't a free text field, you can't just type in anything you want.&nbsp;
1049
1800
We'll describe how to view the options later.
1050
1801
 
1051
1802
<P>
1052
1803
The fourth line is the submit button, which sends the form to the search engine
1053
 
and retrieves the results.
 
1804
and retrieves the results.&nbsp;
1054
1805
This "field" cannot be edited; it is merely a button to push.
1055
1806
 
1056
1807
<P>
1057
 
The fifth line is also a button to push.
1058
 
It clears all the data you have entered, so you can start over.
1059
 
Default values will be restored.
 
1808
The fifth line is also a button to push.&nbsp;
 
1809
It clears all the data you have entered, so you can start over.&nbsp;
 
1810
Default values will be restored.&nbsp;
1060
1811
Thus the third line goes back to &lt;en&gt;, rather than &lt;&gt;.
1061
1812
 
1062
 
<H4 align=center> Data Entry </H4>
 
1813
<H3 align=center> <A NAME=entry> Data Entry </A> </H3>
1063
1814
 
1064
 
Filling out a form is relatively easy, once you know the `I' command.
1065
 
The capital letter I indicates input fields (browse mode),
1066
 
whereas lower case i inserts lines of text in edit mode.
1067
 
In practice there is no ambiguity,
1068
 
so you can  use either lower case i or upper case I for data entry.
 
1815
Filling out a form is relatively easy,
 
1816
once you are familiar with the (overloaded) `i' command.&nbsp;
 
1817
Yes, i by itself means insert text,
 
1818
but in browse mode, i refers to the input fields.
1069
1819
 
1070
1820
<P>
1071
 
If there is only one input field on the current line, i?
1072
 
displays information about that input field.
 
1821
If there is only one input field on the current line, i?&nbsp;
 
1822
displays information about that input field.&nbsp;
1073
1823
If the line contains multiple input fields, you will need to use a number,
1074
 
as in i3? for the third field.
1075
 
The type of input field is displayed, then its size, then the current value, then the field name.
 
1824
as in i3? for the third field.&nbsp;
 
1825
The type of input field is displayed, then its size,
 
1826
then the field name.&nbsp;
1076
1827
If the input field is drawn from a set of options,
1077
1828
the option list is displayed as well,
1078
 
with menu numbers prepended.
 
1829
with menu numbers prepended.&nbsp;
1079
1830
When you want to select an option,
1080
1831
you can either type in a substring that determines that option uniquely,
1081
1832
such as mich for Michigan,
1082
 
or you can type in its menu number.
1083
 
Needless to say, the latter is often easier.
1084
 
Recall the sample form in the previous section.
 
1833
or you can type in its menu number.&nbsp;
 
1834
Needless to say, the latter is often easier.&nbsp;
 
1835
Recall the sample form in the previous section.&nbsp;
1085
1836
If you type i? at the third field, you might see the following.
1086
1837
 
1087
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>select[7] &lt;english&gt; [language]
 
1838
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>select[7] language
1088
1839
1: english
1089
1840
2: french
1090
1841
3: german
1094
1845
 
1095
1846
<P>
1096
1847
If a select list contains hundreds of options,
1097
 
type i?string to see only those options that contain the specified string.
1098
 
Type I?mi in a state field and get Michigan, Mississippi, Missouri, and Minnesota.
1099
 
Then select the option you want by name or by number.
 
1848
type i?string to see only those options that contain the specified string.&nbsp;
 
1849
Type I?mi in a state field and get Michigan, Mississippi, Missouri, and Minnesota.&nbsp;
 
1850
Then you can select the option you want by name or by number.
1100
1851
 
1101
1852
<P>
1102
 
Now let's do some data entry.
1103
 
Type i=xyz to place xyz in the input field.
 
1853
Now let's do some data entry.&nbsp;
 
1854
Type i=xyz to place xyz in the input field.&nbsp;
1104
1855
Remember, you will need to type i3=xyz
1105
 
to put information into the third input field on the current line.
 
1856
to put information into the third input field on the current line.&nbsp;
1106
1857
If you get an error, it is probably because the field has a fixed set of options,
1107
 
and you didn't pick one of those options.
1108
 
You can either type in one of the options or its menu number.
 
1858
and you didn't pick one of those options.&nbsp;
 
1859
You can either type in one of the options or its menu number.&nbsp;
1109
1860
You can also type in a fragment of the option you want,
1110
 
and edbrowse will fill in the rest.
 
1861
and edbrowse will fill in the rest.&nbsp;
1111
1862
This is done whenever one and only one option contains a copy
1112
 
(case insensitive) of the string you entered.
 
1863
(case insensitive) of the string you entered.&nbsp;
1113
1864
Thus you could enter tali above and get Italian,
1114
 
as that is the only language with those four letters.
 
1865
as that is the only language with those four letters.&nbsp;
1115
1866
This is useful when you are entering your address,
1116
 
and they ask for the state.
 
1867
and they ask for the state.&nbsp;
1117
1868
Type in a few letters of your state name, enough to be unique,
1118
 
and you'll probably glom onto the correct option in the list.
 
1869
and you'll probably glom onto the correct option in the list.&nbsp;
1119
1870
Note the paradigm here:
1120
1871
blind people don't want to wade through a menu unless they absolutely have to!
1121
1872
 
1122
1873
<P>
1123
 
You can use i&lt;7 to pull the contents of session 7 into the current input field.
1124
 
Session 7 must have one line of text.
1125
 
Similarly, i&lt;filename reads the contents of the file into the current input field.
1126
 
Again, the file should contain one line of text.
1127
 
The filename is expanded in the usual way.
1128
 
This includes wildcard expansion, as long as the expansion leads to one and only one file.
 
1874
There is some ambiguity when the option is itself a number.&nbsp;
 
1875
In this case I perform three matches.&nbsp;
 
1876
If you type in the number exactly as it appears, that option is selected.&nbsp;
 
1877
If the number you entered is not a perfect match for one of the options, it is treated as a menu number.&nbsp;
 
1878
If it is not a valid menu number (e.g. out of range), I perform a partial match on the options, looking for those digits as a substring.&nbsp;
 
1879
This may seem confusing, but it is usually what you want.
 
1880
 
 
1881
<P>
 
1882
You can use i&lt;7 to pull the contents of session 7 into the current input field.&nbsp;
 
1883
Session 7 must have one line of text.&nbsp;
 
1884
Similarly, i&lt;filename reads the contents of the file into the current input field.&nbsp;
 
1885
Again, the file should contain one line of text.&nbsp;
 
1886
The filename is expanded in the usual way.&nbsp;
 
1887
This includes wildcard expansion, as long as the expansion leads to one and only one file.&nbsp;
1129
1888
Put enough characters around the * to designate a single file.
1130
1889
 
1131
1890
<P>
1132
 
Now suppose you are entering your credit card number, all 16 digits, into a free text field.
1133
 
If you've made a typo, you don't really want to enter the entire string again.
1134
 
No problem -- use the substitute command.
1135
 
You can write this as I/x/y/ or i/x/y/ or s/x/y/ -- whatever you prefer.
1136
 
Remember, you may need to specify a field, as in s3/x/y/.
1137
 
The usual substitution syntax is honored.
 
1891
Now suppose you are entering your credit card number, all 16 digits, into a free text field.&nbsp;
 
1892
If you've made a typo, you don't really want to enter the entire string again.&nbsp;
 
1893
No problem -- use the substitute command.&nbsp;
 
1894
You can write this as i/x/y/ or s/x/y/ -- as you prefer.&nbsp;
 
1895
Remember, you may need to specify a field, as in s3/x/y/.&nbsp;
 
1896
The usual substitution syntax is honored.&nbsp;
 
1897
Don't overgenralize the g suffix in your mind.&nbsp;
 
1898
s3/x/y/g changes every x to y in the third input field, but does not affect the other fields on the current line.
1138
1899
 
1139
1900
<P>
1140
 
If the submit button is the third field on the current line, you can press it via i3*.
1141
 
However, i* is sufficient when there is only one button on the line.
 
1901
If the submit button is the third field on the current line, you can press it via i3*.&nbsp;
 
1902
However, i* is sufficient when there is only one button on the line.&nbsp;
1142
1903
Similarly, you can establish a text field by entering i=kangaroo,
1143
 
rather than i1=kangaroo, if the second field on the current line is a submit button.
 
1904
rather than i1=kangaroo, if the second field on the current line is a submit button.&nbsp;
1144
1905
You only need specify a field number
1145
1906
when there are multiple input fields, or multiple buttons, on the current line.
1146
1907
 
1147
 
<H4 align=center> Text Areas </H4>
 
1908
<H3 align=center> <A NAME=textarea> Text Areas </A> </H3>
1148
1909
 
1149
 
Some internet forms allow you to type freely, as in "Please enter your comments here."
 
1910
Some internet forms allow you to type freely, as in "Please enter your comments here."&nbsp;
1150
1911
This is done inside a window within the screen,
1151
1912
having a fixed number of rows and columns,
1152
 
although that is usually an artificial constraint.
 
1913
although that is usually an artificial constraint.&nbsp;
1153
1914
The sighted user can type more lines than the window will hold,
1154
 
and the window scrolls appropriately.
1155
 
Fortunately the blind user can ignore the artificial window and type freely.
 
1915
and the window scrolls appropriately.&nbsp;
 
1916
Fortunately the blind user can ignore the artificial window and type freely.&nbsp;
1156
1917
Still, the i? directive tells you how big the window would be,
1157
 
if you were running a visual browser.
 
1918
if you were running a visual browser.&nbsp;
1158
1919
You might see something like "area[7x40]", which indicates a window 7 rows by 40 columns.
1159
1920
 
1160
1921
<P>
1161
 
The lynx implementation of the text area is particularly hideous.
1162
 
This is not surprising, since lynx is not an editor.
 
1922
The lynx implementation of the text area is particularly hideous.&nbsp;
 
1923
This is not surprising, since lynx is not an editor.&nbsp;
1163
1924
You can correct small typos on the current line,
1164
 
but you can't actually "edit" the text you are working on.
1165
 
Once you hit return, that line is done, and you're on to the next line.
1166
 
You can't move lines around or insert lines etc.
 
1925
but you can't actually "edit" the text you are working on.&nbsp;
 
1926
Once you hit return, that line is done, and you're on to the next line.&nbsp;
 
1927
You can't move lines around or insert lines etc.&nbsp;
1167
1928
Nor can you prepare your comments ahead of time and read them into the text area from a file.
1168
1929
 
1169
1930
<P>
1170
 
In this program, the text area is managed from another editing session.
1171
 
This allows you to use the full power of the editor.
 
1931
In edbrowse, the text area is managed from another editing session.&nbsp;
 
1932
This allows you to use the full power of the editor.&nbsp;
1172
1933
You can move text, make global substitutions,
1173
 
or read comments in from a prepared file.
1174
 
The editing session is chosen for you, and appears in the input field.
 
1934
or read comments in from a prepared file.&nbsp;
 
1935
The editing session is chosen for you, and appears in the input field.&nbsp;
1175
1936
Consider the following form.
1176
1937
 
1177
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>Enter your email address: &lt;&gt;
 
1938
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>Enter your email address: &lt;&gt;
1178
1939
Enter your comments: &lt;buffer 2&gt;
1179
1940
</font></PRE>
1180
1941
 
1181
1942
<P>
1182
 
In this example session 2 was not active when browsing began.
1183
 
The browser allocated session to specifically for this input field.
 
1943
In this example, session 2 was not active when browsing began.&nbsp;
 
1944
The browser allocated session 2 specifically for this input field.&nbsp;
1184
1945
Type e2 to move to session 2, prepare your comments,
1185
 
and type e1 to return to the input form.
 
1946
and type e1 to return to the input form.&nbsp;
1186
1947
On most web pages the text area starts out blank,
1187
1948
whence buffer 2 will be empty,
1188
 
but this is not always the case.
1189
 
Be sure to check for pre-existing text before you start typing your thoughts.
 
1949
but this is not always the case.&nbsp;
 
1950
Be sure to check for pre-existing text before you start typing your thoughts.&nbsp;
1190
1951
A particularly arrogant site might preload the text area with:
1191
 
"I love your web site because".
 
1952
"I love your website because:".
 
1953
 
 
1954
<P>
1192
1955
When you finally submit the form,
1193
1956
as discussed in the next section,
1194
1957
text buffer 2, associated with the second editing session,
1195
 
will replace the words "bufffer 2" in the input field.
1196
 
Thus your carefully crafted comments are on their way.
 
1958
will replace the words "bufffer 2" in the input field.&nbsp;
 
1959
Thus your carefully crafted comments are on their way.&nbsp;
1197
1960
(This doesn't mean anybody is going to listen to them.)
1198
1961
 
1199
 
<H4 align=center> Push The Button </H4>
 
1962
<H3 align=center> <A NAME=button> Push The Button </A> </H3>
1200
1963
 
1201
1964
If the third input field on the current line is a reset or submit button,
1202
 
you can press the button via i3*.
 
1965
you can press the button via i3*.&nbsp;
1203
1966
The reset button puts the input fields back to their original values,
1204
1967
as supplied by the web page when it was first loaded.
1205
 
Text areas are an exception to this rule.
1206
 
They are simply cleared.
1207
 
Since they are usually blank at the start,
1208
 
with no text preloaded,
1209
 
this "bug" isn't a serious problem.
1210
1968
 
1211
1969
<P>
1212
 
The submit button sends the form to the remote server and waits for a response.
 
1970
The submit button sends the form to the remote server and waits for a response.&nbsp;
1213
1971
This is similar to following an internet link,
1214
 
but in this case you are sending some data along with the request.
1215
 
Type "kangaroo" into a search engine and you'll soon be reading a web page about kangaroos.
1216
 
As with any other link, you can use the ^ key to go back.
1217
 
In this case you will return to the on-line form.
 
1972
but in this case you are sending some data along with the request.&nbsp;
 
1973
Type "kangaroo" into a search engine and you'll soon be reading a web page about kangaroos.&nbsp;
 
1974
As with any other link, you can use the ^ key to go back.&nbsp;
 
1975
In this case you will return to the on-line form.&nbsp;
1218
1976
You can change the data and submit the form again, asking about another animal.
1219
1977
 
1220
1978
<P>
1225
1983
<P>
1226
1984
Once you have submitted your form,
1227
1985
and you are viewing the results,
1228
 
you may notice some strange characters at the end of the filename.
1229
 
(This only happens under the "get" method.)
 
1986
you may notice some strange characters at the end of the filename.&nbsp;
1230
1987
If you have retrieved information on kangaroos, the filename might look like:
1231
 
www.search-engine.com?keywords=kangaroo.
 
1988
www.search-engine.com?keywords=kangaroo.&nbsp;
1232
1989
The text after the question mark is an encoded version of the data
1233
 
you entered into the form.
1234
 
It becomes part of the virtual URL.
1235
 
This is actually a feature, as we shall see in the next section.
 
1990
you entered into the form.&nbsp;
 
1991
It becomes part of the virtual URL.&nbsp;
 
1992
This is actually a good thing, as we shall see in the next section.
1236
1993
 
1237
 
<H4 align=center> Web And Email Addresses </H4>
 
1994
<H3 align=center> <A NAME=addr> Web And Email Addresses </A> </H3>
1238
1995
 
1239
1996
The capital A command shows you the web addresses behind
1240
 
the links on the current line.
1241
 
Each web address will be surrounded by &lt;A&gt; and &lt;/A&gt; tags,
1242
 
ready to be pasted into a bookmark file, if that is what you wish.
1243
 
These addresses exist in a new editing session; the previous session has been pushed onto the stack.
1244
 
You can add these to your bookmark file via w+ $bookmarks.
 
1997
the links on the current line.&nbsp;
 
1998
Each web address will be surrounded by &lt;a&gt; and &lt;/a&gt; tags,
 
1999
ready to be pasted into a bookmark file, if that is what you wish.&nbsp;
 
2000
These addresses exist in a new editing session; the previous session has been pushed onto the stack.&nbsp;
 
2001
You can add these to your bookmark file via w+ $bookmarks,
 
2002
assumeing you have set the environment variable bookmarks appropriately.&nbsp;
1245
2003
They will be appended at the end;
1246
 
you can move them to a more appropriate place in the file later on, when you're not "on line".
 
2004
you can move them to a more appropriate place in the file later on, when you're not "on line".&nbsp;
1247
2005
For many, with dial up connections,
1248
2006
connect time is precious,
1249
 
and should not be spent rearranging bookmark files.
1250
 
Finally, use the ^ key to return to the web page you were viewing.
 
2007
and should not be spent rearranging bookmark files.&nbsp;
 
2008
Finally, use the ^ key to return to the web page you were viewing.&nbsp;
1251
2009
Here is how it might look.
1252
2010
 
1253
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>&lt; b this.that.com/whatever  # browse a web page
 
2011
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>&lt; b this.that.com/whatever  # browse a web page
1254
2012
&gt; 16834  # size of the raw html
1255
2013
&gt; 7855  # size of the browsable text
1256
2014
&lt; /kangaroo/i  # looking for kangaroo on the page
1270
2028
</font></PRE>
1271
2029
 
1272
2030
<P>
1273
 
I suppose I could interrogate the environment variable $bookmarks
 
2031
I suppose I could interrogate the environment variable $bookmarks myself,
1274
2032
and append the URL to that file automatically,
1275
 
but as this example shows, you might not want all the links.
1276
 
In fact the email link makes no sense in a bookmark file.
 
2033
but as this example shows, you might not want all the links.&nbsp;
 
2034
In fact the email link makes no sense in a bookmark file.&nbsp;
1277
2035
Also, you may want to change the description of the link,
1278
2036
though in this example the description is pretty reasonable.
1279
2037
 
1280
2038
<P>
1281
2039
Alternatively, you might discard the url and retain the email address,
1282
 
appending it to your address book.
 
2040
appending it to your address book.&nbsp;
1283
2041
Again, you will want to change the generic phrase "send us mail"
1284
 
to a brief string that is meaningful to you, such as kangaroo-mail.
 
2042
to a brief string that is meaningful to you, such as kangaroo-mail.&nbsp;
1285
2043
This becomes the alias, which you can use to send mail
1286
 
to that recipient.
1287
 
Subsequent sections describe the use of this program as a mail client.
 
2044
to that recipient.&nbsp;
 
2045
(Subsequent sections describe the use of edbrowse as a mail client.)
1288
2046
 
1289
2047
<P>
1290
2048
If there are no links on the current line, or you are not in browse mode,
1291
 
the current filename is used.
1292
 
If the filename looks like a URL,
1293
 
it will be enclosed in &lt;A&gt; &lt;/A&gt; tags,
1294
 
as though it were a link.
 
2049
the current filename is used.&nbsp;
1295
2050
This is useful when you want to bookmark the current page,
1296
2051
rather than some other page pointed to by a link.
1297
2052
 
1298
2053
<P>
1299
2054
If the current page is the result of a form submition, the filename
1300
 
may include your input fields after the question mark.
1301
 
If it does, that's a feature, not a bug.
 
2055
may include your input fields after the question mark.&nbsp;
 
2056
If it does, that's a feature, not a bug.&nbsp;
1302
2057
This exact URL, with the data at the end, can be stored as a bookmark
1303
2058
and activated again and again,
1304
 
as though you had filled out the form each time.
 
2059
as though you had filled out the form each time.&nbsp;
1305
2060
Every week you can call up this virtual URL
1306
 
to see if there is any new information on kangaroos.
 
2061
to see if there is any new information on kangaroos.&nbsp;
1307
2062
A more practical example might be a canned query that retrieves
1308
2063
the weather for a certain city
1309
 
or the stock prices for the companies in your portfolio.
1310
 
You can also write concise shell scripts that "fill in" the virtual
1311
 
form, simply by modifying the information after the question mark.
 
2064
or the stock prices for the companies in your portfolio.&nbsp;
 
2065
You can also write concise scripts that "fill in" the virtual
 
2066
form, simply by modifying the information after the question mark.&nbsp;
1312
2067
This provides a simple command to retrieve the weather from any major city
1313
2068
or the current price of any stock.
1314
2069
 
1315
2070
<P>
1316
 
Not all forms support this type of in-URL encoding.
1317
 
If the A command produces www.search-engine.com,
1318
 
with no ?data at the end,
1319
 
you're out of luck.
1320
 
You will have to fill out the form interactively every time you want to run this query.
1321
 
Fortunately most on-line forms allow you to encode the input fields within the URL.
1322
 
If you are a web designer, do your clients a favor
1323
 
and use the "get" method in your forms whenever possible.
1324
 
This will allow others to create and resubmit canned queries with specific input parameters,
1325
 
or develop shell scripts that query your web site automatically.
1326
 
 
1327
 
<H4 align=center> Cookies </H4>
1328
 
 
1329
 
Some web sites serve "cookies",
 
2071
If the form uses the post, rather than the get method,
 
2072
the same data will appear,
 
2073
but the question mark is replaced with a control a.&nbsp;
 
2074
Unfortunately the control a is not visible, and this could cause confusion.&nbsp;
 
2075
When in doubt, list the line.
 
2076
 
 
2077
<P>
 
2078
One last warning about adding links to your bookmark file.&nbsp;
 
2079
Let's say you've issued your A command, and tweaked the description a bit.&nbsp;
 
2080
Now the link is just write, and you want to save it.&nbsp;
 
2081
You accidentally type `w $bookmarks', forgetting the plus.&nbsp;
 
2082
Instead of apending the link to the end, you have clobbered your entire bookmark file.&nbsp;
 
2083
Years of accumulated links are gone.&nbsp;
 
2084
To avoid this disastrous typo, create a macro to append to your bookmark file.&nbsp;
 
2085
I know, we haven't talked about user defined macros yet, but we will.&nbsp;
 
2086
And when we do, you should write a "bookmark append" macro that looks like this.
 
2087
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>function+bma {
 
2088
  w+ $bookmarks
 
2089
}
 
2090
</font></PRE>
 
2091
 
 
2092
<P>
 
2093
Now you can type &lt;bma to add a link to your favorites,
 
2094
and you don't have to worry about typos.&nbsp;
 
2095
It's shorter than `w+ $bookmarks' anyways.&nbsp;
 
2096
We'll return to this topic when we introduce macros,
 
2097
actually functions,
 
2098
that are defined in your config file.
 
2099
 
 
2100
<H3 align=center> <A NAME=cook> Cookies </A> </H3>
 
2101
 
 
2102
Some websites serve "cookies",
1330
2103
which your browser is expected to retain
1331
 
and pass back during subsequent exchanges.
1332
 
In fact some web sites simply won't work without cooky support.
1333
 
Therefore edbrowse supports cookies by default.
1334
 
You can toggle this feature with the `ac' (accept cookies) command,
1335
 
but you probably don't want to.
 
2104
and pass back during subsequent exchanges.&nbsp;
 
2105
In fact many websites simply won't work without cooky support.&nbsp;
 
2106
Therefore edbrowse always accepts cookies.
1336
2107
 
1337
2108
<P>
1338
 
Note that only Netscape-style cookies are supported.
1339
 
However, this is the most common flavor of cooky.
 
2109
Note that only Netscape-style cookies are supported.&nbsp;
 
2110
However, this is the most common flavor of cooky.&nbsp;
1340
2111
It will probably meet your needs.
1341
2112
 
1342
2113
<P>
1343
2114
Persistent cookies are stored in a file,
1344
 
$HOME/.cookies, and are thus available for subsequent edbrowse sessions.
 
2115
usually $HOME/.cookies,
 
2116
and are thus available for subsequent edbrowse sessions.&nbsp;
1345
2117
These cookies are used to store long-term information about you,
1346
 
such as your login and password into amazon.com.
1347
 
Hence your .cookies file should be mode 0600.
 
2118
such as your login and password into amazon.com.&nbsp;
 
2119
Hence your .cookies file should be mode 0600.&nbsp;
1348
2120
In fact the file is created mode 0600, for your own protection.
1349
2121
 
1350
2122
<P>
1351
 
You probably won't need to view your .cookies file,
 
2123
You probably won't need to view your .cookies file, ever,
1352
2124
but it is text based, and can be edited directly if you wish.
1353
 
The file format is consistent with lynx,
1354
 
if your version of lynx supports persistent cookies.
1355
 
Thus lynx and edbrowse are interoperable.
1356
 
You can receive cookies from a web site using one browser,
1357
 
switch to the other browser, and pass the appropriate cookies back as expected.
1358
 
 
1359
 
<H4 align=center> PDF Files </H4>
1360
 
 
1361
 
The portable document format, pdf, is growing in popularity;
1362
 
don't ask me why.
1363
 
If you want to download a technical manual,
1364
 
or a scientific paper,
1365
 
don't be surprised if it is in pdf format,
1366
 
as indicated by the .pdf suffix on the filename.
1367
 
Unfortunately this format is completely inaccessible to blind users.
1368
 
 
1369
 
<P>
1370
 
Some pdf files (not all)
1371
 
can be converted into html,
1372
 
though the conversion is rather crude.
1373
 
Still, it is sufficient to read the text and follow the hyperlinks.
1374
 
Several third parties provide conversion utilities,
1375
 
but I believe the best utility, now and in the future,
1376
 
is at access.adobe.com.
1377
 
After all, who knows more about pdf than its creater, adobe.com?
1378
 
I doubt anyone else will do a better job converting to and from pdf,
1379
 
especially as pdf evolves and grows in complexity.
1380
 
 
1381
 
<P>
1382
 
If you retrieve a pdf file from the Internet,
1383
 
edbrowse automatically routes it through access.adobe.com,
1384
 
thus converting it into html.
1385
 
Then the text is rendered in the usual way.
1386
 
Note that the file name is the name of the pdf document,
1387
 
but the request actually went to another url.
1388
 
You might be fetching this.that.com/foobar.pdf,
1389
 
and see the error "cannot connect to access.adobe.com".
1390
 
This seems incongruous until you remember that a separate web server,
1391
 
access.adobe.com, is performing the translation.
1392
 
If you can't get to both web sites,
1393
 
e.g. because of an internet problem, you won't be able to retrieve the data.
1394
 
 
1395
 
<P>
1396
 
You can toggle pdf to html conversion
1397
 
by entering the `ph', pdf to html, command.
1398
 
When conversion is disabled,
1399
 
all pdf files will be downloaded as binary files,
1400
 
and you can do whatever you like with them.
1401
 
 
1402
 
<H4 align=center> Secure Connections </H4>
 
2125
 
 
2126
<H3 align=center> <A NAME=ssl> Secure Connections </A> </H3>
1403
2127
 
1404
2128
Edbrowse supports the most common method of encrypting web traffic,
1405
 
HTTP over SSL/TLS, colloquially known as secure http.
1406
 
Web sites which allow
 
2129
HTTP over SSL/TLS, colloquially known as secure http.&nbsp;
 
2130
Websites that support
1407
2131
secure http have URLs of the form:
1408
 
https://secure.server.com/yawn.html.
1409
 
 
1410
 
<H6 align=center> Prerequisites for https</H6>
1411
 
 
1412
 
In order to use this new functionality, you will need to obtain some
1413
 
prerequisite software.
1414
 
Firstly, you must obtain the
1415
 
<A HREF=http://www.openssl.org/source/>
1416
 
OpenSSL toolkit</A>.
1417
 
Then you must obtain the
1418
 
<A HREF=http://symlabs.com/Net_SSLeay/>
1419
 
Net::SSLeay package
1420
 
</A>
1421
 
for Perl.
1422
 
These will need to be installed.  The README, INSTALL, and other files supplied
1423
 
with these packages
1424
 
are (somewhat) self-explanatory.
1425
 
 
1426
 
<H6 align=center> Certificate Verification</H6>
1427
 
 
1428
 
When connecting to a server, you will be sent a certificate.  This contains
1429
 
the server's public key, and has been signed by a certifying authority.
1430
 
This signature can and should be verified.  This lessens the chance that
1431
 
you are dealing with a bogus server.  Certifying authorities run checks on
1432
 
those whom they deal with, and will not sign a certificate for a sham
1433
 
organization.  We verify against a file of certificates from legitimate certifying
1434
 
authorities.  This should be placed in your home directory under the name
1435
 
".ssl-certs".
1436
 
A valid file should be obtainable from the
1437
 
<A HREF=ssl-certs>
1438
 
same place as Edbrowse</A>.
1439
 
You can append
1440
 
additional trusted certificates, as needed, in PEM format, to the end of this file.
1441
 
You'd want to do this, for example, to access machines on your organization's
1442
 
intranet if your organization uses it's own private certifying authority.
1443
 
 
1444
 
<H6 align=center> Disabling Certificate Verification</H6>
1445
 
 
1446
 
Sometimes you may not be concerned about the legitimacy of those with whom
1447
 
you deal.  Maybe their certificate is invalid, out of date, etc.
1448
 
You can toggle certificate verification with the `vs' (verify secure connections) command.
1449
 
Certificate verification is
1450
 
enabled by default.
1451
 
Note that disabling certificate verification is a security risk.  I wouldn't
1452
 
send my credit card information to an unverified server.
1453
 
As of this writing, lynx does not verify any web servers,
1454
 
and is less secure than edbrowse, Explorer, or Netscape.
1455
 
 
1456
 
<H4 align=center> FTP Retrievals </H4>
1457
 
 
1458
 
This browser supports the retrieval of ftp files and directories.  You can
1459
 
give it an FTP URL like:
 
2132
https://secure.server.com.&nbsp;
 
2133
Notice the protocol is https:// rather than http://.&nbsp;
 
2134
The extra s stands for "secure".&nbsp;
 
2135
The traffic is encrypted, i.e. mathematically scrambled,
 
2136
and cannot be intercepted by a nefarious third party.
 
2137
 
 
2138
<P>
 
2139
Edbrowse will verify ssl connections,
 
2140
if you supply a file of ssl certificates.&nbsp;
 
2141
This is an antispoofing measure, to make sure a hacker isn't posing as your bank,
 
2142
trying to steal your account numbers and passwords.&nbsp;
 
2143
You can grab a certificate file <A HREF=ssl-certs>here</A>,
 
2144
but I don't always keep it up to date.&nbsp;
 
2145
If you don't have this file,
 
2146
or, if you don't specify its location in your config file,
 
2147
you will not be able to verify secure connections, and you will be warned accordingly.&nbsp;
 
2148
Some browsers don't have this feature at all, so it's not the end of the world,
 
2149
but in general it's a good idea to verify your secure connections,
 
2150
unless it prevents you from getting to a website whose authenticity you accept at face value.&nbsp;
 
2151
In that case you can use the vs command to turn the feature off.&nbsp;
 
2152
This is a toggle command; type vs again to turn the feature on.
 
2153
 
 
2154
<P>
 
2155
Never send sensitive information,
 
2156
such as social security numbers or credit card numbers,
 
2157
over an insecure channel.&nbsp;
 
2158
Make sure the form is using ssl.&nbsp;
 
2159
How can you tell?&nbsp;
 
2160
The submit button will have the word "secure" added to its text.
 
2161
<P>
 
2162
&lt;Make your purchase now secure&gt;
 
2163
<P>
 
2164
This is similar to the lock icon that Explorer uses to tell you that your connection is secure,
 
2165
although my system is not quite as foolproof.&nbsp;
 
2166
A website could fake you out by putting the word secure in the submit text.
 
2167
 
 
2168
<P>
 
2169
Note that generic buttons (besides the submit button) can also submit your form,
 
2170
through javascript.&nbsp;
 
2171
I don't know if that button is going to submit the form or not,
 
2172
and I don't want to put the word "secure" on every button on the page.&nbsp;
 
2173
I only add it to the submit button,
 
2174
but if that button is secure then they are all secure.&nbsp;
 
2175
They all use the same form, and the same url.
 
2176
 
 
2177
<P>
 
2178
In theory, it is possible for javascript too switch the destination url out from under you at the last minute,
 
2179
from https://this.is.safe.com to http://this.is.untrusted.com.&nbsp;
 
2180
I don't know if other browsers watch for this bait-and-switch, but edbrowse does.&nbsp;
 
2181
If the original url was secure,
 
2182
and I reported this to you via &lt;submit secure&gt;,
 
2183
and javascript changes it to an insecure connection, I won't submit the form.&nbsp;
 
2184
This is really paranoid,
 
2185
because the first website, the one that asked for your credit card number,
 
2186
also supplies the javascript,
 
2187
and they have no incentive to breech security,
 
2188
since you're going to hand them your credit card number anyways.
 
2189
 
 
2190
<P>
 
2191
If you have logins on secure servers,
 
2192
such as PayPal.com,
 
2193
you must keep your password absolutely safe.&nbsp;
 
2194
Never send that password over an insecure connection.&nbsp;
 
2195
It becomes as valuable as your credit card numbers.&nbsp;
 
2196
I have a special password that I use for my secure logins,
 
2197
and <em>only</em> for those logins.&nbsp;
 
2198
I use other, expendable passwords when the connection is not secure.
 
2199
 
 
2200
<P>
 
2201
Please don't fall for all those email scams
 
2202
that tell you your login has expired, and would you please log in again using this convenient form.&nbsp;
 
2203
The mail is forged to look legitimate,
 
2204
and the form actually sends your secret password to a thief,
 
2205
who then rades your account.&nbsp;
 
2206
A reputable company will
 
2207
never, never, never, ask you to login through an email form.&nbsp;
 
2208
They will always tell you to go back to the website and log in there.
 
2209
 
 
2210
<P>
 
2211
Internet security is complex, to say the least,
 
2212
and it is beyond the scope of this document.&nbsp;
 
2213
If you have any questions about it,
 
2214
please send them to me directly.&nbsp;
 
2215
As a general rule,
 
2216
secure http is really quite safe, and you can use it to send sensitive information across the Net.&nbsp;
 
2217
It's probably safer than giving your credit card number to the clerk on the phone,
 
2218
who use to take your order before there was e-commerce.&nbsp;
 
2219
so it's ok to be a little bit paranoid,
 
2220
in fact it's probably a good idea,
 
2221
but don't let that stop you from making your online purchases.
 
2222
 
 
2223
<H3 align=center> <A NAME=ftp> FTP Retrievals </A> </H3>
 
2224
 
 
2225
This browser supports the retrieval of ftp files and directories.&nbsp;
 
2226
You can provide an FTP URL like:
1460
2227
ftp://ftp.random.com/tarball.tar.gz
1461
 
and the file will be fetched.
1462
 
You can also visit an FTP URL from an html file.
 
2228
and the file will be fetched.&nbsp;
 
2229
It doesn't matter whether you type in the url yourself,
 
2230
or it is a hyperlink on a web page.&nbsp;
 
2231
The file is retrieved, and placed in a local file of the same name.&nbsp;
 
2232
You will ssee the words:
 
2233
<P>
 
2234
ftp download
 
2235
<br>
 
2236
some stats on the size of the file and the bits per second
 
2237
<br>
 
2238
success
 
2239
 
 
2240
<P>
 
2241
Of course the download could fail, in which case you will receive an error message.&nbsp;
 
2242
If it was simply interrupted,
 
2243
due to some internet glitch,
 
2244
you can issue the command again,
 
2245
and edbrowse will resume the download from where it left off.&nbsp;
 
2246
This can save time when fetching a large file.
 
2247
 
 
2248
<P>
1463
2249
By default, edbrowse uses the account name "anonymous" and the password
1464
 
"some-user@edbrowse.net" for ftp connections.
1465
 
 
1466
 
<H6 align=center> Parsing Remote Directories</H6>
1467
 
 
 
2250
"some-user@edbrowse.net" for ftp connections.&nbsp;
 
2251
However, you can override this in the url,
 
2252
and some web pages take advantage of this feature.&nbsp;
 
2253
For example, let's say you want to access the file /etc/passwd on whatever.localdomain.&nbsp;
 
2254
This file isn't readable by anonymous users.&nbsp;
 
2255
You have to log in as a real person.&nbsp;
 
2256
Within edbrowse, you might use the command:
 
2257
<P>
 
2258
e ftp://chris:xxx@whatever.localdomain/etc/passwd
 
2259
 
 
2260
<P>
 
2261
The ftp connection will be made as user "Chris", with password "XXX".
 
2262
 
 
2263
<P>
1468
2264
Some ftp URLs point at directories, not files.  If you visit one of these,
1469
2265
and it is located on a Unix-like server, you will receive the listing as an
1470
2266
html file with hyperlinks.  You can visit the directory members just as
1471
 
though you were exploring a web site.
 
2267
though you were exploring a website.&nbsp;
1472
2268
If the server does not run some
1473
2269
flavore of Unix, you will receive the directory listing in plain
1474
2270
text.
1475
2271
 
1476
 
<H6 align=center> Accounts Other Than "anonymous"?</H6>
1477
 
 
1478
 
There is another form which ftp URLs may take.
1479
 
ftp://user:password@host/path/
1480
 
For example, let's say I want to access the file /etc/passwd on numenor.localdomain.
1481
 
This file isn't readable by anonymous users.
1482
 
Within edbrowse, I might use the command:
1483
 
e ftp://chris:xxx@numenor.localdomain/etc/passwd
1484
 
to download the file.
1485
 
The ftp connection will be made as user "Chris", with password "XXX".
1486
 
 
1487
 
<H6 align=center>Modes of ftp</h6>
1488
 
 
1489
 
When you visit an ftp server to download a file or directory listing, two
1490
 
types of connections are employed.  The control connection is used for sending
1491
 
commands to the ftp host, and the data connection is used to download the
1492
 
raw data.
1493
 
 
1494
 
<P>
1495
 
While the control connection is made from the client to the server, the
1496
 
data connection is usually made from the server to the client.  This is
1497
 
called active mode ftp.
1498
 
The problem is that this "active mode" doesn't work well if you happen to
1499
 
be behind a firewall.
1500
 
 
1501
 
<P>
1502
 
The solution is passive mode ftp.  The data connection
1503
 
is made from the client to the server.  Edbrowse uses passive mode by default.
1504
 
But this may not work if the server is behind a firewall.  So you have a choice;
1505
 
use the `pm'command to toggle between passive mode and active mode.
1506
 
 
1507
 
<H4 align=center> Frames </H4>
1508
 
 
1509
 
Frames are a mechanism whereby a web page can fetch and display several other web pages on the screen.
1510
 
Each subpage is called a frame, and lives in its own space on the screen.
 
2272
<P>
 
2273
The ftp mode, i.e. the style of data connection,
 
2274
can be either active or passive.&nbsp;
 
2275
One works well when the client is behind a router,
 
2276
and the other works well when the server is behind a router.&nbsp;
 
2277
You can specify ftp mode active by entering the command `fma',
 
2278
or ftp mode passive by `fmp'.&nbsp;
 
2279
The command `fmd' sets the ftp mode to a default,
 
2280
which tries to establish a passive connection first,
 
2281
and then an active connection as a fallback.&nbsp;
 
2282
This is a reasonable default, so you should probably leave this alone.
 
2283
 
 
2284
<P>
 
2285
Edbrowse doesn't actually establish the ftp connections,
 
2286
rather, it invokes the program ncftpget to fetch the file,
 
2287
and ncftpls to list the directory.&nbsp;
 
2288
These programs are distributed with most Unix systems.&nbsp;
 
2289
If you don't have these programs, please visit
 
2290
<A HREF=http://www.ncftp.com>ncftp.com</A>.
 
2291
 
 
2292
<P>
 
2293
Once again, review the differences.&nbsp;
 
2294
Http pulls a file into a buffer in memory, i.e. an edbrowse session,
 
2295
while ftp copies the file directly to disk.&nbsp;
 
2296
Also, ftp does not print dots every 100K to indicate progress,
 
2297
so you just have to wait until it's done.&nbsp;
 
2298
(Depending on your operating system, you could switch to another virtual console/window and check on the length of the local file.)
 
2299
 
 
2300
<H3 align=center> <A NAME=frame> Frames </A> </H3>
 
2301
 
 
2302
Frames are a mechanism whereby a web page can fetch and display several other web pages on the screen at once.&nbsp;
 
2303
Each subpage is called a frame, and lives in its own space on the screen.&nbsp;
1511
2304
Sometimes the frames are top middle and bottom;
1512
 
sometimes they are left middle and right.
1513
 
Edbrowse fetches these frames and presents them in order.
1514
 
 
1515
 
<P>
1516
 
Most frames have names - hopefully these names are helpful.
1517
 
If a page uses frames you might see something like this.
1518
 
 
1519
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>Frame top:
1520
 
 
1521
 
Stuff about the company, and how to get back to the home page etc.
1522
 
 
1523
 
Frame bottom:
1524
 
 
1525
 
The stuff you actually asked for, your order, etc.
1526
 
</font></PRE>
1527
 
 
1528
 
<P>
1529
 
You can disable frame fetching via the `ff' command,
1530
 
if you know your web sites well, and you want to activate particular frames manually.
1531
 
When frameFetch is disabled, frames look like hyperlinks:
1532
 
frame{top}.
1533
 
Access each one in turn, as if it were just another web page.
1534
 
 
1535
 
<P>
1536
 
There may be web sites out there that won't work unless all the frames are fetched, in order.
1537
 
Suppose the first frame sends your browser a cooky,
1538
 
which it must return when fetching the second frame.
1539
 
I don't know of any web sites like this,
1540
 
but I wouldn't be surprised if there are some out there,
1541
 
so you might want to leave fetchFrames enabled.
1542
 
 
1543
 
<H4 align=center> Javascript </H4>
1544
 
 
1545
 
Javascript is everywhere, but in some cases we can work around it.
1546
 
Remember that web designers rarely <em>program</em> in Java.
1547
 
In fact they aren't programmers at all.
1548
 
They use various wysiwyg web design tools
1549
 
that crank out canned fragments of javascript.
1550
 
In some cases we canrecognize these fragments and deal with them.
1551
 
 
1552
 
<P>
1553
 
Sometimes a hyperlink uses javascript only to open a new window,
1554
 
which brings up the referenced web page.
1555
 
Obviously the notion of a new window is meaningless in edbrowse;
1556
 
every web page is already in its own window.
1557
 
So this program tries to bypass the javascript and replace it with a simple hyperlink.
1558
 
It isn't openNewWindow&nbsp;("foobar.html") any more,
1559
 
it's just foobar.html.
1560
 
It will look and act just like any other hyperlink.
1561
 
 
1562
 
<P>
1563
 
Keep in mind, I'm using a simple heuristic,
1564
 
encoded in a regular expression.
1565
 
I'm sure there are openWindow() calls that I don't recognize as such,
1566
 
and no doubt there are other javascript calls that I will mistake
1567
 
for a subwindow hyperlink.
1568
 
If you find either a false negative or a false positive,
1569
 
send it along and I'll try to update my heuristics.
1570
 
 
1571
 
<P>
1572
 
Another common javascript function is the validate&amp;submit function.
1573
 
This function checks your entries -
 
2305
sometimes they are left middle and right.&nbsp;
 
2306
Edbrowse presents these frames as hyperlinks,
 
2307
and you can call up each in turn,
 
2308
or jump straight to a specific frame if you are familiar with the website.&nbsp;
 
2309
Usually the top frame is navigational in nature,
 
2310
and the bottom is a legal disclaimer/copyright notice,
 
2311
so you're just as happy to skip these and cut to the chase.&nbsp;
 
2312
On rare occasions, and I've only seen this once,
 
2313
you <em>must</em> open the top frame,
 
2314
whether you are interested in it or not,
 
2315
because that particular html page sets some cookies that you need to run the website.
 
2316
 
 
2317
<P>
 
2318
A page of frames might look like this.&nbsp;
 
2319
I think you can guess which one to click on.
 
2320
 
 
2321
<P>
 
2322
Frame {navigation}
 
2323
<br>
 
2324
Frame {main}
 
2325
<br>
 
2326
Frame {bottom}
 
2327
 
 
2328
<P>
 
2329
I thought about a FetchFrame feature that fetches all the frames and presents them in one go,
 
2330
just as they are all displayed on the screen for a sighted user,
 
2331
but this feature is <em>very</em> difficult to implement,
 
2332
and so far, nobody seems to want it.&nbsp;
 
2333
So as you might imagine, it's way down on the list.
 
2334
 
 
2335
<H3 align=center> <A NAME=js> Introduction to Javascript </A> </H3>
 
2336
 
 
2337
Javascript is software, embedded in the web page, that runs on your computer.&nbsp;
 
2338
These functions do not run on the web server,
 
2339
they run right on your box.&nbsp;
 
2340
Hence it is sometimes called client side javascript.&nbsp;
 
2341
And javascript can do almost anything.&nbsp;
 
2342
You could, for instance, download a web page that includes a javascript function to compute the digits of pi,
 
2343
right on your computer,
 
2344
although that would be rather silly.&nbsp;
 
2345
Most of the time javascript is used to validate and/or modify forms,
 
2346
or create fancy visual effects.
 
2347
 
 
2348
<P>
 
2349
The first version of edbrowse, written in perl, ignored javascript completely,
 
2350
and that was ok for a while,
 
2351
but more and more sites use javascript,
 
2352
and these websites were simply inaccessible.&nbsp;
 
2353
Most of the e-commerce sites fall into this category.&nbsp;
 
2354
If you want to make purchases, or manage your bank account online,
 
2355
you <em>need</em> a javascript enabled browser.
 
2356
 
 
2357
<P>
 
2358
The second version of edbrowse, written in C,
 
2359
and indicated by a version number that starts with 2,
 
2360
included a home grown javascript compiler and engine
 
2361
that I wrote myself.&nbsp;
 
2362
This worked pretty well, for a spare time project,
 
2363
but javascript evolves, like any other language or standard,
 
2364
and I just couldn't keep up.
 
2365
 
 
2366
<P>
 
2367
The third version, which is the "latest and greatest", uses a javascript engine from Mozilla.com,
 
2368
which is open source under the Mozzilla Public License.&nbsp;
 
2369
This allows me to leverage, rather than reinvent, some 70,000 lines of code -
 
2370
and somebody else is maintaining that code as javascript evolves.&nbsp;
 
2371
this illustrates the power of the open source community.
 
2372
 
 
2373
<P>
 
2374
Edbrowse does not support all the features of client side (DOM) javascript,
 
2375
and it never will.&nbsp;
 
2376
For example, many websites use javascript to change images
 
2377
on the fly as you move your mouse around the screen.&nbsp;
 
2378
This has no meaning in edbrowse.&nbsp;
 
2379
Other websites bring up multiple windows,
 
2380
and let you control the contents of subwindows using icons in a master window.&nbsp;
 
2381
This would be very difficult to simulate in a command-line environment -
 
2382
so we don't try.
 
2383
 
 
2384
<P>
 
2385
As a rough approximation, I expect to implement about half of javascript,
 
2386
the half that will satisfy 95% of the websites we care about.&nbsp;
 
2387
So you may see warning messages about this or that feature not supported.&nbsp;
 
2388
If you are tired of wading through these messages,
 
2389
or if a bug in my javascript interpreter causes edbrowse to crash completely,
 
2390
you can turn javascript off via the `js' command.&nbsp;
 
2391
This is useful when you are casually surfing the net, looking for information,
 
2392
and you know you're not going to need javascript.&nbsp;
 
2393
You can also disable javascript for specific domains.&nbsp;
 
2394
This will be discussed later, when we describe the edbrowse config file.
 
2395
 
 
2396
<H3 align=center> <A NAME=valid> Validating Forms </A> </H3>
 
2397
 
 
2398
When a web page asks for user input,
 
2399
it often includes a
 
2400
"validate&amp;submit" function.&nbsp;
 
2401
This function checks your entries:
1574
2402
have you filled in all the riquired fields -
1575
2403
is there an @ sign in your email address -
1576
 
etc.
1577
 
Then, if there are no errors, it submits the form.
1578
 
I can't emulate the javascript,
1579
 
but I can <em>assume</em> you have entered the data correctly
1580
 
and submit the form.
1581
 
The javascript call is replaced with a simple submit button.
1582
 
The same text is used, but the letters js are appended,
1583
 
to remind you that javascript is being bypassed.
1584
 
Thus the last line on a registration form might look like:
1585
 
<P>
1586
 
&lt;Register now js&gt;
1587
 
 
1588
 
<P>
1589
 
In some cases the javascript function, which I am neatly bypassing,
1590
 
reformats your data.
1591
 
If it does, you're screwed.
1592
 
 
1593
 
<H4 align=center> Web Strip (Experimental) </H4>
1594
 
 
1595
 
A web page often contains redundent information,
1596
 
relative to its parent page.
1597
 
Plowing through the same navigation links and introductory text,
1598
 
in search of new information,
1599
 
can be a huge waste of time.
1600
 
The sighted user recognizes the same "stuff" at a glance and scrolls down the page,
1601
 
consuming perhaps 4 seconds,
1602
 
but I often spend 4 minutes performing the same operation.
1603
 
How frustrating!
1604
 
 
1605
 
<P>
1606
 
The web strip feature, `ws', attempts to delete the redundent
1607
 
text at the start and end of a web page,
1608
 
leaving only the new information.
1609
 
After all, that's why you activated the link in the first place.
1610
 
You can resurrect the deleted text via the unstrip, `us', command.
1611
 
 
1612
 
<P>
1613
 
This feature is called experimental because it isn't very smart.
1614
 
It's more like a cmp than a diff.
1615
 
The slightest change in a line, or insertion of a blank line,
1616
 
will cause web strip to stop in its tracks.
1617
 
Often there is more text that <em>should</em> be deleted,
1618
 
but I don't have time to turn this into a Ph.D. thesis.
1619
 
If anybody wants to beef up this routine, I'd be grateful.
1620
 
 
1621
 
<H4 align=center> Web Express </H4>
1622
 
 
1623
 
<A HREF=http://www.webexpresstech.com/WebXP/WebExpressTutorial.html>
1624
 
Web express
1625
 
</A>
1626
 
is a stand-alone program designed to fetch specific information from the internet
1627
 
and present it concisely,
1628
 
without all the headers and footers and commercials etc.
1629
 
Some of this technology has been folded into edbrowse, with permission.
1630
 
 
1631
 
<P>
1632
 
The @ command initiates a web express query.
1633
 
The identifier that follows the @ sign is the name of the query.
1634
 
It is often cryptic, just a couple of letters.
1635
 
For instance, @gg is shorthand for a google search.
1636
 
Type the following to look up information on african elephants.
1637
 
<P>
1638
 
@gg african elephant
1639
 
 
1640
 
<P>
1641
 
When the page is retrieved,
1642
 
specific post-processing code strips out the extraneous information,
1643
 
and leaves only the results of your search.
1644
 
This is a web strip feature that really works!
1645
 
It works because somebody has tailored it to this particular page.
1646
 
There are no heuristics - no guesses.
1647
 
The down side is the constant maintenance.
1648
 
If google changes its format,
1649
 
we will have to modify the post-processing commands accordingly.
1650
 
 
1651
 
<P>
1652
 
As described earlier, `us' (unstrip) is the opposite of web strip.
1653
 
You can enter the us command to get the entire google page back again.
1654
 
Then you can jump to other places in google,
1655
 
click through the sponsored links, etc.
1656
 
 
1657
 
<P>
1658
 
The web strip feature
1659
 
supports inheritance.
1660
 
If the first page doesn't have the information you are looking for,
1661
 
aned you call up the second page by clicking on the {more results} button,
1662
 
you can use the ws command to strip the second page of results,
1663
 
using the same google-specific commands
1664
 
that were applied to the first page.
1665
 
 
1666
 
<P>
1667
 
Many shortcuts are available - too many to document here.
1668
 
For instance,
1669
 
@yf jnj gets the current stock quote for Johnson and Johnson from yahoo financial,
1670
 
and @mw elephant looks up the word elephant
1671
 
in the on-line Merriam Webster dictionary.
1672
 
And so on.
1673
 
Type @ by itself to get a list of available shortcuts.
1674
 
 
1675
 
<P>
1676
 
Actually, none of these shortcuts are included in the edbrowse program.
1677
 
They are all defined in your .ebrc config file for maximum flexibility.
1678
 
You can modify existing shortcuts or add your own,
1679
 
reflecting your particular interests.
1680
 
See the
1681
 
<A HREF=sample.ebrc>
1682
 
sample config file</A>
1683
 
for the definitions of various web express commands.
1684
 
 
1685
 
<H4 align=center> Predefined Edbrowse Command Sets </H4>
1686
 
 
1687
 
You can bundle a set of edbrowse commands together under one name,
1688
 
similar to a macro.
1689
 
If the following appears in your .ebrc file,
1690
 
you can type &lt;ud to undos a file.
1691
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>cmdlist = ud
1692
 
&lt;   ,s/\r$//
1693
 
</font></PRE>
1694
 
 
1695
 
<P>
1696
 
The leading &lt; symbol tells edbrowse
1697
 
that the line contains an edbrowse command.
1698
 
The commands bundled together under the name "foo"
1699
 
are invoked by typing &lt;foo.
1700
 
The same list of commands can be folded into other lists of commands,
1701
 
or into the post-processing directives associated with web express shortcuts.
1702
 
The command list named "init" is run at startup.
1703
 
 
1704
 
<P>
1705
 
If the name of the macro has a + before it in the .ebrc file,
1706
 
execution stops when an error occurs.
1707
 
Without the + sign
1708
 
edbrowse runs all the commands in the set.
1709
 
Note that all the commands are run, no matter what,
1710
 
after a web express shortcut.
1711
 
 
1712
 
<H4 align=center> Directory Scan, File Manager </H4>
1713
 
 
1714
 
If you edit a directory
1715
 
you will see a list of all the visible files in that directory,
1716
 
in alphabetical order.
1717
 
Type g to go to one of these files or sub directories.
1718
 
Type ^ to return to the parent directory.
1719
 
This is similar to browse mode;
1720
 
just pretend like there are braces around each file name.
1721
 
Thus you can traverse an entire directory tree
1722
 
as though you were inside a file manager.
1723
 
 
1724
 
<P>
1725
 
Like ls -F, a subdirectory is indicated by a trailing slash.
1726
 
This slash is not part of the filename.
1727
 
Similarly, named pipe is indicated by |,
1728
 
symbolic link by @,
1729
 
block special by *, character special by &lt;,
1730
 
and socket by ^.
1731
 
If a regular file ends in one of these characters, it may confuse you,
1732
 
but it won't confuse this program.
1733
 
Edbrowse knows whether that trailing | is part of the filename
1734
 
or a pipe indicator.
1735
 
Since each file is represented by a single line of text,
1736
 
files with newlines embedded in their names cannot be accessed.
1737
 
 
1738
 
<P>
1739
 
If you read a directory into a preexisting file it is just text.
1740
 
You can't visit any of the underlying files, because they are just words.
1741
 
You must edit a directory in its own session
1742
 
or read a directory into an empty session
1743
 
if you want to access the underlying files.
1744
 
Note that you can write the buffer to another editting session,
1745
 
and in that session the words are just words.
1746
 
This distinction is important as we start to edit the text.
1747
 
 
1748
 
<P>
1749
 
By default, directories are readonly.
1750
 
If you try to delete a line, and hence the associated file,
1751
 
it will tell you that you are still in directory read mode.
1752
 
I'm trying to save you from yourself!
1753
 
Type dw to enable directory writes,
1754
 
and dr to make directories readonly again.
1755
 
 
1756
 
<P>
1757
 
When directory writes are enabled,
1758
 
you can remove files using the d command.
1759
 
For instance, g/\.o$/d removes all the object files.
1760
 
Since these edits have implications outside the scope of this program,
1761
 
there is no undo capability.
1762
 
When you make a change it is made.
1763
 
With this in mind, I borrowed a good idea from Microsoft.
1764
 
The deleted file isn't actually deleted;
1765
 
it is moved to your recycle bin,
1766
 
located in $HOME/.recycle.
1767
 
So if you accidentally type ,d and remove all your files,
1768
 
you can recover them from your recycle bin.
1769
 
You may want to set up a cron job that removes
1770
 
all the files from your recycle bin once a week.
1771
 
This directory is created mode 700, so nobody else can look at your deleted files.
1772
 
If you create this directory yourself, please make if 700.
1773
 
 
1774
 
<P>
1775
 
Because this operation is a move, rather than a true delete,
1776
 
there are a few restrictions based on your operating system.
1777
 
If your OS can move directories,
1778
 
this program will be able to delete a subdirectory as easily as a file.
1779
 
The entire subtree is moved to your recycle bin.
1780
 
Make sure your cleanup cron job is capable of removing directory trees, not just files.
1781
 
 
1782
 
<P>
1783
 
Depending on your OS, you may not be able to move files across file systems.
1784
 
From /disk2 to /disk1, or from the D drive to the C drive.
1785
 
In this case you might want to issue the dx command,
1786
 
which makes directories writable, like dw, but actually deletes the files.
1787
 
You'll need this if you're trying to free up space on the disk.
1788
 
Note that symbolic links are always deleted;
1789
 
there isn't much point in moving a link to the recycle bin.
1790
 
 
1791
 
<P>
1792
 
"What's the point of all this?" you may ask.
1793
 
"What's wrong with the shell?"
1794
 
 
1795
 
<P>
1796
 
Nothing, as long as the file names are small and familiar.
1797
 
But sometimes the file names are long and cumbersome,
1798
 
and it is nearly impossible to type those names into the shell,
1799
 
character for character, upper and lower case, with no mistakes.
1800
 
Meta characters such as the * can help,
1801
 
but only when the file you want has a name radically different from the other files in the directory.
1802
 
This isn't always the case.
1803
 
Suppose an application generates log files as follows.
1804
 
 
1805
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>ProgramFooBar.-04-04-1998.06:31:59.log
1806
 
ProgramFooBar.-04-11-1998.11:37:14.log
1807
 
ProgramFooBar.-04-18-1998.16:22:51.log
1808
 
</font></PRE>
1809
 
 
1810
 
<P>
1811
 
How do you delete the old ones and keep the most recent,
1812
 
or rename them to something more manageable?
1813
 
Stars are a bit risky; you can access multiple files without realizing it.
1814
 
And we're not even talking about those pesky files with spaces or invisible control characters in their names.
1815
 
Our sighted friend calls up his file manager and simply clicks on the file he wants to view or edit or remove.
1816
 
Sometimes I want/need that kind of power.
1817
 
 
1818
 
<P>
1819
 
When the substitute command changes text, it renames the underlying file.
1820
 
This won't move the file on top of another existing file,
1821
 
so you can't lose any data this way.
1822
 
 
1823
 
<P>
1824
 
The search and substitute commands ignore the trailing filetype characters.
1825
 
If you want to rename a directory from foo/ to foobar/,
1826
 
you can type s/$/bar/.
1827
 
The bar will be placed at the end of the word foo, because the trailing / isn't really there.
1828
 
 
1829
 
<P>
1830
 
Now suppose you want to run an arbitrary program on some of these files.
1831
 
This could be a print utility,a compiler, whatever.
1832
 
Sometimes you can rename the files for your convenience, then work in the shell.
1833
 
But sometimes you don't own the files,
1834
 
and sometimes they must retain their original names.
1835
 
This happens when several html documents reference each other through hyperlinks,
1836
 
using the aforementioned filenames.
1837
 
So you can't rename the files, yet you still want to run your program on one or two of them.
1838
 
 
1839
 
<P>
1840
 
You can run any program on any file without retyping that filename via the shell escape.
1841
 
Use kx to assign the label x to the file you are interested in.
1842
 
(This is standard ed syntax.)
1843
 
Then run !program 'x
1844
 
to invoke your program on the file in the line labeled x.
1845
 
This sounds involved, but it is merely text substitution, implemented in a few lines of perl.
1846
 
If 'x is present in a shell escape, and is not next to any letters or digits,
1847
 
we replace it with the text on the line labeled x.
1848
 
Thus if your filename contains spaces, you'd better run !program "'x",
1849
 
to make sure the entire file name is one argument to the running program.
1850
 
 
1851
 
<P>
1852
 
The token '. is replaced with the text on the current line,
1853
 
and the token '_ is replaced with the current filename.
1854
 
If you try to write a file, and remember that you left it readonly,
1855
 
you can make it writable via !chmod +w '_,
1856
 
and then write the text to the file.
1857
 
 
1858
 
<P>
1859
 
You can expand multiple tokens in one shell command.
1860
 
Use kx and ky to mark two files that you want to compare, then run !diff 'x 'y.
1861
 
 
1862
 
<P>
1863
 
This feature is not limited to directory scans.
1864
 
You may be editing a simple file,
1865
 
but you can still paste the contents of a line into your shell command.
1866
 
Off hand I don't know why you'd want to do this,
1867
 
but you can.
1868
 
 
1869
 
<H4 align=center> The Refresh Command </H4>
1870
 
 
1871
 
Type `rf' to refresh the current file.
1872
 
This rereads the file or url into the current buffer.
1873
 
It does not push a new editing session onto the stack.
1874
 
This is analogous to the refresh button on Netscape and Explorer.
1875
 
 
1876
 
<P>
1877
 
If a web page is updated every minute, e.g. with the latest stock prices for your favorite companies,
1878
 
you can type rf to fetch the latest copy of this web page.
1879
 
This assumes the url is a direct html reference,
1880
 
or a dynamic fetch using the get method.
1881
 
This will not work with the post method.
1882
 
It also assumes the intervening internet servers are not caching the web page
1883
 
and handing you the same out-of-date copy over and over again.
1884
 
 
1885
 
<P>
1886
 
On your local machine,
1887
 
you can use this feature to read the latest version of a dynamic file,
1888
 
such as a log file.
1889
 
Or you can reread a directory,
1890
 
to incorporate any new files that have been placed in that directory.
1891
 
For example, you might use the shell escape to execute
1892
 
`cat x y &gt;z',
1893
 
yet z will not appear in your directory scan, until you type rf.
1894
 
 
1895
 
<H4 align=center> User Agent </H4>
 
2404
are there 5 digits in your zip code -
 
2405
and so on.&nbsp;
 
2406
If there are no errors, it submits the form.&nbsp;
 
2407
These functions usually behave well under edbrowse.&nbsp;
 
2408
When you push the button, you will either see the error message,
 
2409
or the form will be submitted,
 
2410
and a confirmation page should appear shortly.
 
2411
 
 
2412
<P>
 
2413
In some cases the javascript function
 
2414
reformats your data.&nbsp;
 
2415
It may fill in some of the "hidden" fields for you,
 
2416
or it may compute sales tax and adjust the purchase price accordingly.&nbsp;
 
2417
This is more than form validation, this is active javascript,
 
2418
and the data won't be right unless the javascript runs properly
 
2419
on your computer.&nbsp;
 
2420
More and more sites are using active javascript,
 
2421
so a javascript enabled browser is a must.
 
2422
 
 
2423
<P>
 
2424
Some javascript functions manage menus dynamically.&nbsp;
 
2425
Make a primary selection,
 
2426
and javascript populates a second dropdown list with options
 
2427
corresponding to your first selection.&nbsp;
 
2428
You can now make a second selection,
 
2429
which further refines your search.&nbsp;
 
2430
If the first menu presents "meats", "vegetables", "fruits", and "grains",
 
2431
and you select fruits,
 
2432
the second menu might contain
 
2433
"apples", "oranges", "lemons", etc.&nbsp;
 
2434
Javascript makes this possible.&nbsp;
 
2435
Unfortunately these dynamic menus are not yet supported by edbrowse.
 
2436
 
 
2437
<H3 align=center> <A NAME=popup> Popups and Popunders </A> </H3>
 
2438
 
 
2439
A popup is a window that suddenly appears in front of the window you really want to see.&nbsp;
 
2440
It usually advertises something, and is often annoying,
 
2441
although in rare cases it is a necessary aspect of the website.
 
2442
 
 
2443
<P>
 
2444
You have a distinct advantage over all those other surfers with their graphical browsers.&nbsp;
 
2445
The popup window does not open automatically.&nbsp;
 
2446
Windows are not well defined in a command line browser anyways,
 
2447
so it would be folly to try to implement this feature,
 
2448
or any other aspect of multi-windowing for that matter.&nbsp;
 
2449
Instead, the popup appears as a hyperlink at or near the top of the page,
 
2450
and you can click on it if you like, or ignore it.&nbsp;
 
2451
This is similar to the <A HREF=#music>background music</A>, described in an earlier section.&nbsp;
 
2452
The popup link might look like this.
 
2453
<P>
 
2454
{Popup: specials()}
 
2455
 
 
2456
<P>
 
2457
Popunders are not as common.&nbsp;
 
2458
They appear after you have closed the window.&nbsp;
 
2459
In some sense they are hidden "under" your web page, and when you close the page they pop out.&nbsp;
 
2460
In edbrowse, this does not happen automatically.&nbsp;
 
2461
When you type q, you quit, and that's the end of it.&nbsp;
 
2462
As you might expect, the popunder function appears as a hyperlink.&nbsp;
 
2463
It might look like this.
 
2464
<P>
 
2465
{On Close: foo()}
 
2466
 
 
2467
<P>
 
2468
Remember, the popup link is a simple html link to another web page,
 
2469
while the Close link calls a javascript function on the current page.&nbsp;
 
2470
However, this javascript function usually links to another web page,
 
2471
so don't be surprised if you find yourself somewhere else on the internet.&nbsp;
 
2472
In either case, popup or popunder, you can use the back key to return to the
 
2473
page you were looking at.&nbsp;
 
2474
If you need access to a popup window and the main page in parallel,
 
2475
use the <A HREF=#move>M command</A>.
 
2476
 
 
2477
<P>
 
2478
Javascript also includes timer functions,
 
2479
that fire after a specified number of seconds.&nbsp;
 
2480
These are implemented as hyperlinks at the top of the page.&nbsp;
 
2481
They usually manage visual effects, and are rather pointless.&nbsp;
 
2482
The following timer might draw a star burst on the screen in 16 seconds.
 
2483
<P>
 
2484
{Timer 16: starburst()}
 
2485
 
 
2486
<H3 align=center> <A NAME=onc> Onchange and Undo </A> </H3>
 
2487
 
 
2488
When you set or change the value of an input field,
 
2489
the form can (optionally) call a javascript routine.&nbsp;
 
2490
It doesn't usually, but it can.&nbsp;
 
2491
In an earlier example, I described a primary and secondary menu.&nbsp;
 
2492
When the first selection is made,
 
2493
e.g. fruits,
 
2494
javascript sets up the second menu commensurate with your primary selection,
 
2495
using the "onchange" feature.
 
2496
 
 
2497
<P>
 
2498
This is all well and good,
 
2499
but edbrowse has something
 
2500
your graphical browser does not, the undo command.&nbsp;
 
2501
And in this context, it doesn't really work.&nbsp;
 
2502
Change fruits to vegetables, and the second menu presents carrots and peas and the like.&nbsp;
 
2503
Now type u for undo,
 
2504
and the first field reverts back to fruits,
 
2505
but the second menu still contains vegetables.&nbsp;
 
2506
This is because the undo feature was originally written for the text editor.&nbsp;
 
2507
It simply puts the text back the way it was, and has no capacity to "undo" the side effects of javascript code.&nbsp;
 
2508
So the moral of the story, if there is one,
 
2509
is to set and change the values of an input form directly,
 
2510
and avoid the undo command, unless you're pretty sure there are no javascript side effects associated with that field.
 
2511
 
 
2512
<H3 align=center> <A NAME=cfg> Config File </A> </H3>
 
2513
 
 
2514
At startup, edbrowse reads and parses a config file.&nbsp;
 
2515
It's ok if this file is missing, but if it is present,
 
2516
it has to be syntactically correct.&nbsp;
 
2517
An error in your config file will cause edbrowse to abort.&nbsp;
 
2518
If this happens, use the -c option to edit the config file directly.&nbsp;
 
2519
This bypasses initialization, and places you in the editor,
 
2520
with the config file preloaded.&nbsp;
 
2521
Make your corrections, write the file,
 
2522
quit, and invoke edbrowse again.&nbsp;
 
2523
Repeate these steps until there are no errors,
 
2524
and you see the words "edbrowse ready".
 
2525
 
 
2526
<P>
 
2527
The config file is in $HOME/.ebrc.&nbsp;
 
2528
The "eb" is shorthand for edbrowse.&nbsp;
 
2529
You cannot rename the config file; it is what it is.&nbsp;
 
2530
This is true on Windows as well, so make sure HOME is set.
 
2531
 
 
2532
<P>
 
2533
The config file is line oriented.&nbsp;
 
2534
Lines begining with # are comments, and are ignored.&nbsp;
 
2535
Blank lines are also ignored.&nbsp;
 
2536
All other lines fall into one of 5 categories.
 
2537
 
 
2538
<OL>
 
2539
<P><LI> Define an option, using the keyword=value syntax.
 
2540
<P><LI> Define an edbrowse script that can be invoked from the command line,
 
2541
or from another script.
 
2542
<P><LI> An edbrowse command, that becomes part of an edbrowse script.
 
2543
<P><LI> Establish an email account.&nbsp;
 
2544
This will be described later, when we talk about the email client.
 
2545
<P><LI> A mail filtering rule.&nbsp;
 
2546
</OL>
 
2547
 
 
2548
<H3 align=center> <A NAME=keyval> Keyword = Value </A> </H3>
 
2549
 
 
2550
The best documentation is an example, so let's dive right in.
 
2551
 
 
2552
<P>
 
2553
Recall the section on <A HREF=#cook>cookies</A>.&nbsp;
 
2554
You'll need a file, often called a cookie jar,
 
2555
to store your cookies.&nbsp;
 
2556
The line that establishes this cookie jar might look like this.
 
2557
<P>
 
2558
jar = /home/eklhad/.ebsys/cookie-jar
 
2559
 
 
2560
<P>
 
2561
This is a simple keyword = value syntax.&nbsp;
 
2562
It's ok if the filename has embedded spaces, or even an equals sign.&nbsp;
 
2563
No need to quote it.
 
2564
 
 
2565
<P>
 
2566
When edbrowse sees this line in its config file, it records the location of the cookie jar,
 
2567
and it checks the validity of that file.&nbsp;
 
2568
If the file is a directory (or something weird),
 
2569
or is otherwise inaccessible,
 
2570
edbrowse prints an error message and aborts.&nbsp;
 
2571
If this happens,
 
2572
use the -c option to edit your config file,
 
2573
and change the cookie jar.
 
2574
 
 
2575
<P>
 
2576
Here are some additional name=value directives.&nbsp;
 
2577
Some of these are used to set up an email account.&nbsp;
 
2578
This will become clearer when we talk about the mail client.
 
2579
 
 
2580
<P>
 
2581
certfile = /home/eklhad/.ebsys/ssl-certs
 
2582
 
 
2583
<P>
 
2584
Specify the file that holds the certificates for secure connections.&nbsp;
 
2585
This was explained in the section on <A HREF=#ssl>secure connections</A>.
 
2586
 
 
2587
<P>
 
2588
maildir = /home/eklhad/mbox
 
2589
<P>
 
2590
Go to this directory when fetching mail.&nbsp;
 
2591
thus, if you save a mail message, you'll always know where it is.
 
2592
 
 
2593
<P>
 
2594
webtimer = 30
 
2595
<br>
 
2596
mailtimer = 180
 
2597
 
 
2598
<P>
 
2599
Wait 30 seconds for a response from a web server, and 3 minutes for a response from the mail server.&nbsp;
 
2600
A time value of 0 waits forever.&nbsp;
 
2601
Sorry, there seems to be no way to interrupt a socket call,
 
2602
other than control backslash (quit), which kills the entire program.&nbsp;
 
2603
That's why these timers are here - so you don't hang forever.&nbsp;
 
2604
The defaults are 20 and 0 respectively.
 
2605
 
 
2606
<P>
 
2607
nojs = space.com
 
2608
<P>
 
2609
Specify domains that don't need javascript.&nbsp;
 
2610
You can eliminate annoying error messages and speed up access
 
2611
by disabling javascript for certain websites.&nbsp;
 
2612
Javascript will not be run on pages within these domains,
 
2613
nor will it be fetched from these domains.
 
2614
 
 
2615
<P>
 
2616
The above directive will also drop javascript from subdomains such as www.space.com.
 
2617
 
 
2618
<P>
 
2619
You can include a path or partial path after the domain, as in space.com/popups.&nbsp;
 
2620
This will block the popup ads that you don't want to see, and often generate edbrowse errors in any case.&nbsp;
 
2621
Subdomains are not considered when a path is given; the domain must match exactly.
 
2622
 
 
2623
<P>
 
2624
inserver = pop3.some-domain.com
 
2625
<br>
 
2626
inport = 110
 
2627
<br>
 
2628
outserver = smtp.some-domain.com
 
2629
<br>
 
2630
outport = 25
 
2631
<P>
 
2632
Specify the machines and ports that you use to fetch mail and send mail respectively.&nbsp;
 
2633
You can use the fully qualified domain names, or aliases, as defined in /etc/hosts.&nbsp;
 
2634
The ports shown here are standard, and almost always correct.&nbsp;
 
2635
They are also default in edbrowse, so you need not set inport and outport unless they are different from that shown above.&nbsp;
 
2636
Note, these keywords are only valid in the context of a mail account, as indicated by mail{}.
 
2637
 
 
2638
<P>
 
2639
login = eklhad
 
2640
<br>
 
2641
password = secret
 
2642
<P>
 
2643
Specify the login and password that edbrowse uses to fetch your mail.
 
2644
 
 
2645
<P>
 
2646
from = Karl Dahlke
 
2647
<br>
 
2648
reply = karl.dahlke@some-domain.com
 
2649
<P>
 
2650
These lines are added in to the emails that you send.&nbsp;
 
2651
They tell the recipient who you are, and how to reply.&nbsp;
 
2652
It is
 
2653
<A HREF=http://www.spamlaws.com>
 
2654
illegal</A> to use these lines for deceptive purposes.&nbsp;
 
2655
Make sure they identify you, and that the reply address is indeed one of your email accounts.
 
2656
 
 
2657
<P>
 
2658
adbook = /home/eklhad/.ebsys/address-book
 
2659
<P>
 
2660
When specifying recipients, you can use aliases instead of full email addresses.&nbsp;
 
2661
Aliases are checked against your address book,
 
2662
a line oriented text file that is specified here.&nbsp;
 
2663
If your address book contains the line
 
2664
<P>
 
2665
fred : fred.flintstone@bedrock.us : 226 cobblestone way : 5553827
 
2666
<P>
 
2667
then you can use the alias fred,
 
2668
and edbrowse will substitute Fred's email address when sending mail.&nbsp;
 
2669
Only the first two fields in the address book are significant
 
2670
as far as edbrowse is concerned.&nbsp;
 
2671
Other fields might hold phone/fax numbers, street address, etc.&nbsp;
 
2672
It's up to you.
 
2673
 
 
2674
<P>
 
2675
spamcan = /home/eklhad/.recycle/save-spam
 
2676
<P>
 
2677
There is no perfect spam filter.&nbsp;
 
2678
But I can't live without one,
 
2679
so I wrote a simple ip blocker.&nbsp;
 
2680
(This is discussed below.)&nbsp;
 
2681
When spam is received,
 
2682
edbrowse prints the line "spam from such and so",
 
2683
and saves the mail in this file.&nbsp;
 
2684
If you recognize the name, spam from your friend,
 
2685
you can call up this file, find the email, and read it.&nbsp;
 
2686
This should not happen, as there is no particular reason to block the ip address of your friend's computer,
 
2687
but hey, better safe than sorry.
 
2688
 
 
2689
<P>
 
2690
ipblack = /home/eklhad/.ebsys/ip-blacklist
 
2691
<P>
 
2692
A line oriented text file holds the ip addresses of known porn/spam sites.&nbsp;
 
2693
The syntax is the usual: numbers separated by dots,
 
2694
with an optional /xx netmask indicator at the end.&nbsp;
 
2695
If the file contains the following two lines,
 
2696
any ip address that starts with 192.168,
 
2697
or 10.11.12.13, are forbidden addresses.
 
2698
<P>
 
2699
192.168.0.0/16
 
2700
<br>
 
2701
10.11.12.13
 
2702
 
 
2703
<P>
 
2704
If an email refers to a website that resolves to any of these addresses it is considered spam,
 
2705
and flagged as such.&nbsp;
 
2706
Let's be clear; I am not blocking email that comes from certain sources.&nbsp;
 
2707
After all, your friend's computer may well be sending you viruses or spyware.&nbsp;
 
2708
Rather, I screen email that has certain urls in its body.&nbsp;
 
2709
If the button that says "cheap meds for you" leads to a forbidden website,
 
2710
you'll never see the email.
 
2711
 
 
2712
<P>
 
2713
Note, I use the very same blacklist in my firewall.&nbsp;
 
2714
A shell script reads in the addresses and issues the appropriate iptables commands.&nbsp;
 
2715
My file has some 2,000 entries.&nbsp;
 
2716
This is large, but manageable.&nbsp;
 
2717
If the list gets much larger, I may rebuild the kernel
 
2718
with the "large ip tables" option enabled.&nbsp;
 
2719
This makes packet matching more efficient when there are many rules.&nbsp;
 
2720
I suppose it sorts them or something.
 
2721
 
 
2722
<H3 align=center> <A NAME=agent> User Agent </A> </H3>
1896
2723
 
1897
2724
Every time you fetch a web page from the internet,
1898
 
your browser identifies itself to the host.
1899
 
This is done automatically.
1900
 
Edbrose identifies itself as "edbrowse/1.5.16",
 
2725
your browser identifies itself to the host.&nbsp;
 
2726
This is done automatically.&nbsp;
 
2727
Edbrose identifies itself as "edbrowse/2.2.9",
1901
2728
where the number after the slash indicates the current version of edbrowse.
1902
2729
 
1903
2730
<P>
1904
2731
All well and good, but some websites have no respect for edbrowse,
1905
 
or lynx for that matter.
1906
 
They won't even let you in the door unless you look like Explorere or Netscape.
 
2732
or lynx for that matter.&nbsp;
 
2733
They won't even let you in the door unless you look like Explorere or Netscape.&nbsp;
1907
2734
Clickbank.com, a major credit card processor, is one example.
1908
2735
<P>
1909
 
So what do we do?
 
2736
So what do we do?&nbsp;
1910
2737
We lie!
1911
2738
 
1912
2739
<P>
1913
2740
You can specify different agents in your .ebrc file,
1914
 
and activate them with the `ua' (user agent) command.
 
2741
and activate them with the `ua' (user agent) command.&nbsp;
1915
2742
If the following lines are in your .ebrc file,
1916
2743
you can type ua1 to pretend to bee lynx,
1917
 
and ua2 to pretend to be Mozilla.
1918
 
Type ua0 to resurrect the standard edbrowse identification.
 
2744
and ua2 to pretend to be Mozilla.&nbsp;
 
2745
Type ua0 to resurrect the standard edbrowse identification.&nbsp;
1919
2746
Let's hope there aren't too many asinine websites out there,
1920
 
like Clickbank, that force us to lie.
 
2747
like Clickbank, that force us to lie.&nbsp;
 
2748
It's just so stupid, and pointless.
1921
2749
 
1922
2750
<P>
1923
2751
agent = Lynx/2.8.4rel.1 libwww-FM/2.14
1924
2752
<br>
1925
2753
agent = Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)
1926
2754
 
1927
 
<H4 align=center> Upper/Lower Case </H4>
1928
 
 
1929
 
The `lc' command converts a line to lower case,
1930
 
and `uc' converts it to upper case.
1931
 
Perl users will recognize these directives.
1932
 
As an extension, `mc' converts to mixed case, capitalizing the first letter of each word,
1933
 
and the d in mcdonald.
1934
 
 
1935
 
<P>
1936
 
This is especially useful in a directory scan.
1937
 
The last thing a blind person wants to worry about is whether some of the letters in a file name are upper case.
1938
 
If directory write mode is enabled,
1939
 
type ,lc to convert all the file names to lower case.
1940
 
 
1941
 
<P>
1942
 
If you want to convert a particular word, type s/word/uc/.
1943
 
This converts the word to upper case.
1944
 
All the other substitution suffixes apply.
1945
 
To change foo, Foo, FOo, and FOO to FOO, everywhere,
1946
 
type ,s/\bfoo\b/uc/ig.
1947
 
 
1948
 
<H4 align=center> Break Line </H4>
1949
 
 
1950
 
The `bl' command breaks the current line into sentences and phrases,
1951
 
each about 70 characters long.
1952
 
It also compresses white space and strips white space from the end of the line.
1953
 
If the line contains return characters,
1954
 
these are turned into line separaters -
1955
 
places where the line will definitely be cut.
1956
 
The only white space that is preserved is the tabs or spaces
1957
 
at the beginning of the line, or after each return character.
1958
 
This is a modest attemp to keep indented text indented,
1959
 
if that makes any sense?
1960
 
 
1961
 
<P>
1962
 
I use this feature in two different ways.
1963
 
If I am familiar with the document,
1964
 
(I probably wrote it),
1965
 
I may use the bl command on a line of text that seems rather long.
1966
 
I typed it in quickly, as an uninterrupted thought, and now I want to break it up.
1967
 
But I don't want to count punctuation marks and say,
1968
 
"I think we need a break after the third comma
1969
 
and the period following that and then at the next comma",
1970
 
issuing the s punctuation commands along the way.
1971
 
Oh I like the s commands well enough - they put you in complete contrl -
1972
 
but it's easier to type bl - and bl usually does the right thing.
1973
 
Also, bl compresses accidental double spaces,
1974
 
a typo that I will never hear if I simply read the line as a whole.
1975
 
 
1976
 
<P>
1977
 
When the document comes in from the outside,
1978
 
usually from another word processor such as MS-Word,
1979
 
bl serves a completely different function.
1980
 
Paragraphs are often stored on a single physical line.
1981
 
Sometimes the entire document is on a single line,
1982
 
with return characters, \r, separating paragraphs.
1983
 
Wysiwyg word processors don't worry about separating sentences and phrases -
1984
 
that's what word wrap is for.
1985
 
Well - bl is our version of word wrap.
1986
 
It doesn't try to conform to any screen;
1987
 
it merely cuts the text into manageable chunks,
1988
 
each piece a separate semantic unit.
1989
 
When bl is issued,
1990
 
physical lines will contain sentences or phrases, as delimited by punctuation,
1991
 
or by the newline/return characters embedded in the original document.
1992
 
 
1993
 
<P>
1994
 
If one of the original lines, delimited by newline or return,
1995
 
is long, i.e. more than 120 characters,
1996
 
it is assumed to be a self-contained paragraph,
1997
 
and a blank line is added before and after.
1998
 
Thus a disassembled paragraph containing 20 sentences
1999
 
does not simply flow into the next disassembled paragraph containing 18 more sentences.
2000
 
An empty line separates the two paragraphs.
2001
 
This is only applicable if bl is applied to a range of lines,
2002
 
or the entire document,
2003
 
as might occur when making an outside document readable.
2004
 
 
2005
 
<P>
2006
 
Don't apply the bl command to a preformatted section,
2007
 
such as a table or ascii art.
2008
 
If you're not sure what to expect,
2009
 
i.e. you didn't write the file,
2010
 
scan through it first,
2011
 
and apply bl to the range of lines that actually represents text.
2012
 
Often this is the entire document (,bl).
2013
 
The following commands do a pretty good job of cleaning up a typical Microsoft Word document.
2014
 
 
2015
 
<P>
2016
 
<PRE><font size=4 face=Arial,Helvetica,sans-serif><code>e whatever.doc or whatever.wps
2017
 
f _  # don't accidently overwrite the microsoft document
2018
 
,s/[~80-~ff~00-~0c~0e-~1f]//g;  # strip out non ascii control/formatting codes
2019
 
g/^\s*$/d  # these blank lines use to contain non ascii codes
2020
 
,bl  # split lines and paragraphs
2021
 
1,20p  # first couple lines are often garbage, but then the text begins.
2022
 
</code></font></PRE>
2023
 
 
2024
 
<P>
2025
 
Note that this function uses the same software as the browse command.
2026
 
Both commands format the text in the same way.
2027
 
If you change the constant $optimalLine = 80 in the ebrowse source,
2028
 
that affects both the break line and the browse translations.
2029
 
 
2030
 
<H4 align=center> Send Mail </H4>
 
2755
<P>
 
2756
This feature was written pre-javascript,
 
2757
and is not 100% compatible with the navigator object.&nbsp;
 
2758
Navigator.userAgent returns the correct string, according to the agent you select,
 
2759
but other aspectss of the navigator object do not change with the agent,
 
2760
and they should.
 
2761
 
 
2762
<H3 align=center> <A NAME=script> Edbrowse Functions </A> </H3>
 
2763
 
 
2764
You can bundle a set of edbrowse commands together under one name,
 
2765
similar to a macro.&nbsp;
 
2766
If the following appears in your .ebrc file,
 
2767
you can type &lt;ud to undos a file.
 
2768
<P>
 
2769
function:ud {
 
2770
<br>
 
2771
&nbsp;&nbsp;,s/\r$//
 
2772
<br>
 
2773
}
 
2774
 
 
2775
<P>
 
2776
The new &lt; command is suppose to remind you of redirection,
 
2777
i.e. read input commands from this macro.&nbsp;
 
2778
And macros can invoke other macros,
 
2779
by using a &lt; command in the body.&nbsp;
 
2780
Almost any edbrowse command is fair game.&nbsp;
 
2781
A macro can fetch web pages from the internet,
 
2782
fill out forms, submit requests, and send mail.
 
2783
 
 
2784
<P>
 
2785
Normally, edbrowse marches along, whether a command succeeds or not.&nbsp;
 
2786
However, you can tell a macro to stop if it encounters an error
 
2787
by using this syntax.
 
2788
<P>
 
2789
function+hw {
 
2790
<br>
 
2791
&nbsp;&nbsp;/hello/p
 
2792
<br>
 
2793
&nbsp;&nbsp;/world/p
 
2794
<br>
 
2795
}
 
2796
 
 
2797
<P>
 
2798
The plus sign after the word function means each command in that function must succeed.&nbsp;
 
2799
If there is no line containing the word hello, the function stops.&nbsp;
 
2800
If there is such a line, then the function moves on,
 
2801
and looks for a line containing the word world.
 
2802
 
 
2803
<P>
 
2804
Other than some indenting, the format is fixed, and unforgiving.&nbsp;
 
2805
You cannot, for instance, put the opening brace on its own line, as K&amp;R would suggest.
 
2806
 
 
2807
<P>
 
2808
These functions, or macros, can accept parameters.&nbsp;
 
2809
Let's make the previous function a bit more general.
 
2810
<P>
 
2811
function+hw {
 
2812
<br>
 
2813
&nbsp;&nbsp;/~1/p
 
2814
<br>
 
2815
&nbsp;&nbsp;/~2/p
 
2816
<br>
 
2817
}
 
2818
 
 
2819
<P>
 
2820
You can reproduce the earlier behavior by typing &lt;hw hello world.&nbsp;
 
2821
Or you can search for different lines by invoking &lt;hw foo bar.&nbsp;
 
2822
The latter looks for a line containing foo and prints it,
 
2823
and if this succeeds it looks for a line containing bar and prints that.&nbsp;
 
2824
Let's build a more useful function, a shortcut to google.&nbsp;
 
2825
The variable ~0 represents all the arguments together.&nbsp;
 
2826
In this case ~0 is the keywords you pass to google, for your search.
 
2827
<P>
 
2828
function+gg {
 
2829
<br>
 
2830
&nbsp;&nbsp;b www.google.com/search?q=~0&amp;hl=n&amp;btnG=Google+Search&amp;meta=
 
2831
<br>
 
2832
}
 
2833
 
 
2834
<P>
 
2835
With this in place, you simply type `&lt;gg kangaroo habitat'
 
2836
to find out where kangaroos live.
 
2837
 
 
2838
<P>
 
2839
Finally, an edbrowse function can branch,
 
2840
based upon the success or failure of the previous command.&nbsp;
 
2841
Use if(*) for success, and if(?) for failure.&nbsp;
 
2842
The ? is suppose to remind you of the question mark that you get when an edbrowse command fails.&nbsp;
 
2843
The following looks for a line containing foo, and if it finds one,
 
2844
it advances to the next line, and if that line contains bar, it deletes it.
 
2845
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>function+silly {
 
2846
  /foo/
 
2847
  if(*) {
 
2848
    +s/bar//
 
2849
    if(*) {
 
2850
      d
 
2851
    }
 
2852
  }
 
2853
}
 
2854
</font></PRE>
 
2855
 
 
2856
<P>
 
2857
I deliberately used function+ instead of function: in the above example.&nbsp;
 
2858
Normally the + will cause the function to abort if an edbrowse command fails.&nbsp;
 
2859
However, if the result of that command is used by a control statement,
 
2860
the function does not abort.&nbsp;
 
2861
This is similar to set -e in the shell,
 
2862
which causes a script to abort,
 
2863
unless the result of the command is used by an if statement.
 
2864
 
 
2865
<P>
 
2866
Other control statements include while(*) while(?) until(*) and until(?).&nbsp;
 
2867
The following deletes lines from the top of the file,
 
2868
as long as they contain foo or bar.&nbsp;
 
2869
It then deletes the blank lines at the top.
 
2870
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>function+topclean {
 
2871
  until(?) {
 
2872
    1g/foo\|bar/d
 
2873
  }
 
2874
  until(?) {
 
2875
    1g/^$/d
 
2876
  }
 
2877
}
 
2878
</font></PRE>
 
2879
 
 
2880
<P>
 
2881
You can use loop(100){ ... } to repeat a set of commands 100 times.&nbsp;
 
2882
I haven't used this feature very often.
 
2883
 
 
2884
<H3 align=center> <A NAME=init> The Init Script </A> </H3>
 
2885
 
 
2886
The script named "init" is run at edbrowse startup.&nbsp;
 
2887
You can use this to establish your default settings - even read in your bookmark file,
 
2888
so your "favorites" are close at hand.&nbsp;
 
2889
Here is an example.
 
2890
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>function+init {
 
2891
#  turn debug off, so we don't see any status messages from this script
 
2892
db0
 
2893
#  Assume directories can be modified
 
2894
dw
 
2895
#  Put beginning and end markers around listed lines
 
2896
el
 
2897
#  Let session 99 hold your favorites, ready to surf.
 
2898
e99
 
2899
b $bookmarks
 
2900
#  back to session 1, ready to go to work
 
2901
e1
 
2902
#  Restore debug level to something reasonable, 1 or 2
 
2903
db1
 
2904
}
 
2905
</font></PRE>
 
2906
 
 
2907
<P>
 
2908
This is just a sample.&nbsp;
 
2909
Put anything you like in your init script,
 
2910
or leave it out altogether if you are happy with edbrowse out of the box.
 
2911
 
 
2912
<H3 align=center> <A NAME=ma> Mail Accounts </A> </H3>
 
2913
 
 
2914
The next chapter describes edbrowse as a mail client,
 
2915
so let's use the config file to define your email accounts.&nbsp;
 
2916
You can define several accounts, as necessary.&nbsp;
 
2917
They are implicitly numbered,
 
2918
in the order they appear in the config file.&nbsp;
 
2919
So the first mail account becomes #1, the second becomes #2, and so on.
 
2920
 
 
2921
<P>
 
2922
We already discussed the relevant keywords for an email account.&nbsp;
 
2923
All you have to do is enclose them in mail{...}, like this.
 
2924
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>mail {
 
2925
  default
 
2926
  inserver = pop3.some-domain.com
 
2927
  outserver = smtp.some-domain.com
 
2928
  login = eklhad
 
2929
  password = secret
 
2930
  from = Karl Dahlke
 
2931
  reply = karl.dahlke@some-domain.com
 
2932
}
 
2933
</font></PRE>
 
2934
 
 
2935
<P>
 
2936
The "default" directive makes this account the default.&nbsp;
 
2937
One and only one account should be labeled default.&nbsp;
 
2938
If you do not specify an account when fetching or sending mail, the default account is used.&nbsp;
 
2939
Beyond this, the default smtp server is <em>always</em> used to send mail,
 
2940
no matter which account you specify.&nbsp;
 
2941
If account #1 is default, and you send mail using account #3,
 
2942
the name and reply address from account #3 will be sent to the recipient,
 
2943
and if he replies, his reply will be sent to your third email account.&nbsp;
 
2944
However, the smtp server from your default account is always used to physically transmit the message.&nbsp;
 
2945
There are technical reasons for doing this,
 
2946
that are beyond the scope of this document.&nbsp;
 
2947
Trust me, it's the right thing to do.
 
2948
 
 
2949
<P>
 
2950
Mail filtering, by sender and/or subject,
 
2951
is controlled by your config file as well.&nbsp;
 
2952
This will be <A HREF=#filter>described later</A>,
 
2953
as part of the fetchmail client.
 
2954
 
 
2955
<H3 align=center> <A NAME=mt> Mime Descriptors </A> </H3>
 
2956
 
 
2957
Mime types are determined by the extension of the file, or in some cases the protocol.&nbsp;
 
2958
They might tell edbrowse to use /usr/bin/play to play file.wav or file.voc,
 
2959
and /usr/bin/mpg123 to play file.mp3, and so on.&nbsp;
 
2960
Rather than repeat it all here, I suggest you look at the mime {...} sections in the sample config file provided below.&nbsp;
 
2961
Linux users can probably copy this part directly into their own config file.&nbsp;
 
2962
It generally does the right thing.&nbsp;
 
2963
Here is one example.
 
2964
 
 
2965
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>mime {
 
2966
type = audio/mp3
 
2967
desc = audio file in mp3 format
 
2968
suffix = mp3
 
2969
program = mpg123 -q -
 
2970
}
 
2971
</font></PRE>
 
2972
 
 
2973
<P>
 
2974
If you have pulled down a file from the internet that ends in .mp3,
 
2975
type `pb' to play the contents of the buffer.&nbsp;
 
2976
The data is piped into the program,
 
2977
whose options tell it to expect data from standard in.&nbsp;
 
2978
If the mp3 player works better from a file,
 
2979
use a trailing percent to turn the buffer into a temp file with the proper suffix.
 
2980
 
 
2981
<P>
 
2982
program = mpg123 -q %
 
2983
 
 
2984
<P>
 
2985
The command `pb' could mean process buffer,as well as play buffer.&nbsp;
 
2986
For instance, a mime descriptor might unzip a zip archive.
 
2987
 
 
2988
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>mime {
 
2989
type = data/zip
 
2990
desc = a compressed zip archive
 
2991
suffix = zip
 
2992
#  use %, since unzip cannot read data from standard in
 
2993
program = unzip %
 
2994
}
 
2995
</font></PRE>
 
2996
 
 
2997
<H3 align=center> <A NAME=sampcfg> A Sample Config File </A> </H3>
 
2998
 
 
2999
The best documentation is an example,
 
3000
so I have provided a sample config file with fake data.&nbsp;
 
3001
It is well commented.&nbsp;
 
3002
You can download a copy <A HREF=sample.ebrc>here</A>.
 
3003
 
 
3004
<H3 align=center> <A NAME=sm> Send Mail </A> </H3>
2031
3005
 
2032
3006
You can email the contents of your current editing session to someone else
2033
 
via an smtp server.
2034
 
Use the `sm' command to send mail.
2035
 
Your pop3/smtp server is described in the config file $HOME/.ebrc.
2036
 
You can
2037
 
<A HREF=sample.ebrc>
2038
 
obtain a sample</A> here.
2039
 
It is well commented.
2040
 
 
2041
 
<P>
2042
 
The recipients, attachments, and subject must appear at the top of your send file.
 
3007
via the `sm' command.&nbsp;
 
3008
Your email accounts are described in your <A HREF=#cfg>config file</A>.
 
3009
 
 
3010
<P>
 
3011
The contents of your .signature file, in your home directory, are automatically appended.&nbsp;
 
3012
This is standard behavior for Unix mail clients.
 
3013
 
 
3014
<P>
 
3015
The recipients, attachments, and subject must appear at the top of your file.&nbsp;
2043
3016
The sm command is picky, so observe the following syntax carefully.
2044
3017
 
2045
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>To: fred.flintstone@bedrock.us
 
3018
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>To: fred.flintstone@bedrock.us
2046
3019
To: barney.rubble@bedrock.us
2047
 
account: 0
 
3020
account: 1
2048
3021
attach: hollyrock-brochure.pdf
2049
3022
Subject: Hollyrock Vacation
2050
3023
Come visit Hollyrock.
2054
3027
</font></PRE>
2055
3028
 
2056
3029
<P>
2057
 
The account line is optional.
2058
 
It tells edbrowse to use the first mail account specified in your .ebrc config file.
 
3030
The account line is optional.&nbsp;
 
3031
It tells edbrowse to use the first mail account specified in your .ebrc config file.&nbsp;
2059
3032
If you don't include an account: line,
2060
 
edbrowse uses the default account, indicated by * in your .ebrc file.
2061
 
That's usually the one you want anyways.
2062
 
 
2063
 
<P>
2064
 
Typing sm5 causes edbrowse to use account number 5 (i.e. the sixth account)
2065
 
in your config file.
2066
 
This overrides the account: line in your file, if there is one.
2067
 
It is often easier to type sm5 than to insert an account:5 line.
2068
 
 
2069
 
<P>
2070
 
Use the attach: lines to add attachments to your email.
2071
 
Each line should specify a file to attach.
 
3033
edbrowse uses the default account, indicated by "default" in your .ebrc file.
 
3034
 
 
3035
<P>
 
3036
Typing sm5 causes edbrowse to use account number 5
 
3037
in your config file.&nbsp;
 
3038
This overrides the account: line in your file, if there is one.&nbsp;
 
3039
It is often easier to type sm5 than to insert an account:5 line.&nbsp;
 
3040
Note, sm-5 is the same as sm5, but the .signature file is not included.&nbsp;
 
3041
Sometimes you want a different ending on your email, for a particular situation.
 
3042
 
 
3043
<P>
 
3044
Use the attach: lines to add attachments to your email.&nbsp;
 
3045
Each line should specify a file to attach,
 
3046
and they must appear before the subject line.&nbsp;
2072
3047
If the filename is simply a number,
2073
 
the corresponding edbrowse session is used instead.
 
3048
the corresponding edbrowse session is used instead.&nbsp;
2074
3049
Return to the earlier example,
2075
 
where we are trying to attach a Hollyrock brochure.
2076
 
Another way to do this is to switch to session 2 and edit the pdf file.
2077
 
This is a binary file, but that doesn't matter.
2078
 
Don't do anything with it, just hold it in session 2.
 
3050
where we are trying to attach a Hollyrock brochure.&nbsp;
 
3051
Another way to do this is to switch to session 2 and read in the pdf file.&nbsp;
 
3052
This is a binary file, but that doesn't matter.&nbsp;
 
3053
Don't try to edit it, just hold it in session 2.&nbsp;
2079
3054
Then switch back to session 1 and use the line attach:2.
2080
3055
 
2081
3056
<P>
2082
3057
If you use attach:2, instead of attach:hollyrock-brochure.pdf,
2083
 
Fred will notice one difference.
2084
 
The attachment is not prenamed for him.
 
3058
Fred will notice one difference.&nbsp;
 
3059
The attachment is not prenamed for him.&nbsp;
2085
3060
If he wants to save the attachment,
2086
 
he'll have to come up with a filename himself.
 
3061
he'll have to come up with a filename himself.&nbsp;
2087
3062
Other than that, the email looks the same.
2088
3063
 
2089
3064
<P>
2090
 
The alt: directive is almost the same as the attach: directive.
2091
 
If you use alt:, the attachment is not treated as an adjunct file.
2092
 
Instead, it is an alternate representation of the same email.
2093
 
The mail client will use the alternate representation if it can.
 
3065
The alt: directive is almost the same as the attach: directive.&nbsp;
 
3066
If you use alt:, the attachment is not treated as an adjunct file.&nbsp;
 
3067
Instead, it is an alternate representation of the same email.&nbsp;
 
3068
The mail client will use the alternate representation if it can.&nbsp;
2094
3069
This is usually used to send multimedia email,
2095
 
with hyperlinks and pictures etc.
 
3070
with hyperlinks and pictures etc.&nbsp;
2096
3071
The primary email is in plain text,
2097
 
but the alternate attachment is in html or rich text.
 
3072
but the alternate attachment is in html or rich text.&nbsp;
2098
3073
Unless something is amiss, the user sees the alternate presentation,
2099
3074
complete with graphics and hyperlinks.
2100
3075
 
2104
3079
 
2105
3080
<P>
2106
3081
As you may have guessed,
2107
 
the to: lines establish the recipients.
2108
 
Please don't specify more than a few recipients.
2109
 
I paste them together into one line,
2110
 
and if that line gets too long, the server might complain.
2111
 
Beyond this, some servers, my mail server included,
2112
 
set a hard limit on the number of recipients.
 
3082
the to: lines establish the recipients.&nbsp;
 
3083
Please don't specify more than a few recipients.&nbsp;
 
3084
Some servers, my mail server included,
 
3085
set a hard limit on the number of recipients.&nbsp;
2113
3086
If you exceed this number,
2114
 
usually ten,
2115
 
the remaining recipients simply don't get their mail.
2116
 
Best to limit your "to:" lines to 8 or less.
 
3087
somewhere between 10 and 100,
 
3088
the remaining recipients simply don't get their mail.&nbsp;
 
3089
Best to limit your "to:" lines to 10 or less.
2117
3090
 
2118
3091
<P>
2119
 
When specifying recipients, you can use aliases instead of full email addresses.
 
3092
When specifying recipients, you can use aliases instead of full email addresses.&nbsp;
2120
3093
Aliases are checked against your address book,
2121
 
a text file that is specified in your .ebrc file.
 
3094
a text file that is specified in your .ebrc file.&nbsp;
2122
3095
If your address book contains the line
2123
3096
<P>
2124
 
fred:fred.flintstone@bedrock.us:226 cobblestone way:5553827
 
3097
fred : fred.flintstone@bedrock.us : 226 cobblestone way : 5553827
2125
3098
<P>
2126
 
then you can simply write "To:fred" at the top of your file.
 
3099
then you can simply write "To:fred" at the top of your file.&nbsp;
2127
3100
Only the first two fields in the address book are significant
2128
 
as far as edbrowse is concerned.
 
3101
as far as edbrowse is concerned.&nbsp;
2129
3102
Other fields might hold phone/fax numbers, street address, etc.
 
3103
<P>
2130
3104
Note that "Reply to fred" is an alternate syntax for "to: fred".
2131
3105
 
2132
3106
<P>
2133
 
Some web pages include sendmail links.
2134
 
They look just like other hyperlinks, but they send email to the appropriate person.
 
3107
Some web pages include sendmail links.&nbsp;
 
3108
They look just like other hyperlinks, but they send email to the appropriate person.&nbsp;
2135
3109
Click here for
2136
3110
<A HREF=http://developer.netscape.com/viewsource/husted_mailto/mailto.html>
2137
 
more details</A>.
 
3111
technical details</A>.
2138
3112
 
2139
3113
<P>
2140
3114
If you activate a sendmail link,
2141
 
you will be placed in a new editing session with the "to" and "subject" lines preloaded.
 
3115
you will be placed in a new editing session with the "to" and "subject" lines preloaded.&nbsp;
2142
3116
If the url did not specify a subject,
2143
 
the subject is simply "Comments".
2144
 
You will probably want to replace this with a better subject line.
2145
 
Write your mail message and type `sm' to send it on its way.
2146
 
Then type ^ to return to the web page you were looking at.
2147
 
Other aspects of sendmail links are not supported by edbrowse,
2148
 
as they are rarely used.
 
3117
the subject is simply "Hello".&nbsp;
 
3118
You will probably want to replace this with a better subject line.&nbsp;
 
3119
Write your mail message and type `sm' to send it on its way.&nbsp;
 
3120
Then type ^ to return to the web page you were looking at.&nbsp;
 
3121
Note that the body of your email may also be preloaded with some default text,
 
3122
so be sure to check before you write and send.
2149
3123
 
2150
3124
<P>
2151
3125
You can include attachments by placing "attach:" lines at the top of the file,
2152
 
assuming the recipient can handle these attachments.
 
3126
assuming the recipient can handle these attachments.&nbsp;
2153
3127
This might make sense when the sendmail link is asking for {bug reports} -
2154
 
you might attach a program and/or its output.
2155
 
Yet this is somewhat unusual.
 
3128
you might attach a program and/or its output.&nbsp;
 
3129
Yet this is somewhat unusual.&nbsp;
2156
3130
Most sendmail links expect a few sentences of feedback, and nothing more.
2157
3131
 
2158
3132
<P>
2159
 
Some web forms are submitted via email, rather than a direct http transmission.
2160
 
Edbrowse handles this properly.
 
3133
Some web forms are submitted via email, rather than a direct http transmission.&nbsp;
 
3134
Edbrowse handles this properly.&nbsp;
2161
3135
It shows you the destination email address,
2162
3136
sends the mail through smtp,
2163
 
and tells you to watch for a reply.
 
3137
and tells you to watch for a reply.&nbsp;
2164
3138
This reply could be an email response, or even a phone call
2165
 
if you provided your phone number in the form.
2166
 
But remember, nothing happens immediately.
2167
 
You are still on the same web page, still looking at the same submit button.
2168
 
Don't push the button again!
 
3139
if you provided your phone number in the form.&nbsp;
 
3140
But remember, nothing happens immediately.&nbsp;
 
3141
You are still on the same web page, still looking at the same submit button.&nbsp;
 
3142
Don't push the button again!&nbsp;
2169
3143
The mail has been sent,
2170
3144
and you'll be hearing from the company in the next few days.
2171
3145
 
2172
 
<H4 align=center> Send Mail Client </H4>
 
3146
<H3 align=center> <A NAME=smc> Send Mail Client </A> </H3>
2173
3147
 
2174
3148
as described in the previous section,
2175
 
edbrowse incorporates the features of a mail client.
2176
 
In addition to the `sm' command,
2177
 
you can send mail in a batch fashion, from the command line.
 
3149
edbrowse incorporates the features of a mail client.&nbsp;
 
3150
In addition to the interactive `sm' command,
 
3151
you can send mail in a batch fashion, from the command line.&nbsp;
2178
3152
If fred and barney are in your address book,
2179
3153
and you want to send them mail from the command line, with an attachment,
2180
 
using your primary email account, do this.
 
3154
using your primary email account, do this.&nbsp;
 
3155
(I'm assuming e has been aliased to an edbrowse executable.)
2181
3156
<P>
2182
 
perl edbrowse -m0 fred barney hollyrock-notice +hollyrock-brochure.pdf
 
3157
e -m1 fred barney hollyrock-notice +hollyrock-brochure.pdf
2183
3158
 
2184
3159
<P>
2185
 
Files with the leading + are assumed to be attachments.
 
3160
Files with the leading + are assumed to be attachments.&nbsp;
2186
3161
If they are binary they will be encoded properly,
2187
 
according to the mime standard.
 
3162
according to the mime standard.&nbsp;
2188
3163
A leading - indicates an alternate format, like this.
2189
3164
 
2190
3165
<P>
2191
 
perl edbrowse -m0 fred barney hollyrock-notice -hollyrock-graphical.html
2192
 
 
2193
 
<P>
2194
 
Remember, you can specify several mail accounts in your .ebrc file.
2195
 
The first account is indicated by index 0, as in -m0.
2196
 
The account with the * (in the config file) is always used
2197
 
as the outgoing smtp server.
2198
 
The -m option does not change this.
2199
 
However, -m3 will set the from and reply address according to account 3,
2200
 
whether that has the * or not.
2201
 
You always use the same smtp server to send your mail,
2202
 
but you can make it look like it came from other places,
2203
 
and direct the replies back to those places.
2204
 
 
2205
 
<P>
2206
 
Suppose you've brought some work home, for instance,
2207
 
and are on your home computer.
2208
 
You want to send mail to your colleagues,
2209
 
but you want it to look like it came from your work account,
2210
 
and more important, you want their replies to go back to your work account
2211
 
so you will see them next morning.
2212
 
Specify the work account via the -m option.
2213
 
Your local server, associated with your home ISP,
2214
 
is still used to send the mail,
2215
 
because that's the only server you can use.
2216
 
Other servers, not associated with your ISP,
2217
 
rarely allow outsiders to send mail.
2218
 
Remember, the smtp protocol has no password.
2219
 
So you always want to use your trusted local mail server to send,
2220
 
even when another account is specified.
2221
 
 
2222
 
<P>
2223
 
All right, that was all very complicated.
2224
 
don't worry about it, edbrowse does the right thing.
 
3166
e -m1 fred barney hollyrock-notice -hollyrock-graphical.html
 
3167
 
 
3168
<P>
 
3169
Remember, you can specify several mail accounts in your .ebrc file.&nbsp;
 
3170
The first account is indicated by index 1, as in -m1, and so on.&nbsp;
2225
3171
You can make your life a lot easier with some aliases in your .bashrc file.
2226
 
 
2227
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>#  My mail, home account
2228
 
alias mymail="perl /usr/local/bin/edbrowse -m0"
2229
 
#  My wife's account; sometimes she doesn't check it for a week.
2230
 
alias wifemail="perl /usr/local/bin/edbrowse -m1"
 
3172
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>#  My mail, home account
 
3173
alias mymail="e -m1"
 
3174
#  My wife's account.
 
3175
alias wifemail="e -m2"
2231
3176
#  My work account.
2232
 
alias workmail="perl /usr/local/bin/edbrowse -m2"
 
3177
alias workmail="e -m3"
2233
3178
#  mail is obsolete
2234
3179
alias mail="echo use mymail, wifemail, or workmail"
2235
3180
</font></PRE>
2236
3181
 
2237
 
<H4 align=center> Fetch Mail Client </H4>
 
3182
<H3 align=center> <A NAME=fmc> Fetch Mail Client </A> </H3>
2238
3183
 
2239
 
If edbrowse is run with the -m0 option, and no other arguments,
 
3184
If edbrowse is run with the -m1 option, and no other arguments,
2240
3185
it is an interactive fetch mail client,
2241
 
retrieving mail from your first pop3 account.
2242
 
The first thing it tells you is how many messages you have.
2243
 
If there are no messages it says "No mail", and exits.
2244
 
If there are messages, it retrieves each one in turn.
 
3186
retrieving mail from your first pop3 account.&nbsp;
 
3187
The first thing it tells you is how many messages you have.&nbsp;
 
3188
If there are no messages it says "No mail", and exits.&nbsp;
 
3189
If there are messages, it retrieves each one in turn.&nbsp;
2245
3190
For each message, it displays some header information (such as subject
2246
 
and sender) and the first page of text, and then presents a prompt.
 
3191
and sender) and the first page of text, and then presents a prompt.&nbsp;
2247
3192
A '?' prompt means the message is complete --
2248
 
a '*' prompt means there is more text to read.
2249
 
You respond by hitting a key.
 
3193
a '*' prompt means there is more text to read.&nbsp;
 
3194
You respond by hitting a key.&nbsp;
2250
3195
Keys have the following meaning.
2251
3196
 
2252
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>?  summary of key commands.
2253
 
q       quit the program.
2254
 
x       abort the program, deleted mail is not really deleted.
2255
 
space   display more text.
2256
 
n       read the next message.
2257
 
A       add the sender to your address book.
2258
 
d       delete this message.
2259
 
J       junk this subject, and delete any future mail with this subject.
2260
 
w       write this message to a file and delete it.
2261
 
k       keep this message in a file, but don't delete it.
2262
 
u       write this message unformatted to a file and delete it.
 
3197
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>?  summary of key commands
 
3198
q       quit the program
 
3199
x       abort the program, deleted mail is not really deleted
 
3200
space   display more text
 
3201
n       read the next message
 
3202
d       delete this message
 
3203
i       show referenced ip addresses, then delete this message
 
3204
j       junk this message, and any messages with this subject, for 10 days
 
3205
J       junk this subject for a year
 
3206
w       write this message to a file and delete it
 
3207
k       keep this message in a file, but don't delete it
 
3208
u       write this message unformatted to a file and delete it
2263
3209
</font></PRE>
2264
3210
 
2265
3211
<P>
2266
 
The capital A command appends name:address to your address book,
2267
 
where name is the modified name of the sender and address is his email address.
2268
 
Name is converted to lower case, and spaces are turned into dots.
2269
 
Thus it can be typed from the shell, as an email alias,
2270
 
without worrying about upper case letters or quotes.
2271
 
In reality, you're probably going to edit the address file,
2272
 
replace the full name with a simpler alias,
2273
 
and move the line to the section where it belongs.
2274
 
Thus fred.flintstone might simply become fred,
2275
 
as you move the line to the section of cartoon characters.
2276
 
 
2277
 
<P>
2278
 
The last three commands, k w and u, require a filename, which you enter.
 
3212
The last three commands, k w and u, require a filename, which you enter.&nbsp;
2279
3213
The reserved filename "x" is essentially /dev/null,
2280
 
hence the mail message, or subordinate attachment, is not saved.
2281
 
You can save the mail message to x (discard) and still save the attachments.
 
3214
whence the mail message is discarded.&nbsp;
 
3215
You can save the mail message to x (discard) and still save the attachments.&nbsp;
2282
3216
If the file is anything other than x,
2283
 
and the program cannot write to the specified file, it dies, rather ungracefully,
2284
 
and you have to reestablish the email session.
2285
 
Yes, I'll make it more fault tolerant in the future.
2286
 
 
2287
 
 
2288
 
<H4 align=center> Mail Filtering </H4>
2289
 
 
2290
 
Your config file supports a modest level of mail filtering.
2291
 
You can redirect all messages from a given email address into a file, or the bit bucket,
2292
 
indicated by the special filename "x".
2293
 
If subsequent messages are directed to an existing file,
2294
 
they are appended to the end of the file, so that no data is lost.
2295
 
Messages with unnamed attachments cannot be auto-redirected,
2296
 
since the program needs to ask you what to do with those attachments.
2297
 
By specifying a partial email address in the filter rule,
2298
 
you can redirect all messages that come from a given domain,
2299
 
such as "@space.com".
2300
 
This is a case insensitive fragment match.
2301
 
There is more documentation on this topic
2302
 
in the
2303
 
<A HREF=sample.ebrc>
2304
 
sample .ebrc file</A>.
2305
 
 
2306
 
<H4 align=center> Formatted Mail </H4>
2307
 
 
2308
 
By default, incoming mail is formatted for readability.
 
3217
and the program cannot write to the specified file, it asks you for a new filename.
 
3218
 
 
3219
<P>
 
3220
The junk command adds a filter rule to your config file,
 
3221
sending any message with this subject to oblivion.&nbsp;
 
3222
This is useful when you don't want to read a particular discussion thread in a mailing list.&nbsp;
 
3223
Use the j command to junk it for ten days.&nbsp;
 
3224
If the subject pops up again in two months, you might be interested.&nbsp;
 
3225
Use the capital J command to junk a subject for a year.&nbsp;
 
3226
This is typically used for spam subjects, such as
 
3227
"Cheap meds for you."
 
3228
 
 
3229
<P>
 
3230
Issue the i command when the mail is obviously porn/spam.&nbsp;
 
3231
You will see the ip addresses, which you can add to your blacklist file.&nbsp;
 
3232
This is not done automatically, because I believe in a certain amount of manual control over the process.&nbsp;
 
3233
For example, if you, as a human, notice that you have blocked out
 
3234
7 addresses starting with 10.16.29,
 
3235
you may want to get rid of those rules and replace them with the single rule 10.16.29.0/24.&nbsp;
 
3236
There is a slight risk in doing this,
 
3237
since a valid address might be nestled in amongst all these spam sites.&nbsp;
 
3238
But it's not likely.&nbsp;
 
3239
In fact, I sometimes take a leap of faith and exclude an entire two-byte block.&nbsp;
 
3240
That's 65,536 websites that are locked out of my computer, for email or browsing.&nbsp;
 
3241
A bit heavy handed perhaps, but I really hate all this spam and spyware crap!
 
3242
 
 
3243
<P>
 
3244
If one of those 65,536 addresses turns out to be valid,
 
3245
use a bang to negate the sense of the address, like this.
 
3246
 
 
3247
<P>
 
3248
10.5.33.177!
 
3249
<br>
 
3250
10.5.0.0/16
 
3251
 
 
3252
<P>
 
3253
Doing these ip lookups in real-time can slow the process of fetching your mail.&nbsp;
 
3254
You can disable the whole thing by omiting, or commenting out, the ipblack= line in your config file.
 
3255
 
 
3256
<P>
 
3257
IP filtering only works for hyperlinks.&nbsp;
 
3258
If an email has an online form that is submitted to a forbidden site, I don't detect that.&nbsp;
 
3259
I should though - as these are the most dangerous emails of all.&nbsp;
 
3260
They pretend to come from your bank, then send your account numbers to a thief in Russia.&nbsp;
 
3261
So yes, this form of ip blocking is on my list of fun things to do.
 
3262
 
 
3263
<P>
 
3264
Like spam keywording, ip blocking is no panacea.&nbsp;
 
3265
For example, a spammer with half a brain can sign up for http redirection at no cost.&nbsp;
 
3266
Suddenly the domain in the email does not reflect the true destination at all.&nbsp;
 
3267
I could add software to pull down the html page and test for redirection,
 
3268
but that would <em>really</em> slow down the interactive mail process.&nbsp;
 
3269
Beyond this, a spammer can use javascript to assemble his destination url on the fly,
 
3270
and as you know, there is no way to anticipate the actions of a javascript program and pre-determine the destination url.&nbsp;
 
3271
And so, the arms race continues,
 
3272
and just like the real world, the offensive team will always have the upper hand.
 
3273
 
 
3274
<H3 align=center> <A NAME=mailfmt> Formatted Mail </A> </H3>
 
3275
 
 
3276
By default, incoming mail is formatted for readability.&nbsp;
2309
3277
If you want to save a copy of the mail, exactly as it was received (unformatted),
2310
 
type  u  at the interactive prompt.
 
3278
type  u  at the interactive prompt.&nbsp;
2311
3279
If you don't want the formatting at all, use the -u option on the command line,
2312
 
as in `perl edbrowse -um0'.
2313
 
 
2314
 
<P>
2315
 
Mail headers and mime section headers are detected,
2316
 
and most of this header information is discarded.
2317
 
Each header is consolodated down to:
2318
 
subject, from, reply-path, and send-date.
2319
 
That's all you really want to read anyways.
2320
 
 
2321
 
<P>
2322
 
The body of the mail message, or mime section,
2323
 
is then decoded, if it was encoded using quoted-printable
2324
 
or base64 mime standard.
2325
 
Sections encoded via base64 are assumed to be binary attachments.
2326
 
They are never displayed, but you can save them to files if you wish.
2327
 
The interactive program prompts you for this.
2328
 
 
2329
 
<P>
2330
 
Sometimes a mail message is replicated, in plain text and in html.
2331
 
You'll see both versions, separated by a dashed line.
2332
 
The second version has the braces and angle brackets associated with browsable text,
2333
 
but you can't really activate any of the links.
2334
 
You're not in the editor after all.
2335
 
If you plan to browse this email,
2336
 
and fill out the form or follow some of the links therein,
2337
 
save it unformatted to a file.
2338
 
When the mail session is complete,
2339
 
edit that file and browse it.
2340
 
You now have the full power of html at your disposal.
2341
 
This is perhaps not as fuly integrated as Netscape,
2342
 
but it's the best I can do.
2343
 
 
2344
 
<P>
2345
 
If the mail is plain text,
2346
 
we can perform some additional processing for readability.
2347
 
Leading &gt; signs, which indicate nested text, are stripped away,
2348
 
and the words "indent n" are placed at the top of the
2349
 
paragraph, to indicate the number of times the paragraph was &gt; indented.
2350
 
This software is much harder than it first seems,
2351
 
because email servers sometimes break lines longer than 80 characters,
2352
 
and the dangling fragments will not have the leading &gt; characters.
2353
 
The fragment must be inferred from context --
2354
 
&gt; lines before and after it.
2355
 
Then, a user might prepend &gt; to the entire mess,
2356
 
and send the mail again, whence a server might break some of the lines,
2357
 
which are now longer than 80 characters, thanks to the new &gt; signs.
2358
 
At other times a user might deliberately inject a short comment
2359
 
(which looks like a broken fragment)
2360
 
into a block of someone else's indented text.
2361
 
As you can see, decisions are made by heuristics,
2362
 
and the algorithm is not 100% accurate.
2363
 
It's barely 80% accurate, but it's better than nothing.
2364
 
 
2365
 
<P>
2366
 
A trailing paragraph that begins "to unsubscribe", and is not too long, is removed,
2367
 
because this is usually listmaintenance that you don't need to read
2368
 
again and again.
2369
 
This paragraph may appear at the end of the mail message, or an internal mime section.
2370
 
 
2371
 
<H4 align=center> Annoy File </H4>
2372
 
 
2373
 
The annoy file, as specified in your .ebrc file,
2374
 
contains lines that annoy you, usually commercials
2375
 
that you don't want to read again and again.
2376
 
Here are some examples.
2377
 
 
2378
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>This is a multi-part message in MIME format.
2379
 
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
2380
 
Do You Yahoo!?
2381
 
</font></PRE>
2382
 
 
2383
 
<P>
2384
 
Email lines that match the lines in this file, exactly, are culled,
2385
 
so you don't have to read them.
2386
 
You maintain this file yourself, manually.
2387
 
If a mail message has commercials that you don't want to hear again,
2388
 
save it somewhere, and edit it, leaving only the commercials.
2389
 
Then add these commercials to your growing annoy file.
2390
 
You'll never see them again.
2391
 
 
2392
 
<P>
2393
 
The lines in the annoy file are hashed, so you can include
2394
 
hundreds of lines of text (if you wish) without degrading performance.
2395
 
 
2396
 
<H4 align=center> Two Letter Command Summary </H4>
2397
 
 
2398
 
The two-letter commands are unique to edbrowse -
2399
 
there's nothing like them in ed.
2400
 
Let's review them here.
2401
 
 
2402
 
<P><PRE><font size=4 face=Arial,Helvetica,sans-serif>qt: quit the program now, whether you've written your files or not
2403
 
db: debug level [0-7]
2404
 
cd: change directory
2405
 
lc: convert line to lower case
2406
 
uc: convert line to upper case
2407
 
mc: convert line to mixed case
2408
 
bl: break line into sentences and phrases
2409
 
sg: substitution strings are global across sessions
2410
 
sl: substitution strings are local to their sessions
2411
 
ci: searches and substitutions are case insensitive
2412
 
cs: searches and substitutions are case sensitive
2413
 
dr: directory is readonly
2414
 
dw: directory is writable, and d moves files to your recycle bin
2415
 
dx: directory is writable, and d deletes files
2416
 
dp: delete-print, print line after each delete (toggle)
2417
 
eo: end markers off
2418
 
el: show end markers ^$ when a line is listed
2419
 
ep: show end markers when a line is listed or printed
2420
 
ub: unbrowse a file
2421
 
f/: retain only the lass component of the filename
2422
 
w/: write to the lass component of the filename
2423
 
w+: append to a file
2424
 
ft: show the title of the current web page
2425
 
fd: show the description of the current web page
2426
 
fk: show the keywords of the current web page
2427
 
ph: auto-convert pdf files to html (toggle)
2428
 
rh: redirect html (toggle)
2429
 
ff: fetch frames automatically (toggle)
2430
 
vs: verify secure connections (toggle)
2431
 
tn: send dos-style newlines on lines in textareas (toggle)
2432
 
ac: accept cookies from web servers (toggle)
2433
 
sr: send refering web page (toggle)
2434
 
pm: run ftp in passive mode (toggle)
2435
 
rf: refresh the web page or directory listing
2436
 
et: edit this web page as pure text
2437
 
ws: strip this web page relative to its parent
2438
 
us: unstrip this web page, inverse of ws
2439
 
sm: send mail [account number]
2440
 
</font></PRE>
2441
 
 
2442
 
<H4 align=center> Mailing List </H4>
2443
 
 
2444
 
There is a mailing list for users of edbrowse and other command line utilities.
2445
 
You can join by sending mail to
2446
 
<A HREF=mailto:commandline-subscribe@yahoogroups.com?subject=Subscribe>
2447
 
commandline-subscribe@yahoogroups.com</A>.
 
3280
as in `e -um1'.&nbsp;
 
3281
This is occasionally necessary,
 
3282
if a bug in my formatting routine causes edbrowse to blow up.&nbsp;
 
3283
You still want to get your mail,
 
3284
(and send me a copy so I can fix the bug),
 
3285
so use the -u option to bypass formatting.
 
3286
 
 
3287
<P>
 
3288
When an html mail message is rendered, javascript is disabled.&nbsp;
 
3289
Thus the mail appears sooner, and the mail client is less likely to crash due to a bug in the javascript machinery.&nbsp;
 
3290
There really isn't much loss here, because you couldn't activate the links or fill out the form anyways.&nbsp;
 
3291
If you want to "interact" with this email message,
 
3292
you have to save it unformatted to a file,
 
3293
finish your email session, edit that file,
 
3294
and type b to browse.&nbsp;
 
3295
Now the html is active, as though you were looking at a web page on somebody's site.
 
3296
 
 
3297
<P>
 
3298
There is a reason for this falderal.&nbsp;
 
3299
When you are running edbrowse as a fetchmail client, there is a time limit, imposed by your pop3 server.&nbsp;
 
3300
You have about 20 seconds to decide the fate of each message.&nbsp;
 
3301
Throw it away, skip it, save it to a file, etc.&nbsp;
 
3302
If you doddle, the mail server hangs up and you have to start all over again.&nbsp;
 
3303
This is not the time to interact with your message;
 
3304
this is not the time to fill out forms or follow hyperlinks to other interesting websites.&nbsp;
 
3305
If you are that interested, save the message to a file and move on.
 
3306
 
 
3307
<P>
 
3308
Your sighted friend, running Outlook Express,
 
3309
doesn't have to worry about this, because every message is saved to a file automatically.&nbsp;
 
3310
When he scans his mail, he is actually looking at files that have been transferred to his computer
 
3311
some time in the past.&nbsp;
 
3312
He is not in the middle of a pop3 session, and there are no time limits.&nbsp;
 
3313
This may be a better approach; I don't know.&nbsp;
 
3314
Someday I may add a feature to grab all your messages and copy them to local files in your mail directory.&nbsp;
 
3315
You could then use edbrowse in directory mode to step through each file in turn.&nbsp;
 
3316
Personally, I get a lot of silly little emails, and spam too,
 
3317
so I am happy to delete the majority of my messages as they come,
 
3318
in real time,
 
3319
and save the few that are interesting.&nbsp;
 
3320
Other filtering options can simplify this process.&nbsp;
 
3321
For instance, mail from my friend Dorothy will always be saved in a particular place,
 
3322
because I always want to read that at my leisure.&nbsp;
 
3323
this is described in the next section.
 
3324
 
 
3325
<H3 align=center> <A NAME=filter> Mail Filtering </A> </H3>
 
3326
 
 
3327
Your config file supports a modest level of mail filtering.&nbsp;
 
3328
You can redirect incoming mail
 
3329
based upon the sender, the receiver, or the subject.&nbsp;
 
3330
These parameters are established in your config file.&nbsp;
 
3331
A mail filtering rule has the form:
 
3332
<P>
 
3333
matchString &gt; destinationFile
 
3334
 
 
3335
<P>
 
3336
Actually the &gt; is a bit misleading.&nbsp;
 
3337
If the file exists, the email is appended to the end; the file is not truncated.&nbsp;
 
3338
So perhaps we should use &gt;&gt;,
 
3339
but I didn't want to bother with the extra greater, over and over again.
 
3340
 
 
3341
<P>
 
3342
The destination file is interpreted relative to the mail directory,
 
3343
which is set in your config file.&nbsp;
 
3344
Of course you can override with an absolute path if you wish.
 
3345
 
 
3346
<P>
 
3347
A mail filtering rule always occurs in the context of a filter block.&nbsp;
 
3348
For instance, if you wish to redirect mail from certain people, do this.
 
3349
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>fromfilter {
 
3350
fred flintstone &gt; fredmail
 
3351
fred.flintstone@bedrock.us &gt; fredmail
 
3352
jerk@hotmail.com &gt; x
 
3353
word@m-w.com > -wod
 
3354
}
 
3355
</font></PRE>
 
3356
 
 
3357
<P>
 
3358
You can specify the sender's name, or his email address.&nbsp;
 
3359
It's not a bad idea to do both,
 
3360
in case he sends mail from some other account etc.
 
3361
 
 
3362
<P>
 
3363
Notice that I didn't capitalize Fred Flintstone.&nbsp;
 
3364
Matches are case insensitive.
 
3365
 
 
3366
<P>
 
3367
The file name "x" is special; it discards the mail entirely.&nbsp;
 
3368
You can use this to throw away mail from people
 
3369
who are constantly harassing you, or sending you spam.
 
3370
 
 
3371
<P>
 
3372
The last entry sends mail to -wod.&nbsp;
 
3373
The leading - is special;
 
3374
it means the mail should be saved to wod unformatted.&nbsp;
 
3375
This happens to be the word of the day from Merriam Webster.&nbsp;
 
3376
I like to save it unformatted, so I can browse it,
 
3377
and click on {audio} to hear the word pronounced.&nbsp;
 
3378
If an email contains hyperlinks,
 
3379
you may want to save it unformatted,
 
3380
so you can browse it later.
 
3381
 
 
3382
<P>
 
3383
You can also filter mail based on the to: field.&nbsp;
 
3384
This is useful if you have several mail accounts,
 
3385
or mail aliases that are forwarded to your primary account.&nbsp;
 
3386
Here is a sample block.
 
3387
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>tofilter {
 
3388
support@my-side-business.com &gt; support
 
3389
sales@my-side-business.com &gt; sales
 
3390
@my-side-business.com &gt; business
 
3391
me@my-regular-dayjob.com &gt; work
 
3392
}
 
3393
</font></PRE>
 
3394
 
 
3395
<P>
 
3396
The third entry is a catchall address,
 
3397
saving any mail that is sent to that domain.&nbsp;
 
3398
Since rules are applied in order,
 
3399
support requests are stored in a file called "support",
 
3400
sales are stored in a file called "sales",
 
3401
and all other emails sent to your business are stored in "business".
 
3402
 
 
3403
<P>
 
3404
You can use catchall addresses in the fromfilter block as well.&nbsp;
 
3405
Anything from this domain goes here, etc.
 
3406
 
 
3407
<P>
 
3408
You can filter based on subject, using the subjfilter{...} block.&nbsp;
 
3409
This can close the door on the virus de jure.&nbsp;
 
3410
If a virus uses a subject line of "Come Kiss Me",
 
3411
you can redirect "come kiss me" to x, and it's gone.
 
3412
 
 
3413
<P>
 
3414
You can also use this feature to block warnings from other ISPs,
 
3415
complaining that you sent them emails with virus attachments.&nbsp;
 
3416
You didn't, of course, because you run linux.&nbsp;
 
3417
You're immune!&nbsp;
 
3418
Your reply address was forged, so the virus warning was sent back to you,
 
3419
but you really had nothing to do with it.&nbsp;
 
3420
Lines like this one can throw these spurious warnings away.
 
3421
 
 
3422
<P>
 
3423
subjfilter {
 
3424
<br>
 
3425
Come Kiss Me > x
 
3426
<br>
 
3427
Net Integrator Virus Alert > x
 
3428
<br>
 
3429
}
 
3430
 
 
3431
<P>
 
3432
Finally, the reply address is checked against your address book.&nbsp;
 
3433
If there is a match, the mail is saved in a file whose name is the email alias.&nbsp;
 
3434
Consider a line in your address book that looks like fred:Fred.Flintstone@SomeDomain.com.&nbsp;
 
3435
When you receive email from this particular address, it is saved to the file fred.&nbsp;
 
3436
Thus you don't have to enter and maintain redundant entries in the filter.&nbsp;
 
3437
There is no need to include Fred.Flintstone@SomeDomain.com &gt; fred.&nbsp;
 
3438
It's taken care of.
 
3439
 
 
3440
<P>
 
3441
If you want to save mail from Fred unformatted, place a minus sign,
 
3442
i.e. -fred, in your address book.&nbsp;
 
3443
This is the same convention as the from filter.&nbsp;
 
3444
If you don't want mail from Fred to be redirected,
 
3445
but you still want to use the alias fred when sending mail,
 
3446
place an exclamation mark at the start, i.e. !fred.
 
3447
 
 
3448
<P>
 
3449
Note that mail filtering occurs before spam detection.&nbsp;
 
3450
Thus mail from your friend,
 
3451
or to your business,
 
3452
will always be saved in a file,
 
3453
even if it references a forbidden website.
 
3454
 
 
3455
<P>
 
3456
If an email is redirected to a file, and it includes attachments,
 
3457
edbrowse will ask you what to do with those attachments,
 
3458
as though you had used the w command to save the mail yourself.&nbsp;
 
3459
If your friend has send you a program (attached) that he wants you to look at, just hit return
 
3460
to save it to the default filename.&nbsp;
 
3461
If your friend's mail has some kind of logo, or background image, that you don't care about,
 
3462
just type x and it will go away.&nbsp;
 
3463
If the image has a recognizable suffix, such as gif, I discard it automatically.&nbsp;
 
3464
If you really want these images, you'll have to save the email unformatted, and browse it later.
 
3465
 
 
3466
<P>
 
3467
Use the -p option to pass over the filters, as in `e -pm1'.&nbsp;
 
3468
This also stops spam detection.&nbsp;
 
3469
I set this when looking at other people's mail, such as my wife's account.&nbsp;
 
3470
I don't want her mail sent somewhere else because it matches one of my filter rules.
 
3471
 
 
3472
<H3 align=center> <A NAME=end> Wrap up </A> </H3>
 
3473
 
 
3474
That concludes the user's guide.&nbsp;
 
3475
As you can see, edbrowse is a difficult program to master, but an easy program to use.&nbsp;
 
3476
I believe this is the key to success for any blind user or programmer.&nbsp;
 
3477
One can certainly paste a screen reader on top of an existing 2 dimensional program
 
3478
such as emacs or lynx, and get "up and running" quickly,
 
3479
but to be truly competitive in the workplace, or efficient at home,
 
3480
you need a <A HREF=http://www.eklhad.net/cli.html>command line interface</a>.&nbsp;
 
3481
Edbrowse is an important step in this direction.&nbsp;
 
3482
It doesn't address the speech adapter, or other common applications such as spreadsheets, finances, or audio systems,
 
3483
but it does provide a high quality text editor and a decent browser and mail client.&nbsp;
 
3484
It's a good start.
 
3485
 
 
3486
<P>
 
3487
<A HREF=#top>Back to top</A>
2448
3488
 
2449
3489
</BODY></font>