1 ;;; w3-vars.el,v --- All variable definitions for emacs-w3
2 ;; Author: $Author: fx $
3 ;; Created: $Date: 2001/10/01 11:42:46 $
4 ;; Version: $Revision: 1.8 $
5 ;; Keywords: comm, help, hypermedia
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu>
9 ;;; Copyright (c) 1996, 97, 98, 99, 2001 Free Software Foundation, Inc.
11 ;;; This file is part of GNU Emacs.
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;;; it under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 2, or (at your option)
16 ;;; any later version.
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;;; Boston, MA 02111-1307, USA.
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 ;;; Variable definitions for w3
31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33 (require 'w3-cus) ; Grab everything that is customized
34 (require 'wid-edit) ; For `widget-keymap'
36 (defconst w3-version-number
37 (let ((x "$State: p4.0pre.47 $"))
38 (if (string-match "State:[ \t\n]+\\([^ \t\n]+\\)" x)
39 (setq x (substring x (match-beginning 1) (match-end 1)))
40 (setq x (substring x 1)))
42 (function (lambda (x) (if (= x ?-) "." (char-to-string x)))) x ""))
43 "Version number of w3-mode.")
45 (defconst w3-version-date (let ((x "$Date: 2001/10/01 11:42:46 $"))
46 (if (string-match "Date: \\([^ \t\n]+\\)" x)
47 (substring x (match-beginning 1) (match-end 1))
49 "Date this version of w3-mode was released.")
52 (format "WWW %s %s" w3-version-number w3-version-date)
53 "More descriptive version of w3-version-number.")
55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56 ;;; General configuration variables
57 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
58 (defvar w3-track-last-buffer nil
59 "*Whether to track the last w3 buffer to automatically switch to with
62 (defvar w3-gc-cons-threshold-multiplier 1
63 "Amount to temporarily multiply gc-cons-threshold by when parsing HTML.
64 Setting this to a number greater than 1 will result in less frequent
65 garbage collections when parsing an HTML document, which may often speed
66 up handling of a large document with many elements. The disadvantage is
67 that it allows Emacs's total memory usage to grow larger, which may result
68 in later garbage collections taking more time.")
70 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
71 ;;; Figure out what flavor of emacs we are running
72 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73 (defvar w3-running-xemacs (string-match "XEmacs" emacs-version)
76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77 ;; Store the database of HTML general entities.
78 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79 ;; Commentary on the basis of the current W3C entity list. -- fx
80 (defvar w3-html-entities
88 (rsquo . 39) ; should be U+8217
105 (uarr . 94) ; should be U+8593
107 (lsquo . 96) ; should be U+8216
209 ;; Special handling of these
223 ;; The following 5 entities are not mentioned in the HTML 2.0
224 ;; standard, nor in any other HTML proposed standard of which I
225 ;; am aware. I am not even sure they are ISO entity names. ***
226 ;; Hence, some arrangement should be made to give a bad HTML
227 ;; message when they are seen.
239 ;; (shy . ????) ; soft hyphen
241 "*An assoc list of entity names and how to actually display them.")
243 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
245 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
246 (defvar w3-popup-menu
247 '("Emacs-W3 Commands"
248 ["Back" w3-history-backward (car (w3-history-find-url-internal (url-view-url t)))]
249 ["Forward" w3-history-forward (cdr (w3-history-find-url-internal (url-view-url t)))]
251 ["Reload" (w3-reload-document) t]
252 ["Show Images" (w3-load-delayed-images) w3-delayed-images]
254 ["Add bookmark" (w3-hotlist-add-document nil) t]
256 "The shorter popup menu.")
258 (defvar w3-graphlink-menu
259 '(("Open this Image (%s)" . w3-fetch)
260 ("Save this Image As..." . w3-download-url)
261 ("Copy this Image Location" . w3-save-url))
262 "An assoc list of function names and labels. These will be displayed
263 in a popup menu when the mouse is pressed on a hyperlink. Format is
264 \( (label . function)), function is called with one argument, the URL of
265 the link. Each label can have exactly one `%s' that will be replaced by
266 the URL of the link.")
268 (defvar w3-hyperlink-menu
269 '(("Open this Link (%s)" . w3-fetch)
270 ("Add Bookmark for this Link" . w3-hotlist-add-document-at-point)
271 ("New Window with this Link" . w3-fetch-other-frame)
272 ("Save Link As..." . w3-download-url)
273 ("Copy this Link Location to Clipboard" . w3-save-url))
274 "An assoc list of function names and labels. These will be displayed
275 in a popup menu when the mouse is pressed on a hyperlink. Format is
276 \( (label . function)), function is called with one argument, the URL of
277 the link. Each label can have exactly one `%s' that will be replaced by
278 the URL of the link.")
280 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
281 ;;; Variables internal to W3, you should not change any of these
282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
283 (defvar w3-graphics-list nil
284 "List of graphics already read in.")
286 (defvar w3-delayed-images nil
287 "A buffer-local variable holding positions and urls of images within
290 (defvar w3-frameset-structure nil
291 "Frameset structure, heap of '(frameset ({cols|rows} \"<dimensions>\")) and '(<frame name> <href>)")
293 (defvar w3-frame-name nil
296 (defvar w3-base-target nil
299 (defvar w3-target-window-distances nil
300 "Target window distances")
302 (defvar w3-tty-char-width 8
303 "*Char width to use when in a tty")
305 (defvar w3-tty-char-height 15
306 "*Char height to use when in a tty")
308 (defvar w3-form-radio-elements nil "Internal variable - do not touch!")
309 (defvar w3-form-elements nil "Internal variable - do not touch!")
311 (defvar w3-user-stylesheet nil
312 "The global stylesheet for this user.")
314 (defvar w3-current-stylesheet nil
315 "The stylesheet for this document.")
317 (defvar w3-last-fill-pos nil
318 "An internal variable for the new display engine that specifies the
319 last character position that was correctly filled.")
321 (defvar w3-active-faces nil "The list of active faces.")
322 (defvar w3-active-voices nil "The list of active voices.")
324 (defconst w3-bug-address "w3-bugs@xemacs.org"
325 "Address of current maintainer, where to send bug reports.")
326 (defvar w3-current-isindex nil "Is the current document a searchable index?")
327 (defvar w3-current-buffer nil "Is the current W3 buffer")
328 (defvar w3-current-last-buffer nil "Last W3 buffer seen before this one.")
329 (defvar w3-current-links nil "An assoc list of <link> tags for this doc.")
330 (defvar w3-current-metainfo nil "An assoc list of <meta> tags for this doc.")
331 (defvar w3-current-source nil "Source of current document.")
332 (defvar w3-current-parse nil "Parsed version of current document.")
333 (defvar w3-current-badhtml nil "List of HTML warnings for this page.")
334 (defvar w3-find-this-link nil "Link to go to within a document.")
335 (defvar w3-hidden-forms nil "List of hidden form areas and their info.")
336 (defvar w3-hotlist nil "Default hotlist.")
337 (defvar w3-last-buffer nil "The last W3 buffer visited.")
338 (defvar w3-roman-characters "ivxLCDMVX" "Roman numerals.")
339 (defvar w3-setup-done nil "Have we been through setup code yet?")
341 (defvar w3-strict-width nil
342 "*This variable will control how wide emacs thinks the current window is.
343 This is useful when working in batch mode, and (window-width) returns the
344 wrong value. If the value is nil, it will use the value (window-width)
347 (defvar w3-submit-button nil
348 "A widget object specifying what button was pressed to submit a form.")
350 (defvar w3-explicit-conversion-tree nil
351 "Tree to hold explicit coding systems for URLs and their superdirs:
352 ((hostN default-coding (dirN-1 default-coding (dirN-1-1 ...) ...) ...)
355 (defvar w3-explicit-encodings-changed-since-last-save nil
356 "Whether the explicit encodings tree has changed since the last save operation.")
358 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
359 ;;; buffer-local variables to keep around when going into w3-mode
360 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
361 (defvar w3-id-positions nil "Internal use only.")
362 (defvar w3-imagemaps nil "Internal use only.")
364 ;; Why aren't these just permanent-local? -- fx
365 (defvar w3-persistent-variables
367 ;; So we can show the URL in the list-buffers listing
368 list-buffers-directory
369 ;; So widgets don't get lost
371 w3-form-radio-elements
377 w3-current-last-buffer
383 w3-current-stylesheet
388 w3-target-window-distances
389 w3-frameset-structure
390 buffer-file-coding-system
391 url-current-mime-headers
393 "A list of variables that should be preserved when entering w3-mode.")
395 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
397 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
398 (defvar w3-netscape-emulation-minor-mode nil
399 "Whether we are in the netscape emulation minor mode.")
400 (defvar w3-netscape-emulation-minor-mode-map (make-sparse-keymap)
401 "Keymap for netscape emulation.")
402 (defvar w3-lynx-emulation-minor-mode nil
403 "Whether we are in the lynx emulation minor mode.")
404 (defvar w3-lynx-emulation-minor-mode-map (make-sparse-keymap)
405 "Keymap for lynx emulation.")
406 (defvar w3-last-search-item nil)
408 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
410 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
411 (defvar w3-form-labels nil "")
415 (make-variable-buffer-local var)))) w3-persistent-variables)
417 (make-variable-buffer-local 'w3-last-fill-pos)
418 (make-variable-buffer-local 'w3-frame-name)
419 (make-variable-buffer-local 'w3-active-faces)
420 (make-variable-buffer-local 'w3-netscape-emulation-minor-mode)
421 (make-variable-buffer-local 'w3-lynx-emulation-minor-mode)
422 (make-variable-buffer-local 'w3-last-search-item)
424 (defvar w3-table-structure nil
425 "Structure to hold table info")
426 (make-variable-buffer-local 'w3-table-structure)