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

Can't load w3m when browse-url-browser-function had been set before



It is if possible, please redo after starting emacs-w3m.
================================================================
This bug report will be sent to the emacs-w3m development team,
 not to your local site managers!!
Please write in simple English, because the emacs-w3m developers
aren't good at English reading. ;-)

Please describe as succinctly as possible:
	- What happened.
	- What you thought should have happened.
	- Precisely what you were doing at the time.

Please also include any Lisp back-traces that you may have.
================================================================
Dear Bug Team!

Consider the following definitions in a user's init file (in this
order):

(add-to-list 'load-path "/path/to/w3m/dir/")

(setq browse-url-browser-function
      #'my-w3m-browse-url-new-session)

(require 'w3m)

(defun my-w3m-browse-url-new-session (url &rest _)
  (code ...))

When you evaluate this from emacs -Q in this order, you get this error:
Debugger entered--Lisp error: (wrong-type-argument listp my-w3m-browse-url-new-session)
  caar(my-w3m-browse-url-new-session)
  (string-match (caar alist) "index.html")
  (if (string-match (caar alist) "index.html") (progn (throw (quote browser) (cdar alist))))
  (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist)))
  (while alist (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist))) (setq alist (cdr alist)))
  (let ((alist browse-url-browser-function)) (while alist (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist))) (setq alist (cdr alist))) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default)
  (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist))) (setq alist (cdr alist))) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default))
  (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist))) (setq alist (cdr alist))) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default)))
  (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when (string-match (caar alist) "index.html") (throw (quote browser) (cdar alist))) (setq alist (cdr alist))) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default))))
  (let ((default (cond ((and (memq system-type (quote ...)) (fboundp (quote browse-url-default-windows-browser))) (quote browse-url-default-windows-browser)) ((and (memq system-type (quote ...)) (fboundp (quote browse-url-default-macosx-browser))) (quote browse-url-default-macosx-browser)) ((fboundp (quote browse-url-default-browser)) (quote browse-url-default-browser)) ((fboundp (quote browse-url-netscape)) (quote browse-url-netscape))))) (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when (string-match ... "index.html") (throw ... ...)) (setq alist (cdr alist))) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default)))))
  (progn (let ((default (cond ((and (memq system-type ...) (fboundp ...)) (quote browse-url-default-windows-browser)) ((and (memq system-type ...) (fboundp ...)) (quote browse-url-default-macosx-browser)) ((fboundp (quote browse-url-default-browser)) (quote browse-url-default-browser)) ((fboundp (quote browse-url-netscape)) (quote browse-url-netscape))))) (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when ... ...) (setq alist ...)) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default))))))
  (if (condition-case nil (require (quote browse-url)) (error nil)) (progn (let ((default (cond ((and ... ...) (quote browse-url-default-windows-browser)) ((and ... ...) (quote browse-url-default-macosx-browser)) ((fboundp ...) (quote browse-url-default-browser)) ((fboundp ...) (quote browse-url-netscape))))) (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let (...) (while alist ... ...) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default)))))))
  (when (condition-case nil (require (quote browse-url)) (error nil)) (let ((default (cond ((and (memq system-type ...) (fboundp ...)) (quote browse-url-default-windows-browser)) ((and (memq system-type ...) (fboundp ...)) (quote browse-url-default-macosx-browser)) ((fboundp (quote browse-url-default-browser)) (quote browse-url-default-browser)) ((fboundp (quote browse-url-netscape)) (quote browse-url-netscape))))) (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ((alist browse-url-browser-function)) (while alist (when ... ...) (setq alist ...)) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default))))))
  (or (when (condition-case nil (require (quote browse-url)) (error nil)) (let ((default (cond ((and ... ...) (quote browse-url-default-windows-browser)) ((and ... ...) (quote browse-url-default-macosx-browser)) ((fboundp ...) (quote browse-url-default-browser)) ((fboundp ...) (quote browse-url-netscape))))) (if (or (not (boundp (quote browse-url-browser-function))) (eq (quote w3m-browse-url) (symbol-value (quote browse-url-browser-function)))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let (...) (while alist ... ...) (message "Found no html handler in browse-url-browser-function to put in w3m-content-type-alist.") default)))))) (when (w3m-which-command "netscape") (list "netscape" (quote url))))
  (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil (require (quote browse-url)) (error nil)) (let ((default (cond (... ...) (... ...) (... ...) (... ...)))) (if (or (not (boundp ...)) (eq (quote w3m-browse-url) (symbol-value ...))) default (if (functionp browse-url-browser-function) (symbol-value (quote browse-url-browser-function)) (catch (quote browser) (let ... ... ... default)))))) (when (w3m-which-command "netscape") (list "netscape" (quote url)))))
  (let* ((fiber-viewer (when (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (list "fiber.exe" "-s" (quote file)))) (external-browser (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil (require ...) (error nil)) (let (...) (if ... default ...))) (when (w3m-which-command "netscape") (list "netscape" (quote url)))))) (image-viewer (or fiber-viewer (when w3m-image-viewer (list w3m-image-viewer (quote file))))) (video-viewer (or fiber-viewer (when (w3m-which-command "mpeg_play") (list "mpeg_play" (quote file))))) (dvi-viewer (or fiber-viewer (cond ((w3m-which-command "xdvi") (list "xdvi" (quote file))) ((w3m-which-command "dvitty") (list "dvitty" (quote file)))))) (ps-viewer (or fiber-viewer (cond ((w3m-which-command "gv") (list "gv" (quote file))) ((w3m-which-command "gs") (list "gs" (quote file)))))) (pdf-viewer (or fiber-viewer (cond ((w3m-which-command "xpdf") (list "xpdf" (quote file))) ((w3m-which-command "acroread") (list "acroread" (quote file))))))) (\` (("text/plain" "\\.\\(?:txt\\|tex\\|el\\)\\'" nil nil) ("text/html" "\\.s?html?\\'" (\, external-browser) nil) ("text/sgml" "\\.sgml?\\'" nil "text/plain") ("text/xml" "\\.xml\\'" nil "text/plain") ("image/jpeg" "\\.jpe?g\\'" (\, image-viewer) nil) ("image/png" "\\.png\\'" (\, image-viewer) nil) ("image/gif" "\\.gif\\'" (\, image-viewer) nil) ("image/tiff" "\\.tif?f\\'" (\, image-viewer) nil) ("image/x-xwd" "\\.xwd\\'" (\, image-viewer) nil) ("image/x-xbm" "\\.xbm\\'" (\, image-viewer) nil) ("image/x-xpm" "\\.xpm\\'" (\, image-viewer) nil) ("image/x-bmp" "\\.bmp\\'" (\, image-viewer) nil) ("video/mpeg" "\\.mpe?g\\'" (\, video-viewer) nil) ("video/quicktime" "\\.mov\\'" (\, video-viewer) nil) ("application/dvi" "\\.dvi\\'" (\, dvi-viewer) nil) ("application/postscript" "\\.e?ps\\'" (\, ps-viewer) nil) ("application/pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/x-pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/xml" "\\.xml\\'" nil w3m-detect-xml-type) ("application/rdf+xml" "\\.rdf\\'" nil "text/plain") ("application/rss+xml" "\\.rss\\'" nil "text/plain") ("application/xhtml+xml" nil nil "text/html"))))
  eval((let* ((fiber-viewer (when (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (list "fiber.exe" "-s" (quote file)))) (external-browser (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil (require ...) (error nil)) (let (...) (if ... default ...))) (when (w3m-which-command "netscape") (list "netscape" (quote url)))))) (image-viewer (or fiber-viewer (when w3m-image-viewer (list w3m-image-viewer (quote file))))) (video-viewer (or fiber-viewer (when (w3m-which-command "mpeg_play") (list "mpeg_play" (quote file))))) (dvi-viewer (or fiber-viewer (cond ((w3m-which-command "xdvi") (list "xdvi" (quote file))) ((w3m-which-command "dvitty") (list "dvitty" (quote file)))))) (ps-viewer (or fiber-viewer (cond ((w3m-which-command "gv") (list "gv" (quote file))) ((w3m-which-command "gs") (list "gs" (quote file)))))) (pdf-viewer (or fiber-viewer (cond ((w3m-which-command "xpdf") (list "xpdf" (quote file))) ((w3m-which-command "acroread") (list "acroread" (quote file))))))) (\` (("text/plain" "\\.\\(?:txt\\|tex\\|el\\)\\'" nil nil) ("text/html" "\\.s?html?\\'" (\, external-browser) nil) ("text/sgml" "\\.sgml?\\'" nil "text/plain") ("text/xml" "\\.xml\\'" nil "text/plain") ("image/jpeg" "\\.jpe?g\\'" (\, image-viewer) nil) ("image/png" "\\.png\\'" (\, image-viewer) nil) ("image/gif" "\\.gif\\'" (\, image-viewer) nil) ("image/tiff" "\\.tif?f\\'" (\, image-viewer) nil) ("image/x-xwd" "\\.xwd\\'" (\, image-viewer) nil) ("image/x-xbm" "\\.xbm\\'" (\, image-viewer) nil) ("image/x-xpm" "\\.xpm\\'" (\, image-viewer) nil) ("image/x-bmp" "\\.bmp\\'" (\, image-viewer) nil) ("video/mpeg" "\\.mpe?g\\'" (\, video-viewer) nil) ("video/quicktime" "\\.mov\\'" (\, video-viewer) nil) ("application/dvi" "\\.dvi\\'" (\, dvi-viewer) nil) ("application/postscript" "\\.e?ps\\'" (\, ps-viewer) nil) ("application/pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/x-pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/xml" "\\.xml\\'" nil w3m-detect-xml-type) ("application/rdf+xml" "\\.rdf\\'" nil "text/plain") ("application/rss+xml" "\\.rss\\'" nil "text/plain") ("application/xhtml+xml" nil nil "text/html")))))
  byte-code("\303\304N\211\203	@\202\n)!\207" [symbol sv exp eval saved-value] 4)
  custom-initialize-reset(w3m-content-type-alist (let* ((fiber-viewer (when (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (list "fiber.exe" "-s" (quote file)))) (external-browser (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil (require ...) (error nil)) (let (...) (if ... default ...))) (when (w3m-which-command "netscape") (list "netscape" (quote url)))))) (image-viewer (or fiber-viewer (when w3m-image-viewer (list w3m-image-viewer (quote file))))) (video-viewer (or fiber-viewer (when (w3m-which-command "mpeg_play") (list "mpeg_play" (quote file))))) (dvi-viewer (or fiber-viewer (cond ((w3m-which-command "xdvi") (list "xdvi" (quote file))) ((w3m-which-command "dvitty") (list "dvitty" (quote file)))))) (ps-viewer (or fiber-viewer (cond ((w3m-which-command "gv") (list "gv" (quote file))) ((w3m-which-command "gs") (list "gs" (quote file)))))) (pdf-viewer (or fiber-viewer (cond ((w3m-which-command "xpdf") (list "xpdf" (quote file))) ((w3m-which-command "acroread") (list "acroread" (quote file))))))) (\` (("text/plain" "\\.\\(?:txt\\|tex\\|el\\)\\'" nil nil) ("text/html" "\\.s?html?\\'" (\, external-browser) nil) ("text/sgml" "\\.sgml?\\'" nil "text/plain") ("text/xml" "\\.xml\\'" nil "text/plain") ("image/jpeg" "\\.jpe?g\\'" (\, image-viewer) nil) ("image/png" "\\.png\\'" (\, image-viewer) nil) ("image/gif" "\\.gif\\'" (\, image-viewer) nil) ("image/tiff" "\\.tif?f\\'" (\, image-viewer) nil) ("image/x-xwd" "\\.xwd\\'" (\, image-viewer) nil) ("image/x-xbm" "\\.xbm\\'" (\, image-viewer) nil) ("image/x-xpm" "\\.xpm\\'" (\, image-viewer) nil) ("image/x-bmp" "\\.bmp\\'" (\, image-viewer) nil) ("video/mpeg" "\\.mpe?g\\'" (\, video-viewer) nil) ("video/quicktime" "\\.mov\\'" (\, video-viewer) nil) ("application/dvi" "\\.dvi\\'" (\, dvi-viewer) nil) ("application/postscript" "\\.e?ps\\'" (\, ps-viewer) nil) ("application/pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/x-pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/xml" "\\.xml\\'" nil w3m-detect-xml-type) ("application/rdf+xml" "\\.rdf\\'" nil "text/plain") ("application/rss+xml" "\\.rss\\'" nil "text/plain") ("application/xhtml+xml" nil nil "text/html")))))
  custom-declare-variable(w3m-content-type-alist (let* ((fiber-viewer (when (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (list "fiber.exe" "-s" (quote file)))) (external-browser (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil (require ...) (error nil)) (let (...) (if ... default ...))) (when (w3m-which-command "netscape") (list "netscape" (quote url)))))) (image-viewer (or fiber-viewer (when w3m-image-viewer (list w3m-image-viewer (quote file))))) (video-viewer (or fiber-viewer (when (w3m-which-command "mpeg_play") (list "mpeg_play" (quote file))))) (dvi-viewer (or fiber-viewer (cond ((w3m-which-command "xdvi") (list "xdvi" (quote file))) ((w3m-which-command "dvitty") (list "dvitty" (quote file)))))) (ps-viewer (or fiber-viewer (cond ((w3m-which-command "gv") (list "gv" (quote file))) ((w3m-which-command "gs") (list "gs" (quote file)))))) (pdf-viewer (or fiber-viewer (cond ((w3m-which-command "xpdf") (list "xpdf" (quote file))) ((w3m-which-command "acroread") (list "acroread" (quote file))))))) (\` (("text/plain" "\\.\\(?:txt\\|tex\\|el\\)\\'" nil nil) ("text/html" "\\.s?html?\\'" (\, external-browser) nil) ("text/sgml" "\\.sgml?\\'" nil "text/plain") ("text/xml" "\\.xml\\'" nil "text/plain") ("image/jpeg" "\\.jpe?g\\'" (\, image-viewer) nil) ("image/png" "\\.png\\'" (\, image-viewer) nil) ("image/gif" "\\.gif\\'" (\, image-viewer) nil) ("image/tiff" "\\.tif?f\\'" (\, image-viewer) nil) ("image/x-xwd" "\\.xwd\\'" (\, image-viewer) nil) ("image/x-xbm" "\\.xbm\\'" (\, image-viewer) nil) ("image/x-xpm" "\\.xpm\\'" (\, image-viewer) nil) ("image/x-bmp" "\\.bmp\\'" (\, image-viewer) nil) ("video/mpeg" "\\.mpe?g\\'" (\, video-viewer) nil) ("video/quicktime" "\\.mov\\'" (\, video-viewer) nil) ("application/dvi" "\\.dvi\\'" (\, dvi-viewer) nil) ("application/postscript" "\\.e?ps\\'" (\, ps-viewer) nil) ("application/pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/x-pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/xml" "\\.xml\\'" nil w3m-detect-xml-type) ("application/rdf+xml" "\\.rdf\\'" nil "text/plain") ("application/rss+xml" "\\.rss\\'" nil "text/plain") ("application/xhtml+xml" nil nil "text/html")))) "*Alist of content types, regexps, commands to view, and filters.\nEach element is a list which consists of the following data:\n\n1. Content type.\n\n2. Regexp matching a url or a file name.\n\n3. Method to view contents.  The following three types may be used:\n   a. Lisp function which takes the url to view as an argument.\n   b. (\"COMMAND\" [ARG...]) -- where \"COMMAND\" is the external command\n      and ARG's are the arguments passed to the command if any.  The\n      symbols `file' and `url' that appear in ARG's will be replaced\n      respectively with the name of a temporary file which contains\n      the contents and the string of the url to view.\n   c. nil which means to download the url into the local file.\n\n4. Content type that overrides the one specified by `1. Content type'.\n   Valid values include:\n   a. Lisp function that takes three arguments URL, CONTENT-TYPE, and\n      CHARSET, and returns a content type.\n   b. String that specifies a content type.\n   c. nil that means not to override the content type." :group w3m :type (repeat (group :indent 2 (string :format "Type: %v\n" :size 0) (radio :format "%{Regexp%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (regexp :format "String: %v\n" :size 0)) (radio :format "%{Viewer%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (cons :tag "External viewer" :extra-offset 2 (string :format "Command: %v\n" :size 0) (repeat :format "Arguments:\n%v%i\n" :extra-offset 2 (restricted-sexp :format "%v\n" :match-alternatives (stringp (quote file) (quote url)) :size 0))) (function :format "%t: %v\n" :size 0)) (radio :format "%{Filter%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (string :format "Equivalent type: %v\n" :size 0) (function :format "Function: %v\n" :size 0)))))
  byte-code("\302\303\304\305\306\307\310\311&\210\302\312\313\314\306\307\310\315&\210\302\316\317\320\306\307\310\321&\210\302\322\323\324\306\307\310\325&\210\302\326\327\330\306\307\310\331&\210\302\332\333\334\306\307\310\335&\210\302\336\337\340\306\307\310\341&\210\302\342\343\344\306\307\310\345&\210\302\346\347\350\306\307\310\351\352\353&	\210\302\354\355\356\306\307\310\351&\210\302\357\347\360\306\307\310\351&\210\302\361\347\362\306\307\310\351\352\363&	\210\302\364\365\366\306\307\310\351\352\367&	\210\302\370\371\372\306\307\310\373&\210\302\374\375\376\306\307\310\377&\210\302\201@\201A\201B\310\201C\306\307&\210\302\201D\347\201E\306\307\310\351&\210\302\201F\355\201G\306\307\310\351&\210\302\201H\201I\201J\306\307\310\351&\210\302\201K\355\201L\306\307\310\351\201M\201N&	\210\302\201O\347\201P\306\307\310\351&\210\302\201Q\355\201R\306\307\310\351&\210\302\201S\347\201T\306\307\310\351&\210\302\201U\201V\201W\306\307\310\201X&\210\302\201Y\355\201Z\306\307\310\351&\210\302\201[\347\201\\\201]\201^\201M\201_\306\307\310\351&\210\302\201`\347\201a\201M\201b\306\307\310\351&	\210\302\201c\347\201d\306\307\310\351&\210\302\201e\347\201f\306\307\310\351&\210\302\201g\355\201h\306\307\310\351&\210\302\201i\355\201j\306\307\310\351&\210\302\201k\201i\201l\306\307\310\351&\210\302\201m\355\201n\306\307\310\201o&\210\302\201p\347\201q\306\307\310\351&\210\302\201r\201s\201t\306\307\310\201u\201M\201v&	\210\302\201w\347\201x\306\307\310\351&\210\302\201y\347\201z\306\307\310\351&\210\302\201{\201|\201}\306\307\310\201~&\210\302\201\201\200\201\201\306\307\310\201\202&\210\302\201\203\201\204\201\205\306\307\310\201\206&\210\302\201\207\201\210\201\211\306\307\310\201\212&\210\302\201\213\201\214\201\215\306\307\310\201\216\201\217\201\220\201\221\201\222\201\223\201\224\201\225?\205\264\201\226\201\227\201\230	!\201\231Q\201\232\201\233	!!\"\257E&\210\302\201\234\201\235\201\236\306\307\310\201\237&\210\302\201\240\201\241\201\242\306\307\310\201\243&\210\302\201\244\201\245\201\246\306\307\310\201\247&\210\302\201\250\201\251\201\252\306\307\310\201\253&\210\302\201\254\201\255\201\256\306\307\310\201\257&\210\302\201\260\347\201\261\306\307\310\351&\207" [noninteractive w3m-command custom-declare-variable w3m-content-type-alist (let* ((fiber-viewer (when (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (list "fiber.exe" "-s" (quote file)))) (external-browser (if (and (eq system-type (quote windows-nt)) (w3m-which-command "fiber")) (quote w3m-w32-browser-with-fiber) (or (when (condition-case nil ... ...) (let ... ...)) (when (w3m-which-command "netscape") (list "netscape" ...))))) (image-viewer (or fiber-viewer (when w3m-image-viewer (list w3m-image-viewer (quote file))))) (video-viewer (or fiber-viewer (when (w3m-which-command "mpeg_play") (list "mpeg_play" (quote file))))) (dvi-viewer (or fiber-viewer (cond ((w3m-which-command "xdvi") (list "xdvi" ...)) ((w3m-which-command "dvitty") (list "dvitty" ...))))) (ps-viewer (or fiber-viewer (cond ((w3m-which-command "gv") (list "gv" ...)) ((w3m-which-command "gs") (list "gs" ...))))) (pdf-viewer (or fiber-viewer (cond ((w3m-which-command "xpdf") (list "xpdf" ...)) ((w3m-which-command "acroread") (list "acroread" ...)))))) (\` (("text/plain" "\\.\\(?:txt\\|tex\\|el\\)\\'" nil nil) ("text/html" "\\.s?html?\\'" (\, external-browser) nil) ("text/sgml" "\\.sgml?\\'" nil "text/plain") ("text/xml" "\\.xml\\'" nil "text/plain") ("image/jpeg" "\\.jpe?g\\'" (\, image-viewer) nil) ("image/png" "\\.png\\'" (\, image-viewer) nil) ("image/gif" "\\.gif\\'" (\, image-viewer) nil) ("image/tiff" "\\.tif?f\\'" (\, image-viewer) nil) ("image/x-xwd" "\\.xwd\\'" (\, image-viewer) nil) ("image/x-xbm" "\\.xbm\\'" (\, image-viewer) nil) ("image/x-xpm" "\\.xpm\\'" (\, image-viewer) nil) ("image/x-bmp" "\\.bmp\\'" (\, image-viewer) nil) ("video/mpeg" "\\.mpe?g\\'" (\, video-viewer) nil) ("video/quicktime" "\\.mov\\'" (\, video-viewer) nil) ("application/dvi" "\\.dvi\\'" (\, dvi-viewer) nil) ("application/postscript" "\\.e?ps\\'" (\, ps-viewer) nil) ("application/pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/x-pdf" "\\.pdf\\'" (\, pdf-viewer) nil) ("application/xml" "\\.xml\\'" nil w3m-detect-xml-type) ("application/rdf+xml" "\\.rdf\\'" nil "text/plain") ("application/rss+xml" "\\.rss\\'" nil "text/plain") ("application/xhtml+xml" nil nil "text/html")))) "*Alist of content types, regexps, commands to view, and filters.\nEach element is a list which consists of the following data:\n\n1. Content type.\n\n2. Regexp matching a url or a file name.\n\n3. Method to view contents.  The following three types may be used:\n   a. Lisp function which takes the url to view as an argument.\n   b. (\"COMMAND\" [ARG...]) -- where \"COMMAND\" is the external command\n      and ARG's are the arguments passed to the command if any.  The\n      symbols `file' and `url' that appear in ARG's will be replaced\n      respectively with the name of a temporary file which contains\n      the contents and the string of the url to view.\n   c. nil which means to download the url into the local file.\n\n4. Content type that overrides the one specified by `1. Content type'.\n   Valid values include:\n   a. Lisp function that takes three arguments URL, CONTENT-TYPE, and\n      CHARSET, and returns a content type.\n   b. String that specifies a content type.\n   c. nil that means not to override the content type." :group w3m :type (repeat (group :indent 2 (string :format "Type: %v\n" :size 0) (radio :format "%{Regexp%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (regexp :format "String: %v\n" :size 0)) (radio :format "%{Viewer%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (cons :tag "External viewer" :extra-offset 2 (string :format "Command: %v\n" :size 0) (repeat :format "Arguments:\n%v%i\n" :extra-offset 2 (restricted-sexp :format "%v\n" :match-alternatives (stringp ... ...) :size 0))) (function :format "%t: %v\n" :size 0)) (radio :format "%{Filter%}: %v" :extra-offset 8 :sample-face underline (const :tag "Not specified" nil) (string :format "Equivalent type: %v\n" :size 0) (function :format "Function: %v\n" :size 0)))) w3m-encoding-type-alist (quote (("\\.gz\\'" . "gzip") ("\\.bz2?\\'" . "bzip"))) "*Alist of file suffixes and content encoding types." (repeat (cons :format "%v" :indent 14 (string :format "Regexp of Suffixes: %v\n" :size 0) (string :format "Encoding Type: %v\n" :size 0))) w3m-decoder-alist (\` ((gzip "gzip" ("-d")) (bzip "bzip2" ("-d")) (deflate (\, (if (not noninteractive) (let (...) (w3m-which-command "inflate")))) nil))) "Alist of encoding types, decoder commands, and arguments." (repeat (group :indent 4 (radio :format "Encoding: %v" (const :format "%v " gzip) (const :format "%v " bzip) (const deflate)) (string :format "Command: %v\n" :size 0) (repeat :tag "Arguments" :extra-offset 2 (string :format "%v\n" :size 0)))) w3m-charset-coding-system-alist (let ((rest (quote ((us_ascii . raw-text) (us-ascii . raw-text) (gb2312 . cn-gb-2312) (cn-gb . cn-gb-2312) (iso-2022-jp-2 . iso-2022-7bit-ss2) (iso-2022-jp-3 . iso-2022-7bit-ss2) (tis-620 . tis620) (windows-874 . tis-620) (cp874 . tis-620) (x-ctext . ctext) (unknown . undecided) (x-unknown . undecided) (windows-1250 . cp1250) (windows-1251 . cp1251) (windows-1252 . cp1252) (windows-1253 . cp1253) (windows-1254 . cp1254) (windows-1255 . cp1255) (windows-1256 . cp1256) (windows-1257 . cp1257) (windows-1258 . cp1258) (euc-jp . euc-japan) (shift-jis . shift_jis) (shift_jis . shift_jis) (sjis . shift_jis) (x-euc-jp . euc-japan) (x-shift-jis . shift_jis) (x-shift_jis . shift_jis) (x-sjis . shift_jis)))) dest) (while rest (or (w3m-find-coding-system (car (car rest))) (setq dest (cons (car rest) dest))) (setq rest (cdr rest))) dest) "Alist of MIME charsets and coding systems.\nBoth charsets and coding systems must be symbols." (repeat (cons :format "%v" :indent 2 (symbol :format "%t: %v\n" :size 0) (coding-system :format "%t: %v\n" :size 0))) w3m-correct-charset-alist (quote (("windows-874" . "tis-620") ("cp874" . "tis-620") ("cp1250" . "windows-1250") ("cp1251" . "windows-1251") ("cp1252" . "windows-1252") ("cp1253" . "windows-1253") ("cp1254" . "windows-1254") ("cp1255" . "windows-1255") ("cp1256" . "windows-1256") ("cp1257" . "windows-1257") ("cp1258" . "windows-1258") ("shift-jis" . "shift_jis") ("sjis" . "shift_jis") ("x-euc-jp" . "euc-jp") ("x-shift-jis" . "shift_jis") ("x-shift_jis" . "shift_jis") ("x-sjis" . "shift_jis"))) "Alist of MIME charsets; strange ones and standard ones." (repeat (cons :format "%v" :indent 11 (string :format "From: %v\n" :size 0) (string :format "To: %v\n" :size 0))) w3m-horizontal-scroll-columns 10 "*Number of steps in columns used when scrolling a window horizontally." (integer :size 0) w3m-horizontal-shift-columns 2 "*Number of steps in columns used when shifting a window horizontally.\nThe term `shifting' means a fine level scrolling." (integer :size 0) w3m-view-recenter 1 "Recenter window contents when going to an anchor.\nAn integer is passed to `recenter', for instance the default 1\n    means put the anchor on the second line of the screen.\nt means `recenter' with no arguments, which puts it in the middle\n    of the screen.\nnil means don't recenter, let the display follow point in the\n    usual way." (radio (integer :format "%{%t%}: %v\n" :value 1 :size 1) (const :format "%t\n" t) (const :format "%t\n" nil)) w3m-use-form t "*Non-nil means make it possible to use form extensions. (EXPERIMENTAL)" boolean :require w3m-form w3m-submit-form-safety-check nil "Non-nil means ask you for confirmation when submitting a form." w3m-use-cookies "*Non-nil means enable emacs-w3m to use cookies.  (EXPERIMENTAL)" w3m-use-filter ...] 20)
  require(w3m)
  eval((require (quote w3m)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)
Indeed, this part of the definition of w3m-content-type-alist is a bit
unlucky:

    (if (functionp browse-url-browser-function)
        (symbol-value 'browse-url-browser-function)
      (catch 'browser
        (let ((alist browse-url-browser-function))
          (while alist ...))))

I guess it should better be something like

    (if (symbolp browse-url-browser-function)
        browse-url-browser-function
      (catch 'browser
        (let ((alist browse-url-browser-function))
          (while alist ...))))


Thanks,

Michael.

================================================================

System Info to help track down your bug:
---------------------------------------
emacs-w3m-version
 => "1.4.531"
emacs-version
 => "GNU Emacs 24.3.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)\n of 2014-05-28 on drachen"
mule-version
 => "6.0 (HANACHIRUSATO)"
system-type
 => gnu/linux
(featurep 'gtk)
 => t
w3m-version
 => "w3m/0.5.3+debian-15"
w3m-type
 => w3m-m17n
w3m-compile-options
 => ("lang=en" "m17n" "image" "color" "ansi-color" "mouse" "gpm" "menu" "cookie" "ssl" "ssl-verify" "external-uri-loader" "w3mmailer" "nntp" "gopher" "ipv6" "alarm" "mark" "migemo")
w3m-language
 => nil
w3m-command-arguments
 => nil
w3m-command-arguments-alist
 => nil
w3m-command-environment
 => nil
w3m-input-coding-system
 => utf-8
w3m-output-coding-system
 => utf-8
w3m-use-mule-ucs
 => nil