(add-to-list 'load-path "/usr/share/emacs21/site-lisp/w3-el") (add-to-list 'load-path "/usr/share/emacs21/site-lisp/url") (when (load "w3" t) (defun my-w3-file-prepare-hook () (make-local-variable 'w3-debug-html) (setq w3-debug-html (if (or (string= (url-type url-current-object) "file") (string-match ".*\\.some\\.domain\\.name" (or (url-host url-current-object) ""))) 'style nil))) (add-hook 'w3-file-prepare-hook 'my-w3-file-prepare-hook) (defun w3-next-document () (interactive) (let ((link (or (let ((rel (assq 'rel w3-current-links))) (and rel (assoc "next" rel))) (let ((rev (assq 'rev w3-current-links))) (and rev (or (assoc "previous" rev) (assoc "prev" rev)))))) href) (and link (setq link (cdr link))) (while (and link (null href)) (setq href (plist-get (car link) 'href)) (setq link (cdr link))) (if href (w3-fetch href) (error "No NEXT document")))) (define-key w3-mode-map (read-kbd-macro "M-SPC") 'w3-next-document) (defun w3-prev-document () (interactive) (let ((link (or (let ((rel (assq 'rel w3-current-links))) (and rel (or (assoc "previous" rel) (assoc "prev" rel)))) (let ((rev (assq 'rev w3-current-links))) (and rev (assoc "next" rev))))) href) (and link (setq link (cdr link))) (while (and link (null href)) (setq href (plist-get (car link) 'href)) (setq link (cdr link))) (if href (w3-fetch href) (error "No PREVIOUS document")))) (define-key w3-mode-map (read-kbd-macro "M-DEL") 'w3-prev-document) (setq ;;* Whether to let a document define certain fonts. w3-user-fonts-take-precedence t ;;* Whether to let a document define certain colors about itself. ;; Like foreground and background colors and pixmaps, color of links ;; and visited links, etc. w3-user-colors-take-precedence t ;;* Whether to let a document specify a CSS stylesheet. w3-honor-stylesheets nil ;;* Use terminal graphics characters for drawing tables and rules if available. w3-use-terminal-characters nil ;;* Use terminal graphics characters for tables and rules even on a tty. w3-use-terminal-characters-on-tty nil ;;* The character to use to create a horizontal rule. ;; Must be the character's code, not a string. This character is ;; replicated across the screen to create a division. If nil W3 will ;; use a terminal graphic character if possible. w3-horizontal-rule-char 45 ;;* Fetch frames - can be: ;; nil no frame display whatsoever ;; 'as-links display frame hyperlinks, but do not fetch them ;; 'ask display frame hyperlinks and ask whether to fetch them ;; t display frame hyperlinks and fetch them. w3-display-frames nil ) )