[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: W3 And/or W3M Browsers



    I don't have W3 or W3M on my own emacs.  Where can I obtain these
    and is it my understanding that W3M is the better of the two?

W3M mode is quicker than W3 mode since W3M runs an external process
but W3 does everything in Emacs Lisp.  I prefer W3M mode.

However, as far as I know, Emacspeak provides better support for W3.
(I don't know whether Emacspeak provides any support for W3M except
the generic.)

Note that W3 mode requires both url and w3.

The text after the following instructions on checkout and building are
from my .emacs file settings.

Both the following CVS check outs are in a shell because that is how
my notes were written.  But the build for W3 is by evaluating Emacs
Lisp expressions.  The build and install for W3M is in a shell.  W3
mode does not need a separate install, 

I use the backslash-carriage-return method to restrict the length of
lines to less than 80 characters.

I do the check outs and builds as a regular user, but the install for
W3M mode as the root user.

Here is info on how to check out W3 mode using a shell and build it
using Emacs:

    this works as of 2002 Jan 17:

    as user `bob' in a shell, CVS checkout

        cd /usr/local/src
        cvs -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/w3 co w3
        cvs -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/url co url

    as user `bob' in Emacs, the build

         (progn
           (cd "/usr/local/src/url")
           (compile "./configure --with-gnus=/usr/local/src/gnus && make"))

    ;; wait for the previous compilation to end
         (progn
           (cd "/usr/local/src/w3")
           (compile "./configure --with-emacs \
                    --with-url=/usr/local/src/url/lisp/ \
                    --with-gnus=/usr/local/src/gnus \
                    --prefix=/usr/local/src/w3 \
                    --exec-prefix=/usr/local/src/w3 \
                    && make"))

Here is info on how to check out W3M mode from CVS and build it, in
both situations using a shell:

    this works as of 2003 Sep 17

    as user `bob' in a shell, CVS checkout

        pushd /usr/local/src
        cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot login
            # No password is set.  Just hit Enter/Return key.
        cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m


    as user `bob' in a shell, the build, which is in a shell

        pushd /usr/local/src/emacs-w3m
        autoconf &&   \
          ./configure \
          --with-addpath=/usr/local/share/emacs/site-lisp/gnus && make
        popd


    as user `root' in a shell, the install, which is in a shell

        pushd /usr/local/src/emacs-w3m
        make install && make install-icons
        popd


    After the build, the installed CVS installation goes into
                            /usr/local/share/emacs/site-lisp/w3m/
    but icon directory is   /usr/local/share/emacs/21.3.50/etc/w3m/icons/
    or                      /usr/local/src/emacs-w3m/icons/

    On 2003 May 1, I had to remove references to Japanese docs in

        /usr/local/src/emacs-w3m/doc/

    I did not do this on 2003 Sep 17; I did do this again on 2003 Oct 3


Here are two sections of my .emacs file, the first for W3 Mode and the
second for W3M mode.  You will need to edit this for your own setup.

;;;;;;;;;;;;;;;; W3 Mode ;;;;;;;;;;;;;;;;
;;  2002 Oct  3

;; ------------ start section with local file names ------------

;; 2001 Nov 27   for w3-4.0pre.47
(setq load-path  (cons "/usr/local/src/w3/lisp"  load-path))
(setq load-path  (cons "/usr/local/src/url"  load-path))
(setq load-path  (cons "/usr/local/src/url/lisp"  load-path))

;;; for Emacs 21, added the following autoload:
(require 'w3-auto)

;;; Emacs/W3 Configuration

;; for Emacs version 21
(setq max-lisp-eval-depth 10000)
(setq max-specpdl-size 10000)

;; Remainder set by Bob by hand.  Should not change from version to version.

;; Use Rattlesnake Home Page for home page ...
;; Note html address format.  You need the *full* pathname.
(setq w3-default-homepage "file:/usr/local/net/rattlesnake-home-page.html")

;; The directory where cache files should be stored;
;; defaults to "~/.w3/cache/"
(setq url-cache-directory "/var/url/")

;; Name by which known to PGP and/or PEM entities, and what is sent to
;; HTTP/1.0 servers as the FROM field.
;; (setq url-pgp/pem-entity "bob@rattlesnake.com")

;; Specify my own stylesheet
(setq w3-default-stylesheet "~/.w3/stylesheet")

;; ------------ end section with local file names ------------

;; This appears to turn off all cookies
(setq url-cookie-untrusted-urls '(".*"))

;; This handles:  type application/x-httpd-php3
(setq url-mime-accept-string "*")

;; Use ps-print for printing.
(setq w3-use-ps-print nil)

;; Show hyperlinks to frames but do not fetch them
(setq w3-display-frames 'as-nil)

;; Set amount of space to leave on right margin of WWW buffers.
;; (default is 2)
(setq w3-right-margin 6)

;; You have a choice of using regular Emacs `dired' rather than W3
;; formatting; this loses hypertext properties but gives you a nicer
;; format.  An advantage of the hypertext is you can easily view a gif
;; by clicking on it.
;; If nil, w3 uses dired
;; If t,   w3 converts to hypertext.
;;(setq url-use-hypertext-dired nil)
(setq url-use-hypertext-dired t)

;; newframe   -- put the w3 page in its own frame
;; bully      -- make the w3 page the current buffer and only window
;; semibully  -- make the w3 page the current buffer in the same window
;; aggressive -- make the w3 page the current buffer in the other window
;; friendly   -- display  w3page in other window but don't make current
;; polite     -- don't display w3 page, but prints message when ready (beeps)
;; quiet      -- like `polite', but don't beep
;; meek       -- make no indication that page is ready
;;  the default is already: (setq  w3-notify 'semibully)

;; Automatically save everything...
;; But works only if in synchronous mode,
;; not when downloading in background!
(setq url-automatic-caching t)

;; 24 May 1998, William Perry says `Do not use
;; url-cache-create-filename-human-readable for this.
;; It is a can of worms.'  (Makes reading RISKS impossible.)
(setq url-cache-creation-function
      'url-cache-create-filename-using-md5)

(setq w3-latex-use-latex2e t)

;; Save a document to the local disk
;; as HTML Source, Formatted Text, LaTeX Source, or Binary.
;; Make an empty keymap if none exists
(if (not (boundp 'w3-mode-map))
    (setq w3-mode-map (make-sparse-keymap)))
(define-key w3-mode-map "\C-c\C-s" 'w3-save-as)

(defun w3-toggle-standalone ()
  "Toggle the value of url-standalone-mode.
When t, this means work without net access by using the cache."
  (interactive)
  (if url-standalone-mode
      (progn
        (setq url-standalone-mode nil)
        (message
         "W3 Standalone mode turned OFF \(value is nil\): requires working Web access."))
    (setq url-standalone-mode t)
    (message "W3 Standalone mode turned ON \(value is t\); W3 uses cache.")))

;; Make an empty keymap if none exists
(if (not (boundp 'w3-mode-map))
    (setq w3-mode-map (make-sparse-keymap)))
(define-key w3-mode-map "\C-c\C-c" 'w3-toggle-standalone)

;; Keep a history
(setq url-keep-history t)

;; Do not load images unless you ask by
;; using the command `w3-load-delayed-images'
(setq w3-delay-image-loads t)
(setq w3-delay-mpeg-loads t)

;; Display pages incrementally.
(setq w3-do-incremental-display t)

;; Show a running total of bytes transferred.
;; If t these can cause a large hit
;; if using a terminal with a slowmodem.
;; (Actually, not a problem, default is t)
; (setq url-show-status nil)

;; Set how much information you want sent to place you visit.
;; none     -- Send all information
;; low      -- Don't send the last location
;; high     -- Don't send the email address or last location
;; paranoid -- Don't send anything
;; evaluate following to update: (url-setup-privacy-info)
(setq-default url-privacy-level (quote paranoid))

;; Tell about cookies
(setq-default url-cookie-confirmation t)

;; If non-nil, provide a menu interface.
;; A value of 1 causes W3 to install a "W3" item in the Emacs menubar.
;; Otherwise, a W3-specific list
;; (setq w3-use-menus 1)

;; Amount to temporarily multiply gc-cons-threshold when parsing HTML.
(setq w3-gc-cons-threshold-multiplier 2)

;; Settings Options

;; These were automatically saved using the `save-options' command for
;; version 2.3.28 on 29 January 1996.

  (setq-default w3-color-use-reducing t)
  (setq-default w3-color-filter (quote ppmdither))
  (setq-default w3-dump-to-disk nil)
  (setq-default url-use-hypertext-gopher t)
  (setq-default url-proxy-services nil)
  (setq-default w3-honor-stylesheets t)

;; End of W3  Settings



;;;;;;;;;;;;;;;; w3m ;;;;;;;;;;;;;;;;

;; The following shell-command must be done as user `root', hence the `sudo'.
;; I don't remember why I put this in my .emacs file; probably it is
;; so that W3M CVS works with my GNU Emacs CVS.
;; You may have to link to some other directory; I do not know.
;; Or maybe you will not need this.
(shell-command
  "sudo ln -s /usr/local/src/emacs-w3m/ /usr/local/share/emacs/21.3.50/etc/w3m")


(setq load-path
      (append (list "/usr/local/share/emacs/site-lisp/w3m") load-path))

;; You will want to change your home page
(setq w3m-home-page "file://u/net/rattlesnake-home-page.html")

;; You may not care about an icon directory
(setq w3m-icon-directory "/usr/local/share/emacs/21.3.50/etc/w3m/icons/")

(load "w3m")

(setq w3m-content-type-alist
      '(
        ("text/html" "\\.s?html?$" browse-url-mozilla)
        ;; ("text/html" "\\.s?html?$" browse-url-galeon)
        ("text/plain" "\\.\\(txt\\|tex\\|el\\)" nil)
        ("application/postscript" "\\.\\(ps\\|eps\\)$" ("gv" file))
        ("application/pdf" "\\.pdf$" ("xpdf" file))
        ;; You many not care about the following image setting
        ("image/jpeg" "\\.jpe?g$" ("/usr/bin/display" file))
        ("image/png" "\\.png$" ("/usr/bin/display" file))
        ("image/gif" "\\.gif$" ("/usr/bin/display" file))
        ("image/tiff" "\\.tif?f$" ("/usr/bin/display" file))
        ("image/x-xwd" "\\.xwd$" ("/usr/bin/display" file))
        ("image/x-xbm" "\\.xbm$" ("/usr/bin/display" file))
        ("image/x-xpm" "\\.xpm$" ("/usr/bin/display" file))
        ("image/x-bmp" "\\.bmp$" ("/usr/bin/display" file))
        ("video/mpeg" "\\.mpe?g$" ("mplayer" file))
        ("video/quicktime" "\\.mov$" ("xmovie" file))))

(define-key w3m-mode-map [up] 'scroll-backward-one-line)
(define-key w3m-mode-map [down] 'scroll-forward-one-line)

(define-key w3m-mode-map [M-up] 'w3m-previous-anchor)
(define-key w3m-mode-map [M-down] 'w3m-next-anchor)

;; Show the URL in the echo area
(setq show-help-function 'message)

;; When using Emacspeak, stop `w3m-next-anchor' from announcing the
;; URI of each link whenever the tab key is pressed
(remove-hook 'w3m-after-cursor-move-hook 'w3m-print-this-url)

;; End of W3M Settings


-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    As I slowly update it,                     bob@rattlesnake.com
        I rewrite a "What's New" segment for   http://www.rattlesnake.com


-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"