;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Copyright (c) 1993, 1994 by William M. Perry (wmperry@indiana.edu)
;;;
;;; This file is not part of GNU Emacs, but the same permissions apply.
;;;
;;; GNU Emacs is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
;;; any later version.
;;;
;;; GNU Emacs is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Emacs; see the file COPYING. If not, write to
;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Variable definitions for w3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst w3-version-number "2.1.25" "Version # of w3-mode")
(defconst w3-version (format "WWW %s 16:56:8, May 12, 1994" w3-version-number)
"More descriptive version of w3-version-number.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; General configuration variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar w3-always-show-output 'prompt
"*Controls whether to show process output or not. If 'nil', never
show output, if 't', always show output, if other than nil or t,
prompt.")
(defvar w3-annotation-position 'bottom
"*A symbol specifying where personal annotations should appear in a buffer.
Can be one of the symbols 'top or 'bottom. If the symbol is eq to 'top, then
the annotations will appear at the top of the buffer. If 'bottom, will appear
at the end of the buffer.")
(defvar w3-bad-port-list
'("25" "119")
"*List of ports to warn the user about connecting to. Defaults to just
the mail and NNTP ports so you cannot be tricked into sending fake mail or
forging messages by a malicious HTML document.")
(defvar w3-bad-server-list
'("iicm.tu-graz.ac.at"
"heplibw3.slac.stanford.edu")
"*Listing of servers that can be interrupted by an HTTP/1.0 request.
Usually just HTTP/0.9 servers with lots of lag from where you are.")
(defvar w3-be-anal-about-file-attributes nil
"*Whether to use HTTP/1.0 to figure out file attributes
or just guess based on file extension, etc.")
(defvar w3-be-asynchronous nil
"*Controls whether document retrievals over HTTP should be done in
the background. This allows you to keep working in other windows
while large downloads occur.")
(defvar w3-cache-size 5 "*Size of the document cache.")
(defvar w3-confirmation-func 'yes-or-no-p
"*What function to use for asking yes or no functions. Possible
values are 'yes-or-no-p or 'y-or-n-p, or any function that takes a
single argument (the prompt), and returns t only if a positive answer
is gotten.")
(defvar w3-connection-retries 5
"*# of times to try for a connection before bailing.
If for some reason w3-open-stream cannot make a connection to a host
right away, it will sit for 1 second, then try again, up to this many
tries.")
(defvar w3-default-action 'w3-prepare-buffer
"*A lisp symbol specifying what action to take for files with
extensions that are not in the w3-mime-extensions assoc list.
This is useful in case you ever run across files with weird extensions
(.foo, .README, .READMEFIRST, etc). This should not be required
anymore.
Possible values: any lisp symbol. Should be a function that takes no
arguments. The return value does not matter, it is ignored. Some examples
are:
Action Value
----------------------------------------------
Parse as HTML 'w3-prepare-buffer
View as text 'indented-text-mode
")
(defvar w3-default-homepage nil
"*The url to open at startup. It can be any valid URL. This will
default to the environment variable WWW_HOME if you do not set it in
your .emacs file. If WWW_HOME is undefined, then it will default to
the hypertext documentation for W3 at Indiana University.")
(defvar w3-directory-format 'hypertext
"*How to format directory listings.
If value is 'hypertext, use directory-files to list them out and
transform them into a hypertext document, then pass it through the
parse like any other document.
If value is 'dired, just pass the directory off to dired using find-file.")
(defvar w3-documents-menu-file
(expand-file-name "/usr/local/lib/mosaic/documents.menu")
"*Where the Mosaic documents-menu file is located. This is a file
that has extra menus for the 'Navigate' menu. This should be in the same
format as the Mosaic extra documents.menu")
(defvar w3-emacs19-hack-faces-p nil
"Whether emacs19 should try to emulate bold/underline faces when running
on a dumb terminal.")
(defvar w3-global-history-file (expand-file-name "~/.mosaic-global-history")
"*The global history file used by both Mosaic/X and W3.
This file contains a list of all the URLs you have visited. This file
is parsed at startup and used to provide URL completion.")
(defvar w3-gopher-labels
'(("0" . "(TXT)")
("1" . "(DIR)")
("2" . "(CSO)")
("3" . "(ERR)")
("4" . "(MAC)")
("5" . "(PCB)")
("6" . "(UUX)")
("7" . "(???)")
("8" . "(TEL)")
("T" . "(TN3)")
("9" . "(BIN)")
("g" . "(GIF)")
("I" . "(IMG)")
("h" . "(WWW)")
("s" . "(SND)"))
"*An assoc list of gopher types and how to describe them in the gopher
menus. These can be any string, but HTML/HTML+ entities should be
used when necessary, or it could disrupt formatting of the document
later on. It is also a good idea to make sure all the strings are the
same length after entity references are removed, on a strictly
stylistic level.")
(defvar w3-gopher-icons
'(
("0" . "&text.document;")
("1" . "&folder;")
("2" . "&index;")
("3" . "&stop;")
("4" . "&binhex.document;")
("5" . "&binhex.document;")
("6" . "&uuencoded.document;")
("7" . "&index;")
("8" . "&telnet;")
("T" . "&tn3270;")
("9" . "&binary.document;")
("g" . "ℑ")
("I" . "ℑ")
("s" . "&audio;"))
"*An assoc list of gopher types and the graphic entity references to
show when possible.")
(defvar w3-group-annotation-port 8001
"*Port for group annotation server")
(defvar w3-group-annotation-server "hoohoo.ncsa.uiuc.edu"
"*Group annotation server")
(defvar w3-horizontal-rule-char ?-
"*The character to use to create a horizontal rule.
Must be the character's code, not a string. This character is
replicated across the screen to create a division.")
(defvar w3-hotlist-file (expand-file-name "~/.mosaic-hotlist-default")
"*Hotlist filename.
This should be the name of a file that is stored in NCSA's Mosaic/X
format (ncsa-mosaic-hotlist-format-1). It is used to keep a listing
of commonly accessed URL's without having to go through 20 levels of
menus to get to them.")
(defvar w3-html2latex-args "-s -"
"*Args to pass w3-html2latex-prog. This should send the LaTeX source
to standard output.")
(defvar w3-html2latex-prog "html2latex"
"*Program to convert html to latex.")
(defvar w3-icon-directory-list
'("http://cs.indiana.edu/elisp/w3/icons/")
"*A list of directorys to look in for the w3 standard icons...
must end in a /!")
(defvar w3-keep-history nil
"*Controls whether to keep a list of all the URLS being visited.
If non-nil, W3 will keep track of all the URLS visited. If you press
\\[w3-write-global-history], it will be written to the file specified
by w3-global-history-file. This is stored in a Mosaic-compatible file
format (ncsa-mosaic-history-format-1).")
(defvar w3-keep-old-buffers t
"*Whether to keep old buffers around when following links.")
(defvar w3-latex-docstyle "[psfig]{article}"
"*The documentstyle to use when printing/mailing converted HTML
files in LaTeX. Good defaults are:
{article}, [psfig,twocolumn]{article}, etc.")
(defvar w3-link-delimiter-info nil
"*A function to call to get extra information about a link and
include it in a buffer. Will be placed after the link and any other
delimiters.")
(defvar w3-local-exec-path nil
"*A list of possible locations for x-exec scripts")
(defvar w3-mail-command 'mail
"*This function will be called whenever w3 needs to send mail. It should
enter a mail-mode-like buffer in the current window.
w3-mail-other-window-command will be used if w3-mutable-windows is t.
The commands mail-to and mail-subject should still work in this
buffer, and it should use mail-header-separator if possible.")
(defvar w3-mail-other-window-command 'mail-other-window
"*This function will be called whenever w3 needs to send mail in
another window. It should enter a mail-mode-like buffer in a
different window. The commands mail-to and mail-subject should still
work in this buffer, and it should use mail-header-separator if
possible.")
(defvar w3-max-inlined-image-size nil
"*The maximum byte size of a file to transfer as an inlined image.
If an image is being retrieved and exceeds this size, then it will be
cancelled. This works best on HTTP/1.0 servers that send a
Content-length header, otherwise the image is retrieved up until the
max number of bytes is retrieved, then killed.")
(defvar w3-max-menu-length 35
"*The maximum length of a pulldown menu before it will be split into
smaller chunks, with the first part as a submenu, followed by the rest
of the menu.")
(defvar w3-mule-attribute 1
"*How to highlight items in Mule (Multi-Linugual Emacs). 1 is underline,
2 is reverse video.")
(defvar w3-mule-retrieval-coding-system (if (boundp 'MULE) *euc-japan*
nil)
"Coding system for retrieval, used before hexified")
(defvar w3-mutable-windows nil
"*Controls how new WWW documents are displayed. If this is set to
non-nil and pop-up-windows is non-nil, then new buffers will be shown
in another window. If either is nil, then it will replace the document
in the current window.")
(defvar w3-news-server nil
"*The default news server to get newsgroups/articles from if no server
is specified in the URL. Defaults to the environment variable NNTPSERVER
or \"news\" if NNTPSERVER is undefined.")
(defvar w3-passwd-entry-func nil
"*This is a symbol indicating which function to call to read in a
password. It will be set up depending on whether you are running EFS
or ange-ftp at startup if it is nil. This function should accept the
prompt string as its first argument, and the default value as its
second argument.")
(defvar w3-personal-annotation-directory
(expand-file-name "~/.mosaic-personal-annotations")
"*Directory where w3 looks for personal annotations.
This is a directory that should hold the personal annotations stored in
a Mosaic-compatible format. (ncsa-mosaic-personal-annotation-log-format-1)")
(defvar w3-personal-mail-address nil
"*Your full email address. This is what is sent to HTTP/1.0 servers as
the FROM field. If not set when w3-do-setup is run, it defaults to
the value of w3-pgp/pem-entity.")
(defvar w3-pgp/pem-entity nil
"*The users PGP/PEM id - usually their email address.")
(defvar w3-ppmtoxbm-command "ppmtopgm | pgmtopbm | pbmtoxbm"
"*The command used to convert from the portable-pixmap graphics format
to an x bitmap. This will only ever be used if lemacs doesn't have support
for XPM.")
(defvar w3-ppmtoxpm-command "ppmtoxpm"
"*The command used to convert from the portable-pixmap graphics format
to XPM. The XPM _MUST_ be in version 3 format.")
(defvar w3-print-command "lpr -h -d"
"*Print command for dvi files.
This is usually lpr -h -d to send it to a postscript printer, but you can set
it up so that it is any command that takes a dvi file as its last argument.")
(defvar w3-proxy-services nil
"*An assoc list of access types and servers that gateway them.
Looks like ((\"http\" . \"server.some.domain:port\") ....) This is set up
from the ACCESS_proxy environment variables in w3-do-setup.")
(defvar w3-reuse-buffers nil
"What to do when following a link will re-fetch a document that has
already been fetched into a W3 buffer. Possible values are: nil,
'yes, and 'no. Nil means ask the user if we should reuse the buffer
(this is the default value). A value of 'yes means assume the user
wants us to reuse the buffer. A value of 'no means assume the user
wants us to re-fetch the document.")
(defvar w3-right-border 2
"*Amount of space to leave on right margin of WWW buffers.
This amount is subtracted from (window-width) for each new WWW buffer
and used as the new fill-column.")
(defvar w3-show-headers nil
"*This is a list of HTTP/1.0 headers to show at the end of a buffer.
All the headers should be in lowercase. They will be inserted at the
end of the buffer in a
regions")
(defvar w3-pre-data-count 0 "# of items from
regions")
(defvar w3-print-next nil "Should we latex & print the next doc?")
(defvar w3-request-data nil "Any data to send with the next request.")
(defvar w3-request-extra-headers nil
"A list of extra headers to send with the next request. Should be
an assoc list of headers/contents.")
(defvar w3-request-method nil "The method to use for the next request.")
(defvar w3-roman-characters "ivxLCDMVX" "Roman numerals")
(defvar w3-setup-done nil "Have we been through setup code yet?")
(defvar w3-source nil "Should we source the next document or not?")
(defvar w3-strict-width nil
"*This variable will control how wide emacs thinks the current window is.
This is useful when working in batch mode, and (window-width) returns the
wrong value. If the value is nil, it will use the value (window-width)
returns.")
(defvar w3-using-proxy nil "Whether we are currently using a proxy gateway.")
(defvar w3-working-buffer " *W3*" "The buffer to do all the processing in.")
(defvar w3-xmp-data nil "Data extracted from regions")
(defvar w3-xmp-data-count 0 "# of items from regions")
(defvar w3-zones-list nil "*List of 'zones' in a dumb emacs buffer")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; buffer-local variables to keep around when going into w3-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar w3-persistent-variables
'(
tab-stop-list
tab-width
w3-current-annotation
w3-current-content-length
w3-current-file
w3-current-isindex
w3-current-last-buffer
w3-current-links
w3-current-mime-encoding
w3-current-mime-headers
w3-current-mime-type
w3-current-mime-viewer
w3-current-port
w3-current-server
w3-current-source
w3-current-type
w3-current-user
w3-delayed-images
w3-delayed-movies
w3-hidden-forms
w3-zones-list
)
"A list of variables that should be preserved when entering w3-mode.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Syntax stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar w3-parse-args-syntax-table
(copy-syntax-table emacs-lisp-mode-syntax-table)
"A syntax table for parsing sgml attributes")
(modify-syntax-entry ?' "\"" w3-parse-args-syntax-table)
(modify-syntax-entry ?< "(>" w3-parse-args-syntax-table)
(modify-syntax-entry ?> ")<" w3-parse-args-syntax-table)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Startup items
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(mapcar 'make-variable-buffer-local w3-persistent-variables)
(suppress-keymap w3-mode-map)
(define-key w3-mode-map " " 'scroll-up)
(define-key w3-mode-map "<" 'w3-start-of-document)
(define-key w3-mode-map ">" 'w3-end-of-document)
(define-key w3-mode-map "?" 'describe-mode)
(define-key w3-mode-map "A" 'w3-hotlist-add-document-at-point)
(define-key w3-mode-map "B" 'w3-backward-in-history)
(define-key w3-mode-map "F" 'w3-forward-in-history)
(define-key w3-mode-map "H" 'w3-use-hotlist)
(define-key w3-mode-map "K" 'w3-save-this-url)
(define-key w3-mode-map "P" 'w3-print-url-under-point)
(define-key w3-mode-map "Q" 'w3-leave-buffer)
(define-key w3-mode-map "S" 'w3-source-document-at-point)
(define-key w3-mode-map "U" 'w3-use-links)
(define-key w3-mode-map "V" 'w3-view-this-url)
(define-key w3-mode-map "\C-?" 'scroll-down)
(define-key w3-mode-map "\C-c\C-b" 'w3-show-history-list)
(define-key w3-mode-map "\C-c\C-v" 'w3-version)
(define-key w3-mode-map "\C-k" 'w3-save-url)
(define-key w3-mode-map "\C-o" 'w3-fetch)
(define-key w3-mode-map "\C-q" 'w3-write-global-history)
(define-key w3-mode-map "\M-M" 'w3-mail-document-under-point)
(define-key w3-mode-map "\M-\C-i" 'w3-insert-this-url)
(define-key w3-mode-map "\M-m" 'w3-mail-current-document)
(define-key w3-mode-map "\M-s" 'w3-search)
(define-key w3-mode-map "\M-\r" 'w3-follow-inlined-image)
(define-key w3-mode-map "\r" 'w3-follow-link)
(define-key w3-mode-map "a" 'w3-hotlist-add-document)
(define-key w3-mode-map "b" 'w3-back-link)
(define-key w3-mode-map "d" 'w3-hotlist-delete)
(define-key w3-mode-map "f" 'w3-forward-link)
(define-key w3-mode-map "g" 'w3-reload-document)
(define-key w3-mode-map "h" 'w3-help)
(define-key w3-mode-map "k" 'w3-save-url)
(define-key w3-mode-map "l" 'w3-goto-last-buffer)
(define-key w3-mode-map "m" 'w3-complete-link)
(define-key w3-mode-map "n" 'w3-forward-link)
(define-key w3-mode-map "o" 'w3-open-local)
(define-key w3-mode-map "p" 'w3-print-this-url)
(define-key w3-mode-map "q" 'w3-quit)
(define-key w3-mode-map "r" 'w3-reload-document)
(define-key w3-mode-map "s" 'w3-source-document)
(define-key w3-mode-map "u" 'w3-leave-buffer)
(define-key w3-mode-map "v" 'w3-view-url)
(define-key w3-mode-map "w" 'w3-submit-bug)
(provide 'w3-vars)