32
|
1 ;;; w3-cus.el --- Customization support for Emacs-W3
|
|
2 ;; Author: wmperry
|
36
|
3 ;; Created: 1997/03/14 21:35:54
|
|
4 ;; Version: 1.4
|
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!
|
36
|
35 (defmacro defgroup (&rest args)
|
|
36 nil)
|
32
|
37 (defmacro defcustom (var value doc &rest args)
|
|
38 (` (defvar (, var) (, value) (, doc))))))
|
|
39
|
36
|
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
|
|
105 (defcustom w3-documentation-root "http://www.cs.indiana.edu/elisp/w3/docs/"
|
|
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
|
|
117 "*Fetch frames - not optimal."
|
|
118 :group 'w3-display
|
|
119 :type 'boolean)
|
|
120
|
|
121 (defcustom w3-do-incremental-display nil
|
|
122 "*Whether to do incremental display of pages or not."
|
|
123 :group 'w3-display
|
|
124 :type 'boolean)
|
|
125
|
|
126 (defcustom w3-echo-link '(title url text name)
|
|
127 "*Whether to display the URL of a link when tabbing through links.
|
|
128 Value is a list of one or more of the following symbols:
|
|
129
|
|
130 url == url of the target
|
|
131 text == text of the link
|
|
132 title == title attribute of the link
|
|
133 name == name or id attribute of the link
|
|
134
|
|
135 If none of the information is available, nothing will be shown for the link
|
|
136 in menus, etc."
|
|
137 :group 'w3-display
|
|
138 :type '(set (const :tag "URL" :value url)
|
|
139 (const :tag "Link Text" :value text)
|
|
140 (const :tag "Title of the link as defined in the HTML tag"
|
|
141 :value title)
|
|
142 (const :tag "Name of the link as defined in the HTML tag"
|
|
143 :value name)))
|
|
144
|
|
145 (defcustom w3-horizontal-rule-char ?-
|
|
146 "*The character to use to create a horizontal rule.
|
|
147 Must be the character's code, not a string. This character is
|
|
148 replicated across the screen to create a division."
|
|
149 :group 'w3-display
|
|
150 :type 'character)
|
|
151
|
|
152 (defcustom w3-defined-link-types
|
|
153 ;; This is the HTML3.0 list (downcased) plus "made".
|
|
154 '("previous" "next" "up" "down" "home" "toc" "index" "glossary"
|
|
155 "copyright" "bookmark" "help" "made")
|
|
156 "A list of the (lower-case) names which have special significance
|
|
157 as the values of REL or REV attributes of <link> elements. They will
|
|
158 be presented on the toolbar or the links menu, for instance."
|
|
159 :group 'w3-display
|
|
160 :type '(repeat string))
|
|
161
|
|
162 ;;; Parsing related variables
|
|
163 (defcustom w3-debug-html nil
|
|
164 "*Whether to gripe about bad HTML or not."
|
|
165 :group 'w3-parsing
|
|
166 :type '(choice (const :tag "HTML Errors" :value t)
|
|
167 (const :tag "Errors and stylistic issues" :value style)
|
|
168 (const :tag "None" :value nil)))
|
|
169
|
|
170 (defcustom w3-debug-buffer "*HTML Debug*"
|
|
171 "*Name of buffer to store debugging information in."
|
|
172 :group 'w3-parsing
|
|
173 :type 'string)
|
|
174
|
|
175 ;;; Image related variables
|
|
176 (defcustom w3-auto-image-alt t
|
|
177 "*Whether emacs-w3 should create an alt attribute for an image that
|
|
178 is missing it.
|
|
179 If nil, emacs-w3 will not automatically create an ALT attribute.
|
|
180 If t, the alt attribute will be [IMAGE(nameofimage)]
|
|
181 If a string, it should be a string suitable for running through format,
|
|
182 with only one %s, which will be replaced with just the filename of the
|
|
183 graphic that is not loaded."
|
|
184 :group 'w3-images
|
|
185 :type '(choice (const :tag "None" :value nil)
|
|
186 (const :tag "Default" :value t)
|
|
187 string))
|
|
188
|
|
189 (defcustom w3-icon-directory "http://cs.indiana.edu/elisp/w3/icons/"
|
|
190 "*Where to find standard icons. Must end in a /!"
|
|
191 :group 'w3-images
|
|
192 :type 'string)
|
|
193
|
|
194 (defcustom w3-icon-format 'gif
|
|
195 "*Image format the default icons are expected to be in.
|
|
196 This is a symbol, string or nil, specifing what file extension to use.
|
|
197 If nil, then no file extension is used."
|
|
198 :group 'w3-images
|
|
199 :type '(choice (const :tag "GIF Image" :value gif)
|
|
200 (const :tag "XPM Image" :value xpm)
|
|
201 (const :tag "XBM Image" :value xbm)
|
|
202 (const :tag "Let the server decide" :value nil)
|
|
203 (string :tag "Other")))
|
|
204
|
|
205 (defcustom w3-delay-image-loads nil
|
|
206 "*Whether to delay image loading, or automatically retrieve them."
|
|
207 :group 'w3-images
|
|
208 :type 'boolean)
|
|
209
|
|
210 (defcustom w3-image-mappings
|
|
211 '(
|
|
212 ("image/x-xbitmap" . xbm)
|
|
213 ("image/xbitmap" . xbm)
|
|
214 ("image/xbm" . xbm)
|
|
215 ("image/jpeg" . jpeg)
|
|
216 ("image/gif" . gif)
|
|
217 ("image/png" . png)
|
|
218 ("image/x-fax" . g3fax)
|
|
219 ("image/x-raster" . rast)
|
|
220 ("image/windowdump" . xwd)
|
|
221 ("image/x-icon" . icon)
|
|
222 ("image/portable-graymap" . pgm)
|
|
223 ("image/portable-pixmap" . ppm)
|
|
224 ("image/x-pixmap" . xpm)
|
|
225 ("image/x-xpixmap" . xpm)
|
|
226 ("image/pict" . pict)
|
|
227 ("image/x-rgb" . sgi)
|
|
228 ("image/x-sgi" . sgi)
|
|
229 ("image/x-macpaint" . macpt)
|
|
230 ("image/x-targa" . tga)
|
|
231 ("image/tiff" . tiff)
|
|
232 )
|
|
233 "*How to map MIME types to image types for the `image' package.
|
|
234 Each entry is a cons cell of MIME types and image-type symbols."
|
|
235 :group 'w3-images
|
|
236 :type '(repeat cons))
|
|
237
|
|
238 ;;; Printing variables
|
|
239 (defcustom w3-latex-docstyle "{article}"
|
|
240 "*The documentstyle to use when printing or mailing files as LaTeX.
|
|
241 Good defaults are: {article}, [psfig,twocolumn]{article}, etc."
|
|
242 :group 'w3-printing
|
|
243 :type 'string)
|
|
244
|
|
245 (defcustom w3-latex-print-links nil
|
|
246 "*If non-nil, prints the URLs of hypertext links as endnotes at the end of
|
|
247 the document. If `footnote', prints the URL's as footnotes on a page."
|
|
248 :group 'w3-printing
|
|
249 :type '(choice (const :tag "As endnotes" :value t)
|
|
250 (const :tag "As footnotes" :value footnote)
|
|
251 (const :tag "Do not print" :value nil)))
|
|
252
|
|
253 (defcustom w3-latex-use-latex2e nil
|
|
254 "*If non-nil, configures LaTeX parser to use LaTeX2e syntax. A `nil'
|
|
255 value indicates that LaTeX 2.0.9 compatibility will be used instead."
|
|
256 :group 'w3-printing
|
|
257 :type 'boolean)
|
|
258
|
|
259 (defcustom w3-latex-packages nil
|
|
260 "*List of LaTeX packages to include when converting HTML to LaTeX.
|
|
261 Currently this is only used if `w3-latex-use-latex2e' is non-nil."
|
|
262 :group 'w3-printing
|
|
263 :type '(repeat string))
|
|
264
|
|
265 (defcustom w3-latex-use-maketitle nil
|
|
266 "*Non-nil makes the LaTeX parser use real LaTeX title pages."
|
|
267 :group 'w3-printing
|
|
268 :type 'boolean)
|
|
269
|
|
270 ;;; Menus
|
|
271 (defcustom w3-max-menu-length 35
|
|
272 "*The maximum length of a pulldown menu before it will be split into
|
|
273 smaller chunks, with the first part as a submenu, followed by the rest
|
|
274 of the menu."
|
|
275 :group 'w3-menus
|
|
276 :type 'integer)
|
|
277
|
|
278 (defcustom w3-max-menu-width 40
|
|
279 "*The maximum width of a pulldown menu choice."
|
|
280 :group 'w3-menus
|
|
281 :type 'integer)
|
|
282
|
|
283 ;;; Advanced stuff
|
|
284 (defcustom w3-modeline-format
|
|
285 '(" " ("W3"
|
|
286 (w3-netscape-emulation-minor-mode
|
|
287 " (NS)")
|
|
288 (w3-lynx-emulation-minor-mode
|
|
289 " (Lynx)")
|
|
290 ": "
|
|
291 (40 (-40 "%b"))
|
|
292 " "
|
|
293 (w3-current-isindex "[Searchable] ")
|
|
294 "%p" " " global-mode-string))
|
|
295 "*The modeline format string when in w3 mode"
|
|
296 :group 'w3-advanced
|
|
297 :type 'list)
|
|
298
|
|
299 (defcustom w3-netscape-compatible-comments t
|
|
300 "*Whether to honor netscape-style <! > comments.
|
|
301 Ye gods I wish I could turn this off by default."
|
|
302 :group 'w3-parsing
|
|
303 :type 'boolean)
|
|
304
|
|
305 (defcustom w3-notify 'semibully
|
|
306 "*Selects the behavior when w3 page is ready.
|
|
307 This variable may have one of the following values:
|
|
308
|
|
309 newframe -- put the w3 page in its own frame
|
|
310 bully -- make the w3 page the current buffer and only window
|
|
311 semibully -- make the w3 page the current buffer in the same window
|
|
312 aggressive -- make the w3 page the current buffer in the other window
|
|
313 friendly -- display w3page in other window but don't make current
|
|
314 polite -- don't display w3 page, but prints message when ready (beeps)
|
|
315 quiet -- like `polite', but don't beep
|
|
316 meek -- make no indication that page is ready
|
|
317
|
|
318 Any other value of `w3-notify' is equivalent to `meek'."
|
|
319 :group 'w3-display
|
|
320 :type '(choice (const :tag "Display in a new frame"
|
|
321 :value newframe)
|
|
322 (const :tag "Display in the current window, select buffer, and kill other windows"
|
|
323 :value bully)
|
|
324 (const :tag "Display in the current window, select buffer"
|
|
325 :value semibully)
|
|
326 (const :tag "Display in another window, select buffer"
|
|
327 :value aggressive)
|
|
328 (const :tag "Display in another window, but do not select it"
|
|
329 :value friendly)
|
|
330 (const :tag "Do not display page, but show a message and beep"
|
|
331 :value polite)
|
|
332 (const :tag "Do not display page, but show a message (no beep)"
|
|
333 :value quiet)
|
|
334 (const :tag "Do not indicate that the page has been retrieved"
|
|
335 :value meek)))
|
|
336
|
|
337 (defcustom w3-popup-menu-on-mouse-3 t
|
|
338 "*Non-nil value means W3 should provide context-sensitive menus on mouse-3.
|
|
339 A nil value means W3 should not change the binding of mouse-3."
|
|
340 :group 'w3-display
|
|
341 :type 'boolean)
|
|
342
|
|
343 (defcustom w3-print-command "lpr -h -d"
|
|
344 "*Print command for dvi files.
|
|
345 This is usually 'lpr -h -d' to send it to a postscript printer, but you can set
|
|
346 it up so that it is any command that takes a dvi file as its last argument."
|
|
347 :group 'w3-printing
|
|
348 :type 'string)
|
|
349
|
|
350 (defcustom w3-reuse-buffers 'yes
|
|
351 "What to do when following a link will re-fetch a document that has
|
|
352 already been fetched into a W3 buffer. Possible values are: nil,
|
|
353 'yes, and 'no. Nil means ask the user if we should reuse the buffer.
|
|
354 A value of 'yes means assume the user wants us to reuse the buffer.
|
|
355 A value of 'no means assume the user wants us to re-fetch the document.
|
|
356
|
|
357 This will also accept:
|
|
358 'no ==> always reload
|
|
359 'yes ==> always reuse
|
|
360 'ask ==> always ask"
|
|
361 :group 'w3-display
|
|
362 :type '(choice (const :tag "Always reload" :value no)
|
|
363 (const :tag "Always reuse" :value yes)
|
|
364 (const :tag "Always ask" :value ask)))
|
|
365
|
|
366 (defcustom w3-right-margin 2
|
|
367 "*Default right margin for Emacs-W3 buffers.
|
|
368 This amount is subtracted from (window-width) for each new WWW buffer
|
|
369 and used as the new fill-column."
|
|
370 :group 'w3-display
|
|
371 :type 'integer)
|
|
372
|
|
373 (defcustom w3-maximum-line-length nil
|
|
374 "*Maximum length of a line.
|
|
375 If nil, then lines can extend all the way to the window margin."
|
|
376 :group 'w3-display
|
|
377 :type 'integer)
|
|
378
|
|
379 (defcustom w3-track-mouse t
|
|
380 "*Whether to track the mouse and message the url under the mouse."
|
|
381 :group 'w3-display
|
|
382 :type 'boolean)
|
|
383
|
|
384 (defcustom w3-honor-stylesheets t
|
|
385 "*Whether to let a document specify a CSS stylesheet."
|
|
386 :group 'w3-display
|
|
387 :type 'boolean)
|
|
388
|
|
389 (defcustom w3-user-colors-take-precedence nil
|
|
390 "*Whether to let a document define certain colors about itself.
|
|
391 Like foreground and background colors and pixmaps, color of links and
|
|
392 visited links, etc."
|
|
393 :group 'w3-display
|
|
394 :type 'boolean)
|
|
395
|
|
396 ;;; Hook Variables
|
|
397 (defcustom w3-load-hook nil
|
|
398 "*Hooks to be run after loading w3."
|
|
399 :group 'w3-hooks
|
|
400 :type 'hook)
|
|
401
|
|
402 (defcustom w3-mode-hook nil
|
|
403 "*Hooks to be run after entering w3-mode."
|
|
404 :group 'w3-hooks
|
|
405 :type 'hook)
|
|
406
|
|
407 (defcustom w3-source-file-hook nil
|
|
408 "*Hooks to be run after getting document source."
|
|
409 :group 'w3-hooks
|
|
410 :type 'hook)
|
|
411
|
|
412 (provide 'w3-cus)
|