comparison lisp/w3/w3-cus.el @ 32:e04119814345 r19-15b99

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