home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / w3 / w3-vars.el < prev    next >
Encoding:
Text File  |  1995-08-31  |  47.8 KB  |  1,167 lines

  1. ;;; w3-vars.el,v --- All variable definitions for emacs-w3
  2. ;; Author: wmperry
  3. ;; Created: 1995/08/25 01:07:18
  4. ;; Version: 1.163
  5. ;; Keywords: comm, help, hypermedia
  6.  
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8. ;;; Copyright (c) 1993, 1994, 1995 by William M. Perry (wmperry@spry.com)
  9. ;;;
  10. ;;; This file is not part of GNU Emacs, but the same permissions apply.
  11. ;;;
  12. ;;; GNU Emacs is free software; you can redistribute it and/or modify
  13. ;;; it under the terms of the GNU General Public License as published by
  14. ;;; the Free Software Foundation; either version 2, or (at your option)
  15. ;;; any later version.
  16. ;;;
  17. ;;; GNU Emacs is distributed in the hope that it will be useful,
  18. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. ;;; GNU General Public License for more details.
  21. ;;;
  22. ;;; You should have received a copy of the GNU General Public License
  23. ;;; along with GNU Emacs; see the file COPYING.  If not, write to
  24. ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26.  
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28. ;;; Variable definitions for w3
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30. (defconst w3-version-number
  31.   (let ((x "p2-2-15"))
  32.     (if (string-match "State:[ \t\n]+.\\([^ \t\n]+\\)" x)
  33.     (setq x (substring x (match-beginning 1) (match-end 1)))
  34.       (setq x (substring x 1)))
  35.     (mapconcat
  36.      (function (lambda (x) (if (= x ?-) "." (char-to-string x)))) x ""))
  37.   "Version # of w3-mode.")
  38.  
  39. (defconst w3-version-date (let ((x "1995/08/25 01:07:18"))
  40.                 (if (string-match "Date: \\([^ \t\n]+\\)" x)
  41.                 (substring x (match-beginning 1) (match-end 1))
  42.                   x))
  43.   "Date this version of w3-mode was released.")
  44.  
  45. (defconst w3-version
  46.   (format "WWW %s %s" w3-version-number w3-version-date)
  47.   "More descriptive version of w3-version-number.")
  48.  
  49. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  50. ;;; General configuration variables
  51. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  52. (defvar w3-annotation-mode 'html-mode
  53.   "*A symbol specifying the major mode to enter when doing annotations.")
  54.  
  55. (defvar w3-annotation-position 'bottom
  56.   "*A symbol specifying where personal annotations should appear in a buffer.
  57. Can be one of the symbols 'top or 'bottom.  If the symbol is eq to 'top, then
  58. the annotations will appear at the top of the buffer.  If 'bottom, will appear
  59. at the end of the buffer.")
  60.  
  61. (defvar w3-auto-image-alt t
  62.   "*Whether emacs-w3 should create an alt attribute for an image that
  63. is missing it.
  64. If nil, emacs-w3 will not automatically create an ALT attribute.
  65. If t, the alt attribute will be [IMAGE(nameofimage)]
  66. If a string, it should be a string suitable for running through format,
  67.    with only one %s, which will be replaced with just the filename of the
  68.    graphic that is not loaded.")
  69.  
  70. (defvar w3-debug-html nil "*Whether to gripe about bad HTML or not.")
  71.  
  72. (defvar w3-debug-buffer "*HTML Debug*"
  73.   "*Name of buffer to store debugging information in.")
  74.  
  75. (defvar w3-default-configuration-file nil
  76.   "*Where per-user customizations of w3 are kept.")
  77.  
  78. (defvar w3-default-action 'w3-prepare-buffer
  79.   "*A lisp symbol specifying what action to take for files with
  80. extensions that are not mapped to a MIME type in `mm-mime-extensions'.
  81. This is useful in case you ever run across files with weird extensions
  82. \(.foo, .README, .READMEFIRST, etc).  This should not be required
  83. anymore.
  84.  
  85. Possible values: any lisp symbol.  Should be a function that takes no
  86. arguments.  The return value does not matter, it is ignored.  Some examples
  87. are:
  88.  
  89. Action            Value
  90. ----------------------------------------------
  91. Parse as HTML        'w3-prepare-buffer
  92. View as text        'indented-text-mode")
  93.  
  94. (defvar w3-default-homepage nil
  95.   "*The url to open at startup.  It can be any valid URL.  This will
  96. default to the environment variable WWW_HOME if you do not set it in
  97. your .emacs file. If WWW_HOME is undefined, then it will default to
  98. the hypertext documentation for W3 at Indiana University.")
  99.  
  100. (defvar w3-default-stylesheet nil
  101.   "*The filename of the users default stylesheet.")
  102.  
  103. (defvar w3-do-blinking nil
  104.   "*Whether emacs-w3 should display blinking text.")
  105.  
  106. (defvar w3-do-incremental-display nil
  107.   "*Whether to do incremental display of pages or not.")
  108.  
  109. (defvar w3-documents-menu-file nil
  110.   "*Where the Mosaic documents-menu file is located.  This is a file
  111. that has extra menus for the 'Navigate' menu.  This should be in the same
  112. format as the Mosaic extra documents.menu.")
  113.  
  114. (defvar w3-dump-to-disk nil
  115.   "*If non-nil, all W3 pages loaded will be dumped to disk.")
  116.  
  117. (defvar w3-emacs19-hack-faces-p nil
  118.   "Whether emacs19 should try to emulate bold/underline faces when running
  119. on a dumb terminal.")
  120.  
  121. (defvar w3-echo-link 'url
  122.   "Whether to display the URL of a link when w3-forward-link or
  123. w3-back-link is called.  Possible values are:
  124.  
  125.   url    == show the url of the target in the minibuffer
  126.   text   == show the text of the link in the minibuffer
  127.   nil    == show nothing")
  128.   
  129. (defvar w3-horizontal-rule-char ?-
  130.   "*The character to use to create a horizontal rule.
  131. Must be the character's code, not a string.  This character is
  132. replicated across the screen to create a division.")
  133.  
  134. (defvar w3-hotlist-file nil
  135.   "*Hotlist filename.
  136. This should be the name of a file that is stored in either
  137. NCSA's Mosaic/X or Netscape/X format.  It is used to keep a listing
  138. of commonly accessed URL's without having to go through 20 levels of
  139. menus to get to them.")
  140.  
  141. (defvar w3-html2latex-args "-s -"
  142.   "*Args to pass `w3-html2latex-prog'.  This should send the LaTeX source
  143. to standard output.")
  144.  
  145. (defvar w3-html2latex-prog "html2latex"
  146.   "*Program to convert html to latex.")
  147.  
  148. (defvar w3-icon-directory-list
  149.   '("http://cs.indiana.edu/elisp/w3/icons/")
  150.   "*A list of directories to look in for the w3 standard icons...
  151. All entries must end in a /!")
  152.  
  153. (defvar w3-indent-level 4
  154.   "*Default # of spaces to indent instead of using TABs.  This is
  155. necessary to preserve tabs in PRE segments yet still get smaller
  156. indentation for lists, etc.")
  157.  
  158. (defvar w3-keep-old-buffers t
  159.   "*Whether to keep old buffers around when following links.")
  160.  
  161. (defvar w3-latex-docstyle "[psfig]{article}"
  162.   "*The documentstyle to use when printing/mailing converted HTML
  163. files in LaTeX.  Good defaults are:
  164. {article}, [psfig,twocolumn]{article}, etc.")
  165.  
  166. (defvar w3-link-delimiter-info nil
  167.   "*A function to call to get extra information about a link and
  168. include it in a buffer.  Will be placed after the link and any other
  169. delimiters.")
  170.  
  171. (defvar w3-mail-command 'mail
  172.   "*This function will be called whenever w3 needs to send mail.  It should
  173. enter a mail-mode-like buffer in the current window.
  174. `w3-mail-other-window-command' will be used if w3-mutable-windows is t.
  175. The commands `mail-to' and `mail-subject' should still work in this
  176. buffer, and it should use mail-header-separator if possible.")
  177.  
  178. (defvar w3-mail-other-window-command 'mail-other-window
  179.   "*This function will be called whenever w3 needs to send mail in
  180. another window.  It should enter a mail-mode-like buffer in a
  181. different window.  The commands `mail-to' and `mail-subject' should still
  182. work in this buffer, and it should use mail-header-separator if
  183. possible.")
  184.  
  185. (defvar w3-max-inlined-image-size nil
  186.   "*The maximum byte size of a file to transfer as an inlined image.
  187. If an image is being retrieved and exceeds this size, then it will be
  188. cancelled.  This works best on HTTP/1.0 servers that send a
  189. Content-length header, otherwise the image is retrieved up until the
  190. max number of bytes is retrieved, then killed.")
  191.  
  192. (defvar w3-max-menu-length 35
  193.   "*The maximum length of a pulldown menu before it will be split into
  194. smaller chunks, with the first part as a submenu, followed by the rest
  195. of the menu.")
  196.  
  197. (defvar w3-max-menu-width 40 "*The maximum width of a pulldown menu choice.")
  198.  
  199. (defvar w3-modeline-format
  200.   '("" "  %&%& "
  201.     ("W3: "
  202.      (40 (-40 "%b"))
  203.      " "
  204.      (w3-current-isindex "[Searchable]  ")
  205.      "%p" "  " global-mode-string))
  206.   "*The modeline format string when in w3 mode")  
  207.  
  208. (defvar w3-mule-attribute 'underline
  209.   "*How to highlight items in Mule (Multi-Linugual Emacs).")
  210.  
  211. (defvar w3-mutable-windows nil
  212.   "*Controls how new WWW documents are displayed.  If this is set to
  213. non-nil and pop-up-windows is non-nil, then new buffers will be shown
  214. in another window.  If either is nil, then it will replace the document
  215. in the current window.")
  216.  
  217. (defvar w3-netscape-configuration-file nil
  218.   "*A Netscape-for-X style configuration file.  This file will only be read if
  219. and only if `w3-use-netscape-configuration-file' is non-nil.")
  220.  
  221. (defvar w3-notify 'friendly
  222.   "*Selects the behavior when w3 page is ready.
  223. This variable may have one of the following values:
  224.  
  225. newframe   -- put the w3 page in its own frame
  226. bully      -- make the w3 page the current buffer and only window
  227. aggressive -- make the w3 page the current buffer in the other window
  228. friendly   -- display  w3page in other window but don't make current
  229. polite     -- don't display w3 page, but prints message when ready (beeps)
  230. quiet      -- like `polite', but don't beep
  231. meek       -- make no indication that page is ready
  232.  
  233. Any other value of `w3-notify' is equivalent to `meek'.")
  234.  
  235. (defvar w3-personal-annotation-directory nil
  236.   "*Directory where w3 looks for personal annotations.
  237. This is a directory that should hold the personal annotations stored in
  238. a Mosaic-compatible format.")
  239.  
  240. (defvar w3-ppmtoxbm-command "ppmtopgm | pgmtopbm | pbmtoxbm"
  241.   "*The command used to convert from the portable-pixmap graphics format
  242. to an x bitmap.  This will only ever be used if XEmacs doesn't have support
  243. for XPM.")
  244.  
  245. (defvar w3-ppmtoxpm-command "ppmtoxpm"
  246.   "*The command used to convert from the portable-pixmap graphics format
  247. to XPM.  The XPM _MUST_ be in version 3 format.")
  248.  
  249. (defvar w3-print-command "lpr -h -d"
  250.   "*Print command for dvi files.
  251. This is usually lpr -h -d to send it to a postscript printer, but you can set
  252. it up so that it is any command that takes a dvi file as its last argument.")
  253.  
  254. (defvar w3-reuse-buffers nil
  255.   "What to do when following a link will re-fetch a document that has
  256. already been fetched into a W3 buffer.  Possible values are: nil,
  257. 'yes, and 'no.  Nil means ask the user if we should reuse the buffer
  258. (this is the default value).  A value of 'yes means assume the user
  259. wants us to reuse the buffer.  A value of 'no means assume the user
  260. wants us to re-fetch the document.
  261.  
  262. This will also accept:
  263. 'no 'never 'reload    ==> always reload
  264. 'yes 'reuse 'always    ==> always reuse
  265. 'ask nil        ==> always ask")
  266.  
  267. (defvar w3-right-border 2
  268.   "*Amount of space to leave on right margin of WWW buffers.
  269. This amount is subtracted from (window-width) for each new WWW buffer
  270. and used as the new fill-column.")
  271.  
  272. (defvar w3-right-justify-address t
  273.   "*Whether to make address fields right justified, like Arena.")
  274.  
  275. (defvar w3-show-headers nil
  276.   "*This is a list of regexps that match HTTP/1.0 headers to show at
  277. the end of a buffer.  All the headers being matched against will be
  278. in lowercase.  All matching headers will be inserted at the end of the
  279. buffer in a <UL> list.")
  280.  
  281. (defvar w3-show-status t
  282.   "*Whether to show a running total of bytes transferred.  Can cause a
  283. large hit if using a remote X display over a slow link, or a terminal
  284. with a slow modem.")
  285.  
  286. (defvar w3-starting-documents
  287.   '(("Internet Starting Points"  "http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/StartingPoints/NetworkStartingPoints.html")
  288.     ("Internet Resources Meta-index"  "http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/MetaIndex.html")
  289.     ("NCSA's What's New"  "http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/whats-new.html"))
  290.   "*An assoc list of titles and URLs for quick access.  These are just
  291. defaults so that new users have somewhere to go.")
  292.  
  293. (defvar w3-temporary-directory "/tmp" "*Where temporary files go.")
  294.  
  295. (defvar w3-track-last-buffer nil
  296.   "*Whether to track the last w3 buffer to automatically switch to with
  297.  M-x w3.")
  298.  
  299. (defvar w3-track-mouse t
  300.   "*Whether to track the mouse and message the url under the mouse.")
  301.  
  302. (defvar w3-use-forms-index t
  303.   "*Non-nil means translate <ISINDEX> tags into a hypertext form.
  304. A single text entry box will be drawn where the ISINDEX tag appears.
  305. If t, the isindex handling will be the same as Mosaic for X.")
  306.  
  307. (defvar w3-use-html2latex nil
  308.   "*This controls how HTML is converted into LaTeX for printing or mailing.
  309. If nil, the w3-convert-html-to-latex function is used instead of the
  310. html2latex in a subprocess.  The lisp function gives slightly better
  311. formatting in my biased opinion.")
  312.  
  313. (defvar w3-use-netscape-configuration-file nil
  314.   "*Whether to use a netscape configuration file to determine things like
  315. home pages, link colors, etc.  If non-nil, then `w3-netscape-configuration-file'
  316. is read in at startup.")
  317.  
  318. (defvar w3-user-colors-take-precedence nil
  319.   "*Whether to let a document define certain colors about itself.
  320. Like foreground and background colors and pixmaps, color of links and
  321. visited links, etc.")
  322.  
  323. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  324. ;;; Hook Variables
  325. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  326. (defvar w3-load-hook nil "*Hooks to be run after loading w3.")
  327. (defvar w3-mode-hook nil "*Hooks to be run after entering w3-mode.")
  328. (defvar w3-file-prepare-hook nil
  329.   "*Hooks to be run before preparing a buffer.")
  330. (defvar w3-file-done-hook nil "*Hooks to be run after preparing a buffer.")
  331. (defvar w3-source-file-hook nil
  332.   "*Hooks to be run after getting document source.")
  333.  
  334. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  335. ;;; Figure out what flavor of emacs we are running
  336. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  337. (defvar w3-running-epoch (and (boundp 'epoch::version)
  338.                   (symbol-value 'epoch::version))
  339.   "*In Epoch.")
  340.  
  341. (defvar w3-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
  342.   "*In XEmacs or Lucid Emacs?.")
  343.  
  344. (defvar w3-running-FSF19 (and (string-match "^19" emacs-version)
  345.                   (not w3-running-xemacs))
  346.   "*In FSF v19 emacs?")
  347.  
  348. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  349. ;;; Link delimiting
  350. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  351. (defvar w3-delimit-emphasis 'guess
  352.   "*Whether to use characters at the start and end of each bold/italic
  353. region.  Types of characters are specified in w3-style-chars-assoc.")
  354.  
  355. (defvar w3-link-start-delimiter '("[[" . "{{")
  356.   "*Put this at front of link if w3-delimit-links is t.")
  357.  
  358. (defvar w3-link-end-delimiter '("]]" . "}}")
  359.   "*Put this at end of link if w3-delimit-links is t.")
  360.  
  361. (defvar w3-delimit-links 'guess
  362.   "*Put brackets around links?  If this variable is eq to 'linkname, then
  363. it will put the link # in brackets after the link text.  If it is nil, then
  364. it will not put anything.  If it is non-nil and not eq to 'linkname, then
  365. it will put [[ & ]] around the entire text of the link.  Is initially set
  366. to be t iff in normal emacs.  Nil if in epoch or lucid emacs, since links
  367. should be in different colors/fonts.")
  368.  
  369. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  370. ;;; embedded document variables
  371. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  372. (defvar w3-mpeg-size 150 "*The height and width of an mpeg window.")
  373. (defvar w3-mpeg-args '("-loop") "*Arguments to mpeg_play.")
  374. (defvar w3-mpeg-program "mpeg_play" "*The mpeg_play executable.")
  375. (defvar w3-delayed-movies nil "A list of mpeg movies for this buffer.")
  376.   
  377. (defvar w3-embedded-data-converters
  378.   '(("application/eqn" . w3-embed-eqn)
  379.     ("application/postscript" . w3-embed-postscript)
  380.     ("text/plain". w3-embed-text)
  381.     ("text/html" . w3-embed-text)
  382.     ("image/.*"  . w3-embed-image))
  383.   "An assoc list of regular expressions to match against MIME content-types
  384. for embedded data in HTML documents.  The cdr is a function to be passed
  385. to 'funcall', with the embedded data and content-type as the sole arguments
  386. passed to the function.")
  387.  
  388. (if w3-running-xemacs
  389.     (progn
  390.       (condition-case ()
  391.       (require 'annotations)
  392.     (error nil))
  393.       (setq w3-embedded-data-converters
  394.         (cons (cons "video/mpeg" 'w3-embed-mpeg)
  395.           w3-embedded-data-converters))))
  396.   
  397. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  398. ;;; Graphics parsing stuff
  399. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  400. (defvar w3-graphics-always-show-entities t
  401.   "*Set to t to always show graphic entities, regardless of the value of
  402. w3-delay-image-loads.  Useful if you keep the entities locally and aren't
  403. worried about the transfer time on something that small.")
  404.  
  405. (defvar w3-graphics-list nil
  406.   "*List of graphics already read in.")
  407.  
  408. (defvar w3-delay-image-loads nil
  409.   "*Delay loading images for w3 or not?")
  410.  
  411. (defvar w3-delayed-images nil
  412.   "*A buffer-local variable holding positions and urls of images within
  413. the buffer.")
  414.  
  415. (defvar w3-delay-mpeg-loads t
  416.   "*Whether to delay loading mpegs or not.")
  417.  
  418. (defvar w3-graphic-converter-alist
  419.   '(
  420.     ("image/x-xbitmap"        . "cat ")
  421.     ("image/xbitmap"          . "cat ")
  422.     ("image/xbm"              . "cat ")
  423.     ("image/jpeg"             . "djpeg | %s")
  424.     ("image/gif"              . "giftopnm  | %s")
  425.     ("image/x-fax"            . "g3topbm   | %s")
  426.     ("image/x-raster"         . "rasttoppm | %s")
  427.     ("image/windowdump"       . "xwdtoppm  | %s")
  428.     ("image/x-icon"           . "icontopbm | %s")
  429.     ("image/portable-graymap" . "pgmtoppm  | %s")
  430.     ("image/portable-pixmap"  . "cat ")
  431.     ("image/x-pixmap"         . "cat ")
  432.     ("image/x-xpixmap"        . "cat ")
  433.     ("image/pict"             . "picttoppm | %s")
  434.     ("image/x-macpaint"       . "macptopbm | %s")
  435.     ("image/x-targa"          . "tgatoppm  | %s")
  436.     ("image/tiff"             . "tifftopgm | pgmtoppm | %s")
  437.     ) "*How to convert graphics into xpixmaps.")
  438.  
  439. (defvar w3-color-use-reducing 'guess
  440.   "*Whether to use ppmquant/ppmdither to do color reducing for inlined images.
  441. If you are using a 24bit display, you should set this to nil.")
  442.  
  443. (defvar w3-color-max-red 4
  444.   "*Max # of red cells to allocate for inlined images.")
  445.  
  446. (defvar w3-color-max-green 4
  447.   "*Max # of green cells to allocate for inlined images.")
  448.  
  449. (defvar w3-color-max-blue 4
  450.   "*Max # of blue cells to allocate for inlined images.")
  451.  
  452. (defvar w3-color-filter 'ppmdither
  453.   "*How to do color reducing on inlined images.
  454. This should be a symbol, either ppmdither or ppmquant.
  455. This variable only has any meaning if w3-color-use-reducing is non-nil.
  456. Possible values are:
  457.  
  458. ppmquant    :== Use the ppmquant program to reduce colors.  The product
  459.                 of w3-color-max-[red|green|blue] is used as the maximum
  460.                 number of colors.
  461. ppmdither   :== Use the ppmdither program to reduce colors.
  462.  
  463. any string :== Use this string as the filter.  No interpretation of it
  464.                is done at all.  Example is:
  465.                ppmquant -fs -map ~/pixmaps/colormap.ppm")
  466.  
  467. (defvar w3-ppmdither-is-buggy t
  468.   "*The ppmdither which comes with pbmplus/netpbm releases through 
  469. 1mar1994 at least ignores the 'maxval' in its input.  This can cause
  470. trouble viewing black-and-white gifs.  If this variable is set, a
  471. (harmless) 'pnmdepth 255' step is inserted to work around this bug.
  472. You can test your ppmdither by doing 
  473.   ppmmake white 100 100 | pnmdepth 1 | ppmdither | pnmdepth 255 | ppmhist
  474. If the output has a single line like this:
  475.   255 255 255     255     10000
  476. then it's safe to set this variable to nil.")
  477.  
  478. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  479. ;;; How to look up styles
  480. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  481. (defvar w3-style-tags-assoc nil
  482.   "A version of w3-style-chars-assoc for the new display engine.")
  483.  
  484. (defvar w3-style-chars-assoc
  485.   '(
  486.     ("B"       . ("*" . "*"))
  487.     ("ADDRESS" . ("*" . "*"))
  488.     ("BYLINE"  . ("_" . "_"))
  489.     ("CITE"    . ("_" . "_"))
  490.     ("CMD"     . ("*" . "*"))
  491.     ("DFN"     . ("*" . "*"))
  492.     ("EM"      . ("~" . "~"))
  493.     ("I"       . ("~" . "~"))
  494.     ("Q"       . ("\"" . "\""))
  495.     ("REMOVED" . ("" . ""))
  496.     ("S"       . ("" . ""))
  497.     ("STRONG"  . ("*" . "*"))
  498.     ("SUB"     . ("" . ""))
  499.     ("SUP"     . ("" . ""))
  500.     ("U"       . ("_" . "_"))
  501.     )
  502.   "*An assoc list of emphasis tags and their corresponding
  503. begin and end characters.")
  504.  
  505. (defvar w3-header-chars-assoc
  506.   '(
  507.     (h1 . (?* ?* w3-upcase-region))
  508.     (h2 . (?* ?* w3-upcase-region))
  509.     (h3 . (?- ?- w3-upcase-region))
  510.     (h4 . (nil ?= nil))
  511.     (h5 . (nil ?= nil))
  512.     (h6 . (nil ?: nil)))
  513.   "*An assoc list of header tags and a list of formatting instructions.
  514. This list consists of 3 items - the first item is a character that is
  515. inserted before the header X number of times, where X is the length of
  516. the header.  A <BR> is automatically inserted after this.
  517. The second item is the character to insert after the header.  A <BR>
  518. is inserted before and after this string. And the third is a function
  519. to call on the region between the start and end of the header.  This
  520. will be called with 2 arguments, the buffer positions of the start and
  521. end of the headers.")
  522.  
  523. (defvar w3-list-chars-assoc 
  524.   '(
  525.     (ul . ("o" "*" "+" ">"))
  526.     (ol . ("." ")" "]" ":"))
  527.     (dl . ("o" "*" "+" ">")))
  528.   "An assoc list of characters to put at the front of list items.  It is
  529. keyed on the type of list, followed by a list of items.  Each item should
  530. be placed in the nth position of the list, where n is the nesting level it
  531. should be used for.  n starts at 1.")
  532.  
  533. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  534. ;;; Styles for emphasis, bold, etc
  535. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  536. (cond
  537.  ((or w3-running-epoch w3-running-FSF19 w3-running-xemacs)
  538.   (defvar w3-node-style 'w3-node-style "Face used for hypertext links.")
  539.   (defvar w3-default-style 'w3-default-style "Default face.")
  540.   (defvar w3-visited-node-style 'w3-visited-node-style "Visited links."))
  541.  (t
  542.   (defvar w3-node-style nil)
  543.   (defvar w3-default-style nil)
  544.   (defvar w3-visited-node-style nil)))
  545.  
  546. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  547. ;;; Entities table
  548. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  549. (defvar w3-html-entities
  550.   '(
  551.     ("Æ"      . "╞") ; capital AE diphthong (ligature)
  552.     ("Á"     . "┴") ; capital A, acute accent
  553.     ("Â"      . "┬") ; capital A, circumflex accent
  554.     ("À"     . "└") ; capital A, grave accent
  555.     ("Å"      . "┼") ; capital A, ring
  556.     ("Ã"     . "├") ; capital A, tilde
  557.     ("Ä"       . "─") ; capital A, dieresis or umlaut mark
  558.     ("Ç"     . "╟") ; capital C, cedilla
  559.     ("Ð"        . "╨") ; capital Eth, Icelandic
  560.     ("É"     . "╔") ; capital E, acute accent
  561.     ("Ê"      . "╩") ; capital E, circumflex accent
  562.     ("È"     . "╚") ; capital E, grave accent
  563.     ("Ë"       . "╦") ; capital E, dieresis or umlaut mark
  564.     ("Í"     . "═") ; capital I, acute accent
  565.     ("Î"      . "╬") ; capital I, circumflex accent
  566.     ("Ì"     . "╠") ; capital I, grave accent
  567.     ("Ï"       . "╧") ; capital I, dieresis or umlaut mark
  568.     ("Ñ"     . "╤") ; capital N, tilde
  569.     ("Ó"     . "╙") ; capital O, acute accent
  570.     ("Ô"      . "╘") ; capital O, circumflex accent
  571.     ("Ò"     . "╥") ; capital O, grave accent
  572.     ("Ø"     . "╪") ; capital O, slash
  573.     ("Õ"     . "╒") ; capital O, tilde
  574.     ("Ö"       . "╓") ; capital O, dieresis or umlaut mark
  575.     ("Þ"      . "▐") ; capital THORN, Icelandic
  576.     ("Ú"     . "┌") ; capital U, acute accent
  577.     ("Û"      . "█") ; capital U, circumflex accent
  578.     ("Ù"     . "┘") ; capital U, grave accent
  579.     ("Ü"       . "▄") ; capital U, dieresis or umlaut mark
  580.     ("Ý"     . "▌") ; capital Y, acute accent
  581.     ("´"      . "┤") ; acute accent on its own
  582.     ("á"     . "ß") ; small a, acute accent
  583.     ("â"      . "Γ") ; small a, circumflex accent
  584.     ("æ"      . "µ") ; small ae diphthong (ligature)
  585.     ("à"     . "α") ; small a, grave accent
  586.     ("'"       . "'") ; apostrophe
  587.     ("å"      . "σ") ; small a, ring
  588.     ("*"        . "*") ; asterisk
  589.     ("ã"     . "π") ; small a, tilde
  590.     ("ä"       . "Σ") ; small a, dieresis or umlaut mark
  591.     ("˘"      . "[breve ]")  ; breve
  592.     ("¦"     . "ª") ; broken (vertical) bar
  593.     ("\"       . "[bsol  ]")   ; /backslash =reverse solidus
  594.     ("ˇ"      . "[caron ]")   ; caron
  595.     ("¸"      . "╕") ; cedilla on its own
  596.     ("ç"     . "τ") ; small c, cedilla
  597.     ("¢"       . "ó") ; cent sign
  598.     ("ˆ"       . "[circ  ]")   ; circumflex accent
  599.     (":"      . ":") ; colon
  600.     (","      . ",") ; comma
  601.     ("@"     . "@") ; commercial at
  602.     ("©"       . "⌐") ; copyright sign
  603.     ("¤"     . "ñ") ; general currency sign
  604.     ("↓"       . "[darr  ]")   ; /downarrow A: =downward arrow
  605.     ("˝"      . "[dblac ]")   ; double acute accent
  606.     ("°"        . "░") ; degree sign
  607.     ("¨"        . "¿") ; dieresis
  608.     ("÷"     . "≈") ; divide sign
  609.     ("$"     . "$") ; dollar sign
  610.     ("˙"        . "[dot   ]")   ; dot above
  611.     ("é"     . "Θ") ; small e, acute accent
  612.     ("ê"      . "Ω") ; small e, circumflex accent
  613.     ("è"     . "Φ") ; small e, grave accent
  614.     (" "       . "  ") ; em space
  615.     (" "       . " ") ; en space
  616.     ("="     . "=") ; equals sign
  617.     ("ð"        . "≡") ; small eth, Icelandic
  618.     ("ë"       . "δ") ; small e, dieresis or umlaut mark
  619.     ("!"       . "!") ; exclamation mark
  620.     ("½"     . "╜") ; fraction - one-half
  621.     ("¼"     . "╝") ; fraction - one-quarter
  622.     ("¾"     . "╛") ; fraction - three-quarters
  623.     ("⅛"     . "1/8") ; fraction - one-eigth
  624.     ("⅜"     . "3/8") ; fraction - three-eighths
  625.     ("⅝"     . "5/8") ; fraction - five-eighths
  626.     ("⅞"     . "7/8") ; fraction - seven-eighths
  627.     ("⅓"     . "1/3") ; fraction - one-third
  628.     ("⅔"     . "2/3") ; fraction - two-thirds
  629.     ("⅕"     . "1/5") ; fraction - one-fifth
  630.     ("⅖"     . "2/5") ; fraction - two-fifths
  631.     ("⅗"     . "3/5") ; fraction - three-fifths
  632.     ("⅘"     . "4/5") ; fraction - four-fifths
  633.     ("⅙"     . "1/6") ; fraction - one-sixth
  634.     ("⅚"     . "5/6") ; fraction - five-sixths
  635.     ("`"      . "`") ; grave accent
  636.     (">"         . ">") ; greater-than sign
  637.     (">"          . ">") ; greater-than sign
  638.     ("½"       . "╜") ; fraction - one-half
  639.     ("…"     . ". . .") ; ellipsis (horizontal)
  640.     ("&hibar;"      . "»") ; high bar
  641.     ("―"     . "-") ; horizontal bar
  642.     ("‐"     . "-") ; hyphen
  643.     ("í"     . "φ") ; small i, acute accent
  644.     ("î"      . "ε") ; small i, circumflex accent
  645.     ("¡"      . "í") ; inverted exclamation mark
  646.     ("ì"     . "∞") ; small i, grave accent
  647.     ("¿"     . "┐") ; inverted question mark
  648.     ("ï"       . "∩") ; small i, dieresis or umlaut mark
  649.     ("←"       . "<--") ; left arrow
  650.     ("«"      . "½") ; angle quotation mark, left
  651.     ("{"       . "{") ; left curly bracket
  652.     ("“"      . "``") ; double quotation mark, left
  653.     ("_"     . "_") ; low bar
  654.     ("("       . "(") ; left parenthesis
  655.     ("["       . "[") ; left square bracket
  656.     ("‘"      . "`") ; single quotation mark, left
  657.     ("<"         . "<") ; less-than sign
  658.     ("<"          . "<") ; less-than sign
  659.     ("¯"       . "»") ; macron
  660.     ("—"      . "--") ; em-dash
  661.     ("µ"      . "╡") ; micro sign
  662.     ("·"     . "╖") ; middle dot
  663.     (" "       . " ") ; non-breaking-space
  664.     ("–"      . "-") ; en-dash
  665.     ("¬"        . "¼") ; logical not
  666.     ("ñ"     . "±") ; small n, tilde
  667.     ("#"        . "#") ; number sign
  668.     ("ó"     . "≤") ; small o, acute accent
  669.     ("ô"      . "⌠") ; small o, circumflex accent
  670.     ("˛"       . "[ogon  ]")   ; ogonek
  671.     ("ò"     . "≥") ; small o, grave accent
  672.     ("Ω"        . "[ohm   ]")   ; ohm sign
  673.     ("ª"       . "¬") ; ordinal indicator, feminine
  674.     ("º"       . "║") ; ordinal indicator, masculine
  675.     ("ø"     . "°") ; small o, slash
  676.     ("õ"     . "⌡") ; small o, tilde
  677.     ("ö"       . "÷") ; small o, dieresis or umlaut mark
  678.     ("¶"       . "╢") ; pilcrow (paragraph sign)
  679.     ("%"     . "%") ; percent sign
  680.     ("."     . ".") ; full stop, period
  681.     ("+"       . "+") ; plus sign
  682.     ("±"     . "▒") ; plus-or-minus sign
  683.     ("£"      . "ú") ; pound sign
  684.     ("?"      . "?") ; question mark
  685.     ("""       . "\"") ; quotation mark
  686.     ("»"      . "╗") ; angle quotation mark, right
  687.     ("→"       . "-->") ; Right arrow
  688.     ("}"       . "}") ; right curly bracket
  689.     ("”"      . "''") ; double quotation mark, right
  690.     ("®"        . "«") ; registered sign
  691.     ("˚"       . "░") ; ring
  692.     (")"       . ")") ; right parenthesis
  693.     ("]"       . "]") ; right square bracket
  694.     ("’"      . "'") ; single quotation mark, right
  695.     ("§"       . "º") ; section sign
  696.     (";"       . ";") ; semicolon
  697.     ("­"        . "") ; soft hyphen
  698.     ("/"        . "[sol   ]")   ; solidus
  699.     ("♪"       . "[sung  ]")   ; music note (sung text sign)
  700.     ("¹"       . "╣") ; superscript one
  701.     ("²"       . "▓") ; superscript two
  702.     ("³"       . "│") ; superscript three
  703.     ("ß"      . "▀") ; small sharp s, German (sz ligature)
  704.     ("þ"      . "■") ; small thorn, Icelandic
  705.     ("˜"      . "~") ; tilde
  706.     ("×"      . "*") ; multiply sign
  707.     ("™"      . "(TM)") ; trade mark sign
  708.     ("ú"     . "·") ; small u, acute accent
  709.     ("↑"       . "^") ; Up arrow
  710.     ("û"      . "√") ; small u, circumflex accent
  711.     ("ù"     . "∙") ; small u, grave accent
  712.     ("¨"        . "¿") ; umlaut mark
  713.     ("ü"       . "ⁿ") ; small u, dieresis or umlaut mark
  714.     ("ý"     . "²") ; small y, acute accent
  715.     ("¥"        . "Ñ") ; yen sign
  716.     ("ÿ"       . " ") ; small y, dieresis or umlaut mark
  717.     ("⋮"     . "[vellip]")   ; vertical ellipsis
  718.     ("|"     . "|") ; vertical bar
  719.     ("&"        . "&") ; ampersand
  720.     )
  721.   "*An assoc list of entity names and how to actually display them.")
  722.  
  723. (defvar w3-graphics-entities-alist
  724.   '(
  725.     ("&archive;"             . ("archive.xbm" . "[archive]"))
  726.     ("&audio;"               . ("audio.xbm" . "[audio]"))
  727.     ("&binary.document;"     . ("binary.document.xbm" . "[bin]"))
  728.     ("&binhex.document;"     . ("binhex.document.xbm" . "[binhex]"))
  729.     ("&caution;"             . ("caution.xbm" . "[CAUTION]"))
  730.     ("&clock;"               . ("clock.xbm" . "[clock]"))
  731.     ("&compressed.document;" . ("compressed.document.xbm" . "[comp]"))
  732.     ("&disk.drive;"          . ("disk.drive.xbm" . "[diskdrive]"))
  733.     ("&diskette;"            . ("diskette.xbm" . "[diskette]"))
  734.     ("&display;"             . ("display.xbm" . "[display]"))
  735.     ("&document;"            . ("unknown.document.xbm" . "[unk]"))
  736.     ("&fax;"                 . ("fax.xbm" . "[fax]"))
  737.     ("&filing.cabinet;"      . ("filing.cabinet.xbm" . "[filing cabinet]"))
  738.     ("&film;"                . ("film.xbm" . "[film]"))
  739.     ("&fixed.disk;"          . ("fixed.disk.xbm" . "[fixed disk]"))
  740.     ("&folder;"              . ("folder.xbm" . "[folder]"))
  741.     ("&form;"                . ("form.xbm" . "[form]")) ; draw one
  742.     ("&ftp;"                 . ("ftp.xbm" . "[ftp]"))
  743.     ("&glossary;"            . ("glossary.xbm" . "[glossary]"))
  744.     ("&home;"                . ("home.xbm" . "[HOME]"))
  745.     ("ℑ"               . ("image.xbm" . "[image]"))
  746.     ("&index;"               . ("index.xbm" . "[index]"))
  747.     ("&keyboard;"            . ("keyboard.xbm" . "[keyboard]"))
  748.     ("&mail;"                . ("mail.xbm" . "[mail]"))
  749.     ("&mail.in;"             . ("mail.in.xbm" . "[mail - in]"))
  750.     ("&mail.out;"            . ("mail.out.xbm" . "[mail - out]"))
  751.     ("↦"                 . ("map.xbm" . "[map]"))
  752.     ("&mouse;"               . ("mouse.xbm" . "[mouse]"))
  753.     ("&network;"             . ("network.xbm" . "[network]"))
  754.     ("&next;"                . ("next.xbm" . "[next]"))
  755.     ("¬ebook;"            . ("notebook.xbm" . "[notebook]"))
  756.     ("&parent;"              . ("parent.xbm" . "[parent]")) ; draw one
  757.     ("&previous;"            . ("previous.xbm" . "[previous]")) ; draw one
  758.     ("&printer;"             . ("printer.xbm" . "[printer]"))
  759.     ("&scheduler;"           . ("scheduler.xbm" . "[scheduler]"))
  760.     ("&stop;"                . ("stop.xbm" . "[STOP]"))
  761.     ("&summary;"             . ("summary.xbm" . "[summary]")) ; draw one
  762.     ("&symlink;"             . ("symlink.xbm" . "[symlink]"))
  763.     ("&telephone;"           . ("telephone.xbm" . "[telephone]"))
  764.     ("&telnet;"              . ("telnet.xbm" . "[telnet]"))
  765.     ("&text.document;"       . ("unknown.document.xbm" . "[text]"))
  766.     ("&tn3270;"              . ("tn3270.xbm" . "[tn3270]"))
  767.     ("&toc;"                 . ("toc.xbm" . "[Table Of Contents]")); Draw one!
  768.     ("&trash;"               . ("trash.xbm" . "[trash]"))
  769.     ("&unknown.document;"    . ("unknown.document.xbm" . "[unknown]"))
  770.     ("&uuencoded.document;"  . ("uuencoded.document.xbm" . "[uuencoded]"))
  771.     ("&workstation;"         . ("workstation.xbm" . "[workstation]"))
  772.     )
  773.     "*An assoc list of entity nams and the names of bitmaps to
  774. display them. The car is the entity name, the cdr is a list of the
  775. form (bitmapfile . alttag), where bitmapfile is a filename that
  776. specifies a bitmap file - w3-icon-directory is prepended to this
  777. automatically.  Alttag is the text to use if the bitmap is
  778. unavailable.  If nil, no text is used.")
  779.  
  780. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  781. ;;; Menu definitions
  782. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  783. (defvar w3-navigate-menu nil)
  784. (defvar w3-popup-menu
  785.   '("WWW Browser"
  786.     ["Open Local File" w3-open-local t]
  787.     ["Open URL" w3-fetch t]
  788.     ["Copy URL to clipboard" w3-save-url t]
  789.     "---"
  790.     "---"
  791.     ["Load Delayed Images" w3-load-delayed-images w3-delayed-images]
  792.     ["Load Delayed MPEGs" w3-load-delayed-mpegs w3-delayed-movies]
  793.     "---"
  794.     ["Add annotation" w3-annotation-add t]
  795.     "---"
  796.     ["Leave & Bury Buffer" w3-leave-buffer t]
  797.     ["Leave & Kill Buffer" w3-quit t]
  798.     )
  799.   "The shorter popup menu.")
  800.  
  801. (defvar w3-documentation-root "http://www.cs.indiana.edu/elisp/w3/"
  802.   "*Where the w3 documentation lives.  This MUST end in a slash.")
  803.  
  804. (defvar w3-graphlink-menu
  805.   '(("View headers"  . url-popup-info)
  806.     ("Dump to disk"  . w3-download-url)
  807.     ("Copy URL"      . w3-save-url)
  808.     ("Get image"     . w3-fetch))
  809.   "An assoc list of function names and labels.  These will be displayed
  810. in a popup menu when the mouse is pressed on a hyperlink.  Format is
  811. ( (label . function)), function is called with one argument, the URL of
  812. the link.")  
  813.  
  814. (defvar w3-hyperlink-menu
  815.   '(("View headers"  . w3-popup-info)
  816.     ("Dump to disk"  . w3-download-url)
  817.     ("Mail document" . w3-mail-current-document)
  818.     ("Copy URL"      . w3-save-url)
  819.     ("View source"   . w3-source-document)
  820.     ("Print"         . w3-print-this-url)
  821.     )
  822.   "An assoc list of function names and labels.  These will be displayed
  823. in a popup menu when the mouse is pressed on a hyperlink.  Format is
  824. ( (label . function)), function is called with one argument, the URL of
  825. the link.")
  826.  
  827. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  828. ;;; Variables internal to W3, you should not change any of these
  829. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  830. (defvar w3-faces
  831.    '(
  832. ;     W3-face        Fall-back default face
  833.      (abbrev     .   default)
  834.      (abstract   .   default)
  835.      (acronym    .   default)
  836.      (added      .   italic)
  837.      (address    .   italic)
  838.      (arg        .   italic)
  839.      (b          .   bold)
  840.      (big        .   bold)
  841.      (blink      .   bold)
  842.      (blink      .   italic)
  843.      (byline     .   italic)
  844.      (cite       .   italic)
  845.      (cmd        .   bold)
  846.      (code       .   default)
  847.      (dfn        .   italic)
  848.      (em         .   italic)
  849.      (font0      .   default)
  850.      (font1      .   default)
  851.      (font2      .   default)
  852.      (font3      .   default)
  853.      (font4      .   default)
  854.      (font5      .   default)
  855.      (font6      .   default)
  856.      (font7      .   default)
  857.      (h1         .   bold)
  858.      (h2         .   bold)
  859.      (h3         .   italic)
  860.      (h4         .   italic)
  861.      (h5         .   underline)
  862.      (h6         .   underline)
  863.      (i          .   italic)
  864.      (kbd        .   default)
  865.      (person     .   bold)
  866.      (q          .   italic)
  867.      (removed    .   italic)
  868.      (rot13      .   rot13)
  869.      (s          .   highlight)
  870.      (samp       .   default)
  871.      (small      .   italic)
  872.      (strong     .   bold)
  873.      (sub        .   bold)
  874.      (sup        .   italic)
  875.      (tt         .   default)
  876.      (u          .   underline)
  877.      (var        .   italic)
  878.      (wired      .   italic)
  879.      )
  880.  
  881.    "*An assoc list of faces.  The cdr of each list item is the default
  882. face to copy if no resources are set to define the face.
  883. (`face-differs-from-default-p' is used to determine whether to copy
  884. the default face or not).")
  885.  
  886. (defvar w3-all-faces
  887.   (cons (cons 'html 'w3-default-style)
  888.     (mapcar
  889.      (function
  890.       (lambda (x)
  891.         (cons (car x) (intern
  892.                (concat "w3-" (symbol-name (car x)) "-style")))))
  893.      w3-faces))
  894.   "A list of all the faces for use by emacs-w3.")
  895.  
  896. (defvar w3-invisible-href-list nil
  897.   "A list of 'invisible' graphic links in the current buffer.")
  898.  
  899. (defconst w3-state-locator-variable
  900.   '(
  901.     align
  902.     background
  903.     center
  904.     depth
  905.     figalt
  906.     figdata
  907.     fillcol
  908.     form
  909.     formnum
  910.     header-start
  911.     href
  912.     image
  913.     lists
  914.     mpeg
  915.     name
  916.     needspace
  917.     next-break
  918.     nofill
  919.     nowrap
  920.     optarg
  921.     options
  922.     pre-start
  923.     select
  924.     secret
  925.     table
  926.     text-mangler
  927.     title
  928.     w3-graphic
  929.     zone
  930.     label-text
  931.     )
  932.   "A list of all the various state kept in the drawing engine.
  933. This is used by the `w3-get-state' and `w3-put-state' macros.")
  934.  
  935. (defvar w3-state-vector
  936.   (make-vector (1+ (length w3-state-locator-variable)) nil)
  937.   "Various state shit kept by emacs-w3.")
  938.  
  939. (defvar w3-user-stylesheet nil
  940.   "The global stylesheet for this user.")
  941.  
  942. (defvar w3-current-stylesheet nil
  943.   "The stylesheet for this document.")
  944.  
  945. (defvar w3-base-alist nil
  946.   "An assoc list of named BASE tags in the current document.")
  947.  
  948. (defvar w3-blinking-buffs nil
  949.   "A list of buffers with blinking text in them.
  950. This is used to optimize when we change a face so the entire display
  951. doesn't flash every second, whether we've run into a buffer that is
  952. displaying blinking text or not.")
  953.  
  954. (defvar w3-last-fill-pos nil
  955.   "An internal variable for the new display engine that specifies the
  956. last character position that was correctly filled.")
  957.  
  958. (defvar w3-last-tag nil
  959.   "An internal variable for the new display engine that specifies the
  960. last tag processed.")
  961.  
  962. (defvar w3-table-info nil
  963.   "An internal variable for the new display engine for keeping table data
  964. during the pre-pass parsing.")
  965.  
  966. (defvar w3-current-formatter nil
  967.   "Current formatter function.")
  968.  
  969. (defvar w3-draw-buffer nil
  970.   "Where we are currently drawing into.  This _must_ be a buffer object
  971. when it is referenced.")
  972.  
  973. (defvar w3-active-faces nil "The list of active faces.")
  974.  
  975. (defvar w3-netscape-variable-mappings
  976.   '(("PRINT_COLOR"    . ps-print-color-p)
  977.     ("DITHER_IMAGES"    . w3-color-use-reducing)
  978.     ("SOCKS_HOST"    . url-socks-host)
  979.     ("ORGANIZATION"    . url-user-organization)
  980.     ("EMAIL_ADDRESS"    . url-personal-mail-address)
  981.     ("REAL_NAME"    . url-user-real-name)
  982.     ("NEWSGROUP_DESCRIPTIONS" . url-show-newsgroup-descriptions)
  983.     ("NNTPSERVER"    . url-news-server)
  984.     ("AUTOLOAD_IMAGES"    . w3-delay-image-loads)
  985.     ("HOME_DOCUMENT"    . w3-default-homepage)
  986.     ("UNDERLINE_LINKS"    . w3-underline-links)
  987.     ("TMPDIR"        . url-temporary-directory))
  988.   "A mapping from netscape configuration file options to w3 variables.")
  989.      
  990. (defvar w3-acceptable-protocols-alist
  991.   '(("Gopher"                           . "gopher")
  992.     ("TN3270 (IBM Mainframe emulation)" . "tn3270")
  993.     ("Interactive Telnet Session"       . "telnet")
  994.     ("Local file or file over ftp"      . "file")
  995.     ("File on an http server"           . "http")
  996.     ("Usenet newsgroup/article"         . "news")
  997.     ("Mail session"                     . "mailto"))
  998.   "An assoc list of descriptive labels and the corresponding URL stub.")
  999. (defvar w3-annotation-marker "<ncsa-annotation-format-1>")
  1000. (defvar w3-annotation-minor-mode nil "Whether we are in the minor mode.")
  1001. (defvar w3-annotation-minor-mode-map (make-keymap) "Keymap for annotation.")
  1002. (defconst w3-bug-address "wmperry@spry.com" "Address of current maintainer.")
  1003. (defvar w3-continuation '(url-uncompress url-clean-text)
  1004.   "List of functions to call to process a document completely.")
  1005. (defvar w3-current-annotation nil "URL of document we are annotating...")
  1006. (defvar w3-current-isindex nil "Is the current document a searchable index?")
  1007. (defvar w3-current-last-buffer nil "Last W3 buffer seen before this one.")
  1008. (defvar w3-current-links nil "An assoc list of <LINK> tags for this doc.")
  1009. (defvar w3-current-source nil "Source of current document.")
  1010. (defvar w3-current-parse nil "Parsed version of current document.")
  1011. (defconst w3-default-continuation '(url-uncompress url-clean-text) 
  1012.   "Default action to start with - cleans text and uncompresses if necessary.")
  1013. (defvar w3-editing-annotation nil "Are we editing an annotation or not?")
  1014. (defvar w3-find-this-link nil "Link to go to within a document.")
  1015. (defvar w3-hidden-forms nil "List of hidden form areas and their info.")
  1016. (defvar w3-hotlist nil "Default hotlist.")
  1017. (defvar w3-icon-path-cache nil "Cache of where we found icons for entities.")
  1018. (defvar w3-last-buffer nil "The last W3 buffer visited.")
  1019. (defvar w3-mode-map (make-keymap) "*Keymap to use in w3-mode.")
  1020. (defvar w3-old-kill-emacs-hook nil "Old value of kill-emacs-hook, if any.")
  1021. (defvar w3-personal-annotations nil "Assoc list of personal annotations.")
  1022. (defvar w3-print-next nil "Should we latex & print the next doc?")
  1023. (defvar w3-roman-characters "ivxLCDMVX" "Roman numerals.")
  1024. (defvar w3-setup-done nil "Have we been through setup code yet?")
  1025. (defvar w3-source nil "Should we source the next document or not?")
  1026. (defvar w3-strict-width nil
  1027.   "*This variable will control how wide emacs thinks the current window is.
  1028. This is useful when working in batch mode, and (window-width) returns the
  1029. wrong value.  If the value is nil, it will use the value (window-width)
  1030. returns.")
  1031. (defvar w3-submit-button nil
  1032.   "A zone object specifying what button was pressed to submit a form.")
  1033. (defvar w3-zones-list nil "*List of 'zones' in a dumb emacs buffer.")
  1034.  
  1035. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1036. ;;; buffer-local variables to keep around when going into w3-mode
  1037. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1038. (defvar w3-e19-hotlist-menu nil
  1039.   "A menu for hotlists.")
  1040.  
  1041. (defvar w3-e19-links-menu nil
  1042.   "A buffer-local menu for links.")
  1043.  
  1044. (defvar w3-persistent-variables
  1045.   '(
  1046.     url-current-callback-func
  1047.     url-current-content-length
  1048.     url-current-file
  1049.     url-current-mime-encoding
  1050.     url-current-mime-headers
  1051.     url-current-mime-type
  1052.     url-current-mime-viewer
  1053.     url-current-port
  1054.     url-current-referer
  1055.     url-current-server
  1056.     url-current-type
  1057.     url-current-user
  1058.     w3-e19-links-menu
  1059.     w3-current-parse
  1060.     w3-current-annotation
  1061.     w3-current-isindex
  1062.     w3-current-last-buffer
  1063.     w3-current-links
  1064.     w3-current-source
  1065.     w3-delayed-images
  1066.     w3-delayed-movies
  1067.     w3-hidden-forms
  1068.     w3-invisible-href-list
  1069.     w3-node-style
  1070.     w3-state-vector
  1071.     w3-visited-node-style
  1072.     w3-form-labels
  1073.     w3-zones-list
  1074.     )
  1075.   "A list of variables that should be preserved when entering w3-mode.")
  1076.  
  1077. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1078. ;;; Syntax stuff
  1079. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1080. (defvar w3-parse-args-syntax-table
  1081.   (copy-syntax-table emacs-lisp-mode-syntax-table)
  1082.   "A syntax table for parsing sgml attributes.")
  1083.  
  1084. (modify-syntax-entry ?' "\"" w3-parse-args-syntax-table)
  1085. (modify-syntax-entry ?` "\"" w3-parse-args-syntax-table)
  1086. (modify-syntax-entry ?< "(>" w3-parse-args-syntax-table)
  1087. (modify-syntax-entry ?> ")<" w3-parse-args-syntax-table)
  1088.  
  1089. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1090. ;;; Startup items
  1091. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1092. (defvar w3-form-labels nil "")
  1093. (mapcar 'make-variable-buffer-local w3-persistent-variables)
  1094. (make-variable-buffer-local 'w3-state-vector)
  1095. (make-variable-buffer-local 'w3-current-stylesheet)
  1096. (make-variable-buffer-local 'w3-base-alist)
  1097. (make-variable-buffer-local 'w3-annotation-minor-mode)
  1098. (make-variable-buffer-local 'w3-last-tag)
  1099. (make-variable-buffer-local 'w3-last-fill-pos)
  1100. (make-variable-buffer-local 'w3-table-info)
  1101. (make-variable-buffer-local 'w3-draw-buffer)
  1102. (make-variable-buffer-local 'w3-current-formatter)
  1103. (make-variable-buffer-local 'w3-active-faces)
  1104. (make-variable-buffer-local 'w3-default-style)
  1105.  
  1106. (suppress-keymap w3-mode-map)
  1107. (define-key w3-mode-map " "       'w3-scroll-up)
  1108. (define-key w3-mode-map "<"        'beginning-of-buffer)
  1109. (define-key w3-mode-map ">"        'end-of-buffer)
  1110. (define-key w3-mode-map "?"        'w3-help)
  1111. (define-key w3-mode-map "A"        'w3-hotlist-add-document-at-point)
  1112. (define-key w3-mode-map "B"        'w3-backward-in-history)
  1113. (define-key w3-mode-map "F"        'w3-forward-in-history)
  1114. (define-key w3-mode-map "G"        'w3-show-graphics)
  1115. (define-key w3-mode-map "H"       'w3-show-hotlist)
  1116. (define-key w3-mode-map "I"        'w3-popup-info)
  1117. (define-key w3-mode-map "K"        'w3-save-this-url)
  1118. (define-key w3-mode-map "P"        'w3-print-url-under-point)
  1119. (define-key w3-mode-map "Q"        'w3-leave-buffer)
  1120. (define-key w3-mode-map "R"        'w3-refresh-buffer)
  1121. (define-key w3-mode-map "S"        'w3-source-document-at-point)
  1122. (define-key w3-mode-map "U"        'w3-use-links)
  1123. (define-key w3-mode-map "V"        'w3-view-this-url)
  1124. (define-key w3-mode-map "\C-?"     'scroll-down)
  1125. (define-key w3-mode-map "\C-c\C-b" 'w3-show-history-list)
  1126. (define-key w3-mode-map "\C-c\C-v" 'w3-version)
  1127. (define-key w3-mode-map "\C-o"     'w3-fetch)
  1128. (define-key w3-mode-map "\M-M"     'w3-mail-document-under-point)
  1129. (define-key w3-mode-map "\M-\C-i"  'w3-insert-this-url)
  1130. (define-key w3-mode-map "\M-m"       'w3-mail-current-document)
  1131. (define-key w3-mode-map "\M-s"       'w3-search)
  1132. (define-key w3-mode-map "\M-\r"    'w3-follow-inlined-image)
  1133. (define-key w3-mode-map "\r"       'w3-follow-link)
  1134. (define-key w3-mode-map "\t"       'w3-forward-link)
  1135. (define-key w3-mode-map "a"       'w3-hotlist-add-document)
  1136. (define-key w3-mode-map "b"       'w3-back-link)
  1137. (define-key w3-mode-map "c"        'w3-mail-document-author)
  1138. (define-key w3-mode-map "d"        'w3-hotlist-delete)
  1139. (define-key w3-mode-map "f"       'w3-forward-link)
  1140. (define-key w3-mode-map "g"        'w3-reload-document)
  1141. (define-key w3-mode-map "h"        'w3-use-hotlist)
  1142. (define-key w3-mode-map "i"        'w3-document-information)
  1143. (define-key w3-mode-map "k"        'w3-save-url)
  1144. (define-key w3-mode-map "l"        'w3-goto-last-buffer)
  1145. (define-key w3-mode-map "m"        'w3-complete-link)
  1146. (define-key w3-mode-map "n"        'w3-forward-link)
  1147. (define-key w3-mode-map "o"       'w3-open-local)
  1148. (define-key w3-mode-map "p"        'w3-print-this-url)
  1149. (define-key w3-mode-map "q"       'w3-quit)
  1150. (define-key w3-mode-map "r"        'w3-reload-document)
  1151. (define-key w3-mode-map "s"        'w3-source-document)
  1152. (define-key w3-mode-map "u"        'w3-leave-buffer)
  1153. (define-key w3-mode-map "v"       'url-view-url)
  1154. (define-key w3-mode-map "w"        'w3-submit-bug)
  1155.  
  1156. (cond
  1157.  (w3-running-FSF19
  1158.   (define-key w3-mode-map [S-tab]    'w3-back-link))
  1159.  (w3-running-xemacs
  1160.   (define-key w3-mode-map '(shift tab) 'w3-back-link))
  1161.  (t nil))
  1162.  
  1163. (define-key w3-annotation-minor-mode-map "\C-c\C-c"
  1164.   'w3-personal-annotation-finish)
  1165.  
  1166. (provide 'w3-vars)
  1167.