32
|
1 ;;; w3-cus.el --- Customization support for Emacs-W3
|
|
2 ;; Author: wmperry
|
138
|
3 ;; Created: 1997/04/24 14:57:19
|
|
4 ;; Version: 1.8
|
32
|
5 ;; Keywords: comm, help, hypermedia
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
|
|
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
|
|
10 ;;;
|
|
11 ;;; This file is part of GNU Emacs.
|
|
12 ;;;
|
|
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.
|
|
17 ;;;
|
|
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.
|
|
22 ;;;
|
|
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
28 (eval-and-compile
|
|
29 (condition-case ()
|
|
30 (require 'custom)
|
|
31 (error nil))
|
|
32 (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
|
|
33 nil ;; We've got what we needed
|
|
34 ;; We have the old custom-library, hack around it!
|
114
|
35 (defmacro defgroup (&rest args)
|
|
36 nil)
|
32
|
37 (defmacro defcustom (var value doc &rest args)
|
|
38 (` (defvar (, var) (, value) (, doc))))))
|
|
39
|
114
|
40 (defgroup w3 nil
|
|
41 "Emacs-W3 - the web browser of choice."
|
|
42 :group 'hypermedia)
|
|
43
|
|
44 (defgroup w3-files nil
|
|
45 "Emacs-W3 configuration files."
|
|
46 :group 'w3)
|
|
47
|
|
48 (defgroup w3-images nil
|
|
49 "Controlling image handling."
|
|
50 :group 'w3)
|
|
51
|
|
52 (defgroup w3-printing nil
|
|
53 "Various options for hardcopy from web pages."
|
|
54 :group 'w3)
|
|
55
|
|
56 (defgroup w3-menus nil
|
|
57 "The look of menus in Emacs-W3"
|
|
58 :group 'w3)
|
|
59
|
|
60 (defgroup w3-parsing nil
|
|
61 "Options relating to HTML parsing"
|
|
62 :group 'w3)
|
|
63
|
|
64 (defgroup w3-display nil
|
|
65 "Variables relating to how web pages are displayed."
|
|
66 :group 'w3)
|
|
67
|
|
68 (defgroup w3-hooks nil
|
|
69 "Hooks relating to Emacs-W3."
|
|
70 :group 'w3)
|
|
71
|
32
|
72 ;;; File related variables
|
|
73 (defcustom w3-configuration-directory "~/.w3/"
|
|
74 "*Directory where Emacs-w3 can find its configuration files"
|
|
75 :group 'w3-files
|
|
76 :type 'directory)
|
|
77
|
|
78 (defcustom w3-default-configuration-file nil
|
|
79 "*Where per-user customizations of w3 are kept."
|
|
80 :group 'w3-files
|
|
81 :type 'file)
|
|
82
|
|
83 (defcustom w3-default-homepage nil
|
|
84 "*The url to open at startup. It can be any valid URL.
|
|
85 This will default to the environment variable WWW_HOME if you do not
|
|
86 set it in your .emacs file. If WWW_HOME is undefined, then it will
|
|
87 default to the hypertext documentation for W3 at Indiana University."
|
|
88 :group 'w3-files
|
|
89 :type 'string)
|
|
90
|
|
91 (defcustom w3-default-stylesheet nil
|
|
92 "*The filename of the users default stylesheet."
|
|
93 :group 'w3-files
|
|
94 :type 'file)
|
|
95
|
|
96 (defcustom w3-hotlist-file nil
|
|
97 "*Hotlist filename.
|
|
98 This should be the name of a file that is stored in either
|
|
99 NCSA's Mosaic/X or Netscape/X format. It is used to keep a listing
|
|
100 of commonly accessed URL's without having to go through 20 levels of
|
|
101 menus to get to them."
|
|
102 :group 'w3-files
|
|
103 :type 'file)
|
|
104
|
116
|
105 (defcustom w3-documentation-root "http://www.cs.indiana.edu/elisp/w3/"
|
32
|
106 "*Where the w3 documentation lives. This MUST end in a slash."
|
|
107 :group 'w3-files
|
|
108 :type 'string)
|
|
109
|
|
110 (defcustom w3-temporary-directory (or (getenv "TMPDIR") "/tmp")
|
|
111 "*Where temporary files go."
|
|
112 :group 'w3-files
|
|
113 :type 'directory)
|
|
114
|
|
115 ;;; Display related variables
|
|
116 (defcustom w3-display-frames nil
|
114
|
117 "*Fetch frames - can be:
|
|
118 nil no frame display whatsoever
|
|
119 'as-links display frame hyperlinks, but do not fetch them
|
|
120 'ask display frame hyperlinks and ask whether to fetch them
|
|
121 t display frame hyperlinks and fetch them."
|
32
|
122 :group 'w3-display
|
114
|
123 :type '(choice (const :tag "Do not display frames" :value nil)
|
|
124 (const :tag "Show hyperlinks" :value as-links)
|
|
125 (const :tag "Show hyperlinks, ask whether to retrieve them" :value ask)
|
|
126 (const :tag "Automatically retrieve frames" :value t)))
|
32
|
127
|
116
|
128 (defcustom w3-bullets
|
|
129 '((disc . ?*)
|
|
130 (circle . ?o)
|
|
131 (square . ?#)
|
|
132 (none . ? )
|
|
133 )
|
|
134 "*An assoc list of unordered list types mapping to characters to use
|
|
135 as the bullet character."
|
32
|
136 :group 'w3-display
|
116
|
137 :type 'list)
|
32
|
138
|
|
139 (defcustom w3-echo-link '(title url text name)
|
|
140 "*Whether to display the URL of a link when tabbing through links.
|
|
141 Value is a list of one or more of the following symbols:
|
|
142
|
|
143 url == url of the target
|
|
144 text == text of the link
|
|
145 title == title attribute of the link
|
|
146 name == name or id attribute of the link
|
|
147
|
|
148 If none of the information is available, nothing will be shown for the link
|
|
149 in menus, etc."
|
|
150 :group 'w3-display
|
|
151 :type '(set (const :tag "URL" :value url)
|
|
152 (const :tag "Link Text" :value text)
|
|
153 (const :tag "Title of the link as defined in the HTML tag"
|
|
154 :value title)
|
|
155 (const :tag "Name of the link as defined in the HTML tag"
|
|
156 :value name)))
|
|
157
|
116
|
158 (defcustom w3-horizontal-rule-char nil
|
32
|
159 "*The character to use to create a horizontal rule.
|
|
160 Must be the character's code, not a string. This character is
|
116
|
161 replicated across the screen to create a division.
|
|
162 If nil W3 will use a terminal graphic character if possible."
|
|
163 :group 'w3-display
|
|
164 :type '(choice (const :tag "Best possible" :value nil)
|
|
165 (character)))
|
|
166
|
|
167 ;;; these three variables control how w3-setup-terminal-chars works
|
|
168 (defcustom w3-use-terminal-characters t
|
|
169 "*Use terminal graphics characters for drawing tables and rules if available"
|
|
170 :group 'w3-display
|
|
171 :type 'boolean)
|
|
172
|
|
173 (defcustom w3-use-terminal-characters-on-tty nil
|
|
174 "*Use terminal graphics characters for tables and rules even on a tty.
|
|
175 This triggers display bugs on both FSF Emacs and XEmacs.
|
|
176 (Though it's usually tolerable at least on FSF Emacs.)"
|
32
|
177 :group 'w3-display
|
116
|
178 :type 'boolean)
|
|
179
|
|
180 (defcustom w3-use-terminal-glyphs t
|
|
181 "*Use glyphs if possible rather than properties for terminal graphics characters
|
|
182
|
|
183 Glyphs are probably more efficient but don't work with the most recent versions
|
|
184 of XEmacs and there are some cute tricks we can play with text-properties that
|
|
185 glyphs won't let us do. It may be possible someday to make XEmacs automagically
|
|
186 translate the characters back to ascii characters when pasted into another
|
|
187 buffer. (On the other hand, right now w3-excise-terminal-characters doesn't
|
|
188 work at all if we're using text-properties)."
|
|
189 :group 'w3-display
|
|
190 :type '(choice (const :tag "Use Glyphs" :value t)
|
|
191 (const :tag "Use Text Properties" :value nil)))
|
|
192
|
|
193 (defcustom w3-do-incremental-display nil
|
|
194 "*Whether to do incremental display of pages or not."
|
|
195 :group 'w3-display
|
|
196 :type 'boolean)
|
32
|
197
|
|
198 (defcustom w3-defined-link-types
|
|
199 ;; This is the HTML3.0 list (downcased) plus "made".
|
|
200 '("previous" "next" "up" "down" "home" "toc" "index" "glossary"
|
|
201 "copyright" "bookmark" "help" "made")
|
|
202 "A list of the (lower-case) names which have special significance
|
|
203 as the values of REL or REV attributes of <link> elements. They will
|
|
204 be presented on the toolbar or the links menu, for instance."
|
|
205 :group 'w3-display
|
|
206 :type '(repeat string))
|
|
207
|
|
208 ;;; Parsing related variables
|
|
209 (defcustom w3-debug-html nil
|
|
210 "*Whether to gripe about bad HTML or not."
|
|
211 :group 'w3-parsing
|
|
212 :type '(choice (const :tag "HTML Errors" :value t)
|
|
213 (const :tag "Errors and stylistic issues" :value style)
|
|
214 (const :tag "None" :value nil)))
|
|
215
|
|
216 (defcustom w3-debug-buffer "*HTML Debug*"
|
|
217 "*Name of buffer to store debugging information in."
|
|
218 :group 'w3-parsing
|
|
219 :type 'string)
|
|
220
|
|
221 ;;; Image related variables
|
|
222 (defcustom w3-auto-image-alt t
|
|
223 "*Whether emacs-w3 should create an alt attribute for an image that
|
|
224 is missing it.
|
|
225 If nil, emacs-w3 will not automatically create an ALT attribute.
|
|
226 If t, the alt attribute will be [IMAGE(nameofimage)]
|
|
227 If a string, it should be a string suitable for running through format,
|
|
228 with only one %s, which will be replaced with just the filename of the
|
|
229 graphic that is not loaded."
|
|
230 :group 'w3-images
|
|
231 :type '(choice (const :tag "None" :value nil)
|
|
232 (const :tag "Default" :value t)
|
|
233 string))
|
|
234
|
|
235 (defcustom w3-icon-directory "http://cs.indiana.edu/elisp/w3/icons/"
|
|
236 "*Where to find standard icons. Must end in a /!"
|
|
237 :group 'w3-images
|
|
238 :type 'string)
|
|
239
|
|
240 (defcustom w3-icon-format 'gif
|
|
241 "*Image format the default icons are expected to be in.
|
|
242 This is a symbol, string or nil, specifing what file extension to use.
|
|
243 If nil, then no file extension is used."
|
|
244 :group 'w3-images
|
|
245 :type '(choice (const :tag "GIF Image" :value gif)
|
|
246 (const :tag "XPM Image" :value xpm)
|
|
247 (const :tag "XBM Image" :value xbm)
|
|
248 (const :tag "Let the server decide" :value nil)
|
|
249 (string :tag "Other")))
|
|
250
|
|
251 (defcustom w3-delay-image-loads nil
|
|
252 "*Whether to delay image loading, or automatically retrieve them."
|
|
253 :group 'w3-images
|
|
254 :type 'boolean)
|
|
255
|
|
256 (defcustom w3-image-mappings
|
|
257 '(
|
|
258 ("image/x-xbitmap" . xbm)
|
|
259 ("image/xbitmap" . xbm)
|
|
260 ("image/xbm" . xbm)
|
|
261 ("image/jpeg" . jpeg)
|
|
262 ("image/gif" . gif)
|
|
263 ("image/png" . png)
|
|
264 ("image/x-fax" . g3fax)
|
|
265 ("image/x-raster" . rast)
|
|
266 ("image/windowdump" . xwd)
|
|
267 ("image/x-icon" . icon)
|
|
268 ("image/portable-graymap" . pgm)
|
|
269 ("image/portable-pixmap" . ppm)
|
|
270 ("image/x-pixmap" . xpm)
|
|
271 ("image/x-xpixmap" . xpm)
|
|
272 ("image/pict" . pict)
|
|
273 ("image/x-rgb" . sgi)
|
|
274 ("image/x-sgi" . sgi)
|
|
275 ("image/x-macpaint" . macpt)
|
|
276 ("image/x-targa" . tga)
|
|
277 ("image/tiff" . tiff)
|
|
278 )
|
|
279 "*How to map MIME types to image types for the `image' package.
|
|
280 Each entry is a cons cell of MIME types and image-type symbols."
|
|
281 :group 'w3-images
|
138
|
282 :type '(repeat (cons :format "%v"
|
|
283 (string :tag "MIME Type")
|
|
284 (symbol :tag "Image type"))))
|
32
|
285
|
|
286 ;;; Printing variables
|
|
287 (defcustom w3-latex-docstyle "{article}"
|
|
288 "*The documentstyle to use when printing or mailing files as LaTeX.
|
|
289 Good defaults are: {article}, [psfig,twocolumn]{article}, etc."
|
|
290 :group 'w3-printing
|
|
291 :type 'string)
|
|
292
|
|
293 (defcustom w3-latex-print-links nil
|
|
294 "*If non-nil, prints the URLs of hypertext links as endnotes at the end of
|
|
295 the document. If `footnote', prints the URL's as footnotes on a page."
|
|
296 :group 'w3-printing
|
|
297 :type '(choice (const :tag "As endnotes" :value t)
|
|
298 (const :tag "As footnotes" :value footnote)
|
|
299 (const :tag "Do not print" :value nil)))
|
|
300
|
|
301 (defcustom w3-latex-use-latex2e nil
|
|
302 "*If non-nil, configures LaTeX parser to use LaTeX2e syntax. A `nil'
|
|
303 value indicates that LaTeX 2.0.9 compatibility will be used instead."
|
|
304 :group 'w3-printing
|
|
305 :type 'boolean)
|
|
306
|
|
307 (defcustom w3-latex-packages nil
|
|
308 "*List of LaTeX packages to include when converting HTML to LaTeX.
|
|
309 Currently this is only used if `w3-latex-use-latex2e' is non-nil."
|
|
310 :group 'w3-printing
|
|
311 :type '(repeat string))
|
|
312
|
|
313 (defcustom w3-latex-use-maketitle nil
|
|
314 "*Non-nil makes the LaTeX parser use real LaTeX title pages."
|
|
315 :group 'w3-printing
|
|
316 :type 'boolean)
|
|
317
|
|
318 ;;; Menus
|
|
319 (defcustom w3-max-menu-length 35
|
|
320 "*The maximum length of a pulldown menu before it will be split into
|
|
321 smaller chunks, with the first part as a submenu, followed by the rest
|
|
322 of the menu."
|
|
323 :group 'w3-menus
|
|
324 :type 'integer)
|
|
325
|
|
326 (defcustom w3-max-menu-width 40
|
|
327 "*The maximum width of a pulldown menu choice."
|
|
328 :group 'w3-menus
|
|
329 :type 'integer)
|
|
330
|
|
331 ;;; Advanced stuff
|
|
332 (defcustom w3-modeline-format
|
|
333 '(" " ("W3"
|
|
334 (w3-netscape-emulation-minor-mode
|
|
335 " (NS)")
|
|
336 (w3-lynx-emulation-minor-mode
|
|
337 " (Lynx)")
|
|
338 ": "
|
|
339 (40 (-40 "%b"))
|
|
340 " "
|
|
341 (w3-current-isindex "[Searchable] ")
|
|
342 "%p" " " global-mode-string))
|
|
343 "*The modeline format string when in w3 mode"
|
|
344 :group 'w3-advanced
|
|
345 :type 'list)
|
|
346
|
|
347 (defcustom w3-netscape-compatible-comments t
|
|
348 "*Whether to honor netscape-style <! > comments.
|
|
349 Ye gods I wish I could turn this off by default."
|
|
350 :group 'w3-parsing
|
|
351 :type 'boolean)
|
|
352
|
|
353 (defcustom w3-notify 'semibully
|
|
354 "*Selects the behavior when w3 page is ready.
|
|
355 This variable may have one of the following values:
|
|
356
|
|
357 newframe -- put the w3 page in its own frame
|
|
358 bully -- make the w3 page the current buffer and only window
|
|
359 semibully -- make the w3 page the current buffer in the same window
|
|
360 aggressive -- make the w3 page the current buffer in the other window
|
|
361 friendly -- display w3page in other window but don't make current
|
|
362 polite -- don't display w3 page, but prints message when ready (beeps)
|
|
363 quiet -- like `polite', but don't beep
|
|
364 meek -- make no indication that page is ready
|
|
365
|
|
366 Any other value of `w3-notify' is equivalent to `meek'."
|
|
367 :group 'w3-display
|
|
368 :type '(choice (const :tag "Display in a new frame"
|
|
369 :value newframe)
|
|
370 (const :tag "Display in the current window, select buffer, and kill other windows"
|
|
371 :value bully)
|
|
372 (const :tag "Display in the current window, select buffer"
|
|
373 :value semibully)
|
|
374 (const :tag "Display in another window, select buffer"
|
|
375 :value aggressive)
|
|
376 (const :tag "Display in another window, but do not select it"
|
|
377 :value friendly)
|
|
378 (const :tag "Do not display page, but show a message and beep"
|
|
379 :value polite)
|
|
380 (const :tag "Do not display page, but show a message (no beep)"
|
|
381 :value quiet)
|
|
382 (const :tag "Do not indicate that the page has been retrieved"
|
|
383 :value meek)))
|
|
384
|
|
385 (defcustom w3-popup-menu-on-mouse-3 t
|
|
386 "*Non-nil value means W3 should provide context-sensitive menus on mouse-3.
|
|
387 A nil value means W3 should not change the binding of mouse-3."
|
|
388 :group 'w3-display
|
|
389 :type 'boolean)
|
|
390
|
|
391 (defcustom w3-print-command "lpr -h -d"
|
|
392 "*Print command for dvi files.
|
|
393 This is usually 'lpr -h -d' to send it to a postscript printer, but you can set
|
|
394 it up so that it is any command that takes a dvi file as its last argument."
|
|
395 :group 'w3-printing
|
|
396 :type 'string)
|
|
397
|
|
398 (defcustom w3-reuse-buffers 'yes
|
|
399 "What to do when following a link will re-fetch a document that has
|
|
400 already been fetched into a W3 buffer. Possible values are: nil,
|
|
401 'yes, and 'no. Nil means ask the user if we should reuse the buffer.
|
|
402 A value of 'yes means assume the user wants us to reuse the buffer.
|
|
403 A value of 'no means assume the user wants us to re-fetch the document.
|
|
404
|
|
405 This will also accept:
|
|
406 'no ==> always reload
|
|
407 'yes ==> always reuse
|
|
408 'ask ==> always ask"
|
|
409 :group 'w3-display
|
|
410 :type '(choice (const :tag "Always reload" :value no)
|
|
411 (const :tag "Always reuse" :value yes)
|
|
412 (const :tag "Always ask" :value ask)))
|
|
413
|
|
414 (defcustom w3-right-margin 2
|
|
415 "*Default right margin for Emacs-W3 buffers.
|
|
416 This amount is subtracted from (window-width) for each new WWW buffer
|
|
417 and used as the new fill-column."
|
|
418 :group 'w3-display
|
|
419 :type 'integer)
|
|
420
|
|
421 (defcustom w3-maximum-line-length nil
|
|
422 "*Maximum length of a line.
|
|
423 If nil, then lines can extend all the way to the window margin."
|
|
424 :group 'w3-display
|
|
425 :type 'integer)
|
|
426
|
|
427 (defcustom w3-track-mouse t
|
|
428 "*Whether to track the mouse and message the url under the mouse."
|
|
429 :group 'w3-display
|
|
430 :type 'boolean)
|
|
431
|
|
432 (defcustom w3-honor-stylesheets t
|
|
433 "*Whether to let a document specify a CSS stylesheet."
|
|
434 :group 'w3-display
|
|
435 :type 'boolean)
|
|
436
|
|
437 (defcustom w3-user-colors-take-precedence nil
|
|
438 "*Whether to let a document define certain colors about itself.
|
|
439 Like foreground and background colors and pixmaps, color of links and
|
|
440 visited links, etc."
|
|
441 :group 'w3-display
|
|
442 :type 'boolean)
|
|
443
|
|
444 ;;; Hook Variables
|
|
445 (defcustom w3-load-hook nil
|
|
446 "*Hooks to be run after loading w3."
|
|
447 :group 'w3-hooks
|
|
448 :type 'hook)
|
|
449
|
|
450 (defcustom w3-mode-hook nil
|
|
451 "*Hooks to be run after entering w3-mode."
|
|
452 :group 'w3-hooks
|
|
453 :type 'hook)
|
|
454
|
|
455 (defcustom w3-source-file-hook nil
|
|
456 "*Hooks to be run after getting document source."
|
|
457 :group 'w3-hooks
|
|
458 :type 'hook)
|
|
459
|
|
460 (provide 'w3-cus)
|