summaryrefslogtreecommitdiff
path: root/share/emacs/site-lisp/w3m
diff options
context:
space:
mode:
Diffstat (limited to 'share/emacs/site-lisp/w3m')
-rw-r--r--share/emacs/site-lisp/w3m/ChangeLog10203
-rw-r--r--share/emacs/site-lisp/w3m/ChangeLog.16731
-rw-r--r--share/emacs/site-lisp/w3m/mew-w3m.el474
-rw-r--r--share/emacs/site-lisp/w3m/mime-w3m.el227
-rw-r--r--share/emacs/site-lisp/w3m/octet.el547
-rw-r--r--share/emacs/site-lisp/w3m/w3m-antenna.el659
-rw-r--r--share/emacs/site-lisp/w3m/w3m-bookmark.el588
-rw-r--r--share/emacs/site-lisp/w3m/w3m-bug.el192
-rw-r--r--share/emacs/site-lisp/w3m/w3m-ccl.el202
-rw-r--r--share/emacs/site-lisp/w3m/w3m-cookie.el578
-rw-r--r--share/emacs/site-lisp/w3m/w3m-dtree.el239
-rw-r--r--share/emacs/site-lisp/w3m/w3m-ems.el1410
-rw-r--r--share/emacs/site-lisp/w3m/w3m-favicon.el367
-rw-r--r--share/emacs/site-lisp/w3m/w3m-fb.el208
-rw-r--r--share/emacs/site-lisp/w3m/w3m-filter.el367
-rw-r--r--share/emacs/site-lisp/w3m/w3m-form.el1896
-rw-r--r--share/emacs/site-lisp/w3m/w3m-hist.el732
-rw-r--r--share/emacs/site-lisp/w3m/w3m-image.el266
-rw-r--r--share/emacs/site-lisp/w3m/w3m-lnum.el144
-rw-r--r--share/emacs/site-lisp/w3m/w3m-load.el447
-rw-r--r--share/emacs/site-lisp/w3m/w3m-mail.el396
-rw-r--r--share/emacs/site-lisp/w3m/w3m-namazu.el278
-rw-r--r--share/emacs/site-lisp/w3m/w3m-perldoc.el124
-rw-r--r--share/emacs/site-lisp/w3m/w3m-proc.el801
-rw-r--r--share/emacs/site-lisp/w3m/w3m-rss.el169
-rw-r--r--share/emacs/site-lisp/w3m/w3m-search.el365
-rw-r--r--share/emacs/site-lisp/w3m/w3m-session.el909
-rw-r--r--share/emacs/site-lisp/w3m/w3m-symbol.el230
-rw-r--r--share/emacs/site-lisp/w3m/w3m-tabmenu.el188
-rw-r--r--share/emacs/site-lisp/w3m/w3m-ucs.el109
-rw-r--r--share/emacs/site-lisp/w3m/w3m-util.el1421
-rw-r--r--share/emacs/site-lisp/w3m/w3m-weather.el510
-rw-r--r--share/emacs/site-lisp/w3m/w3m.el10648
33 files changed, 42625 insertions, 0 deletions
diff --git a/share/emacs/site-lisp/w3m/ChangeLog b/share/emacs/site-lisp/w3m/ChangeLog
new file mode 100644
index 00000000000..a8c7aca637a
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/ChangeLog
@@ -0,0 +1,10203 @@
+2010-02-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Turn truncate-lines off for text/plain pages.
+
+2010-02-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-images): Add menu to images.
+ (w3m-download-this-image, w3m-print-this-image-url): New functions.
+ (w3m-link-menu): Add them; enable menu only when url or image is there.
+
+2010-02-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-window-hscroll): Revert 2010-01-13 change.
+
+2010-02-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-cache-available-p): Now, pages with neither Last-Modified
+ header and ETag header are treated as dynamically-generated pages.
+ (w3m-cache-header-delete-variable-part): Contination lines are also
+ removed.
+
+2010-02-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-local-dirlist-cgi, w3m-set-display-ins-del):
+ Honor w3m-command-environment.
+ Suggested by Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>.
+
+2010-02-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-redisplay-this-page): Save positions.
+
+2010-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-reload-this-page): Save positions.
+
+ * w3m-hist.el (w3m-history-store-position)
+ (w3m-history-restore-position): Use line number and column number to
+ save positions.
+
+2010-01-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-previous-page): Restore positions as well when
+ jumping within a page.
+ (w3m-view-this-url-1): Reset hscroll after retrieving a new page.
+ (w3m-view-this-url): Save positions first.
+ (w3m-delete-buffer): Restore positions in a page being left.
+ (w3m-goto-url): Don't save positions here.
+
+ * w3m-util.el (w3m-popup-buffer): Restore positions only when buffer to
+ be displayed is hidden, not always.
+
+2010-01-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-next-anchor, w3m-previous-anchor, w3m-next-form)
+ (w3m-previous-form, w3m-next-image, w3m-previous-image): Remove unused
+ var `st'.
+
+2010-01-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Make it work as before for group: urls.
+
+2010-01-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-doc-view-map): New variable.
+ (w3m-view-this-url-1): Improve the way to keep the window configuration
+ for the case where w3m-new-session-in-background is non-nil.
+ (w3m-doc-view): Use w3m-doc-view-map.
+ (w3m-doc-view-quit): New function.
+
+2010-01-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug)
+ * w3m-session.el (w3m-session-save, w3m-session-automatic-save)
+ (w3m-session-deleted-save, w3m-session-crash-recovery-save)
+ * w3m.el (w3m-key-binding): Use save-current-buffer instead of
+ save-excursion.
+
+ * mew-w3m.el (mew-w3m-view-inline-image, mew-mime-text/html-w3m)
+ * w3m-xmas.el (w3m-window-hscroll)
+ * w3mhack.el (toplevel, w3mhack-generate-load-file): Use
+ with-current-buffer rather than save-excursion + set-buffer.
+
+ * w3m-cookie.el (w3m-cookie-parse-args): Use with-current-buffer rather
+ than save-excursion + set-buffer; no need to use save-restriction and
+ narrow-to-region; remove duplicate set-syntax-table.
+
+2010-01-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-print-this-url): Exclude empty image-alt string.
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Strip text props from
+ string elements contained in w3m-current-forms so as to enable XEmacs
+ to read ~/.w3m/.sessions file.
+
+2010-01-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-refontify-anchor, w3m-cache-setup)
+ (w3m-cache-remove-oldest, w3m-cache-remove, w3m-cache-contents)
+ (w3m-cache-request-contents, w3m-view-this-url-1)
+ (w3m-download-this-url, w3m-goto-url)
+ * w3m-session.el (w3m-session-save)
+ * w3m-bookmark.el (w3m-bookmark-sections, w3m-bookmark-write-file)
+ (w3m-bookmark-kill-entries, w3m-bookmark-undo, w3m-bookmark-iterator)
+ * w3m-util.el (w3m-unseen-buffer-p): Use with-current-buffer rather
+ than save-excursion + set-buffer.
+
+ * w3m.el (toplevel, w3m-highlight-current-anchor-1): Use point-at-eol
+ rather than `(save-excursion (end-of-line) (point))'.
+
+ * w3m-util.el: Autoload w3m-history-restore-position when compiling;
+ autoload w3m-fb-frame-parameter only when compiling.
+
+2010-01-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-next-buffer): Save and restore positions.
+ (w3m-close-window): Save positions.
+
+ * w3m-hist.el (w3m-history-store-position)
+ (w3m-history-restore-position): Save and restore hscroll.
+
+ * w3m-util.el (w3m-popup-buffer): Restore positions.
+
+2009-11-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-check-rss): Ignore future entries to
+ display site announcements.
+
+2009-11-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-region-cite-mark): Add new selection.
+ (mew-w3m-region): Rewrite.
+
+2009-11-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-region-cite-mark): New option.
+ (mew-w3m-region): New function.
+ (mew-mime-text/html-w3m): Use `mew-w3m-region' instead of `w3m-region'.
+
+2009-09-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-image.el (w3m-imagick-convert-program-available-p): If someone
+ set `w3m-imagick-convert-program' to nil before load emacs-w3m, do not
+ show warning message for ImageMagick's `convert'.
+
+2009-09-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el (w3m-mail-embed-base-url, w3m-mail-compose-with-mml)
+ (w3m-mail-compose-with-vm): Don't use
+ default-enable-multibyte-characters that is obsolete in Emacs 23.2.
+
+2009-09-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-content-type-alist): Support
+ `browse-url-default-windows|macosx-browser'. Thanks to Leo.
+ Cf. [emacs-w3m:11035].
+
+ * w3m-ems.el (w3m-form-button, w3m-form-button-mouse)
+ (w3m-form-button-pressed, w3m-tab-unselected)
+ (w3m-tab-unselected-retrieving, w3m-tab-unselected-unseen)
+ (w3m-tab-selected, w3m-tab-selected-retrieving, w3m-tab-background)
+ (w3m-tab-selected-background, w3m-tab-mouse): Add type ns. Thanks to
+ Leo. Cf. [emacs-w3m:11034].
+
+2009-08-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Do not display image, if
+ its url is local and current url is not local.
+
+2009-08-24 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-output-coding-system): Use `utf-8' except for emacs-21
+ under Japaese environment.
+
+2009-08-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-symbol): Set nil with emacs-23 or later.
+ cf. [emacs-w3m:11002].
+
+2009-08-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-util.el (w3m-puny-decode-url): Decode the part of hostname only.
+ Add doc-strings.
+ (w3m-puny-encode-url): Add doc-strings.
+
+2009-08-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-puny-utf-16be): New variable.
+ (w3m-url-readable-string): Call `w3m-puny-decode-url'.
+ (w3m-url-transfer-encode-string): Call `w3m-puny-encode-url'.
+ (w3m-header-line-insert): Call `w3m-puny-decode-url'.
+ (w3m-input-url): Call `w3m-puny-decode-url' for initial URL.
+
+ * w3m-util.el (top): Add the variable definition of `w3m-puny-utf-16be'
+ to avoid byte-compile warnings.
+ (w3m-puny-code-regex, w3m-puny-code-nonascii, w3m-puny-base)
+ (w3m-puny-tmin, w3m-puny-tmax, w3m-puny-damp, w3m-puny-skew)
+ (w3m-puny-initial-bias, w3m-puny-initial-n, w3m-puny-delimiter): New
+ constants.
+ (w3m-puny-adapt, w3m-puny-decode-digit, w3m-puny-encode-digit)
+ (w3m-puny-decode1, w3m-puny-decode, w3m-puny-decode-url)
+ (w3m-puny-encode1, w3m-puny-encode, w3m-puny-encode-url): New
+ functions.
+
+2009-08-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-decode-anchor-string): Convert contol-characters to
+ space.
+
+2009-07-17 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-about-retrieve): When type is `nil', decode cached
+ contents to display source of 404 page. Reported by Dan Jacobson
+ <jidanni@jidanni.org>.
+ (w3m-do-cleanup-temp-files): New customize variable.
+ (w3m-cleanup-temp-files): Use it.
+ (toplevel): Call it when emacs-w3m shutdown.
+
+2009-07-04 Naohiro Aota <naota@elisp.net>
+
+ * w3m-search.el (w3m-search-thing-at-point-arg): New variable.
+ (w3m-search-read-query): Use it.
+
+ * w3m-util.el (w3m-current-title): Set title to "<retrieving>>" when
+ w3m is retrieving a page.
+
+2009-06-13 Kevin Ryde <user42@zip.com.au>
+
+ * w3m.el (w3m-view-recenter): Only nil,t,integer, not a cons.
+ (w3m-search-name-anchor, w3m-view-this-url-1): No arg to w3m-recenter.
+ (w3m-next-anchor, w3m-previous-anchor, w3m-next-form,
+ w3m-previous-form, w3m-next-image, w3m-previous-image): Don't
+ recenter, leave recentering just for following a link, not Tab etc
+ within the buffer.
+ (w3m-recenter): Remove NAME arg, believe don't need to differentiate
+ URLs with an anchor or not since with no anchor `point' is at the
+ start of the buffer and can't be recentered anyway.
+ Use C-u style "(recenter '(4))" for the `t' middle-of-screen case.
+ No need for code to avoid redisplay, `recenter' doesn't redisplay in
+ the integer or C-u cases.
+
+2009-06-13 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-fontify-anchors): Decode entities of name anchor.
+
+2009-05-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-cache-available-p): Analyze the cache-control header more
+ strictly.
+ (w3m-scroll-up-or-next-url): Bind w3m-prefer-cache to `t' when goto
+ the w3m-next-url.
+ (w3m-scroll-down-or-previous-url): Bind w3m-prefer-cache to `t' when
+ goto the w3m-previous-url.
+
+2009-05-23 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-reload-this-page): Add new argument `no-popup'; Call
+ w3m-goto-url() with the argument.
+ (w3m-goto-url-with-timer): Use it.
+
+2009-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-bookmark-make-item)
+ * w3m-cookie.el (w3m-cookie-create)
+ * w3m-dtree.el (w3m-dtree-expand-file-name, w3m-dtree-directory-name)
+ * w3m-form.el (w3m-form-normalize-action, w3m-form-p)
+ (w3m-form-set-method, w3m-form-put-property, w3m-form-field-parse)
+ (w3m-form-real-reset)
+ * w3m-hist.el (w3m-history-set-current)
+ * w3m-namazu.el (w3m-namazu-call-process)
+ * w3m-proc.el (w3m-process-p, w3m-process-kill-process)
+ (w3m-process-error-handler)
+ * w3m-session.el (w3m-session-history-to-save, w3m-session-make-item)
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items-1)
+ * w3m-util.el (w3m-get-buffer-create, w3m-kill-buffer)
+ (w3m-current-title, w3m-buffer-title, w3m-buffer-number)
+ (w3m-buffer-set-number, w3m-buffer-name-add-title)
+ (w3m-generate-new-buffer, w3m-lefttab-exist-p, w3m-righttab-exist-p)
+ (w3m-url-valid, w3m-time-newer-p, w3m-time-lapse-seconds)
+ (w3m-url-local-p, w3m-url-authinfo, w3m-url-strip-authinfo)
+ (w3m-url-strip-fragment, w3m-url-strip-query, w3m-which-command)
+ (w3m-assoc-ignore-case, w3m-unseen-buffer-p)
+ * w3m-xmas.el (w3m-make-glyph)
+ * w3m.el (w3m-clear-local-variables, w3m-copy-local-variables)
+ (w3m-arrived-p, w3m-arrived-put, w3m-arrived-get)
+ (w3m-url-transfer-encode-string, w3m-entity-value)
+ (w3m-decode-anchor-string, w3m-toggle-inline-images-internal)
+ (w3m-canonicalize-url, w3m-cache-header-delete-variable-part)
+ (w3m-w3m-canonicalize-url, w3m-view-this-url-1)
+ * mime-w3m.el (mime-w3m-setup): Don't use defsubst.
+
+ * w3m-hist.el (w3m-history-plist-put, w3m-history-remove-properties):
+ Don't inline w3m-history-add-properties.
+
+2009-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-cache-available-p): Work around too large integer in
+ Cache-Control header.
+
+2009-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-to-file-name): Fix regexp used for stripping
+ localhost part; make url a Tramp name if it is guessed.
+
+2009-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-to-file-name): Allow "file:/foo.html" in addition to
+ "file://foo.html" and "file:///foo.html".
+
+2009-04-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-bookmark-buffer): Use the time 0 as modtime of
+ the bookmark buffer by default.
+
+2009-04-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-this-url-1): Pass url to sentinel.
+ (w3m-recenter): Save excursion.
+
+2009-04-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-recenter): New user option.
+ (w3m-recenter): New function.
+ (w3m-search-name-anchor, w3m-view-this-url-1, w3m-next-anchor)
+ (w3m-previous-anchor, w3m-next-form, w3m-previous-form, w3m-next-image)
+ (w3m-previous-image): Use it.
+
+2009-04-20 Kevin Ryde <user42@zip.com.au>
+
+ * w3m.el (w3m-local-find-file-regexps): Make regexp-opt group regexps
+ explicitly.
+
+2009-04-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-cache-available-p): The control of expire is added.
+ (w3m-w3m-retrieve-1): The case where the option "no_cache=1" is put has
+ been increased.
+
+2009-04-12 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-select-buffer-delete-buffer, w3m-goto-url)
+ (w3m-delete-buffers): Unqueue image retrieving process manually.
+ (w3m-idle-images-show): Widen narrowing.
+
+ * w3m-proc.el (w3m-process-stop): Don't unqueue image retrieving
+ process.
+
+ * w3m.el (w3m-message-silent): New variable.
+ (w3m-message): Use it: when the variable is `t', don't show a message.
+ (w3m-idle-images-show): Use it.
+ (w3m-w3m-dump-head): lexical-let it.
+ (w3m-w3m-dump-extra): Ditto.
+ (w3m-w3m-retrieve): Ditto.
+ (w3m-retrieve-and-render): Ditto.
+ (w3m-refresh-minimum-interval): New variable.
+ (w3m-check-refresh-attribute): Use it.
+ (w3m-view-previous-page): When visiting pages by history-back or
+ history-next, don't just ignore refresh, but wait for a while.
+ (w3m-idle-images-show): When there are events pended, re-create the
+ idle timer; Check current position's item every time loop starts.
+ (w3m-idle-images-show-unqueue): Set w3m-idle-images-show-timer
+ properly.
+ (w3m-arrived-add): Revert recent changes.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): lexical-let w3m-message-silent.
+
+2009-04-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-arrived-add): If url has a multi-byte character, do not
+ do recursive-call itself. If decoded url does not have a multi-byte
+ character, do not do recursive-call itself.
+
+2009-03-28 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-goto-url-with-timer): When going to the same url, use
+ `w3m-reload-this-page'.
+ (w3m-image-no-idle-timer): New variable.
+ (w3m-toggle-inline-images-internal): Use it.
+ (w3m-arrived-add): Add also decoded url.
+ (w3m-goto-url): Restore forms also when url is local.
+
+2009-03-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-link-menu): Always provide title string. Suggested by
+ David Abrahams <dave@boostpro.com>.
+ Cf. <URL:http://news.gmane.org/group/gmane.emacs.w3m/thread=8126>.
+
+2009-03-17 Victor Ren <victor.ren@ericsson.com>
+
+ * w3m.el (w3m-url-to-file-name): Support "file://c:/" in addition to
+ "file:///c:/".
+
+2009-03-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-parse-header): The value of w3m-document-charset is
+ not used excluding x-moe-internal.
+
+2009-03-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-decode-buffer): If context-charset is x-moe-internal,
+ x-moe-internal is used as charset regardless of w3m-type.
+ (w3m-w3m-parse-header): Add w3m-document-charset to handle of the
+ headers. If w3m-document-charset is x-moe-internal, charset sets to
+ x-moe-internal compulsorily. If x-w3m-content-encoding is exist, the
+ value of x-w3m-content-encoding is used as encoding method regardless
+ of w3m-type.
+
+2009-03-03 Naohiro Aota <naota@elisp.net>
+
+ * w3m-hist.el (w3m-history-slimmed-history-flat, w3m-history-slim): New
+ functions.
+
+ * w3m-session.el (w3m-session-history-to-save): Use it.
+
+2009-02-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Require w3m-session instead of autoloading it.
+
+ * w3m-session.el: Don't require w3m; require w3m-util; silent warnings.
+ (w3m-session-select): Use w3m-get-buffer-create instead of
+ get-buffer-create to kill the session select buffer when quitting.
+
+ * w3m-util.el (w3m-delete-frames-and-windows): Delete frames if the
+ other windows visit buffers being related to emacs-w3m or the session
+ select buffer.
+ (w3m-replace-in-string): eval-and-compile.
+
+2009-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Autoload w3m-go-to-linknum.
+ (w3m-lynx-like-map, w3m-info-like-map): Bind `C-c C-l' to it.
+ (w3m-mode): Mention w3m-go-to-linknum in doc string.
+
+ * w3m-util.el (w3m-read-number): New function.
+
+ * w3m-lnum.el (w3m-go-to-linknum): Use w3m-read-number.
+
+2008-04-12 Jose A. Ortega Ruiz <jao@gnu.org>
+
+ * w3m-lnum.el (w3m-go-to-linknum): New function.
+
+2009-02-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-session.el (w3m-session-ignore-errors): New macro.
+ (w3m-session-save, w3m-session-automatic-save)
+ (w3m-session-deleted-save, w3m-session-crash-recovery-save)
+ (w3m-session-crash-recovery-remove, w3m-session-select-mode)
+ (w3m-session-select, w3m-session-make-menu-items)
+ (w3m-session-last-autosave-session, w3m-session-last-crashed-session):
+ Use it.
+
+ (toplevel): Require cl when compiling.
+ (w3m-session-crash-recovery-save)
+ (w3m-session-select-list-all-sessions): Remove unused variables.
+
+2009-02-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-session.el (w3m-session-last-crashed-session): Fix tiny typo.
+
+2009-02-15 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-idle-images-show): If detect deleted buffer, unqueue
+ processes related to the buffer.
+
+ * w3m-session.el (w3m-session-crash-recovery): Change the default to t.
+
+2009-02-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-buffer-setup): Add keymap that cycles buffers as usual to
+ mode-line-buffer-identification.
+
+2009-02-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-bookmark-view, w3m-bookmark-view-new-session)
+ (w3m-bookmark-make-menu-items): Check if bookmark file exists.
+
+2009-02-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-header-line-insert): Don't decode url containing
+ non-ASCII characters already. e.g. about://weather/WHERE
+
+2009-02-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Remove a wrong set-buffer().
+
+2009-02-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-input-url): Offer decoded url in the minibuffer.
+ (w3m-copy-buffer): Copy w3m-current-coding-system.
+ (w3m-header-line-insert): Display decoded url.
+
+2009-02-02 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-idle-images-show): Change the order of image retrieving.
+ (w3m-toggle-inline-images-internal): Use `w3m-idle-image-item'
+ text-property.
+ (w3m-goto-url): Add new argument `no-popup'.
+ (w3m-goto-url-with-timer): Call w3m-goto-url with `no-popup' nil.
+
+2009-02-01 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Add new argument
+ `safe-regexp'.
+ (w3m-toggle-inline-images): Pass `safe-regexp' to
+ w3m-toggle-inline-images-internal when called non-interactively.
+
+2009-01-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el: Autoload w3m-idle-images-show-unqueue when compiling.
+
+2009-01-27 Naohiro Aota <naota@elisp.net>
+
+ * w3m-proc.el (w3m-process-stop): Call `w3m-idle-images-show-unqueue'.
+
+ * w3m.el (w3m-idle-images-show-timer, w3m-idle-images-show-list)
+ (w3m-idle-images-show-interval): New variables.
+ (w3m-idle-images-show, w3m-idle-images-show-unqueue): New functions.
+ (w3m-toggle-inline-images-internal): Use them.
+
+2009-01-26 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-content-type-alist): Add "application/x-pdf" content
+ type.
+
+2009-01-21 Kevin Ryde <user42@zip.com.au>
+
+ * w3m.el (w3m-search-name-anchor): Return true meaning "found" if
+ point is already at the anchor position.
+
+2009-01-21 Naohiro Aota <naota@elisp.net>
+
+ * w3m-session.el (w3m-session-last-autosave-session): Check if
+ autosaved sessions set exists before asking whether to load the last
+ sessions set; Search older sessions sets when the last sessions set
+ doesn't exist (maybe it is removed by user); Load autosaved sessions
+ set when w3m-session-load-last-sessions is non-nil.
+ (w3m-session-load-last-sessions): Fix docstring; Change `auto' to `t'.
+ (w3m-session-crash-recovery-title): New variable.
+ (w3m-session-load-crashed-sessions): Ditto.
+ (w3m-session-crash-recovery-save): New function.
+
+ * w3m.el (w3m-goto-url): Save sessions set for crash recovering.
+ (w3m-delete-buffer): Ditto.
+ (w3m): Load crashed sessions if necessary. Suggested by Samuel Wales
+ <samologist@gmail.com>.
+
+2009-01-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Use new `w3m-balloon-help'
+ text-property for balloon help.
+ (w3m-fontify-images): Ditto and create help together href, alt and URL
+ of image.
+
+2009-01-19 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-image-anchor): Fix docstring.
+ (toplevel): Fix w3m-image-anchor-face's alias.
+
+2009-01-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-images): Put the 'full alt text' on new
+ 'w3m-image-alt' property.
+ (w3m-print-this-url): Print the content of 'w3m-image-alt'.
+
+ * w3m-util.el (w3m-image-alt): New macro.
+
+2009-01-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/Makefile.in (.texi.info): Use --no-split.
+
+2009-01-11 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m): Move last session restoring asking afterward, so that
+ the restoring wouldn't be avoided by w3m-input-url's input.
+
+ * w3m-session.el (w3m-session-last-autosave-session): Follow the above
+ change.
+
+2009-01-10 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m): Check whether to load the last autosaved
+ sessions. Suggested by Samuel Wales <samologist@gmail.com>.
+
+ * w3m-session.el (w3m-session-automatic-keep-number): New variable.
+ Suggested by Samuel Wales <samologist@gmail.com>.
+ (w3m-session-automatic-save): Use it.
+ (w3m-session-last-autosave-session): New function.
+ (w3m-session-load-last-sessions): New variable.
+
+ * w3m.el (w3m-image-anchor): New face.
+ (w3m-fontify-images): Use it.
+
+2009-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-language): Allow the value like "Japanese (UTF-8)" of
+ current-language-environment.
+
+ * w3m-symbol.el (w3m-symbol): Ditto.
+
+ * w3mhack.el (w3mhack-makeinfo): Use locale-coding-system for Emacs to
+ encode Japanese messages.
+
+2009-01-09 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (w3m-create-text-page, w3m-goto-url): Check if the url is
+ arrived before getting real-url.
+
+2009-01-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top): Add the variable definitions of
+ `w3m-tab-menubar-make-items-preitems' and `w3m-session-menu-items-pre'
+ to avoid byte-compile warnings.
+ (w3m-setup-menu): Move the postion of session menu.
+ (w3m-mouse-major-mode-menu): Add session menu.
+
+ * w3m-xmas.el (autoload): Add w3m-setup-session-menu.
+ (w3m-menu-on-forefront): Treat "Session" menu.
+ (w3m-setup-menu): Call `w3m-setup-session-menu'.
+
+2008-12-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-select-buffer-mode-map): Bind `w3m-select-buffer-quit' to
+ C-g.
+
+ * w3m-session.el (w3m-session-select-mode-map): Bind
+ `w3m-session-select-quit' to C-g.
+
+ * w3m-form.el (w3m-form-input-select-keymap): Bind
+ `w3m-form-input-select-keymap' to C-g.
+ (w3m-form-input-map-keymap): Bind `w3m-form-input-map-exit' to C-g.
+
+2008-12-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-session.el (w3m-session-select-mode-map): Add new key.
+ (w3m-session-select-mode): Modify doc-string.
+ (w3m-session-select-rename): New command.
+ (w3m-session-rename): New function.
+
+2008-12-17 Naohiro Aota <naota@elisp.net>
+
+ * w3m.el (autoload): Add w3m-setup-session-menu.
+ (w3m-menubar): Moved session menu to w3m-session-menu-items.
+ (top): Call w3m-setup-session-menu.
+
+ * w3m-session.el: Change to use major mode; Add session menu.
+ (w3m-session-unknown-title): New option.
+
+2008-12-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-compatible-encoding-alist): Add (gb2312 . gbk).
+
+2008-12-12 David Engster <dengste@eml.cc>
+
+ * w3m-proc.el (w3m-process-wait-process): Reduce sit-for time.
+ (w3m-process-sentinel): Wait for process output (on Emacs only).
+
+2008-12-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-show-redirection-error-information): Improve the
+ error message.
+
+2008-12-10 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-next-anchor): Go to the first anchor when next
+ anchor is not found.
+ (w3m-previous-anchor): Go to the last anchor when previous anchor
+ is not found.
+ (w3m-url-encode-string): Encode SPC only when encode-space is
+ non-nil.
+
+ * w3m-form.el (w3m-form-make-form-data): Follow the above change.
+
+ * w3m.el (w3m-gmane-url-at-point): Ditto.
+ (w3m-canonicalize-url): Ditto.
+
+2008-12-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-make-ccl-coding-system): Use define-coding-system if
+ it is available.
+
+2008-12-06 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-show-redirection-error-information): New function.
+ (w3m-retrieve-and-render): Use it.
+ (w3m-w3m-retrieve-1): Return 'redirection-exceeded if redirect counter
+ exceeded.
+ (w3m-w3m-retrieve): Return "X-w3m-error/redirection" if attr eq
+ 'redirection-exceeded.
+ (w3m-w3m-attributes-1): Return dummy attribute if redirect counter
+ exceeded.
+
+2008-12-05 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-same-window-p): New function.
+ (w3m-form-input-textarea): Use it.
+
+ * w3m.el (w3m-local-find-file-regexps): Try to open with emacs-w3m as
+ many types as possible.
+
+2008-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify): Remove hidden anchors like "<a href=url> </a>".
+ cf. [emacs-w3m:10484]
+
+2008-12-01 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-input-textarea): Use the whole current window
+ for the textarea when `same-window-buffer-names' contains the buffer
+ name "*w3m form textarea*"; simplify the window size calculation.
+
+2008-11-21 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-w3m-parse-header): Also remove parameters when charset is
+ specified.
+
+2008-11-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-visited-file-modtime): New function.
+
+ * w3m-bookmark.el (w3m-bookmark-file-modtime): Just return result of
+ file-attributes().
+
+2008-11-11 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-antenna.el (w3m-antenna-check-rss): Support RSS2.0. Check also
+ items.
+ (w3m-antenna-alist): Update site-class if needed.
+
+ * w3m-bookmark.el (w3m-bookmark-buffer, w3m-bookmark-verify-modtime):
+ Replace visited-file-modtime with w3m-visited-file-modtime.
+
+2008-10-28 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-view-header): Check if current page is source of
+ about:something.
+
+2008-10-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-active-region-or-url-at-point): Take notice of the link
+ under the point as well; return the url of the current page by default
+ if the new optional argument `default=current' is given.
+ (w3m-input-url): Make w3m-active-region-or-url-at-point return the url
+ of the current page by default; modify the prompt string according to
+ whether there is an initial input.
+ (w3m-download, w3m-goto-url, w3m-goto-url-new-session): Simplify args
+ passed to w3m-input-url.
+ (w3m-view-this-url): Make w3m-active-region-or-url-at-point return the
+ url of the current page by default.
+
+2008-10-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-italic): Make it be a underline face on a non-window
+ system by default.
+
+2008-09-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images-internal)
+ (w3m-resize-inline-image-internal): Confirm whether to retrieve
+ insecure image only once, or don't confirm it if
+ w3m-confirm-leaving-secure-page is nil. Suggested by Dan Jacobson
+ <jidanni@jidanni.org>.
+ (w3m-confirm-leaving-secure-page): Doc fix.
+
+ * w3mhack.el (w3mhack-makeinfo): Remove Emacs 19 stuff; remove TeX
+ directives first; don't call texinfo-mode.
+
+2008-09-21 Akinori MUSHA <knu@iDaemons.org>
+
+ * doc/emacs-w3m.texi (Image Variables): Fix syntax error.
+
+ * doc/emacs-w3m-ja.texi (Image Variables): Ditto.
+
+2008-09-17 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-buffer-local-url): New constant variable.
+ (w3m-buffer-local-url-p): New function.
+ (w3m-goto-url): Also process buffer local url.
+ (w3m-region): Use w3m-buffer-local-url as url if it is not set.
+ (w3m-safe-view-this-url, w3m-mouse-safe-view-this-url): Check if url is
+ buffer local.
+
+2008-09-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-download): Add doc string.
+ (w3m-lynx-like-map): Bind M-d key to w3m-download.
+ (w3m-mode): Add w3m-download to major mode info; clarify description of
+ w3m-download-this-url.
+
+2008-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-gmane-url-at-point): Return a url used for asking Gmane
+ for the thread that begins with the current article instead of the
+ whole thread if it is run on the Message-ID header.
+ (w3m-examine-command-line-args): Make it an alias to `(lambda nil)'
+ instead of `ignore' after it is run for the first time in order to
+ silence the byte compiler.
+
+2008-09-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-use-favicon): Assume w3m-image.elc is always loaded.
+ (w3m-resize-inline-image-internal): Change it to a normal function from
+ an inline function; remove interactive.
+ (w3m-zoom-in-image, w3m-zoom-out-image): Error if ImageMagick's convert
+ program is not available; improve doc string.
+ (w3m-auto-show): Don't make the cursor position disappear after
+ executing beginning-of-buffer and end-of-buffer.
+
+2008-08-25 David Hansen <david.hansen@gmx.net>
+
+ * w3m.el (w3m-about-header): Fixed typo.
+
+2008-08-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-source, w3m-view-header): Save points positioned
+ last in pages. Suggested by Dan Jacobson <jidanni@jidanni.org>.
+
+2008-07-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el: Bind w3m-image-default-background when compiling.
+
+2008-07-20 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-hist.el (w3m-history-restore-position): Run
+ w3m-after-cursor-move-hook after restoring cursor position.
+
+2008-07-18 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-image-default-background): New variable.
+
+ * w3m-ems.el (w3m-create-image): Use it.
+ (w3m-initialize-graphic-icons): Check if xpm is available. Reported by
+ Diego 'Flameeyes' Petten,Ar(B <flameeyes@gmail.com>.
+
+ * w3m-filter.el (w3m-filter-wikipedia): Improve regexp.
+
+2008-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Test if mule-version is
+ bound (XEmacs does not provide it).
+
+2008-06-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-input, w3m-form-input-password): Process
+ readonly attribute.
+
+2008-06-25 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Make it non-interactive.
+
+ * w3m-form.el (w3m-form-input-textarea): Make buffer unmodified when
+ user selected to reuse saved text; parse readonly attribute; kill newly
+ generated buffer when the reusing question aborted.
+ (w3m-form-textarea-info): Also provide readonly info.
+ (w3m-fontify-textareas): Parse readonly attribute.
+ (w3m-form-parse-and-fontify): Ditto.
+ (w3m-form-input): Ignore cursor moving while read from minibuffer.
+ (w3m-form-input-password): Ditto.
+ (w3m-form-input-file): Ditto.
+
+ * w3m.el (w3m-toggle-inline-image): Don't toggle images that are
+ outside of the region even if they are identical to the ones in the
+ region; don't do recursive call of itself; rearrange the source code.
+ (w3m-toggle-inline-images): Check whether images are safe even if it is
+ called with w3m-display-inline-images=t and force=t; rearrange the
+ source code.
+ (w3m-toggle-inline-images-internal): Add new optional argument:
+ `begin-pos' and `end-pos'. Only process region from `begin-pos' to
+ `end-pos'.
+
+2008-06-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-image): Work for an image in which there is
+ the region end within its anchor. Reported by Dan Jacobson
+ <jidanni@jidanni.org>.
+
+ * w3m-util.el (w3m-deactivate-region): Use zmacs-deactivate-region for
+ XEmacs.
+
+2008-06-22 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-search.el (w3m-search-engine-alist): Improve detection of utf-8
+ capability.
+ (w3m-search-engine-alist): Abolish `yahoo beta' entry; Improve `blog'
+ entry to work like `google' entry.
+
+ * w3m-session.el: Add coding cookie.
+
+2008-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-submit-form-safety-check): New user option. Suggested by
+ Dan Jacobson <jidanni@jidanni.org>.
+ (w3m-submit-form): Use it.
+
+2008-06-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-auto-show): Scrool horizontally after executing a search
+ command.
+
+2008-06-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-header-line-title): Modify the doc-string.
+
+2008-06-06 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-select-buffer): Don't delete other windows.
+
+ * w3m-filter.el (w3m-filter-wikipedia): New function.
+ (w3m-filter-rules): Add w3m-filter-wikipedia.
+
+2008-06-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Add coding cookie.
+
+2008-06-02 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-detect-meta-charset): Use also ';' as delimiter.
+
+2008-05-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-examine-command-line-args): Treat the null string given
+ as a url in the command line args as `w3m-home-page' or "about:".
+
+2008-05-28 Naohiro Aota <nao.aota@gmail.com>
+
+ * doc/emacs-w3m.texi (Inline Images): Update.
+
+ * doc/emacs-w3m-ja.texi (Inline Images): Ditto.
+
+2008-05-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-readable-string): Don't decode url if it looks not to
+ have been encoded.
+ (w3m-current-longest-line): New variable.
+ (w3m-set-current-longest-line): New function.
+ (w3m-scroll-left, w3m-shift-left): Don't scroll the window endlessly;
+ beep if the window can't be scrolled any more.
+ (w3m-scroll-right, w3m-shift-right): Beep if the window can't be
+ scrolled any more.
+
+2008-05-25 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-relationship-estimate-rules): Fix regexp for Google
+ search within EmacsWiki.
+
+2008-05-20 Naohiro Aota <nao.aota@gmail.com>
+
+ * README: Add information about how to create `configure' script.
+
+ * README.ja: Ditto.
+
+ * w3m.el (w3m-goto-url): Delayed encoding of fragment part.
+
+2008-05-18 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-cookie.el (w3m-cookie-save-current-site-cookies): New function.
+ (w3m-cookie-save): Add optional argument "domain".
+
+2008-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-add-text-properties): New inline macro.
+ (mew-w3m-view-inline-image): Use `mew-w3m-add-text-properties'.
+ (mew-mime-text/html-w3m): Ditto.
+
+2008-05-09 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-cookie.el (w3m-cookie-save): Make it interactive function.
+ (w3m-cookie-save-cookies): New variable.
+ (w3m-cookie-shutdown): Use it.
+
+ * w3m.el (toplevel): Shutdown cookie system when exiting emacs.
+
+2008-05-08 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-cookie.el (w3m-cookie-shutdown): Fixed docstring.
+
+2008-05-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-amazon): Fix string to search the body.
+
+2008-04-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * doc/emacs-w3m-ja.texi: Update translation.
+
+ * w3m.el (w3m-goto-url): Use w3m-current-coding-system first to encode
+ url if available; Also encode name part when url is local.
+ (w3m-ignored-image-url-regexp): New variable.
+ (w3m-toggle-inline-images-internal): Don't display image whose url
+ match `w3m-ignored-image-url-regexp'.
+ (w3m-decode-entities, w3m-decode-entities-string): Replace
+ "(match-beginning 2)" with "(match-end 1)" to deal with emacs-21's
+ strange behavior.
+
+2008-04-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-rules): Support Mixi with SSL.
+
+2008-04-22 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Fix Comments.
+ (texinfo-format-geq, texinfo-format-leq,): Support @geq and @leq.
+
+2008-04-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-rules): Add rule for the site of Allatanys.
+ (w3m-filter-allatanys): New function.
+
+ * w3m.el (w3m-relationship-estimate-rules): Fix regexp for Google
+ search within EmacsWiki. Add rule for Google Mobile Proxy.
+
+2008-04-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top): Add the variables definition of `w3m-bookmark-mode',
+ `w3m-bookmark-menu-items', `w3m-bookmark-menu-items-pre' and
+ `w3m-tab-menubar-make-items-preitems' avoid byte-compile warnings.
+ (w3m-rmouse-menubar): New user option.
+ (w3m-setup-menu): Add the setup of `w3m-rmouse-menubar'.
+ (w3m-mouse-major-mode-menu): Rewrite to use `w3m-rmouse-menubar'.
+ (w3m-link-menu): Add `w3m-external-view-this-url'.
+
+2008-04-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-turnoff-inline-images): New command.
+ (w3m-toggle-inline-images): If force is 'turnoff, turn off to display
+ images.
+ (w3m-menubar): Add w3m-turnoff-inline-images.
+ (w3m-lynx-like-map): Ditto.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Ditto.
+
+2008-04-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-relationship-estimate-rules): Fix custom type.
+
+2008-04-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-relationship-estimate-rules): Support Google search
+ within EmacsWiki. cf. [emacs-w3m:10067]
+
+2008-03-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mouse-safe-view-this-url): Remove redundant confirmation
+ of whether to follow link.
+
+2008-03-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-doc-view-content-types): New variable.
+ (w3m-doc-view): New function.
+ (w3m-create-page): Use it.
+ (w3m-content-type-alist): Add application/dvi.
+ (w3m-delete-buffer): Save windows layout.
+
+2008-03-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-image.el (w3m-imagick-convert-program-available-p): Don't use
+ w3m-imagick-convert-data which may issue a warning when checking
+ whether the convert program supports png32. cf. [emacs-w3m:10048]
+
+2008-03-03 Naohiro Aota <nao.aota@gmail.com>
+
+ * doc/emacs-w3m.texi (Inline Images): Updated.
+
+ * doc/emacs-w3m-ja.texi (Inline Images): Ditto.
+
+ * w3m.el (w3m-toggle-inline-images): Only toggle in the region if
+ Transient Mark mode.
+ (w3m-toggle-inline-image): Ditto.
+
+2008-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-arrived-intern): Protect against null string. It enables
+ url completion even for null string. Suggested by Aota-san.
+
+2008-02-07 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-expand-path-name): New function.
+ (w3m-expand-url): Remove useless expanded path-name check.
+
+2008-02-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-lisp, install-icons, install-icons30): Quote
+ directory name that might contain whitespace.
+
+ * doc/Makefile.in (install): Ditto.
+
+ * aclocal.m4 (AC_PATH_LISPDIR): Ditto; always report prefix name.
+
+ * mkinstalldirs: Replace it with the 2006-05-11.19 version.
+
+2008-01-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-fontify-anchors): Don't expand icon's url when it is nil.
+
+2008-01-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-safe-url-regexp): Add note to doc string.
+ (w3m-fontify): Hold the value of w3m-safe-url-regexp with the
+ w3m-safe-url-regexp text-property.
+ (w3m-toggle-inline-image, w3m-toggle-inline-images)
+ (w3m-safe-view-this-url, w3m-mouse-safe-view-this-url): Check whether
+ url is safe by comparing it with the value of the w3m-safe-url-regexp
+ text property; prompt a user to confirm whether to proceed.
+ (w3m-safe-toggle-inline-image, w3m-safe-toggle-inline-images): Abolish.
+ (w3m-minor-mode-command-alist): Map w3m-toggle-inline-image and
+ w3m-toggle-inline-images to themselves.
+
+2008-01-20 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-search-name-anchor): Accept and optional argument
+ `no-record'.
+ (w3m-goto-url): Going other page's anchor, call
+ `w3m-search-name-anchor' with 3rd argument t.
+
+2008-01-16 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-input-textarea-coding-system): Revert.
+ (w3m-form-input-textarea): Set w3m-form-input-textarea-coding-system to
+ use in w3m-form-coding-system-accept-region-p.
+
+2008-01-15 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-textarea-file-coding-system): New variable.
+ (w3m-form-input-textarea-save): Use it.
+ (w3m-form-input-textarea): Ditto.
+ (w3m-form-input-textarea-coding-system): Abolish.
+
+2008-01-11 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-filter.el (w3m-filter-iframe): New function.
+ (w3m-filter-rules): Add rule for inserting link to the url iframe
+ displays.
+
+2008-01-09 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-coding-system-accept-region-p): Abolish.
+
+ * w3m-ems.el (w3m-form-coding-system-accept-region-p): Use
+ select-safe-coding-system if unencodable-char-position is not
+ available.
+
+ * w3m-xmas.el (w3m-form-coding-system-accept-region-p): Use
+ decode-coding-string and encode-coding-string instead of
+ unencodable-char-position; Only warn coding-system problem.
+
+2008-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-decode-string): Don't replace +'s with spaces.
+
+2007-12-27 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-coding-system-accept-region-p): New function.
+ (w3m-form-input-textarea-save, w3m-form-input-textarea-set): Use it.
+
+2007-12-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-session.el (w3m-session-goto-session): Go to the current w3m
+ buffer in data of session.
+
+2007-12-24 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-session.el (w3m-session-history-to-save): New function.
+ (w3m-session-save): Also record history data.
+ (w3m-session-automatic-save, w3m-session-deleted-save): Ditto.
+ (w3m-session-select): Follow the format change.
+ (w3m-session-goto-session): Also restore history data.
+
+2007-12-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-tabmenu.el (w3m-tab-menubar-force-update): New function.
+ (top): Register `w3m-tab-menubar-force-update' to
+ `w3m-display-functions'.
+
+2007-12-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-lynx-like-map): Bind `w3m-move-unseen-buffer'.
+ (w3m-info-like-map): Ditto.
+ (w3m-buffer-unseen): New buffer local variable.
+ (w3m-set-buffer-unseen): New function.
+ (w3m-set-buffer-seen): Ditto.
+ (w3m-move-unseen-buffer): Ditto.
+ (w3m-remove-local-hook): Ditto.
+ (w3m-goto-url): Set buffer to unseen.
+ (w3m-select-buffer-generate-contents): Support `unseen'.
+
+ * w3m-util.el (top): Add the variable definition of `w3m-buffer-unseen'
+ to avoid byte-compile warnings.
+ (w3m-unseen-buffer-p): New inline macro.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items-1): Support `unseen'.
+
+ * w3m-ems.el (w3m-remove-local-hook): New function.
+ (w3m-tab-unselected-unseen): New face.
+ (w3m-tab-line): Support `unseen'.
+
+2007-12-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mode): Set show-trailing-whitespace to nil.
+
+2007-12-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-default-background): New user option.
+ (w3m-favicon-set-image): Don't set background color of favicon here.
+ (w3m-favicon-convert): Set the background color of favicon according to
+ w3m-favicon-default-background.
+
+ * w3m-ems.el (w3m-tab-line): Don't set the background color of favicon
+ here.
+
+ * w3m-image.el (w3m-imagick-identify-program): New user option.
+
+2007-12-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-kill-stray-processes): Do not kill
+ process when the buffer associated to it is alive.
+ (w3m-process-sentinel): Do not call a handler when its parent
+ buffer have been killed.
+
+2007-12-15 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-submit): Remove query part from the form's
+ action url when using get method.
+
+2007-12-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-size): Change the value form into
+ the cons of WIDTH and HEIGHT.
+ (w3m-favicon-convert-args): New user option.
+ (w3m-favicon-convert): Pass it to convert.
+
+ * w3m-ems.el (w3m-tab-mouse-track-selected-tab): Follow change of
+ w3m-favicon-size.
+
+2007-12-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-tab-line): Set the background color of favicon
+ for Emacs 22+.
+
+ * w3m-favicon.el (w3m-favicon-set-image): Ditto.
+
+ * w3m-image.el (w3m-imagick-convert-program-available-p): Check
+ whether the convert program supports the image type png32 for
+ Emacs 22+.
+ (w3m-imagick-convert-buffer, w3m-imagick-start-convert-buffer):
+ Use png32 if it is available.
+
+2007-12-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-convert): Make last change revert.
+
+2007-12-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-convert): Apply the background color
+ of header line or mode line to pixels of which the color is
+ transparent.
+
+2007-12-06 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-goto-url): Canonicalize the url when it is called
+ non-interactively.
+
+2007-12-01 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-name-anchor-from-hist): New buffer-local variable.
+ (w3m-clear-local-variables): Also clear w3m-name-anchor-from-hist.
+ (w3m-goto-url): Save and restoe w3m-name-anchor-from-hist.
+ (w3m-search-name-anchor): Record (point)s of before and after
+ following a name-anchor.
+ (w3m-view-previous-page): If possible, move back the cursor to the
+ point where it was before following name-anchors.
+
+2007-11-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-proc.el (w3m-process-y-or-n-p): Ignore space to avoid
+ answering y without intention.
+
+2007-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url-new-session): Use
+ w3m-active-region-or-url-at-point. Reported by Naohiro Aota.
+
+ * w3m-ems.el (w3m-create-image): Don't modify case-fold-search.
+
+ * w3m-xmas.el (w3m-create-image): Ditto; parse image data to
+ identify its type in the beginning position.
+
+2007-11-29 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-w3m-dump-extra, w3m-w3m-retrieve): Removed image
+ data type tests.
+
+ * w3m-xmas.el (w3m-create-image): Parse image data first, use
+ server's content-type when it failed to identify type.
+
+ * w3m-ems.el (w3m-create-image): Ditto.
+
+2007-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Fix google news entry.
+
+ * w3m-ems.el (w3m-create-image): Parse image data if it failed in
+ identifying type.
+
+ * w3m-xmas.el (w3m-create-image): Ditto.
+
+2007-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-resize-inline-image-internal): Validate image url.
+ Reported by Naohiro Aota <nao.aota@gmail.com>.
+
+2007-11-27 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Confirm retrieving
+ non-secure image.
+ (w3m-resize-inline-image-internal): Ditto.
+
+2007-11-27 Katsumi Yamaoka <yamaoka@jpl.org>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-retrieve-and-render): Permit leaving safe pages
+ without confirmation for several safe commands.
+
+2007-11-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-symbol.el: Autoload w3m-mule-unicode-p when compiling.
+
+ * w3m-proc.el: Update the way to suppress compile warning for gensym.
+
+2007-11-26 Trent W. Buck <trentbuck@gmail.com>
+
+ * w3m.el (w3m-confirm-leaving-secure-page): New user option.
+ (w3m-retrieve-and-render): Use it.
+
+2007-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-use-japanese-menu): Default to nil for XEmacs 21.4 and
+ SXEmacs.
+ (w3m-link-map): New variable.
+ (w3m-fontify-anchors): Add menu to links.
+ (w3m-read-file-name): Don't use default file name if it is "".
+ (w3m-link-menu): Define.
+
+2007-11-06 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-redisplay-with-charset): Strip first 'about://source/'
+ before setf w3m-arrived-content-charset.
+ (w3m-redisplay-and-reset): Ditto.
+
+2007-11-05 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-filter.el (w3m-filter-rules): Add rule for the site of imepita.
+ (w3m-filter-imepita): New function.
+
+2007-11-03 David Hansen <david.hansen@gmx.net>
+
+ * w3m-proc.el (w3m-process-wait-process): Preserve the current buffer
+ \(work around an Emacs bug\).
+
+2007-11-03 David Hansen <david.hansen@gmx.net>
+
+ * w3m.el (w3m-relationship-oddmuse-estimate): Follow new page layout.
+
+2007-11-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-ucs-to-char): Alias to unicode-to-char, ucs-to-char,
+ or int-to-char.
+
+ * w3m-ems.el (w3m-ucs-to-char): Always define it.
+
+ * w3m.el (w3m-ucs-to-char): Abolish.
+
+2007-10-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-module-list): Don't compile mew-w3m.el and
+ mew-shimbun.el if there is only the official Mew XEmacs package that is
+ extremely old.
+
+ * w3m-proc.el: Update the way to suppress compile warning for gensym.
+
+ * w3m-util.el (w3m-list-buffers): Check if w3m-fb-mode is bound.
+
+ * w3m.el (w3m-copy-buffer, w3m-mouse-major-mode-menu): Remove unused
+ let-bound variables.
+
+2007-10-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-lisp): Don't install w3m-ems.el for XEmacs and
+ w3m-xmas.el for GNU Emacs.
+
+2007-10-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * *, doc/*: Fix expressions of the copyright notices.
+
+ * w3mhack.el (w3mhack-makeinfo): Don't split Info file to pieces.
+
+ * doc/emacs-w3m.texi, doc/emacs-w3m-ja.texi: Use @copying and
+ @insertcopying to put up the copyright notice.
+ (Coding convention of Shimbun): Don't use @itemx with @@multitable.
+
+ * doc/ptexinfmt.el (texinfo-copying-text, texinfo-copying)
+ (texinfo-insertcopying, texinfo-format-scan): Add them for old Emacsen.
+
+ * doc/Makefile.in (install): Remove installed *.info-[0-9] files;
+ install only *.info files.
+ (.texi.dvi): Don't specify "-l ja" to texi2dvi.
+ (clean): No need to remove *.info-[0-9] and *.info-[0-9][0-9] files.
+
+2007-10-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-find-coding-system): Return symbol, not coding
+ system object.
+
+2007-10-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-entity-regexp, w3m-entity-value): Accept case-insensitive
+ numeric character references.
+
+2007-10-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-message): Work with XEmacs.
+
+2007-10-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el: Bind w3m-use-title-buffer-name (see the comment).
+
+ * Makefile.in (very-slow): Add missing semicolon.
+
+2007-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-lisp): Don't install ChangeLog~.
+
+2007-10-02 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-show-error-information): When emacs-w3m cannot find
+ host, set charset to us-ascii.
+
+2007-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-show-decoded-url): Add entry for nikkei.co.jp.
+
+2007-09-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-decode-buffer): Don't decode escaped URLs.
+ (w3m-toggle-inline-images-internal): Escape non-ASCII characters in the
+ URL of the image before retrieving it.
+
+2007-09-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-safe-view-this-url): When a function which is
+ specified by `w3m-goto-article-function' returns the
+ `w3m-goto-url' symbol, it falls back to emacs-w3m displaying
+ functions. Cf. [emacs-w3m:09660]
+ (w3m-goto-article-function): Its comment is updated to follow the
+ above change.
+ (w3m-entity-value, w3m-decode-entities-string): Change to save
+ working memory.
+
+2007-09-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-entity-regexp): Bind max-specpdl-size for old Emacsen.
+ (w3m): Revert 2007-09-19 change.
+
+2007-09-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * NEWS: New file.
+
+2007-09-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-examine-command-line-args): Don't pass negative number to
+ nthcdr.
+
+ * w3m-session.el (w3m-session-save, w3m-session-select): Use mapc
+ instead of mapcar.
+
+2007-09-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Changes to stricten entities decoded by
+ `w3m-decode-entities'.
+ (w3m-entity-table, w3m-entity-reverse-table): New constants.
+ (w3m-entity-regexp): Stricten.
+ (w3m-entity-alist, w3m-entity-db, w3m-entity-db-size): Abolished.
+ (w3m-entity-value, w3m-decode-entities, w3m-decode-entities-string,
+ w3m-encode-specials-string): Rewritten to use the above constants.
+
+2007-09-21 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Support @fonttextsize, @textdegree.
+
+2007-09-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-examine-command-line-args): Rewrite.
+ (w3m): Always call it; set the 2nd arg new-session when Emacs 21 or
+ XEmacs runs in the batch mode.
+
+2007-09-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-examine-command-line-args): Inhibit Emacs head from
+ displaying startup screen when emacs-w3m runs in the batch mode;
+ improve parsing of arguments.
+
+2007-09-13 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-expand-path-name): Save the matched data surely.
+
+2007-09-09 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-expand-url): Use "/" as path when it of base-uri is not
+ defined; Clear query of base-uri when empty query exist; Changes to
+ follow RFC3986.
+
+2007-09-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-euc-japan-encoder, w3m-iso-latin-1-encoder): Use
+ mule-version to decide whether to redefine them.
+
+ * w3m.el: Use emacs-version instead of emacs-major-version to show the
+ version of Emacs that emacs-w3m doesn't support.
+
+2007-09-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-local-file-type): Regard news:* urls as text/html.
+ (w3m-w3m-retrieve): Return nil if retrieving failed.
+ (w3m-show-error-information): Improve error message for news:* urls.
+
+2007-09-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_PATH_EMACS): Improve expression of Emacs version.
+
+ * doc/ptexinfmt.el (ptexinfmt-broken-facility)
+ (ptexinfmt-defun-if-broken, ptexinfmt-defun-if-void)
+ (ptexinfmt-defvar-if-void): Don't use old-style backquotes.
+ (texinfo-format-cedilla-accent): Quote `,'.
+
+ * w3m-antenna.el (w3m-antenna-site-key, w3m-antenna-site-title)
+ (w3m-antenna-site-class, w3m-antenna-site-url)
+ (w3m-antenna-site-last-modified, w3m-antenna-site-size)
+ (w3m-antenna-site-size-detected): Don't use old-style backquotes.
+
+ * w3m-ccl.el (w3m-ccl-write-repeat, w3m-euc-japan-decoder)
+ (w3m-euc-japan-encoder, w3m-iso-latin-1-decoder)
+ (w3m-iso-latin-1-encoder): Don't use old-style backquotes.
+
+ * w3m-dtree.el (w3m-dtree-has-child): Don't use old-style backquotes.
+
+ * w3m-form.el (w3m-form-method, w3m-form-action, w3m-form-charlst)
+ (w3m-form-enctype, w3m-form-plist, w3m-form-get-property, w3m-form-put)
+ (w3m-form-get): Don't use old-style backquotes.
+
+ * w3m-namazu.el (w3m-namazu-default-index-customize-spec): Don't use
+ old-style backquotes.
+
+ * w3m-util.el (w3m-static-if, w3m-static-when, w3m-static-unless)
+ (w3m-condition-case, w3m-add-text-properties)
+ (w3m-get-text-property-around, w3m-action, w3m-anchor, w3m-image)
+ (w3m-submit, w3m-anchor-sequence): Don't use old-style backquotes.
+
+ * w3m.el (w3m-dirlist-cgi-program): Don't use old-style backquotes.
+
+ * w3mhack.el (char-before, match-string-no-properties)
+ (set-text-properties): Don't use old-style backquotes.
+
+ * w3m-filter.el: Set file's coding-system to euc-japan in order to
+ enable non-Mule XEmacsen to byte-compile this module.
+
+2007-08-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top): Remove unnecessary space at the line end.
+ (w3m-use-title-buffer-name): New option.
+ (w3m-copy-buffer): Use `w3m-generate-new-buffer' instead of
+ `generate-new-buffer'.
+ (w3m-pack-buffer-numbers): Call `w3m-form-set-number' with new name of
+ buffer.
+ (w3m-buffer-setup): Use `w3m-generate-new-buffer' instead of
+ `generate-new-buffer'.
+ (w3m-buffer-setup): Do not display title if w3m-use-title-buffer-name
+ is non-nil.
+ (w3m-modeline-title): Retrun "" if w3m-use-title-buffer-name is
+ non-nil.
+ (w3m-goto-url): Call `w3m-buffer-name-add-title' when display.
+ (w3m): Use `w3m-generate-new-buffer' instead of `generate-new-buffer'.
+ (w3m-use-header-line-title): New option.
+
+ * w3m-form.el (w3m-form-set-number): Change 2'nd argument to `newname'
+ from `count'.
+
+ * w3m-util.el (top): Add the variable definition of
+ `w3m-use-title-buffer-name' to avoid byte-compile warnings.
+ (w3m-buffer-number): Support the feature of buffer-name with title.
+ (w3m-buffer-set-number): Ditto.
+ (w3m-generate-new-buffer): Ditto.
+ (w3m-buffer-name-lessp): Ditto.
+ (w3m-buffer-name-add-title): New inline macro.
+
+ * w3m-ems.el (top): Add the variable definition of
+ `w3m-use-header-line-title' to avoid byte-compile warnings.
+ (w3m-setup-header-line): If `w3m-use-header-line-title' is not nil,
+ display title and URI.
+
+2007-08-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (top): Add the function definition of
+ `w3m-decode-coding-string-with-priority' to avoid byte-compile
+ warnings.
+
+ * w3m-ems.el (top): Add the variable definition of
+ `w3m-default-coding-system' and `w3m-coding-system' to avoid
+ byte-compile warnings.
+
+ * w3m-xmas.el (top): Add the variable definition of `w3m-coding-system'
+ to avoid byte-compile warnings.
+
+2007-08-29 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-proc.el (w3m-process-filter): Decode realm string.
+
+ * w3m.el (w3m-url-decode-string): Define latter half as a function :
+ w3m-decode-coding-string-with-priority ,and use it.
+
+ * w3m-ems.el (w3m-decode-coding-string-with-priority): New function.
+
+ * w3m-xmas.el (w3m-decode-coding-string-with-priority): Return string
+ itself unless find-coding-system is defined as built-in function.
+
+2007-08-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-uri-replace-alist): Add key of "alc:".
+ (w3m-relationship-estimate-rules): Add alc's rule.
+ (w3m-relationship-alc-estimate): New function.
+
+ * w3m-search.el (w3m-search-engine-alist): Add rule of
+ http://eow.alc.co.jp/.
+
+ * w3m-filter.el (w3m-filter-rules): Add w3m-filter-alc.
+ (w3m-filter-alc): New function. Supper `goFairWord'.
+
+2007-08-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-mailto-url): Make it work even with no rfc2368.el.
+
+2007-08-21 Eugene Oleinik <eo@aoizora.org>
+
+ * w3m-filter.el (w3m-filter-google-separator): New user option.
+ (w3m-filter-google): Replace hard-coded ones with it.
+ (w3m-filter): Iterate through all cases in w3m-filter-rules.
+ (w3m-filter-replace-regexp): New function.
+
+2007-08-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-detect-xml-type): New function that treats
+ application/xml looking like xhtml+xml as text/html.
+ (w3m-content-type-alist): Use it for application/xml.
+ (w3m-w3m-parse-header): Parse Alternates header for a real url.
+ (w3m-w3m-retrieve-1): Retrieve real url according to Alternates header.
+ (w3m-external-view): Treat xhtml+xml as html.
+
+2007-07-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el: Changes to download contents after submitting form.
+ (w3m-form-download): New variable.
+ (w3m-fontify-textareas, w3m-form-parse-and-fontify): Combine the above
+ variable into expressions which represent form actions.
+ (w3m-form-submit): Accept and optional argument `download'.
+
+ * w3m.el: Changes to download contents after submitting form.
+ (w3m-download): Accept and optional argument `post-data'.
+ (w3m-download-this-url): `w3m-form-download' is binded locally.
+ (w3m-view-this-url): Ditto.
+ (w3m-submit-form): Ditto.
+
+2007-07-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ucs.el (font-ccl-encoder-alist): Bind it for XEmacs 21.5.
+
+2007-07-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-relationship-estimate-rules): Make Google rule support
+ images.
+
+2007-07-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-session.el (w3m-session-select, w3m-session-selected): Add spec
+ for dark tty.
+ (w3m-session-select): Use read-key-sequence rather than read-event or
+ next-command-event in order to enable it to read arrow keys in tty.
+
+2007-07-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-make-button): Make it work.
+
+ * w3m-ems.el (w3m-form-make-button): Work when w3m-form-use-fancy-faces
+ is nil.
+
+2007-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-article-function): Change the default function into
+ browse-url; doc fix.
+ (w3m-safe-view-this-url): Catch a signal from function which is set to
+ w3m-goto-article-function, and don't run the default function if it is
+ nil.
+
+2007-07-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-article-function): Use defcustom; doc fix.
+ (w3m-safe-view-this-url): Use functionp instead of fboundp to check the
+ value of w3m-goto-article-function.
+
+ * w3m-favicon.el, w3m-namazu.el, w3m-perldoc.el, w3m-xmas.el, w3m.el:
+ Use custom-set-default instead of set-default in defcustom forms.
+
+2007-07-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-help-echo): Make the function for Emacs bind
+ deactivate-mark to nil.
+
+2007-06-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el, w3m-form.el, w3m-lnum.el, w3m-search.el, w3m-session.el
+ * w3m.el: Rename w3m-FOO-face with w3m-FOO.
+
+2007-06-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Format @key{...}.
+
+2007-06-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-lynx-like-map, w3m-info-like-map): Bind [backtab] to
+ w3m-previous-anchor.
+
+2007-06-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-local-retrieve, w3m-w3m-retrieve, w3m-about-retrieve)
+ (w3m-cid-retrieve, w3m-data-retrieve, w3m-retrieve, w3m-about-header):
+ Change the term and the symbol name `no-decode' into `no-uncompress'.
+
+2007-06-08 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-w3m-retrieve): Check if content-type is wrong after
+ decoding encoded contents.
+
+ * w3m-ems.el (w3m-create-image, w3m-create-resized-image): Decode
+ content retrieving image.
+
+ * w3m-xmas.el (w3m-create-image, w3m-create-resized-image): Ditto.
+
+2007-06-07 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-search.el (w3m-search-engine-alist): Add output encoding argument
+ to google search.
+
+2007-06-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-image.el (w3m-imagick-convert-program, w3m-resize-images): Reset
+ them if convert program is not really available.
+ (w3m-imagick-convert-program-available-p): New function.
+ (w3m-imagick-convert-buffer, w3m-imagick-start-convert-data): Use it.
+
+2007-06-05 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m-image.el (w3m-imagick-start-convert-data): Clarify message which
+ is issued when convert program is not available.
+
+2007-06-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-mixi): Follow the change of Mixi's HTML.
+
+2007-06-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * attic/vm-w3m.el, attic/vm-7.19.patch: Remove. They have been
+ integrated into VM 8.x.
+
+2007-05-17 Tatsuya Kinoshita <tats@vega.ocn.ne.jp>
+
+ * w3m.el (w3m-view-this-url-1): Check whether the marker buffer exists.
+
+2007-05-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-switch-to-buffer, w3m-subst-switch-to-buffer-keys):
+ Remove.
+
+2007-05-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-expand-url): Guard error in aref when url is "".
+
+2007-05-16 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-expand-url): Remove query strings when expanding URL like
+ "foo.cgi?#bar"; add "./" to top of URL when expanding "?hoge".
+
+2007-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-switch-to-buffer): Work just like switch-to-buffer.
+ Suggested by Robert J. Chassell <bob@rattlesnake.com>.
+
+2007-05-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-encode-string, w3m-url-transfer-encode-string): Use
+ uppercase letters in hexadecimal string. Suggested by Lukasz Demianiuk
+ <ldemianiuk@gmail.com>.
+
+2007-05-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-header-line-url): New function.
+ (w3m-url-at-point): Call w3m-header-line-url after
+ w3m-gmane-url-at-point.
+ (w3m-goto-url-with-timer): Execute w3m-goto-url if its buffer does not
+ exist foreground.
+
+2007-05-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (all): Revert SHIRAI's 2007-04-24 changes and fix it to
+ accompany Ito-san's patch [w3m-dev 04233].
+ (w3m-display-ins-del): New option.
+ (w3m-support-emacs-w3m): Remove this variable.
+ (w3m-strike-through-face): Modify.
+ (w3m-insert-face): Ditto.
+ (w3m-strike-through-face-no-windowsystem): Remove this face.
+ (w3m-fontify-insert): Remove this variable.
+ (w3m-halfdump-command-arguments): Remove w3m-support-emacs-w3m.
+ (w3m-halfdump-command-common-arguments): Add w3m-display-ins-del
+ support.
+ (w3m-fontify-strike-through): Rewrite.
+ (w3m-fontify-insert): Ditto.
+ (w3m-set-display-ins-del): New function.
+ (w3m-rendering-half-dump): Call w3m-set-display-ins-del.
+
+2007-04-30 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-resume): Also resume contents of forms without
+ name.
+ (w3m-fontify-textareas): Also fontify textareas without name.
+ (w3m-form-field-parse): Also parse form fields without name.
+
+2007-04-28 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-decode-buffer): Use w3m-url-transfer-encode-string
+ instead of w3m-url-encode-string.
+
+2007-04-27 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-view-this-url): Check if w3m-current-url is string before
+ matching.
+
+2007-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Fully decode a source by default.
+ (w3m-view-source): Doc fix.
+
+2007-04-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-goto-url): Redisplay to search an anchor sure with
+ goto-new-session.
+
+2007-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-source-decode-level): New variable.
+ (w3m-decode-buffer): Control how much it decodes an html source
+ according to w3m-view-source-decode-level.
+ (w3m-view-source): Bind w3m-view-source-decode-level with prefix arg.
+
+2007-04-25 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-decode-buffer): Encode urls containing non-ASCII
+ characters quoted with '' as well as those quoted with "".
+ (w3m-goto-url): Decode urls when url is local.
+
+ characters when displaying an html source.
+
+2007-04-24 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-decode-buffer): Use charset specified in meta tag even
+ for decoding html source.
+
+2007-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-lisp): Install shimbun/ChangeLog file.
+
+2007-04-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-support-emacs-w3m): New variable.
+ (w3m-compile-options): Set w3m-support-emacs-w3m to t if w3m compiled
+ with emacsdump.
+ (w3m-strike-through-face-no-windowsystem): New face.
+ (w3m-halfdump-command-arguments): Use '-emacsdump' instead of
+ '-halfdump' when w3m has it.
+ (w3m-fontify-strike-through): Support w3m-support-emacs-w3m.
+ (w3m-fontify-insert): Ditto.
+
+2007-04-24 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-goto-url): Set truncate-lines to nil, if a source or
+ header view.
+ (w3m-view-source): Remove to set truncate-lines.
+ (w3m-view-header): Ditto.
+
+2007-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * ChangeLog, ChangeLog.1: Separate shimbun entries.
+ (Local Variables): Set fill-column to 79.
+
+2007-04-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-input-textarea-filename): Use MD5 first.
+
+2007-04-14 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m-form.el (w3m-form-input-textarea-filename): Truncate filename
+ into less than or equal to 255 bytes long.
+
+2007-04-06 Matt Hodges <M.P.Hodges@rl.ac.uk>
+
+ * w3m.el (w3m-next-buffer): Fix last change when w3m-fb-mode.
+
+2007-04-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-parent-page): Use numbered prefix argument to move
+ the parent directory according to input number.
+
+2007-03-31 Andreas Seltenreich <seltenreich@gmx.de>
+
+ * w3m.el (w3m-external-view-file): Actually kill the temporary buffer.
+
+2007-03-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-ems.el (w3m-tab-mouse-track-selected-tab): Sleep anyway.
+ (w3m-tab-make-keymap): Add key-bindings for mouse wheel-up|down to
+ w3m-mode-map.
+
+2007-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug-system-informations): Add gtk.
+ (report-emacs-w3m-bug): Bind print-quoted to t.
+
+ * w3m-ems.el (w3m-force-window-update): Do split-window-vertically
+ instead of performing enlarge-window/shrink-window for Emacs 21.
+ (w3m-tab-mouse-track-selected-tab): Add `decelerate' argument; use it
+ instead of to check the value of this-command.
+ (w3m-tab-move-right): Set it.
+ (w3m-tab-make-keymap): Rearrange.
+ (w3m-update-tab-line): Remove.
+
+ * w3m.el (w3m-select-buffer-update): Use w3m-force-window-update
+ instead of w3m-update-tab-line.
+
+2007-03-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-ems.el (w3m-tab-mouse-track-selected-tab): Tiny fix.
+ (w3m-tab-make-keymap): Use next|previous-buffer-action instead of
+ w3m-tab-next|previous-buffer.
+
+2007-03-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-tab-mouse-track-selected-tab): Ignore mouse position
+ info if mouse points to other frame; recognize wheel-up and wheel-down
+ in addition to mouse-4 and mouse-5; don't respond to too fast operation
+ of mouse wheel for moving a tab.
+
+2007-03-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-tab-track-mouse): New variable.
+ (w3m-tab-mouse-position-adjuster): Express the values in pixel units
+ rather than the number of characters.
+ (w3m-tab-mouse-track-selected-tab): Be controlled by
+ w3m-tab-track-mouse; calculate the mouse position in pixel units rather
+ than the number of characters.
+ (w3m-tab-make-keymap): Make the buffer selected by a tab the current
+ buffer before performing w3m-tab-move-(left|right).
+ (w3m-tab-separator-map): New keymap.
+ (w3m-tab-separator): Use it as the local-map property.
+ (w3m-tab-line): Use it as the local-map property in trailing space.
+
+2007-03-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el (w3m-tab-unselected-face)
+ (w3m-tab-unselected-retrieving-face, w3m-tab-selected-face)
+ (w3m-tab-selected-retrieving-face, w3m-tab-mouse-face): Make background
+ colors bright.
+ (w3m-tab-mouse-position-adjuster): New variable.
+ (w3m-tab-mouse-track-selected-tab, w3m-tab-next-buffer)
+ (w3m-tab-previous-buffer, w3m-tab-move-right, w3m-tab-move-left): New
+ functions.
+ (w3m-tab-map): Bind C-wheel-up and C-mouse-4 to w3m-tab-move-left; bind
+ C-wheel-down and C-mouse-5 to w3m-tab-move-right; use
+ w3m-tab-previous-buffer and w3m-tab-next-buffer instead of
+ w3m-previous-buffer and w3m-next-buffer.
+ (w3m-tab-separator): Add tab-separator property.
+
+ * w3m.el (w3m-next-buffer): Fix calculation.
+ (w3m-lynx-like-map, w3m-info-like-map): Bind `C-c C-,' and `C-c C-<' to
+ w3m-tab-move-left, and bind `C-c C-.' and `C-c C->' to
+ w3m-tab-move-right for GNU Emacs.
+
+2007-03-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-add-tab-number): New user option.
+
+ * w3m-ems.el (top): Add w3m-add-tab-number to avoid byte-compile
+ warnings.
+ (w3m-tab-line): Display sequential number on tab title when
+ w3m-add-tab-number is not nil.
+
+ * w3m.el (w3m-menubar): Add w3m-session-save and w3m-session-select.
+ (w3m-tab-button-menu-commands): Ditto.
+
+2007-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ems.el: New file merging w3m-e21.el, w3m-e23.el and w3m-fsf.el.
+ (image-size): No need to silence the byte compiler.
+ (w3m-ccl-get-ucs-codepoint-with-emacs-unicode): Remove.
+ (w3m-euc-japan-encoder, w3m-euc-japan-encoder)
+ (w3m-iso-latin-1-encoder, w3m-iso-latin-1-encoder): Redefine them only
+ for Emacs 22 and earlier.
+
+ * w3m-e21.el, w3m-e23.el, w3m-fsf.el: Remove.
+
+ * w3m.el: Load w3m-ems.el instead of w3m-e21.el or w3m-e23.el.
+ (w3m-fontify-strike-through): Remove variable.
+
+ * w3mhack.el (w3mhack-mdelete): Remove.
+ (w3mhack-module-list): Use w3m-ems.el instead of w3m-fsf.el and
+ w3m-e21.el or w3m-e23.el.
+
+ * Makefile.in (tarball): No need to exclude w3m-e23.el.
+
+2007-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_SET_XEMACSDEBUG): Fix the way to quote the value of
+ XEMACSDEBUG. Reported by Norbert Koch <nk@viteno.net>.
+
+2007-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_SET_XEMACSDEBUG): Quote VANILLA_FLAG.
+
+2007-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_SET_XEMACSDEBUG): New function; set XEMACSDEBUG
+ environment variable, which is eval'd when XEmacs 21.5 starts, to the
+ Lisp form, which sets `log-warning-minimum-level' to `error', in order
+ to suppress warnings for Lisp shadows when XEmacs 21.5 starts.
+ (AC_PATH_EMACS): Run AC_SET_XEMACSDEBUG.
+ (AC_EMACS_LISP, AC_ADD_LOAD_PATH): Use XEMACSDEBUG.
+
+ * Makefile.in (XEMACSDEBUG): New variable.
+ (lisp, what-where, install-package, install-package-ja, dist)
+ (.el.elc, slow, very-slow): Use it.
+
+ * doc/Makefile.in (XEMACSDEBUG): New variable.
+ (EMACSINFO, version.texi, install-en, install-ja): Use it.
+
+ * w3mhack.el: Reset `log-warning-minimum-level' to `info'.
+
+2007-03-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-session.el (w3m-session-deleted-save): Sort buffers to use their
+ name.
+
+2007-03-13 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (autoload): Add w3m-session-deleted-save.
+ (w3m-delete-buffer): Call w3m-session-deleted-save.
+ (w3m-delete-other-buffers): Call w3m-delete-buffers instead of piece of
+ code.
+ (w3m-delete-buffers): Call w3m-session-deleted-save.
+
+ * w3m-session.el (w3m-session-deleted-save): New option.
+ (w3m-session-deleted-title): Ditto.
+ (w3m-session-deleted-keep-number): Ditto.
+ (w3m-session-deleted-save): New function.
+ (w3m-session-select): Display URLs.
+ (w3m-session-select): Add key assignment; `k' and `j'.
+
+2007-03-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug): Use a new buffer to compose a mail
+ if at least mail-user-agent is sendmail-user-agent that is the default.
+ cf. http://article.gmane.org/gmane.emacs.devel/67501
+
+2007-03-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-load-file): Advise make-autoload to
+ support define-minor-mode if it should be necessary.
+
+2007-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-async-exec-with-many-urls): New variable; default to t
+ except for XEmacs 21.5.
+ (w3m-goto-url): Bind w3m-async-exec to nil when retrieving group:* urls
+ if w3m-async-exec-with-many-urls is nil.
+
+ * w3m-session.el (w3m-session-goto-session): Bind w3m-async-exec to nil
+ if w3m-async-exec-with-many-urls is nil.
+
+2007-03-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-session.el (w3m-session-select): Use next-command-event and
+ event-key for XEmacs with checked surely.
+
+2007-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-session.el (w3m-session-automatic-save): Remove unused vars.
+ (w3m-session-select): Use next-command-event for XEmacs; clear the echo
+ area after entering command.
+
+2007-03-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (autoload): Add w3m-session-select, w3m-session-save and
+ w3m-session-automatic-save.
+ (w3m-lynx-like-map): Add w3m-session-select and w3m-session-save to
+ map.
+ (w3m-info-like-map): Ditto.
+ (w3m-arrived-shutdown-functions): Add w3m-session-automatic-save.
+ (w3m-quit): Call w3m-session-automatic-save.
+
+ * w3m-session.el: New file.
+
+2007-02-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-rules): Add rules for the site of Amazon
+ and Mixi.
+ (w3m-filter-amazon-regxp): New option.
+ (w3m-filter-amazon-short-url-bottom): Ditto.
+ (w3m-filter-google): Add doc-string.
+ (w3m-filter-amazon): New function.
+ (w3m-filter-mixi): New function.
+
+2007-02-24 Tatsuya Kinoshita <tats@vega.ocn.ne.jp>
+
+ * Makefile.in, doc/Makefile.in (clean): Remove doc/version.texi.
+
+2007-02-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Improve further regexp matching urls
+ containing non-ASCII characters.
+
+2007-02-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Improve regexp matching urls containing
+ non-ASCII characters.
+
+2007-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Encode urls containing non-ASCII
+ characters.
+
+2007-02-06 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-decode-entities): Don't decode things like entities in
+ forms of the text or the select type having the name property.
+
+2007-02-05 Naohiro Aota <nao.aota@gmail.com>
+
+ * w3m.el (w3m-fontify): Don't delete things like tags in forms of
+ type=text as well as of type=textarea.
+
+2007-02-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-arrived-intern): New macro, that normalizes urls by
+ stripping last `/'s.
+ (w3m-arrived-add, w3m-arrived-p, w3m-arrived-time)
+ (w3m-arrived-put, w3m-arrived-get): Use it.
+ (w3m-create-text-page): Make sure to set w3m-current-title.
+
+2007-02-04 David Hansen <david.hansen@physik.fu-berlin.de>
+
+ * w3m.el (w3m-relationship-estimate-rules): Added
+ `w3m-relationship-slashdot-estimate'.
+ (w3m-relationship-slashdot-estimate): New function.
+
+2007-02-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-menu-on-forefront): New variable.
+ (w3m-setup-menu): Use it.
+
+ * w3m-e21.el (w3m-menu-on-forefront): New function.
+
+ * w3m-xmas.el (w3m-menu-on-forefront): New function.
+ (w3m-setup-menu): Use it.
+
+ * w3m-bookmark.el (w3m-setup-bookmark-menu): Don't arrange the order of
+ the menu items here.
+ * w3m-tabmenu.el (w3m-setup-tab-menu): Ditto.
+
+2007-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in, doc/Makefile.in: Add datarootdir setting that is
+ required for newer autoconfs.
+
+ * w3m.el (w3m-lynx-like-map, w3m-info-like-map): Use (featurep 'gtk)
+ instead of (boundp 'gtk-version-string); use down-mouse-3 instead of
+ mouse-3, and bind drag-mouse-3 and mouse-3 to undefined for GTK Emacs.
+
+ * w3m-e21.el (w3m-use-toolbar)
+ (w3m-toolbar-icon-preferred-image-types): Use (featurep 'gtk) instead
+ of (boundp 'gtk-version-string).
+ (w3m-toolbar-configurations): Select frame visiting buffer which is
+ about to apply configurations; use (featurep 'gtk) instead of \(boundp
+ 'gtk-version-string); enable it for GTK Emacs; exclude
+ auto-resize-tool-bars and auto-raise-tool-bar-buttons.
+
+2007-01-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-clean-hook-options): Remove.
+
+2007-01-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-search.el (w3m-search-read-query): Check that face property is
+ `list' to avoid argument error.
+
+2007-01-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-define-w3m-make-ccl-coding-system): Rename from
+ w3m-xmas-define-w3m-make-ccl-coding-system.
+ (w3m-toolbar-make-buttons): Rename from w3m-xmas-make-toolbar-buttons.
+ (w3m-define-missing-widgets): Rename from
+ w3m-xmas-define-missing-widgets.
+ (w3m-show-current-title-in-buffer-tab): Rename from
+ w3m-xmas-show-current-title-in-buffer-tab.
+ (w3m-setup-tab-in-gutter): Rename from w3m-xmas-setup-tab-in-gutter.
+ (w3m-update-tab-in-gutter): Rename from w3m-xmas-update-tab-in-gutter.
+
+ * w3m-e21.el (w3m-toolbar-icon-preferred-image-types)
+ (w3m-toolbar-icon-preferred-image-types): Use w3m-update-toolbars
+ instead of w3m-setup-toolbar.
+ (w3m-toolbar-configurations): Rename from
+ w3m-e21-toolbar-configurations; make it customizable for LUCID Emacs.
+ (w3m-toolbar-define-keys): Rename from w3m-e21-setup-toolbar; don't
+ apply w3m-toolbar-configurations here.
+ (w3m-toolbar-make-buttons): Rename from w3m-e21-make-toolbar-buttons.
+ (w3m-toolbar-set-configurations): New function.
+ (w3m-setup-toolbar): Remove force argument; apply
+ w3m-toolbar-configurations here.
+ (w3m-update-toolbars): New function.
+ (w3m-switch-to-buffer): Rename from w3m-e21-switch-to-buffer.
+ (w3m-subst-switch-to-buffer-keys): Rename from
+ w3m-e21-subst-switch-to-buffer-keys.
+
+ * w3m.el (w3m-message): Clear previous message only if it is longer
+ than the window width and running Emacs 22 and greater.
+
+2007-01-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-toolbar-icon-preferred-image-types)
+ (w3m-toolbar-use-single-image-per-icon): New variables.
+ (w3m-find-image): New function.
+ (w3m-xmas-make-toolbar-buttons): Use it; add force argument.
+ (w3m-setup-toolbar): Use it; add force and buffer arguments.
+ (w3m-initialize-graphic-icons): Use it.
+
+ * w3m-e21.el (w3m-toolbar-icon-preferred-image-types)
+ (w3m-toolbar-use-single-image-per-icon): Apply customized value to tool
+ bar immediately.
+ (w3m-e21-make-toolbar-buttons, w3m-setup-toolbar): Add force arg.
+
+2007-01-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * icons/*.png, icons30/*.png: New files.
+
+ * Makefile.in (install-icons, install-icons30): Install png files.
+
+ * w3mhack.el (w3mhack-nonunix-install, w3mhack-make-package): Install
+ png files.
+ (w3mhack-what-where): Update for png files.
+
+ * w3m-e21.el (w3m-use-toolbar): Check whether tool-bar and
+ gtk-version-string are available.
+ (w3m-toolbar-icon-preferred-image-types)
+ (w3m-toolbar-use-single-image-per-icon): New variables.
+ (w3m-find-image): New function.
+ (w3m-e21-make-toolbar-buttons, w3m-setup-toolbar)
+ (w3m-initialize-graphic-icons): Use it.
+
+2007-01-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-halfdump-command-arguments): Generate the right values
+ for non-Mule XEmacs.
+
+2007-01-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-message): Clear previous message first. Suggested by
+ David Hansen <david.hansen@gmx.net>.
+
+2007-01-18 Friedrich Delgado Friedrichs <delgado@dfn-cert.de>
+
+ * w3m-proc.el (w3m-process-ssl-passphrase): New variable.
+ (w3m-process-filter): Enable w3m to authenticate itself with a client
+ certificate.
+
+2007-01-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el: Autoload iswitchb-read-buffer when compiling.
+
+2007-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-e21-switch-to-buffer): Add iswitchb-mode support.
+
+2007-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-modeline-title): Don't use w3m-force-window-update which
+ obstructs viewing of large images. Reported by Chris Moore
+ <dooglus@gmail.com>.
+
+2006-12-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-rules): Add rule for the site of Google.
+ (w3m-filter-google-use-utf8): New user option.
+ (w3m-filter-google-use-ruled-line): Ditto.
+ (w3m-filter-google): New function.
+
+2006-12-13 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Fix amazon entry.
+
+2006-12-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_EXAMINE_PACKAGEDIR): Check for
+ (early|late|last)-package-hierarchies as well as
+ (early|late|last)-packages; prefer them to configure-package-path.
+
+2006-12-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el: Changes to create a new session after submitting form.
+ (w3m-form-new-session): New variable.
+ (w3m-fontify-textareas, w3m-form-parse-and-fontify): Combine the above
+ variable into expressions which represent form actions.
+ (w3m-form-submit): Accept and optional argument `new-session'.
+
+ * w3m.el: Changes to create a new session after submitting form.
+ (w3m-submit-form): Accept and optional argument `new-session'.
+ `w3m-form-new-session' is binded locally.
+ (w3m-view-this-url): `w3m-form-new-session' is binded locally.
+
+2006-12-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-parent-page): Add prefix argument `TOP'. If TOP is
+ non-nil, visit the top of this site."
+ (w3m-parent-page-available-p): Fix regexp.
+
+2006-12-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * patches/README: Update.
+ * patches/italic-text.patch: New file.
+ * patches/dot-domain.patch: New file.
+ * patches/file-progress.patch: Renew.
+ * patches/w3m-0.2.1-inu-1.5-solaris-xemacs.patch: Remove.
+ * patches/no-proxy.patch: Remove.
+
+2006-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-italic-face): New face.
+ (w3m-fontify-italic): New function.
+ (w3m-fontify): Use it.
+
+2006-11-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (w3m-mail-compose-with-mew): Refrain handling of
+ `current-prefix-arg'.
+
+2006-11-14 Ren Lifeng <lfren@cad.zju.edu.cn>
+
+ * w3m-cookie.el (w3m-cookie-1-acceptable-p): Accept cookie whose domain
+ attribute is ".foo.barz.bar" from host "foo.barz.bar".
+ (w3m-cookie-retrieve): Send cookie whose domain attribute is
+ ".foo.barz.bar" when requesting host "foo.barz.bar".
+
+2006-11-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el (w3m-mail-compose-with-vm): Require vm-startup.
+
+2006-11-20 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * w3m-mail.el (w3m-mail-compose-with-semi): Require mime-edit.
+
+2006-10-11 David Hansen <david.hansen@physik.fu-berlin.de>
+
+ * w3m.el (w3m-relationship-estimate-rules): Support for google code
+ search added.
+
+2006-10-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el, w3m-bookmarks.el, w3m-search.el: Remove misadded Luca Capello
+ from the Authors field.
+
+2006-10-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-compatible-encoding-alist): Add iso-8859-8/windows-1255
+ and iso-8859-9/windows-1254.
+
+2006-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el (w3m-mail-compose-with-vm): Treat source as binary data
+ for images; encode source according to charset; use mail-send-actions
+ to kill source buffer.
+ (w3m-mail): Examine charset when the page is displayed normally.
+
+ * w3m-util.el (w3m-coding-system-to-mime-charset): Rename to
+ w3m-coding-system-to-charset and move to w3m.el
+
+ * w3m.el (w3m-coding-system-to-charset): Move from w3m-util.el.
+ (w3m-buffer): New function.
+
+2006-09-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mail-user-agents): Add vm-user-agent.
+
+ * w3m-mail.el (w3m-mail-user-agent-compose-function-alist): Add
+ vm-user-agent.
+ (w3m-mail-compose-with-vm): New function.
+ (w3m-mail-goto-body-and-clear-body): New function.
+ (w3m-mail-position-point): New function.
+ (w3m-mail-compose-with-mml, w3m-mail-compose-with-semi): Use them.
+
+2006-09-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (w3m-mail-compose-with-mew): Handle coding-system and
+ charset accurately. When call with `current-prefix-arg', try to use
+ existing draft buffer.
+
+ * w3m-mail.el (w3m-mail): Bind `w3m-history-reuse-history-elements' to
+ 'reload.
+
+2006-09-29 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * w3m-mail.el (w3m-mail-compose-with-semi): Handle types other than
+ text/html as well. Decide the charset when the charset is nil though
+ the content-type is a text.
+
+2006-09-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el (w3m-mail-compose-with-mml): Treat source as binary data
+ for images (we will probably have to do so for some more types); pass
+ content-type argument to MML.
+
+2006-09-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mail-user-agents): Add mew-user-agent.
+
+ * w3m-mail.el (top): Autoload w3m-mail-compose-with-mew
+ (w3m-mail-user-agent-compose-function-alist): Add mew-user-agent.
+ (w3m-mail-compose-with-mml): Add `content-type' argument
+ (w3m-mail-compose-with-semi): Ditto.
+ (w3m-mail): Handle `content-type' and `about://header/'.
+
+ * mew-w3m.el (w3m-mail-compose-with-mew): New function. Add
+ `content-type' argument and handle it.
+
+2006-09-28 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * w3m-mail.el (w3m-mail-user-agent-compose-function-alist): Add
+ wl-user-agent.
+ (w3m-mail-compose-with-semi): New function.
+
+ * w3m.el (w3m-mail-user-agents): Add wl-user-agent.
+
+2006-09-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-coding-system-to-mime-charset): New function.
+
+ * w3m-mail.el (w3m-mail-compose-with-mml): Bind gnus-newsgroup-name to
+ nil while composing mail if gnus-user-agent is used instead of removing
+ X-Draft-From header.
+ (w3m-mail): Use w3m-coding-system-to-mime-charset.
+
+2006-09-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el (w3m-mail-compose-with-mml): Remove X-Draft-From header;
+ make charset argument a string.
+ (w3m-mail): Make charset argument to be passed to composer a symbol.
+
+2006-09-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-mail.el: New file.
+
+ * w3m.el: Autoload w3m-mail.
+ (w3m-mail-user-agents): New variable.
+ (w3m-menubar): Add w3m-mail.
+
+2006-09-26 Luca Capello <luca@pca.it>
+
+ * w3m-search.el (w3m-search-new-session): New command.
+ (w3m-search-read-variables): Ditto.
+ (w3m-search-do-search): Ditto.
+ (w3m-search): Rewrite to use the new commands above; add myself to the
+ authors list.
+
+ * w3m.el (autoload): Add w3m-search-new-session.
+ (w3m-menubar): Add w3m-search-new-session.
+ (w3m-info-like-map): Add w3m-search-new-session at the place of the
+ called-interactively w3m-search to be compliant with the other
+ *-new-session key-bindings.
+ (w3m-mode): Add description of w3m-search-new-session to docstring.
+
+2006-09-25 Luca Capello <luca@pca.it>
+
+ * w3m-bookmark.el: Add myself to the authors list, forgotten when
+ submitting the patch for w3m-bookmark-view-new-session.
+
+ * w3m.el: Ditto.
+
+2006-09-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-tab-make-keymap): Support mouse wheel on the tab.
+
+ * w3m-e23.el (w3m-tab-make-keymap): Ditto.
+
+2006-09-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-fb.el: Bind w3m-delete-buffer, w3m-fb-frame-parameter,
+ w3m-list-buffers, w3m-next-buffer, and w3m-pop-up-frames when
+ compiling.
+
+2006-09-16 David Hansen <david.hansen@physik.fu-berlin.de>
+
+ * w3m.el (w3m-relationship-estimate-rules): Changed freshmeat URL
+ regexp.
+
+2006-09-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-lynx-like-map, w3m-info-like-map): Don't bind M-g key
+ because Emacs 22 uses it as a prefix command in global map. Suggested
+ by David Hansen <david.hansen@gmx.net>.
+
+2006-09-09 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Instruct explicitly Google
+ to return English pages for google-en.
+
+2006-09-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-default-directory): New variable.
+ (w3m-current-directory): Use it.
+
+2006-09-05 David Hansen <david.hansen@gmx.net>
+
+ * w3m.el (w3m-local-find-file-regexps): Default to '(nil
+ . "\\.[sx]?html?\\'").
+
+2006-08-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-enable-google-feeling-lucky): New variable.
+ (w3m-input-url): Disable the Google feeling lucky feature if it is nil.
+
+2006-08-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-show-decoded-url): Add entry for ohmynews.co.jp.
+
+2006-08-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-relationship-search-patterns): Call
+ `w3m-decode-anchor-string' in order to decode "&amp;" in anchor
+ strings.
+ (w3m-relationship-freshmeat-estimate): Removed.
+ (w3m-relationship-estimate-rules): Use
+ `w3m-relationship-simple-estimate' instead of the above, to simplify
+ related codes.
+
+2006-08-11 David Hansen <david.hansen@pysik.fu-berlin.de>
+
+ * w3m.el (w3m-relationship-oddmuse-estimate): New function.
+ (w3m-relationship-freshmeat-estimate): New function.
+ (w3m-relationship-estimate-rules): Fixed regexp for google groups.
+ Added above new functions.
+
+2006-07-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-truncate-string): Don't autoload mule-util.el.
+
+2006-06-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items-precbuf): New internal
+ variable.
+ (w3m-tab-menubar-make-items-prebuflst): Ditto.
+ (w3m-tab-menubar-make-items-preurl): Ditto.
+ (w3m-tab-menubar-make-items-preitems): Ditto.
+ (w3m-tab-menubar-make-items): Set an use previous variables to used for
+ the speed improvement.
+
+ * w3m-util.el (w3m-make-menu-commands-keys): New internal variable.
+ (w3m-make-menu-commands): Set and use `w3m-make-menu-commands-keys to
+ used for the speed improvement.
+
+2006-06-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * attic/rfc2368.el: Copy from Emacs 22; modify rfc2368-unhexify-string
+ to work with both Emacs and XEmacs.
+
+2006-05-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-this-url-1): Set 5th argument of `w3m-copy-buffer'
+ to `w3m-new-session-in-background'.
+ (w3m-copy-buffer): Add `background' argument. When URL is null and
+ `background' is not non-nil, stay the current buffer.
+
+2006-05-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-read-query): Ignore page title only in
+ w3m-mode buffers.
+
+2006-05-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-read-query): Assume there's not only a list
+ of faces but also just a face.
+
+2006-05-30 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m.el (w3m-copy-buffer): Create empty w3m buffer when url is not
+ set. Cause error on meaningless combination of arguments.
+
+2006-05-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-tab-selected-background-face): New face.
+ (w3m-tab-separator): Put `mouse-face' for the shape of a mouse button.
+ (w3m-tab-line): Ditto.
+
+ * w3m-e23.el (w3m-tab-selected-background-face): New face.
+ (w3m-tab-separator): Put `mouse-face' for the shape of a mouse button.
+ (w3m-tab-line): Ditto.
+
+2006-05-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-tab-button-menu-commands): Disable same items if
+ `w3m-tab-button-menu-current-buffer' is nil.
+ (w3m-tab-button-menu2): New function.
+
+ * w3m-e21.el (top): Add the variables and function to avoid
+ byte-compile warnings.
+ (w3m-tab-drag-mouse-function): Support drag & drop to out of the
+ frame. Don't call `bury-buffer'.
+ (w3m-tab-click-mouse-function): Don't call `bury-buffer'.
+ (w3m-tab-double-click-mouse1-function): new function.
+ (w3m-tab-double-click-mouse2-function): Ditto.
+ (w3m-tab-make-keymap): Add some methods.
+
+ * w3m-e23.el (top): Add the variables and function to avoid
+ byte-compile warnings.
+ (w3m-tab-drag-mouse-function): Support drag & drop to out of the
+ frame. Don't call `bury-buffer'.
+ (w3m-tab-click-mouse-function): Don't call `bury-buffer'.
+ (w3m-tab-double-click-mouse1-function): new function.
+ (w3m-tab-double-click-mouse2-function): Ditto.
+ (w3m-tab-make-keymap): Add some methods.
+
+ * w3m.el (w3m-tab-button-menu-commands): Change position some items.
+
+2006-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-widget-type-convert-widget): New function.
+
+ * w3m.el (w3m-home-page, w3m-new-session-url)
+ (w3m-uri-replace-alist): Use it.
+
+ * w3m-dtree.el (w3m-dtree-indent-strings, w3m-dtree-stop-strings): Use
+ it.
+
+ * w3m-symbol.el (w3m-symbol-custom-type): Use it.
+
+2006-05-21 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m.el (autoload): `w3m-bookmark-view-new-sessiont' ->
+ `w3m-bookmark-view-new-session'.
+
+2006-05-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-home-page): Rewrite :convert-widget function.
+ (w3m-new-session-url): Ditto.
+
+2006-05-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-new-session-url): Doc fix; improve custom type.
+ (w3m-new-session-in-background): Doc fix.
+
+2006-05-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-new-session-url): Rename from
+ `w3m-tab-button-new-session-url'.
+ (w3m-tab-button-focus-new-tab): Delete.
+ (w3m-view-this-url-new-session-in-background): This option sets
+ obsolete.
+ (w3m-new-session-in-background): New option.
+ (w3m-menubar): Change and add Some items.
+ (w3m-copy-buffer): If call-interactively, set `just-copy' to `t'. If
+ `w3m-new-session-in-background' and `just-copy' is non-nil, swith to
+ original buffer when finished.
+ (w3m-lynx-like-map): Add `w3m-bookmark-view-new-session'.
+ (w3m-tab-button-menu-commands): Use `w3m-new-session-in-background'
+ insted of `w3m-tab-button-focus-new-tab'.
+ (w3m-goto-new-session-url): New command.
+ (w3m-goto-url-new-session): Call `w3m-copy-buffer' with
+ `w3m-new-session-in-background'.
+ (w3m-select-buffer-generate-contents): Add prefix number to beginning
+ of title name.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-items-sub-coeff): New variable.
+ (w3m-tab-menubar-items-width): Ditto.
+ (w3m-tab-menubar-make-items-1): New inline macro and trancate string of
+ tab's title if over `w3m-tab-menubar-items-width'.
+ (w3m-tab-menubar-make-items): Use `w3m-tab-menubar-make-items-1'. If
+ the number of tabs over `(- (frame-height)
+ w3m-tab-menubar-items-sub-coeff)', make sub-menu.
+
+ * w3m-bookmark.el (w3m-bookmark-view-new-session): Use
+ w3m-view-this-url-1 instead of w3m-goto-url; warn if w3m-mode does not
+ run.
+ (w3m-bookmark-menu-items): Add w3m-bookmark-view-new-session.
+
+2006-05-18 Luca Capello <luca@pca.it>
+
+ * w3m-bookmark.el (w3m-bookmark-view): Add docstring.
+ (w3m-bookmark-view-new-session): New command.
+
+ * w3m.el (autoload): Add docstring to w3m-bookmark-view; add
+ w3m-bookmark-view-new-session.
+ (w3m-menubar): Add Bookmark submenu and w3m-bookmark-view-new-session.
+ (w3m-info-like-map): Add w3m-bookmark-view-new-session.
+ (w3m-mode): Add description of w3m-bookmark-view-new-session to
+ docstring.
+
+2006-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-tab-button-focus-new-tab): New option.
+ (w3m-menubar): Add some items.
+ (w3m-external-view-this-url): New command.
+ (w3m-external-view-current-url): Ditto.
+ (w3m-tab-button-menu-commands): Use `w3m-tab-button-focus-new-tab' on
+ `w3m-goto-url-new-session' and `w3m-copy-buffer'.
+ (w3m-tab-button-menu): Make with `w3m-make-menu-commands'.
+
+ * w3m-util.el (top): Add the variable definition of `w3m-mode-map' to
+ avoid byte-compile warnings.
+ (w3m-make-menu-commands): New function.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items): Use
+ `w3m-make-menu-commands'.
+
+2006-05-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-url-with-external-browser): Add optional url
+ argument.
+ (w3m-tab-button-menu-commands): Make w3m-copy-buffer and
+ w3m-view-url-with-external-browser select the buffer; pass url to
+ w3m-view-url-with-external-browser.
+
+2006-05-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-bookmark-add-all-urls): New function.
+
+ * w3m.el: Autoload w3m-bookmark-add-all-urls.
+ (w3m-menubar): Add w3m-reload-all-pages.
+ (w3m-lynx-like-map): Add w3m-reload-all-pages and
+ w3m-bookmark-add-all-urls.
+ (w3m-info-like-map): Ditto.
+ (w3m-tab-button-menu-commands): Make it enable to pass arguments to
+ function items; use w3m-goto-url-new-session, w3m-reload-all-pages, and
+ w3m-bookmark-add-all-urls instead of lambda forms.
+ (w3m-tab-button-menu): Pass arguments to functions defined in
+ w3m-tab-button-menu-commands.
+ (w3m-mode): Add descriptions about w3m-reload-all-pages and
+ w3m-bookmark-add-all-urls to docstring.
+ (w3m-reload-all-pages): New function.
+
+2006-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-lynx-like-map): Define `w3m-mouse-major-mode-menu' to
+ mouse-3.
+ (w3m-info-like-map): Ditto.
+ (w3m-mouse-major-mode-menu): New command.
+
+ * w3m-util.el (top): Add the variable definition of
+ `w3m-use-japanese-menu' to avoid byte-compile warnings.
+ (w3m-make-menu-item): Change method to take measures for garbage
+ characters on XEmacs.
+
+ * w3m-bookmark.el (w3m-bookmark-make-item-xmas): New variable.
+ (w3m-bookmark-make-item): New inline macro.
+ (w3m-bookmark-make-menu-items): Use `w3m-bookmark-make-item'.
+
+2006-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-menubar): Use `w3m-make-menu-item'.
+ (w3m-tab-button-menu-current-buffer): Enable always.
+ (w3m-tab-button-menu-commands): Ditto. Use `w3m-make-menu-item'.
+
+ * w3m-util.el (w3m-make-menu-item): New function.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items): Handle
+ `w3m-tab-button-menu-commands' always.
+
+ * w3m-bookmark.el (w3m-bookmark-menu-items): Use `w3m-make-menu-item'.
+
+2006-05-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-japanese-menu): Change default value.
+ (w3m-menubar): Simplify the rule to use Japanese menu.
+ (w3m-tab-button-menu-commands): Ditto.
+
+ * w3m-bookmark.el (w3m-bookmark-menu-items): Simplify the rule to use
+ Japanese menu.
+
+2006-05-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-menubar): Escape the Japanese katakana `a' which breaks
+ the string syntax in non-Mule XEmacs.
+
+ * w3m-bookmark.el (w3m-bookmark-menu-items): Escape the Japanese kanji
+ `etsu' which breaks the string syntax in non-Mule XEmacs.
+
+2006-05-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-japanese-menu): New option.
+ (w3m-menubar): Add Japanese menu.
+ (w3m-tab-button-menu-commands): Change the way to check Japanse or
+ others.
+
+ * w3m-bookmark.el (w3m-bookmark-menu-items): Add Japanese menu.
+
+2006-05-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-tab-button-new-session-url): New option.
+ (w3m-delete-other-buffers): New command.
+ (w3m-delete-left-tabs): Ditto.
+ (w3m-delete-right-tabs): Ditto.
+ (w3m-delete-buffers): New function.
+ (w3m-lynx-like-map): Add `w3m-delete-left|right-tabs'.
+ (w3m-tab-button-menu-commands): New new items.
+
+ * w3m-util.el (w3m-lefttab-exist-p): New inline function.
+ (w3m-righttab-exist-p): Ditto.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items): Handle
+ `w3m-tab-button-menu-commands' if possible.
+
+2006-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-tab-button-menu-commands): New variable.
+ (w3m-tab-button-menu-current-buffer): New variable.
+ (w3m-tab-button-menu): New variable.
+ (w3m-tab-button-menu): New function.
+
+ * w3m-e21.el (w3m-tab-make-keymap): Bind mouse-3 to menu.
+
+2006-05-14 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-refontify-anchor): Improve parameter check.
+ (w3m-create-image-page): Use `w3m-add-face-property' instead
+ `put-text-property'/`add-text-properties'/`w3m-add-text-properties'.
+ (w3m-history-highlight-current-url): Ditto.
+ (w3m-header-line-insert): Ditto.
+
+ * w3m-search.el (w3m-search-read-query): Improve parameter check.
+
+ * w3m-lnum.el (w3m-link-numbering): Use `w3m-add-face-property' instead
+ `put-text-property'.
+
+ * w3m-form.el (w3m-form-make-button): Use `w3m-add-face-property'
+ instead `add-text-properties'.
+ (w3m-fontify-textareas): Ditto.
+ (w3m-form-parse-and-fontify): Ditto.
+
+ * w3m-e21.el,w3m-e23.el (w3m-form-make-button): Improve face property
+ append method.
+ (w3m-setup-header-line): Ditto.
+ (w3m-tab-line): Ditto.
+ (w3m-tab-separator): Modify `face' value to list.
+
+2006-05-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Use utf-8 for google if
+ possible.
+
+2006-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-show-decoded-url): Add entry for hatena.ne.jp.
+
+2006-05-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_SET_VANILLA_FLAG): Add --no-unibyte option so as to
+ invalidate EMACS_UNIBYTE environment variable.
+
+2006-05-07 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-symbol.el: Bind w3m-use-symbol when compiling.
+ (w3m-use-symbol): New function.
+ (w3m-replace-symbol): Use it.
+
+ * w3m.el (w3m-use-symbol): Changed its default value when
+ w3m-output-coding-system is utf-8.
+
+2006-05-07 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-util.el (w3m-device-on-window-system-p): New function.
+ (w3m-popup-frame-p): Use it.
+
+ * w3m-search.el (w3m-search-engine-alist): Ditto.
+
+ * w3m.el (w3m-fontify-strike-through): Ditto.
+
+2006-05-06 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Remove lycos-ja.
+
+2006-05-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-history): New variable.
+ (w3m-search): Use it.
+
+2006-05-01 David Hansen <david.hansen@gmx.net>
+
+ * w3m-search.el (w3m-search-engine-alist): Add freshmeat.
+
+2006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-decode-string): Don't perform find-coding-system on a
+ list of coding system in XEmacs.
+
+2006-04-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-google-feeling-lucky-charset): New user option.
+ (w3m-canonicalize-url): Support search-keyword for "I'm Feeling Lucky
+ on Google". Add 2nd argument.
+ (w3m-input-url): Suport "I'm Feeling Lucky". Add 5th argument
+ `feeling-lucky'. Bind key to `self-insert-command' if `feeling-lucky'.
+ Call `w3m-canonicalize-url' with `feeling-lucky'.
+ (w3m-view-this-url): Call `w3m-input-url' with `feeling-lucky'.
+ (w3m-goto-url-new-session): Ditto.
+ (w3m): Ditto.
+
+2006-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Require APEL XEmacs package 1.32 and later.
+
+2006-04-22 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add msdn.
+
+2006-04-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-decode-string): Support non-Mule XEmacs
+ superficially.
+
+ * w3m-util.el (w3m-replace-in-string): Prefer replace-regexp-in-string
+ over of replace-in-string. It was done in Gnus by Reiner Steib.
+
+2006-04-20 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * w3m-search.el (w3m-search-engine-alist): Fix url for ja.wikipedia.
+
+2006-04-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add ja.wikipedia.
+
+2006-04-20 David Hansen <david.hansen@gmx.net>
+
+ * w3m-search.el (w3m-search-engine-alist): Add wikipedia, en.wikipedia
+ and de.wikipedia.
+
+2006-04-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-download): Clear minibuffer after y-or-n-p.
+
+2006-04-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * attic/vm-w3m.el (vm-w3m-use-w3m-minor-mode-map): New variable.
+ (vm-mime-display-internal-text/html): Use it.
+
+2006-04-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-decode-string): Make string unibyte before decoding.
+
+2006-03-16 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-data-retrieve): New function.
+ (w3m-attributes, w3m-retrieve): Add support `data:' scheme handled by
+ `w3m-data-retrieve'.
+
+2006-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ccl.el (charset-id): Define it as a macro instead of an alias to
+ charset-id-internal if Emacs doesn't provide it.
+
+2006-03-12 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-insert-face): New face.
+ (w3m-fontify-insert): New variable.
+ (w3m-fontify-insert): New function.
+ (w3m-fontify): Add calling `w3m-fontify-insert'.
+
+2006-02-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Decode buffer's string outside the
+ buffer.
+
+2006-02-26 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-parse-header): When the url matchs to ftp, rewrite
+ type and charset.
+ (w3m-w3m-attributes-1): Don't rewrite type and charset.
+ (w3m-w3m-retrieve): Don't check status code when the url does not match
+ to http.
+
+2006-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-components-regexp): Move to w3m-util.el.
+ (w3m-fontify-anchors, w3m-canonicalize-url, w3m-add-referer-p)
+ (w3m-expand-url, w3m-view-this-url-1, w3m-goto-url)
+ (w3m-goto-url-new-session): Use w3m-string-match-url-components rather
+ than to run string-match with w3m-url-components-regexp.
+ cf. <URL:http://emacs-w3m.namazu.org/ml/msg08412.html>.
+
+ * w3m-form.el (w3m-form-normalize-action): Ditto.
+
+ * w3m-cookie.el (w3m-parse-http-url): Ditto.
+
+ * w3m-util.el (w3m-string-match-url-components-1): New function.
+ (w3m-url-components-regexp): Move from w3m.el.
+ (w3m-string-match-url-components): New macro.
+
+2006-01-19 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-fontify-strike-through): Improve matching point.
+
+2006-01-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/Makefile.in: Add rules to make pdf files.
+
+ * configure.in: Check for dvipdfmx and texi2pdf.
+
+2005-12-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-util.el (top): Add the variable definition of `w3m-mode-hook' to
+ avoid byte-compile warnings.
+
+2005-12-30 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-fontify-strike-through): Fix multi `<del>' problem.
+
+2005-12-23 Matt Hodges <MPHodges@member.fsf.org>
+
+ * w3m-util.el (w3m-list-buffers): Ensure disabling the w3m-fb-mode
+ after a careless (setq w3m-fb-mode t).
+
+2005-12-22 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m-antenna.el (w3m-antenna-refresh-interval): Add new customize
+ variable.
+ (w3m-antenna-make-contents): Add new generation rule for refresh
+ interval replacing `%R' to META Refresh tag and contents value are
+ `w3m-antenna-refresh-interval'.
+ (w3m-antenna-html-skelton): Add %R rule.
+
+2005-12-19 Matt Hodges <MPHodges@member.fsf.org>
+
+ * w3m-util.el (w3m-list-buffers): Further fix against the case where
+ someone did (setq w3m-fb-mode t).
+
+2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-fb.el (w3m-fb-mode): Never activate w3m-fb-mode if
+ w3m-pop-up-frames is non-nil.
+
+ * w3m-util.el (w3m-list-buffers): Reset w3m-fb-mode if it seems to have
+ been set thoughtlessly.
+
+2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-fb.el: Don't require w3m.
+ (w3m-fb-frame-parameter): Always define.
+ (w3m-fb-delete-frame-functions): Ditto.
+ (w3m-fb-select-buffer): Fix the 2nd clause of cond.
+ (w3m-fb-advised-functions): Remove.
+ (w3m-list-buffers): Move advice code to w3m-fb.el.
+ (w3m-close-window): Move advice code to w3m.el.
+ (w3m-delete-buffer): Ditto.
+ (w3m-quit): Ditto.
+ (w3m-fb-mode): Remove w3m-fb-advised-functions stuff.
+
+ * w3m.el (w3m-fb): Require.
+ (w3m-delete-buffer, w3m-quit, w3m-close-window): Merge the codes which
+ were formerly provided as advices in w3m-fb.el.
+
+ * w3m-util.el (w3m-fb-list-buffers-frame, w3m-fb-mode): Bind them when
+ compiling.
+ (w3m-fb-frame-parameter): Autoload.
+ (w3m-list-buffers): Merge the code which was formerly provided as an
+ advice in w3m-fb.el.
+
+2005-11-26 Matt Hodges <MPHodges@member.fsf.org>
+
+ * w3m-fb.el: New file.
+
+2005-12-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-submit): Use the post method for the
+ multipart/form-data enctype according to the proposal of RFC2070 even
+ if the form specifies the get method.
+
+2005-11-24 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-submit): If anchor exists, go to the uri.
+
+2005-11-21 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m-favicon.el (w3m-favicon-type): Renew default image type list.
+
+2005-11-19 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-menubar): Renew enable/disable condition for `[Copy This
+ Session]',`[Download This URL]', and Append `[Toggle This Image]'.
+
+ * w3m-bookmark.el (w3m-bookmark-menu-items): Renew enable/disable
+ condition for `[Add This URL to Bookmark]'.
+
+2005-11-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-open-all-links-in-new-session): Reverse the list of URLs.
+
+2005-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-drag-mouse-function): Lower the buffer displayed
+ before moving to the other tab.
+ (w3m-tab-click-mouse-function): Ditto.
+
+2005-10-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-util.el (w3m-add-face-property): Simplified.
+
+2005-10-15 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m-util.el (w3m-add-face-property): Add new functions.
+ (w3m-remove-face-property): Ditto.
+
+ * w3m.el (w3m-fontify-bold, w3m-fontify-underline)
+ (w3m-fontify-strike-through, w3m-fontify-anchors)
+ (w3m-fontify-images): Replace `w3m-add-text-properties' to
+ `w3m-add-face-property' at FACE.
+ (w3m-refontify-anchor): Change for FACE properly is list type.
+
+2005-10-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-insert-image): Make it work with a face text property
+ whose value is a list.
+ (w3m-remove-image): Remove useless text property.
+ * w3m-e23.el (w3m-insert-image,w3m-remove-image): Same as w3m-e21.el's
+ modification.
+
+2005-09-29 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-proc.el (w3m-process-filter): Fixed regexp.
+
+2005-09-27 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-proc.el (w3m-process-filter): Remove SSL warning message for
+ basic authentication over SSL.
+
+2005-09-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify): Remove empty lines at the beginning of the
+ buffer (see the comment).
+
+2005-09-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Revert.
+
+2005-09-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Bind w3m-treat-image-size
+ to avoid inserting excessive newlines.
+
+2005-09-18 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-relationship-estimate-rules): Add a rule for Google Blog
+ Search.
+
+ * w3m-search.el (w3m-search-engine-alist): Use
+ `http://blogsearch.google.com/' instead of `http://search.blogger.com/'
+ for "blog-*" search, because search.blogger.com does not have a
+ explicit link to previous search result page.
+
+2005-09-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-redisplay-this-page): Use the cache always.
+
+2005-09-15 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "blog-*" entries.
+
+2005-09-02 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Support @frenchspacing, @euro, @sansserif.
+ (texinfo-format-ordf): Fix typo.
+
+2005-09-01 Hiroshi Fujishima <hiroshi.fujishima@gmail.com>
+
+ * w3m-search.el (w3m-search-engine-alist): Update goo-ja, waei, eiwa,
+ kokugo URL.
+
+2005-08-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-ucs.el: Enable XEmacs 21.5-Mule to compile it anyway.
+
+2005-08-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Put the encoded anchor names instead of
+ the itself.
+
+2005-08-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * octet.el (octet-insert-buffer): Use insert-buffer-substring instead
+ of insert-buffer.
+
+ * w3m-bookmark.el (w3m-about-bookmark): Ditto.
+
+ * w3m-proc.el (w3m-process-sentinel): Ditto.
+
+2005-07-29 Kevin Rodgers <kevin.rodgers@ihs.com>
+
+ * w3m.el (w3m-content-type-alist): Add the text/sgml entry.
+
+2005-07-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-scroll-up-1): New function.
+ (w3m-lynx-like-map): Use it for the J command.
+ (w3m-scroll-up-or-next-url): Use it.
+
+2005-07-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-current-message): New internal variable.
+ (w3m-message): Use the above variable to keep the last displayed
+ message, to decide that this function can override the current message
+ in the echo area.
+ (w3m-make-help-echo): Use `message' instead of `w3m-message' to clear
+ the echo area in the foreground context.
+ (w3m-quit): Ditto.
+ (w3m-goto-ftp-url): Ditto.
+ (w3m-select-buffer-show-this-line-and-switch): Ditto.
+
+ * w3m-proc.el (w3m-process-background): New internal variable.
+ (w3m-process-sentinel): Set t to the above variable.
+
+2005-07-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-message): Bury messages when the cursor in the echo area
+ which is used by `y-or-n-p' etc.
+ (w3m-view-parent-page): Refer both `start' link element and `content'
+ start element before checking a parent URL.
+
+2005-07-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-bookmark-menu-dummy-item): Remove.
+ (w3m-bookmark-menubar-dummy): Remove.
+ (w3m-bookmark-menu-items): Also define the menu for the case where
+ w3m-bookmark-mode is turned on.
+ (w3m-setup-bookmark-menu): Rewrite it so as to work properly with Emacs
+ 22.
+ (w3m-bookmark-menubar-update): Ditto; remove the iswitchb section.
+ (w3m-bookmark-make-menu-items): Return nil if there's no bookmark.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-dummy): Remove.
+ (w3m-setup-tab-menu): Rewrite it so as to work properly with Emacs 22.
+ (w3m-tab-menubar-update): Ditto; remove the iswitchb section.
+
+2005-07-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-bookmark.el (w3m-bookmark-buffer): Disable undo before modify the
+ buffer.
+ (w3m-bookmark-menu-items-pre): New variable.
+ (w3m-bookmark-menu-items-time): Ditto.
+ (w3m-bookmark-make-menu-items): Use previous items if it available.
+
+2005-07-09 Tsuyoshi CHO <tsuyoshi_cho@yahoo.co.jp>
+
+ * w3m-xmas.el (top): Add `w3m-setup-bookmark-menu' to autoload list at
+ compiled time.
+ (w3m-setup-menu): Append bookmark menu setup calling.
+
+ * w3m-bookmark.el (top): Add requirement `easymenu' and
+ `easy-menu-remove-item' autoload at compiled time.
+ (w3m-bookmark-menu-open-new-session): Add new customize variable.
+ (w3m-bookmark-menu-dummy-item): Add new const variable.
+ (w3m-bookmark-menubar-dummy): Ditto.
+ (w3m-bookmark-menu-items): Ditto, Define Bookmark const menu items.
+ (w3m-setup-bookmark-menu): Add new autoload function.
+ (w3m-bookmark-menubar-update): Add new function.
+ (w3m-bookmark-iterator): Ditto.
+ (w3m-bookmark-menu-open-item): Ditto.
+ (w3m-bookmark-make-menu-items): Ditto.
+
+ * w3m.el (top): Add `w3m-setup-bookmark-menu' to autoload list at
+ compiled time.
+ (w3m-menubar): Remove "Bookmark" menu item.
+
+2005-07-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-print-current-url): Bind deactivate-mark.
+ (w3m-print-this-url): Ditto.
+
+2005-07-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-check-current-position): Bind deactivate-mark. (cf.
+ http://news.gmane.org/group/gmane.emacs.pretest.bugs/thread=8335).
+
+2005-07-05 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * ChangeLog: Add file local variables to set fill-column 74 and
+ indent-tabs-mode t.
+
+2005-07-03 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "technorati-*" entries.
+
+2005-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-which-command): Make sure the command is not a
+ directory. cf. <URL:http://emacs-w3m.namazu.org/ml/msg08113.html>.
+
+2005-06-26 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-relationship-estimate-rules): Add a rule for Yahoo Search
+ Beta.
+
+2005-06-26 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-relationship-estimate-rules): Improve regexp for Google
+ in order to make the scroll-to-next-page feature work on Google News as
+ well.
+
+2005-06-26 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add Yahoo Beta.
+
+2005-06-18 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Search Google News in US by
+ "google news-en".
+
+2005-06-17 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "google news" entry.
+
+2005-06-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_PATH_EMACS): Check whether XEmacs works with the shy
+ group regexp and runs call-process-region correctly.
+
+ * w3m-perldoc.el (w3m-about-perldoc): Don't relieve buggy XEmacs 21.5
+ for call-process-region.
+
+ * w3m-xmas.el (w3m-fix-gif): Ditto.
+ (w3m-initialize-graphic-icons): Ditto.
+
+ * w3m.el (w3m-decode-encoded-contents): Ditto.
+ (w3m-x-moe-decode-buffer): Ditto.
+ (w3m-rendering-half-dump): Ditto.
+
+ * w3mhack.el: Advise byte-optimize-form-code-walker to avoid the
+ ``...called for effect'' warnings for Emacs 21.4 as well as 21.3; don't
+ relieve buggy XEmacs 21.5 for call-process-region.
+
+2005-06-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ Make emacs-w3m not support the XEmacs versions older than 21.4.17
+ or 21.5-b19.
+
+ * aclocal.m4 (AC_PATH_EMACS): Check whether XEmacs runs the timer
+ functions correctly.
+
+ * w3m-util.el (w3m-cancel-refresh-timer): Use delete-itimer instead of
+ cancel-timer under XEmacs.
+
+ * w3m-xmas.el (call-process-region): Don't advise it.
+ (w3m-run-at-time): Remove.
+
+ * w3m.el (w3m-refresh-at-time): Use run-at-time instead of
+ w3m-run-at-time.
+
+ * w3mhack.el (w3mhack-byte-optimize-letX): Doc fix.
+
+2005-06-09 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el: Update my mail address.
+
+2005-06-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna-mapcar): Remove unused temp var.
+
+ * w3m-bookmark.el (w3m-bookmark-buffer): Remove
+ file-coding-system-for-read.
+
+ * w3m-form.el (w3m-form-input-textarea-save): Remove
+ file-coding-system.
+ (w3m-form-input-textarea): Ditto.
+
+ * w3m-image.el (w3m-imagick-convert-buffer): Remove file-coding-system.
+ (w3m-imagick-start-convert-buffer): Remove file-coding-system and
+ jam-zcat-filename-list.
+
+ * w3m.el (w3m-load-list): Remove file-coding-system-for-read.
+ (w3m-save-list): Remove file-coding-system.
+ (w3m-local-retrieve): Remove file-coding-system-for-read and
+ jam-zcat-filename-list.
+ (w3m-download): Remove file-coding-system and jam-zcat-filename-list.
+ (w3m-copy-buffer): Remove unused temp var.
+
+ * w3mhack.el (w3mhack-byte-optimize-letX): Remove file-coding-system,
+ file-coding-system-for-read and pathname-coding-system.
+
+2005-06-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-replace-in-string): Don't use eval-and-compile.
+ (w3m-compare-strings): Ditto.
+ (w3m-force-window-update): Alias to ignore if it is not defined.
+ (w3m-force-window-update-later): New function.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Use
+ w3m-force-window-update-later.
+
+ * w3m-proc.el (w3m-process-stop): Use w3m-force-window-update-later.
+
+ * w3m.el (w3m-retrieve-and-render): Use w3m-force-window-update-later.
+ (w3m-select-buffer-show-this-line): Always run w3m-force-window-update.
+
+2005-06-09 Masatake YAMATO <jet@gyve.org>
+
+ * w3m-e21.el (w3m-initialize-graphic-icons): Highlight icon under
+ mouse.
+
+2005-06-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-mouse-face): New face.
+ (w3m-setup-header-line): Use highlight face for bg color.
+ (w3m-tab-line): Use w3m-tab-mouse-face.
+
+2005-06-08 Masatake YAMATO <jet@gyve.org>
+
+ * w3m-e21.el (w3m-setup-header-line): Highlight url under mouse.
+ (w3m-tab-line): Highlight tab under mouse.
+
+2005-05-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-run-mode-hooks): New function.
+
+ * w3m-form.el (w3m-form-input-select-mode): Use it.
+ (w3m-form-input-map-mode): Use it.
+
+ * w3m.el (w3m-mode): Use it.
+
+2005-05-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-truncate-string): Autoload mule-util for
+ truncate-string-to-width.
+
+2005-05-26 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m.el (w3m-safe-view-this-url): `unsecure' -> `insecure'.
+ (w3m-safe-toggle-inline-image): Ditto.
+ (w3m-safe-toggle-inline-images): Ditto.
+
+2005-05-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-menubar): Add the "Close Other Sessions" button.
+ (w3m-delete-other-buffers): Run w3m-force-window-update.
+
+2005-05-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * attic/vm-w3m.el (vm-w3m): Provide the feature.
+
+ * attic/vm-7.19.patch: New file.
+
+2005-05-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-open-all-links-in-new-session): Fix regexp.
+
+2005-05-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bookmark.el (w3m-about-bookmark): Use shy group in regexp.
+
+ * w3m-cookie.el (w3m-cookie-two-dot-domains-regexp): Ditto.
+ (w3m-cookie-set): Ditto.
+
+ * w3m-dtree.el (w3m-dtree-directory-name): Ditto.
+ (w3m-about-dtree): Ditto.
+
+ * w3m-favicon.el (w3m-favicon-setup): Ditto.
+
+ * w3m-namazu.el (w3m-about-namazu): Ditto.
+
+ * w3m-proc.el (w3m-process-filter): Ditto.
+
+ * w3m-rss.el (w3m-rss-parse-date-string): Ditto.
+
+ * w3m-util.el (w3m-html-string-regexp): Remove useless quotes.
+ (w3m-parse-attributes): Don't use old fashioned backquotes; use shy
+ group in regexp.
+ (w3m-url-authinfo-regexp): Use shy group in regexp.
+
+ * w3m-weather.el (w3m-weather-completion-table): Ditto.
+ (w3m-weather-area-completion): Ditto.
+
+ * w3m-xmas.el (w3m-fix-gif): Ditto.
+
+ * w3m.el: Use shy group in regexp when examining w3m-command.
+ (w3m-content-type-alist): Use shy group in regexp.
+ (w3m-show-decoded-url): Ditto.
+ (w3m-add-referer): Ditto.
+ (w3m-relationship-estimate-rules): Ditto.
+ (w3m-arrived-ignored-regexp): Ditto.
+ (w3m-history-ignored-regexp): Ditto.
+ (w3m-url-to-file-name): Ditto.
+ (w3m-fontify-strike-through): Ditto.
+ (w3m-fontify): Ditto.
+ (w3m-url-completion): Ditto.
+ (w3m-gmane-url-at-point): Ditto.
+ (w3m-cache-header-delete-variable-part): Ditto.
+ (w3m-cache-available-p): Ditto.
+ (w3m-decode-buffer): Ditto.
+ (w3m-local-dirlist-cgi): Ditto.
+ (w3m-w3m-canonicalize-url): Ditto.
+ (w3m-additional-command-arguments): Ditto.
+ (w3m-download): Ditto.
+ (w3m-check-header-tags): Ditto.
+ (w3m-retrieve-and-render): Ditto.
+ (w3m-create-text-page): Ditto.
+ (w3m-view-this-url): Ditto.
+ (w3m-open-all-links-in-new-session): Ditto.
+ (w3m-external-view-file): Ditto.
+ (w3m-edit-url): Ditto.
+ (w3m-convert-ftp-url-for-emacsen): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-goto-url-new-session): Ditto.
+ (w3m-about-db-history): Ditto.
+ (w3m-history-highlight-current-url): Ditto.
+
+ * w3mhack.el: Fix the section adding dirs to load-path.
+ (w3mhack-make-package): Use shy group in regexp.
+ (w3mhack-makeinfo): Ditto.
+
+2005-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (clean): Don't remove w3m-kwds.el.
+ (.el.elc): Use batch-byte-compile instead of w3mhack-batch-compile.
+ (very-slow): Don't run keywords.
+ (keywords): Remove.
+
+ * aclocal.m4 (AC_PATH_EMACS): Don't support Emacs 19 and 20.
+ (AC_PATH_LISPDIR): Follow the change of the EMACS_FLAVOR value.
+ (AC_PATH_ICONDIR): Ditto.
+ (AC_CHECK_ELISP): Remove.
+ (AC_CHECK_XML): Remove.
+
+ * configure.in: Don't check for regexp-opt; don't run AC_CHECK_XML.
+
+ * mime-w3m.el (mime-w3m-mode-map): Remove.
+ (mime-w3m-local-map-property): Remove.
+ (mime-w3m-preview-text/html): Don't use it.
+
+ * octet.el (octet-decode-image): Ignore Emacs 19 and 20.
+
+ * w3m-bitmap.el: Remove.
+
+ * w3m-bookmark.el (w3m-bookmark-sections): Use point-at-eol.
+ (w3m-bookmark-safe-string): Don't support Mule 2.3.
+ (w3m-bookmark-current-number): Use point-at-eol.
+ (w3m-bookmark-kill-entries): Use point-at-bol.
+
+ * w3m-bug.el: Don't require w3m-om or w3m-e19.
+
+ * w3m-ccl.el: Don't require w3m-om.
+
+ * w3m-e19.el: Remove.
+
+ * w3m-e20.el: Remove.
+
+ * w3m-hist.el: Don't load w3m-kwds.el.
+
+ * w3m-lnum.el (w3m-link-numbering): Don't support Emacs 20.
+
+ * w3m-om.el: Remove.
+
+ * w3m-proc.el: Don't require w3m-om or w3m-e19.
+
+ * w3m-search.el (w3m-search-read-query): Use point-at-bol.
+
+ * w3m-ucs.el: Ignore Emacs 20.
+
+ * w3m-util.el: Don't load w3m-kwds.el; don't support Emacs 19.
+ (w3m-use-tab-p): Ignore Emacs 19 and 20.
+ (w3m-popup-window-p): Ditto.
+ (w3m-add-w3m-initial-frames): Don't support Emacs 19.
+ (after-make-frame-hook): Don't use it.
+ (delete-frame): Don't advise it for Emacs 19 or 20.
+ (w3m-truncate-string): Don't support Emacs 19 and 20.
+ (w3m-default-face-colors): Remove.
+ (w3m-replace-in-string): Don't support Emacs 19 and 20.
+
+ * w3m-xmas.el (w3m-should-unoptimize-animated-gifs): Default to always
+ t.
+ (w3m-make-glyph): Use string-to-number instead of string-to-int.
+
+ * w3m.el: Don't require w3m-e20, w3m-om or w3m-e19.
+ (emacs-w3m-version): Reset to 1.4.50.
+ (w3m-language): Ignore Mule 2.3.
+ (w3m-history-current-url-face): Don't require wid-edit.
+ (w3m-bold-face): Don't use w3m-default-face-colors.
+ (w3m-underline-face): Ditto.
+ (w3m-strike-through-face): Ditto.
+ (w3m-use-symbol): Ignore Emacs 19 and 20.
+ (w3m-show-decoded-url): Ditto.
+ (w3m-use-tab): Doc fix.
+ (w3m-entity-alist): Don't support Mule 2.3.
+ (w3m-make-help-echo): Ignore Emacs version.
+ (w3m-toggle-inline-images-internal): Ignore bitmap images.
+ (w3m-resize-inline-image-internal): Don't support Emacs 19 and 20.
+ (w3m-url-at-point): Always use ffap.
+ (w3m-about-retrieve): Consider base64 codec is always available.
+ (w3m-close-window): Don't support Emacs 19 and 20.
+ (w3m-store-current-position): Use point-at-bol and point-at-eol.
+ (w3m-buffer-setup): Ditto.
+ (w3m-make-separator): Don't support Mule 2.3.
+ (w3m-select-buffer-current-buffer): Use point-at-bol.
+ (w3m-header-line-insert): Don't support Emacs 19 and 20.
+
+ * w3mhack.el: Consider w3mhack-batch-compile is not used.
+ (locate-library): Don't redefine it for Emacs 19.
+ (APEL): Don't check for it for Emacs.
+ (w3mhack-colon-keywords-file): Remove.
+ (w3mhack-module-list): Ignore Emacs 19, 20, old XEmacsen and
+ BITMAP-MULE.
+ (w3mhack-shimbun-modules-using-rss): Remove.
+ (current-column): Don't take care of it for old Emacsen.
+ (w3mhack-compile): Don't run w3mhack-check-colon-keywords-file.
+ (w3mhack-batch-compile): Remove.
+ (w3mhack-nonunix-install): Ignore Emacs 19 and 20.
+ (custom-declare-variable): Don't take care of it for Emacs 19.
+ (locate-library): Ditto.
+ (w3mhack-generate-colon-keywords-file): Remove.
+ (w3mhack-check-colon-keywords-file): Remove.
+ (w3mhack-load-path): Ignore Emacs 19, 20 and old XEmacsen.
+ (w3mhack-makeinfo): Ignore Mule 2.3.
+
+ * attic/regexp-opt.el: Remove.
+
+ * attic/xml.el: Remove.
+
+ * patches/mule-2.3@19.34.patch: Remove.
+
+2005-04-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-remove-invisible-image-alt): New function.
+ (w3m-rendering-buffer): Use it.
+
+2005-04-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Decode "\240" into "&nbsp;".
+
+2005-04-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Decode `&#nnn;' entities in 128..159.
+
+2005-04-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-detect-xml-charset): Return nil if the data don't look
+ like xml contents.
+ (w3m-compatible-encoding-alist): New variable.
+ (w3m-decode-buffer): Always use w3m-detect-xml-charset; use a
+ compatible encoding according to w3m-compatible-encoding-alist.
+
+ * w3m-xmas.el (w3m-find-coding-system): Don't return binary for the nil
+ argument.
+
+
+2005-03-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Release emacs-w3m-1.4.4 from emacs-w3m-1_4 branch.
+
+2005-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-setup-toolbar): Make sure icon files exist.
+ (w3m-update-toolbar): Make sure toolbar items have been specified.
+ (w3m-initialize-graphic-icons): Make sure icon files exist.
+
+ * w3m-e21.el (w3m-setup-toolbar): Make sure icon files exist.
+ (w3m-initialize-graphic-icons): Ditto.
+
+2005-03-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (tarball): Remove `w3m-e23.el' instead of `w3m-e22.el'.
+
+ * w3m.el (w3m-url-readable-string): Decide a scheme to guess encodings
+ based on the target URL, instead of the current URL.
+ (w3m-show-decoded-url): Doc fix to follow the above change.
+ (w3m-copy-buffer): Do not set `w3m-current-url' and
+ `w3m-current-coding-system'.
+ (w3m-goto-url-new-session): Simplified.
+
+2005-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (display-images-p): Remove alias.
+
+2005-03-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (very-slow): Don't mv non-existent files.
+
+ * w3m-e19.el (easy-menu-remove-item): Don't autoload it.
+
+ * w3m-om.el (easy-menu-remove-item): Ditto.
+
+ * w3m-rss.el (match-string-no-properties): Avoid warning for Emacs 19
+ and XEmacs.
+ (split-string): Avoid warning for Emacs 19.
+
+ * w3m-symbol.el: Require cl when compiling.
+
+ * w3m-tabmenu.el (easy-menu-remove-item): Aautoload it for Emacs 19.
+
+ * w3m.el: Autoload widget-get to avoid compile warning for Emacs 19.
+ (w3m): Remove unused bound variable.
+
+ * w3mhack.el: Bind executable-binary-suffixes to the proper value for
+ OS/2 and emx while checking for the shell command; cause an error only
+ when compiling or formatting files.
+
+ * attic/addpath.el: Make it work with old Emacsen even if cl is not
+ loaded; load custom, bind defcustom'ed variables and make the
+ locate-library function run quietly for Emacs 19; synch the code
+ testing the shell command with w3mhack.el.
+ (char-after): Add a byte-optimizer for Emacs 19.
+
+ * w3m-ccl.el: Load w3m-om instead of autoloading it for charset-id.
+
+ * w3m-util.el: Load cl independently when compiling.
+
+2005-03-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Check whether the shell command can be used.
+
+ * attic/addpath.el: Ditto; add early-package-load-path to load-path for
+ XEmacs 21.5.
+
+2005-03-17 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-favicon.el: Add autoload of `w3m-url-readable-string'.
+
+2005-03-17 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+
+ * w3m.el (w3m-check-header-tags): Check abnormal `base' url.
+
+2005-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Add early-package-load-path to load-path for XEmacs 21.5.
+
+ * w3m-xmas.el: Fbind coding-system-type to ignore if it is void.
+
+2005-03-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-mee-new): Display clear signs of coding-system
+ for `w3m-url-decode-string'.
+ (w3m-form-mee-select-value): Ditto.
+ (w3m-form-parse-and-fontify): Ditto.
+
+ * w3m.el (w3m-decode-buffer): Decode the buffer within buffer set the
+ `multibyte'.
+
+2005-03-13 MIYOSHI Masanori <miyoshi@meadowy.org>
+
+ * doc/emacs-w3m-ja.texi (Sport Sites Supported by Shimbun): Update.
+
+ * doc/emacs-w3m.texi (Sport Sites Supported by Shimbun): Ditto.
+
+2005-03-12 MIYOSHI Masanori <miyoshi@meadowy.org>
+
+ * doc/emacs-w3m-ja.texi (Sport Sites Supported by Shimbun): Update.
+
+ * doc/emacs-w3m.texi (Sport Sites Supported by Shimbun): Ditto.
+
+2005-03-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Load w3m-e23.el(c) that exists in the same directory as
+ w3m.el(c) so as to exclude ones in other places; report the precise
+ error message if it doesn't exist.
+
+2005-03-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-decode-coding-string-with-priority): Ignore
+ `undecided' so as not to use it for the priority list.
+
+2005-03-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-fsf.el (w3m-detect-coding-region): Guard error for `undecided'.
+
+2005-03-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Remove the byte-optimizer which replaces truncate-string
+ with truncate-string-to-width.
+
+2005-03-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-modeline-title): Replace truncate-string-to-width with
+ w3m-truncate-string.
+
+ * w3m-util.el (w3m-truncate-string): Use truncate-string-to-width if it
+ is available.
+
+2005-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-info-like-map): Bind the `y' key to the
+ w3m-print-current-url command; bind the `Y' key to the
+ w3m-print-this-url command; don't bind the `c' key.
+
+2005-03-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-help-echo): Fix the backquote form.
+ (w3m-make-balloon-help): Ditto.
+
+ * w3m-util.el (w3m-set-match-data): Use existing markers.
+
+2005-03-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-readable-string): Save matching data. Check whether
+ `w3m-current-url' is string before checking it.
+ (w3m-goto-url-new-session, w3m-copy-buffer): Call `w3m-goto-url' with
+ `redisplay' option to enforce redisplaying the certain content.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Decode an URL when displaying
+ it.
+
+ * w3m-form.el (w3m-form-input-textarea-mode-setup): An expression is
+ evaluated without checking type, and save matching data.
+
+2005-03-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-readable-string): Check whether
+ `w3m-current-coding-system' is valid before calling
+ `w3m-url-decode-string'.
+ (w3m-local-dirlist-cgi, w3m-w3m-dump-extra): Use
+ `w3m-url-readable-string'.
+ (w3m-copy-buffer): Copy all buffer-local variables, and do not cancel
+ them even if `empty' option is set.
+ (w3m-display-progress-message): Import from w3m-util.el to suppress
+ byte-compile warnings.
+
+ * w3m-util.el (w3m-parse-attributes): Accept XHTML format of boolean
+ atttibutes.
+ (w3m-display-progress-message): Export to w3m.el.
+
+2005-03-03 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-url-readable-string): An expression is evaluated without
+ checking type.
+
+2005-03-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-show-decoded-url): Update its customize spec to use it as
+ the rule set to decode URIs when displaying them. Changed its default
+ value.
+ (w3m-url-readable-string): New function to process the above option.
+ (w3m-make-help-echo, w3m-make-balloon-help): Do not accept `url-decode'
+ option, and use the above function to decore URIs.
+ (w3m-fontify-anchors): Follow the above change.
+ (w3m-print-current-url, w3m-print-this-url): Call the above function.
+ (w3m-make-url-decode-function): Removed.
+ (w3m-entity-alist, w3m-about-history): Remove redundant `function'.
+ For more detail, see http://www.mew.org/~kazu/doc/elisp/function.html.
+
+2005-03-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-modeline-title-string): New variable.
+ (w3m-modeline-title-timer): New variable.
+ (w3m-modeline-title): New function used to truncate the title string
+ not to cut the right end of the mode line. Works only with Emacs 22
+ and newer.
+ (w3m-buffer-setup): Use it.
+
+2005-03-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-help-echo): Make it work with XEmacs.
+ (w3m-make-balloon-help): Support decoding URIs.
+ (w3m-fontify-anchors): Make the balloon-help show decoded URIs.
+
+2005-03-02 ARISAWA Akihiro <ari@mbf.ocn.ne.jp>
+
+ * w3m.el (w3m-show-decoded-url): New user option.
+ (w3m-make-url-decode-function): New inline function.
+ (w3m-make-help-echo): Use it.
+ (w3m-fontify-anchors): The function of help-echo property has an
+ ability to decode url.
+
+2005-03-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-decode-coding-string-with-priority): New function.
+
+ * w3m.el (w3m-url-decode-string): Use it.
+
+2005-03-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-attributes-1): Support `300 Multiple Choices'.
+ (w3m-w3m-retrieve): Ditto.
+ (w3m-w3m-retrieve-1): Ditto.
+
+2005-02-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-detect-coding-region): Use the name of the coding
+ system instead of the coding category if it is void.
+
+ * w3m-util.el (w3m-set-match-data): New macro which converts points
+ into markers under XEmacs.
+ (w3m-search-tag-1): Use it.
+
+ * w3m-e19.el: Autoload easymenu in order to avoid compile warning.
+ * w3m-om.el: Ditto.
+
+2005-02-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (all): Use `w3m-form-set-number' and `w3m-form-kill-buffer'
+ instead of `w3m-form-textarea-set-number' and
+ `w3m-form-textarea-kill-buffer'
+
+ * w3m-form.el (w3m-form-input-select-urlid): New buffer local variable.
+ (w3m-form-input-map-urlname): Ditto.
+ (w3m-form-set-number): Rename from `w3m-form-textarea-set-number' and
+ treate buffers of `select' and `map'.
+ (w3m-form-kill-buffer): Ditto.
+ (w3m-form-input-select-set): Allways remove own buffer.
+ (w3m-form-input-select-exit): Ditto.
+ (w3m-form-input-map-set): Ditto.
+ (w3m-form-input-map-exit): Ditto.
+ (w3m-form-input-select): When exists same from buffer, use it.
+ (w3m-form-input-map): Ditto.
+
+2005-02-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-what-where): Fix the form.
+ (w3mhack-makeinfo): Silence it when formatting @multitable section.
+
+2005-02-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top): Add autoloads of `w3m-form-textarea-kill-buffer' and
+ `w3m-form-textarea-set-number' to avoid byte-compile warnings.
+ (w3m-delete-buffer): Call `w3m-form-textarea-kill-buffer' when use
+ form.
+ (w3m-delete-other-buffers): Ditto.
+ (w3m-quit): Ditto.
+ (w3m-select-buffer-delete-buffer): Ditto.
+ (w3m-pack-buffer-numbers): Call `w3m-form-textarea-set-number' when use
+ form.
+
+ * w3m-form.el (top): Move all buffer local variables on the top to
+ avoid byte-compile warnings.
+ (w3m-form-parse-and-fontify): Set `w3m-form-use-textarea-backup-p' to
+ nil.
+ (w3m-form-input-textarea-save): Use `w3m-form-use-textarea-backup-p'
+ instead of `w3m-form-use-textarea-backup'.
+ (w3m-form-input-textarea-set): Allways remove textarea buffer and
+ window.
+ (w3m-form-input-textarea-exit): Ditto.
+ (w3m-form-input-textarea): Check to call for backup. Check identity of
+ existed textarea buffer and w3m buffer. Treat
+ `w3m-form-use-textarea-backup-p'.
+ (w3m-form-use-textarea-backup-p): New function.
+ (w3m-form-textarea-set-number): Ditto.
+ (w3m-form-textarea-kill-buffer): Ditto.
+ (w3m-form-submit-get-textarea-files): If no backup, return nil.
+
+2005-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el: Autoload cancel-timer for XEmacs.
+
+ * w3m-xmas.el (w3m-run-at-time): Use run-at-time which comes from
+ timer-funcs.el if it seems to work correctly.
+ (cancel-timer): Defun if it is void.
+
+2005-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/ptexinfmt.el (texinfo-multitable-widths): Reverse the logic that
+ shows whether it is broken.
+
+ * w3m-util.el: Autoload regexp-opt for Emacs 19.
+
+ * w3mhack.el (w3mhack-makeinfo): Load poe for Emacs 19.
+
+2005-02-24 Romain Francoise <romain@orebokech.com>
+
+ * w3m.el (w3m-lynx-like-map): Bind [follow-link] so as to make mouse-1
+ work in Emacs 22 like mouse-2.
+ (w3m-info-like-map): Ditto.
+
+2005-02-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-antenna.el (w3m-antenna-check-rss): Parse all date fields.
+
+2005-02-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-input-textarea): Fix.
+
+2005-02-21 Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>,
+ Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-input-textarea-mode-setup): Fix.
+ (w3m-form-input-textarea): Follow the above change.
+
+2005-02-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-textarea-edit-mode): Changed its default value
+ to `text-mode'.
+
+2005-02-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-package): Change the default directory in which
+ icon files will be installed from `etc/w3m/icons/' into
+ `etc/images/w3m/' following the most recent Emacs and Gnus.
+ (install-package-ja): Ditto.
+
+ * aclocal.m4 (AC_EXAMINE_PACKAGEDIR): Use configure-package-path.
+ (AC_PATH_ICONDIR): Change the default directory in which icon files
+ will be installed from `etc/w3m/icons/' into `etc/images/w3m/'
+ following the most recent Emacs and Gnus.
+
+ * w3m.el (w3m-icon-directory): Improve the way to determin the default
+ value.
+
+ * w3mhack.el (w3mhack-nonunix-install): Change the default directory in
+ which icon files will be installed from `etc/w3m/icons/' into
+ `etc/images/w3m/' following the most recent Emacs and Gnus.
+ (w3mhack-make-package): Ditto.
+ (w3mhack-what-where): Ditto.
+
+2005-02-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-lnum.el: Rename from w3m-link-numbering.el.
+
+ * mime-w3m.el: Load mime-parse.el before mime.el and w3m.el when
+ compiling rather than always loading mime.el and w3m.el.
+
+2005-02-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el: Changes to define `w3m-form-input-textarea-mode' as a
+ minor mode.
+ (w3m-form-textarea-edit-mode): New option.
+ (w3m-form-input-textarea-map): Renamed from
+ `w3m-form-input-textarea-keymap'.
+ (w3m-form-input-textarea-mode) [variable]: New internal variable.
+ (w3m-form-input-textarea-mode) [function]: Reconstructed.
+ (w3m-form-input-textarea-mode-setup): New function.
+ (w3m-form-input-textarea): Clean up.
+
+2005-02-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_PATH_EMACS): Show the correct Emacs version.
+
+ * mime-w3m.el: Always require mime and w3m instead of to autoload
+ mime-parse.el.
+
+ * w3m-bitmap.el: Bind w3m-work-buffer-list when compiling.
+
+ * w3m-proc.el: Silence the byte compiler complaining against gensym.
+
+ * w3m-rss.el: Use eval-and-compile in order to autoload timezone.el.
+
+ * w3m.el (w3m-treat-drive-letter): Use eval-and-compile.
+ (w3m-touch-file-available-p): Move forward.
+ (w3m-touch-file): Ditto.
+ (w3m-expand-path-name): Use eval-and-compile.
+ (w3m-window-hscroll): Ditto.
+ (w3m-current-column): Ditto.
+ (w3m-set-window-hscroll): Ditto.
+ (w3m-add-local-hook): Silence the byte compiler.
+ (w3m-run-at-time): Use eval-and-compile.
+
+ * w3mhack.el: Remove the code used to silence the byte compiler which
+ complains make-local-hook is obsolete.
+ (w3mhack-makeinfo): Silence XEmacs when formatting Infos.
+
+ * octet.el: Require cl when compiling.
+ * w3m-filter.el: Ditto.
+ * w3m-fsf.el: Ditto.
+ * w3m-link-numbering.el: Ditto.
+ * w3m-namazu.el: Ditto.
+
+2005-02-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Load w3m-e23.el for Emacs 23.
+
+ * w3mhack.el (w3mhack-module-list): Use w3m-e23.el for Emacs 23.
+
+ * w3m-e23.el: Rename from w3m-e22.el.
+
+2005-02-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Load w3m-e21.el even if the version of Emacs is 22.x when the
+ Emacs CVS HEAD is used.
+
+ * w3mhack.el (w3mhack-module-list): Prefer w3m-e21.el rather than
+ w3m-e22.el if the Emacs CVS HEAD is used.
+
+2005-02-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-html-skelton): Fix typo.
+ (w3m-antenna-make-contents): Replace %D to the modified time of
+ `w3m-antenna-file'.
+
+2005-02-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-gmane-url-at-point): New function.
+ (w3m-url-at-point): Use it.
+
+2005-01-30 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m.el (w3m-attributes): Support cid urls.
+ (w3m-external-view): Ditto.
+
+2005-01-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-force-window-update): Make it work whatever the value
+ for the resize-mini-windows variable is.
+ (w3m-update-tab-line): Ditto.
+
+2005-01-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-rss.el (w3m-rss-parse-date-string): Support the date format in
+ the RFC822 style which RSS 2.0 allows. Suggested by David Hansen
+ <david.hansen@physik.fu-berlin.de>.
+
+2005-01-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (w3m-force-window-update, w3m-update-tab-line): Call
+ `enlarge-window' before calling `shrink-window', in order to avoid
+ deleting sole window.
+
+2005-01-19 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-content-type-alist): Check if "fiber.exe" is exist.
+
+2005-01-17 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Check if w3m-current-url is
+ available.
+
+2004-07-24 Tsuyoshi CHO <mfalcon_sky@emailuser.net>
+
+ * w3m.el (w3m-menubar): Rearrange it hierarchical.
+ (w3m-setup-menu): Use easymenu.
+
+2005-01-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-input-textarea): Modify string of the inquiry.
+
+2005-01-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-goto-url): Call `w3m-form-textarea-files-remove' if
+ necessary.
+
+ * w3m-util.el (w3m-compare-strings): New define.
+
+ * w3m-form.el (w3m-form-textarea-file-expire-date): Modify Document.
+ (w3m-fontify-textareas): Put `w3m-form-file-name' property.
+ (w3m-form-textarea-files, w3m-form-textarea-post-files): New buffer
+ local variable.
+ (w3m-form-parse-and-fontify): Set `w3m-form-textarea-files'. Put
+ `w3m-form-file-name' property on the form of textarea.
+ (w3m-form-input-textarea): Use same textarea buffer if exist. Don't
+ ask user if don't modify its area without tailed white space. Visible
+ the editted text when ask user. Guard against 'C-g'. Added
+ `w3m-form-textarea-file-cleanup' to hook as `kill-emacs-hook'
+ (w3m-form-textarea-same-check): New function.
+ (w3m-form-textarea-file-cleanup): Remove myself from `kill-emacs-hook'.
+ (w3m-form-textarea-files-remove): New function.
+ (w3m-form-submit-get-textarea-files): Ditto.
+ (w3m-form-submit): Set `w3m-form-textarea-post-files' for removing
+ files.
+ (w3m-form-resume): Check `selects' is cons.
+
+2005-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/Makefile.in (.texi.info): Set LC_ALL=C.
+
+2004-12-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-quit): Call `w3m-form-textarea-file-cleanup'.
+ (w3m-view-this-url-1): Revert final change.
+
+ * w3m-form.el (w3m-form-textarea-file-expire-date): New user option.
+ (w3m-form-textarea-file-cleanup): New function.
+
+2004-12-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-use-textarea-backup): New user option.
+ (w3m-form-textarea-directory): Ditto.
+ (w3m-form-get-coding-system): New function.
+ (w3m-form-make-form-data): Use `w3m-form-get-coding-system'.
+ (w3m-form-input-textarea-keymap): Define "C-xC-s" to
+ `w3m-form-input-textarea-save'.
+ (w3m-form-input-textarea-file): New variable.
+ (w3m-form-input-textarea-coding-system): Ditto.
+ (w3m-form-input-textarea-filename): New function.
+ (w3m-form-input-textarea-save): Ditto.
+ (w3m-form-input-textarea-set): Call `w3m-form-input-textarea-save'.
+ (w3m-form-input-textarea-exit): Ditto.
+ (w3m-form-input-textarea-mode): Modify doc-string.
+ (w3m-form-input-textarea): Handling filename and coding-system.
+
+2004-12-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-this-url-1): Revert 2004-12-17 change. The buffer
+ seems empty killed before to restore window configuration. Restore the
+ position and window-start if last window equal current-window.
+
+2004-12-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-hist.el (w3m-history-restore-position): Handling the window of
+ w3m for sure absolutely.
+
+2004-12-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Revert.
+
+2004-12-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Bind undo-outer-limit.
+
+2004-12-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Local file is given special treatment
+ for `href'. Fix match data of `href'.
+ (w3m-view-this-url-1): If the points of window was treated in
+ w3m-goto-url(), now reconstruct window configuration.
+
+2004-12-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-update-tab-line): Wobble the window size instead of
+ setting the cursor color.
+
+2004-12-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-namazu.el (w3m-namazu): Added optional argument `reload'.
+
+2004-12-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-tag-regexp-of): Remove.
+ (w3m-search-tag-1): New function.
+ (w3m-search-tag): New macro.
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Use w3m-search-tag instead
+ of w3m-tag-regexp-of.
+
+2004-12-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Use 'w3m-name-anchor2 property to avoid
+ overriding 'w3m-name-anchor property.
+ (w3m-search-name-anchor): Search 'w3m-name-anchor2 property if not
+ detect 'w3m-name-anchor property.
+
+2004-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Ignore a select form in the
+ case where w3mmee is running if its value is not specified. Reported
+ by Clemens Fischer <ino-qc@spotteswoode.de.eu.org>.
+
+ * w3mhack.el (labels): Remove.
+
+2004-11-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (labels): A temporary substitution against the Emacs CVS
+ bug.
+
+2004-11-26 TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
+
+ * w3m-form.el (w3m-form-resume): Check whether a form exists, before
+ resuming its values from its history.
+
+2004-11-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-rss.el: New file.
+
+ * w3m-antenna.el (w3m-antenna-check-rss): New function.
+ (w3m-antenna-sites): Improve its customize spec to support
+ `w3m-antenna-check-rss'.
+
+ * w3m.el (w3m-content-type-alist): Add text/xml, application/xml,
+ application/rdf+xml, and application/rss+xml.
+ (w3m-detect-xml-charset): New function.
+ (w3m-decode-buffer): Use the above function when decoding XML contents.
+
+2004-11-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-redisplay-this-page): Don't make a new history.
+
+2004-11-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-output-coding-system): Use `utf-8' if Emacs has internal
+ utf-8 only.
+ (w3m-input-coding-system): Revert last change.
+ (w3m-halfdump-command-arguments): Bind `fix_width_conv' and
+ `use_jisx0201' when w3m-m17n.
+
+2004-11-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-input-coding-system): Use `utf-8' if Emacs has internal
+ utf-8, it has no Mule-UCS and w3m-type is `w3m-m17n'.
+
+2004-11-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-char-to-int, w3m-string-to-char-list,
+ w3m-int-to-char): Silence byte-compiler.
+ * w3m-ccl.el (charset-id): Ditto.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-update): Don't let iswitchb manage
+ the w3m tab menubar.
+
+2004-10-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-check-refresh-attribute): Support own page reload.
+ (w3m-goto-url-with-timer): Ditto.
+
+2004-10-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_ADD_LOAD_PATH): Clarify the error message.
+
+2004-10-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (call-process-region): Add an advice in order to fix an
+ XEmacs 21.5.18 bug.
+ * w3mhack.el (call-process-region): Ditto.
+
+2004-10-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-check-refresh-attribute): Fix to analyze the URL.
+
+2004-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-touch-file): Protect against the absence of
+ file-name-coding-system and default-file-name-coding-system.
+
+2004-10-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-buffer-setup): Modify `mode-line-buffer-identification';
+ display "Loading..." instead of `w3m-current-titile' when process of
+ w3m active.
+
+2004-10-16 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-touch-file): Use `set-file-times' if available; bind
+ `coding-system-for-write' while calling `w3m-touch-command'.
+
+2004-10-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-perldoc.el (w3m-perldoc-input-coding-system)
+ (w3m-perldoc-output-coding-system): New options.
+ (w3m-about-perldoc): Use the above options, to display both modules
+ encoded in EUC-JP and ones encoded in UTF-8 correctly.
+
+2004-10-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-line): Replace "%" with "%%" in
+ w3m-tab-line-format.
+
+2004-10-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-retrieve): Add autoload cookie.
+
+2004-10-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add the parameter
+ `ie=Shift_JIS' to Google for Japanese users.
+
+2004-09-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-antenna.el (w3m-about-antenna): Revert 2004-09-16 change.
+
+2004-09-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-antenna.el (w3m-about-antenna): Change the method to compare an
+ arrived time to a last-modified time.
+
+2004-09-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Don't make a new history when reloading.
+ (w3m-reload-this-page): Ditto.
+
+ * w3m-hist.el (w3m-history-restore-position): Don't cause an error even
+ if a page has shrunk.
+
+
+2004-08-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.4.3 from emacs-w3m-1_4 branch.
+
+2004-08-15 Kazuhiro UCHIDA <kayoujin@yahoo.co.jp>
+
+ * w3m.el (w3m-remove-meta-charset-tags): Check that a content field has
+ a valid value before parsing it.
+
+2004-08-12 Romain Francoise <romain@orebokech.com>
+
+ * w3m.el (w3m-relationship-estimate-rules): Improve regexp for Google
+ in order to make the scroll-to-next-page feature work on Google Groups
+ as well.
+
+2004-08-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-relationship-estimate-rules): Fix regexp for Google.
+ Suggested by Romain Francoise <romain@orebokech.com>.
+
+2004-08-02 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el (slanted): Rename @s to @slanted.
+
+2004-07-30 Romain Francoise <romain@orebokech.com>
+
+ Enable emacs-w3m to be built with Emacs --without-x.
+
+ * w3m-e21.el (image-size): Alias to ignore if it is not available.
+
+ * w3m-favicon.el (w3m-favicon-type): Don't use image-types if it is not
+ available.
+
+ * w3m.el (mouse-set-point): Autoload mouse.elc.
+
+2004-07-20 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Support @s.
+
+
+2004-07-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.4.2 from emacs-w3m-1_4 branch.
+
+ * w3m.el (w3m-w3m-canonicalize-url): Revival.
+ (w3m-w3m-attributes, w3m-w3m-retrieve): Call the above.
+ (w3m-canonicalize-url): Do not check a slash.
+
+2004-07-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-detect-meta-charset): Check that a content field has a
+ valid value before parsing it.
+
+2004-07-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+ Suggested by Tatsuya Kinoshita <tats@vega.ocn.ne.jp>
+
+ * w3m.el (w3m-correct-charset-alist): Reverse "windows-125x" and
+ "cp125x".
+
+
+2004-07-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.4.1 from emacs-w3m-1_4 branch.
+
+2004-07-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-weather.el: Reconstructed to follow the change of site design.
+ (w3m-weather-completion-table, w3m-weather-filter-functions): Update.
+ (w3m-weather-extract-contents, w3m-weather-adjust-contents): New
+ functions.
+ (w3m-weather-remove-headers, w3m-weather-remove-footers,
+ w3m-weather-get-seikatu-sisu, w3m-weather-insert-seikatu-sisu):
+ Removed.
+
+2004-06-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-canonicalize-url): Don't make sure arg is a string.
+ (w3m-input-url): Don't use w3m-canonicalize-url for non-string url
+ which may be the symbol popup.
+
+2004-06-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-canonicalize-url): New function.
+ (w3m-input-url, w3m-browse-url): Call the above.
+ (w3m-w3m-canonicalize-url): Abolished.
+ (w3m-w3m-attributes, w3m-w3m-retrieve): Do not call the abolished
+ function.
+ (w3m-url-hierarchical-schemes): Add `ftps'.
+
+2004-06-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-add-w3m-initial-frames): Share the opened frame in
+ w3m-initial-frames over all emacs-w3m buffers if w3m-use-tab is
+ non-nil.
+ (w3m-delete-w3m-initial-frames): New function; add it to
+ delete-frame-functions or delete-frame-hook, or merge into delete-frame
+ using defadvice.
+ (w3m-delete-frames-and-windows): Return to the former buffer after
+ performing walk-windows; don't manage w3m-initial-frames.
+
+ * w3m.el (w3m-delete-buffer): Don't manage w3m-initial-frames.
+
+2004-06-14 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m.el (TopLevel): Display meaningful message when w3m-command is
+ nil.
+
+2004-06-21 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-fontify): Call `w3m-replace-symbol' before
+ `w3m-fontify-anchors' in order not to lose text properties.
+
+2004-06-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Run w3m-mode before popping to the newly created buffer
+ up.
+
+2004-06-12 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-output-coding-system): Change default value for w3m-m17n.
+
+ * w3m-bug.el (report-emacs-w3m-bug-system-informations): Add
+ w3m-input-coding-system and w3m-output-coding-system.
+
+2004-06-11 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-meta-content-type-charset-regexp)
+ (w3m-meta-charset-content-type-regexp)
+ (w3m-meta-refresh-content-regexp)
+ (w3m-meta-content-refresh-regexp): Removed.
+ (w3m-detect-meta-charset, w3m-remove-meta-charset-tags)
+ (w3m-check-refresh-attribute): Use `w3m-parse-attributes' instead of
+ above regexp.
+ (w3m-rendering-buffer): Don't call `w3m-remove-meta-charset-tags' for
+ w3m-m17n.
+
+2004-06-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-new-session): Doc fix.
+ (w3m-safe-view-this-url): Use w3m-goto-url-new-session only when a user
+ invokes this command in a buffer not being running the w3m-mode.
+
+2004-06-07 Masatake YAMATO <jet@gyve.org>
+
+ * w3m-hist.el (w3m-history-store-position): Fix a wrong message.
+
+2004-06-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-filter.el (w3m-filter-rules): Relax the condition.
+
+2004-06-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-new-session): Doc fix.
+ (w3m-safe-view-this-url): Use w3m-goto-url-new-session instead of
+ w3m-goto-url when w3m-make-new-session is non-nil.
+
+2004-06-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-new-session): New user option.
+ (w3m): Make a new emacs-w3m buffer if w3m-make-new-session is non-nil
+ and a user specifies a url string.
+
+2004-06-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-popup-buffer): Don't use focus-frame in Emacs.
+
+2004-06-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el (w3m-process-wait-discard-input): Abolish.
+ (w3m-process-wait-process): Don't use accept-process-output to make it
+ possible to show progress messages; discard key press events while
+ waiting for finishing of a process.
+
+2004-05-24 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-put-by-name): Overwrite ID value when a name is
+ found.
+
+2004-05-22 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-fontify): Remove tags in the form element except for
+ textarea.
+
+2004-05-18 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * w3m-util.el (w3m-replace-in-string): New function which is a copy of
+ shimbun-replace-in-string.
+ * w3m.el (w3m-active-region-or-url-at-point): Use it; remove all
+ whitespace in region.
+
+2004-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Bind mew-use-text/html as t.
+
+2004-05-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-home-page): Improve the customizing widget.
+
+2004-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-expand-url): Bind file-name-handler-alist as nil.
+
+2004-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-arrived-ignored-regexp): Add about:blank.
+ (w3m-history-ignored-regexp): Ditto.
+ (w3m-about-retrieve): Ditto.
+ (w3m-buffer-setup): Prefer the last visited emacs-w3m buffer.
+
+2004-05-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-filter.el (w3m-filter-rules): Update its default value and its
+ customize spec.
+
+2004-05-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-dump-extra): Examine image data briefly to detect
+ only gif, jpeg and png by itself.
+
+ * w3m-util.el (w3m-image-type-from-data): Abolish.
+
+2004-05-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-dump-extra): Check only 300 bytes at the top of the
+ data.
+
+2004-05-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-image-type-from-data): New function. Suggested by
+ KOSEKI Yoshinori <kose@meadowy.org>.
+
+ * w3m.el (w3m-w3m-dump-extra): Use it.
+
+2004-05-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el (w3m-process-start-process): Use
+ set-process-query-on-exit-flag if it is available.
+
+ * w3m.el (w3m-w3m-dump-extra): Trust the magic at the beginning of
+ image data rather than the content-type header.
+
+2004-05-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-copy-buffer): Prefer cached contents without checking
+ their validity.
+
+2004-05-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-waited): Revival.
+ (w3m-process-with-wait-handler): Set t to the above.
+
+ * w3m.el (w3m-w3m-dump-extra): Check the above.
+
+2004-04-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (emacs-w3m-version): Reset.
+
+
+2004-04-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.4 from emacs-w3m-1_4 branch.
+
+ * Makefile.in (install-package): Install w3m-load.el.
+ (dist, tarball): Reimplemented, in order to keep time stamps of source
+ files.
+
+ * w3mhack.el (w3mhack-generate-xemacs-load-file): Simplified.
+
+2004-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-xemacs-load-file): Replace
+ `replace-string' with basic functions.
+
+2004-04-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-generate-xemacs-load-file): New function.
+ (w3mhack-make-package): Use `w3mhack-generate-xemacs-load-file.
+
+2004-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-update-files-autoloads): New function.
+ (w3mhack-generate-load-file): Use `w3mhack-update-files-autoloads'.
+
+2004-04-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (tarball): Remove w3m-kwds.el and w3m-load.el.
+
+ * configure.in, aclocal.m4: Add `--with-xml' option.
+
+ * w3mhack.el (w3mhack-module-list): New function.
+ (w3mhack-examine-modules): Use the above.
+ (w3mhack-compile): Use `w3mhack-module-list' instead of
+ `w3mhack-examine-modules'.
+ (w3mhack-generate-load-file): Likewise; Insert ^L to avoid an error of
+ `update-file-autoloads' of old emacsen.
+
+2004-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-treat-image-size): Default to t.
+
+ * w3m-filter.el (w3m-filter-asahi-shimbun): Use marker to limit the
+ search bound.
+
+2004-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-load-file): Save w3m-load.el file before
+ performing `update-file-autoloads'.
+
+2004-04-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (install-lisp): Do not install w3mhack.el.
+ (install-package): Install neither w3mhack.el nor w3m-load.el.
+
+2004-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-treat-image-size): Default to nil.
+ (w3m-rendering-half-dump): Fix a logic determining whether to specify
+ `-ppl' and `-ppc' options to the w3m command.
+
+2004-04-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el: Create w3m-load.el.
+ (w3mhack-load-file): New variable.
+ (w3mhack-examine-modules): Ignore `w3mhack-load-file'.
+ (w3mhack-generate-load-file): New function.
+ (w3mhack-compile): Call the above.
+
+ * .cvsignore: Ignore w3m-load.el.
+
+ * Makefile.in (clean): Remove w3m-load.el.
+
+2004-04-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-expand-path-name): In Emacs, don't bind
+ directory-sep-char which is an obsolete variable.
+
+2004-04-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el, w3m-favicon.el: Move snippets managing
+ `w3m-arrived-setup-functions' and `w3m-arrived-shutdown-functions' from
+ w3m.el into w3m-favicon.el.
+
+2004-04-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-hns-last-modified): Use 32400 as a
+ correct timezone instead of JST (suggested by YAMAOKA-san).
+
+2004-04-22 Christian Schmitt <Christian.Schmitt@Dresdner-Bank.com>
+
+ * w3m.el (w3m-expand-path-name): Bind directory-sep-char to `?/'. It
+ is `?\' by default in XEmacs on Windows (native, not Cygwin).
+
+2004-04-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-use-symbol): Don't activate it in Emacs 20. Advised by
+ Arisawa-san.
+
+2004-04-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Simplify the rule of sending referers.
+ (w3m-add-referer-regexps): Abolished.
+ (w3m-add-referer-predicate-function): Abolished.
+ (w3m-add-referer): New option.
+ (w3m-add-referer-p): New function.
+ (w3m-add-referer-predicate-by-referer-regexps): Removed.
+ (w3m-add-referer-predicate-by-hosts): Removed.
+ (w3m-request-arguments, w3m-header-arguments): Follow the above
+ changes.
+
+2004-04-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-add-w3m-initial-frames): Get the correct value for
+ the newly created frame in Emacs 19.
+
+ * w3m.el (w3m-about-retrieve): Load base64 for Emacs 19.
+ (w3m-minor-mode-command-alist): Add w3m-print-this-url.
+
+ * w3m-bitmap.el (w3m-bitmap-image-insert): Don't put the evaporate
+ property on empty overlays (revert 2004-04-07 change).
+
+2004-04-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-link-numbering.el (w3m-view-numbered-link): Removed.
+ (w3m-move-numbered-anchor): New command.
+ (w3m-link-numbering-mode-map): Use `w3m-move-numbered-anchor' instead
+ of `w3m-view-numbered-link'.
+
+2004-04-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-input-coding-system): Use `w3m-output-coding-system' as
+ its default value for w3m-m17n and w3mmee.
+ (w3m-halfdump-command-arguments): Use "-I" option to disable
+ automatic-detection of coding systems for w3m-m17n and w3mmee.
+
+2004-04-16 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-meta-refresh-content-regexp): Allow quoted string as url.
+ (w3m-meta-content-refresh-regexp): Ditto.
+ (w3m-check-refresh-attribute): Decode entities.
+
+2004-04-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-link-numbering.el (w3m-link-numbering): Quit when links have
+ already been numbered.
+
+2004-04-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-link-numbering.el (w3m-link-numbering-mode): Delete all overlays
+ that display link numbers, when deactivating.
+
+2004-04-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-link-numbering.el (w3m-link-numbering): Add face to before-string
+ correctly under XEmacs; don't bother to delete overlays (suggested by
+ TSUCHIYA-san).
+
+2004-04-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-link-numbering.el (w3m-link-numbering-face): New face.
+ (w3m-link-numbering): Use it.
+
+2004-04-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-link-numbering.el: New file.
+
+ * w3m.el (w3m-browse-url): Load `browse-url' before calling
+ `browse-url-interactive-arg'.
+
+2004-04-12 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Support @indicateurl, @LaTeX, @ordf, @ordm. @url
+ is now a synonym for @uref.
+
+2004-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-anchors): No need to enable evaporation of
+ overlays in XEmacs.
+
+2004-04-08 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * w3m.el (w3m-delete-all-overlays): Revert.
+ (w3m-highlight-current-anchor): Ditto.
+
+2004-04-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-all-overlays): Remove.
+
+2004-04-07 Masatake YAMATO <jet@gyve.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-insert): Enable the evaporate
+ property on overlays.
+
+ * w3m-e21.el (w3m-form-make-button): Enable the evaporate property on
+ buttun overlays.
+
+ * w3m.el (w3m-fontify-anchors): Ditto.
+ (w3m-create-text-page): No need to delete zombie overlays.
+ (w3m-create-image-page): Ditto.
+ (w3m-highlight-current-anchor-1): Enable the evaporate property on
+ overlays.
+ (w3m-highlight-current-anchor): No need to delete overlays.
+
+2004-04-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-rendering-extract-title): Remove too much whitespace.
+
+2004-04-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-all-overlays): Simply delete all overlays if the
+ optional arg is given.
+ (w3m-create-text-page): Delete zombie overlays.
+ (w3m-create-image-page): Ditto.
+
+2004-04-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Improve custom.
+
+2004-04-04 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "amazon" entry.
+
+2004-03-31 Yuya Nishida <yuya@j96.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "amazon-ja" entry;
+ "PostData" can be specified.
+ (w3m-search): Support post-data.
+
+2004-04-04 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-header-arguments): Set unibyte at work buffer.
+
+ * w3m-form.el (w3m-form-make-form-data): Set unibyte at work buffer;
+ Encode form data.
+
+2004-03-22 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-type): Check if w3m-compile-options contains "m17n".
+
+2004-03-19 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-add-referer-regexps): Fix typo.
+ (w3m-add-referer-predicate-function): New user option.
+ (w3m-add-referer-predicate-by-referer-regexps): New function.
+ (w3m-add-referer-predicate-by-hosts): Ditto.
+ (w3m-request-arguments): Call w3m-add-referer-predicate-function.
+ (w3m-header-arguments): Ditto.
+
+ * octet.el (mime-view-octet): Avoid redundant invocation of
+ `mime-entity-content'.
+
+2004-03-14 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-symbol.el (w3m-mule-unicode-symbol): Fixed 32th character.
+ Thanks to Taichi KAWABATA for his report.
+
+2004-03-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-weather.el (w3m-weather-get-seikatu-sisu): Relax regular
+ expressions to extract indices, to follow the change of the site
+ design.
+
+2004-03-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-force-window-update): New function.
+ (w3m-tab-drag-mouse-function, w3m-tab-click-mouse-function,
+ w3m-tab-line, w3m-e21-switch-to-buffer, w3m-select-buffer-hook): Use
+ `w3m-force-window-update' instead of `w3m-e21-wobble-window-size'.
+ (w3m-e21-wobble-window-size): Abolish.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Use `w3m-force-window-update'.
+
+ * w3m-proc.el: Autoload `w3m-force-window-update' when compiling.
+ (w3m-process-stop): Use `w3m-force-window-update'.
+
+ * w3m.el (w3m-select-buffer-show-this-line): Use
+ `w3m-force-window-update'.
+
+
+2004-02-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (emacs-w3m-version): Release 1.3.85.
+
+2004-02-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-drag-mouse-function): Call
+ `w3m-e21-wobble-window-size'.
+ (w3m-tab-click-mouse-function): New function.
+ (w3m-tab-make-keymap): Use it.
+
+2004-02-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-mee-new): Use `w3m-form-normalize-action' for
+ action.
+
+2004-02-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-select-buffer-show-this-line): Call
+ `w3m-e21-wobble-window-size' when Emacs 21 or 22 is running.
+
+ * w3m-e21.el (w3m-tab-line-format): Make it buffer-local variable.
+ (w3m-tab-timer): Ditto.
+ (w3m-e21-wobble-window-size): New function.
+ (w3m-tab-line): Make `w3m-tab-timer' hold boolean value; let a timer
+ function run certainly in a buffer in which a timer started; use
+ `w3m-e21-wobble-window-size'.
+ (w3m-e21-switch-to-buffer): New command.
+ (w3m-e21-subst-switch-to-buffer-keys): New function.
+ (w3m-mode-setup-functions): Add `w3m-e21-subst-switch-to-buffer-keys'.
+ (w3m-select-buffer-hook): Add `w3m-e21-wobble-window-size'.
+ (w3m-spinner-image-index): Make it buffer-local variable.
+
+2004-02-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-make-form-data): Align form by the number of
+ `hseq'.
+
+2004-02-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-sites): Add
+ `w3m-antenna-check-another-page' to its customize spec.
+ (w3m-antenna-check-another-page): New function.
+ (w3m-about-antenna): Relaxed the condition to check changed sites.
+ (w3m-antenna-add): Add a new site at the end of `w3m-antenna-sites'
+ instead of adding it at the top.
+
+2004-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna-function): New widget.
+ (w3m-antenna-sites): Use it.
+
+2004-02-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-expand-path-name): Protect expand-file-name from
+ cygwin-mount.el's behavior on Windows.
+
+ * w3m-antenna.el (w3m-about-antenna): Check arrived-time if no
+ last-modified.
+
+2004-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna-sites): Fix mis-implemented customizing
+ widgets in Emacs 20.7 through 21.3 and XEmacs.
+ (w3m-antenna-add): Support Emacs 20.
+
+ * w3m-util.el (widget-default-get): Remove advice.
+
+2004-02-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (widget-default-get): Advise the function to fix a bug in
+ Emacs 21.1 through 21.3.
+
+2004-02-17 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-resume): Fix for checkbox.
+
+2004-02-11 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: Support @docbook, @ifdocbook, @ifnotdocbook, and
+ @registeredsymbol.
+
+2004-02-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-active-region-or-url-at-point): Move the point backward
+ from the end of the active region instead of moving it forward, in
+ order to avoid enlarging the region.
+
+2004-02-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-active-region-or-url-at-point): Find a url-like string in
+ the region instead of extracting the whole substring when the region is
+ active. Don't use `w3m-url-at-point' for that since it doesn't work
+ for all url string.
+ (w3m-quit): Delete frames seemingly fast.
+
+2004-02-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Because some broken servers
+ provide empty contents as their favicons, check the length of the
+ retrieved content, before calling `w3m-favicon-convert'.
+
+2004-02-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Changes to validate cached contents.
+ (w3m-follow-cache-control-header): Abolished.
+ (w3m-prefer-cache): New option.
+ (w3m-cache-available-p): Check whether a cached header includes cache
+ control headers.
+ (w3m-w3m-dump-extra): Always cache both a header and a content.
+ (w3m-w3m-retrieve-1): Check whether a cache is available, before using
+ it.
+ (w3m-view-this-url): When visiting history pages, prefer cached
+ contents without checking their validity.
+ (w3m-view-previous-page, w3m-view-source, w3m-view-header): Prefer
+ cached contents without checking their validity.
+
+2004-02-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-show-error-information): Decode cache contents if
+ necessary.
+
+2004-02-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-edit-url): Define as a command.
+
+2004-02-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Exclude w3m-e22.el except for
+ Emacs 22.
+
+2004-01-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-edit-function-alist): New option.
+ (w3m-edit-url): Refer the above alist to find a suitable function for
+ editing a specified page.
+ (w3m-edit-function, w3m-edit-current-url): Its docstring is modified to
+ follow the above change.
+ (w3m-edit-this-url): Its docstring is modified likewise, and it is
+ simplified.
+ (w3m-goto-url): Ignore cached form data when reloading.
+
+ * w3m.el (w3m-safe-view-this-url): Call `w3m-goto-url' when a function
+ set to `w3m-goto-article-function' returns nil.
+
+2004-01-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Changes to follow anchors that point Shimbun articles.
+ (w3m-goto-article-function): New variable.
+ (w3m-safe-view-this-url): Refer the above.
+
+2004-01-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-follow-cache-control-header): New option.
+ (w3m-w3m-dump-extra): If `w3m-follow-cache-control-header' is nil, do
+ not follow the chache control headers.
+
+2004-01-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (tarball): Because Emacs-22 has not been released, remove
+ w3m-e22.el from the creating tarball.
+
+2004-01-27 Taichi KAWABATA <batta@beige.ocn.ne.jp>
+
+ * w3m-e22.el: New file. This file is simply the copy of w3m-e21.el
+ except that the ccl section has been removed.
+
+ * w3m.el: Require w3m-e22 when Emacs 22 is running.
+
+2004-01-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-after-cursor-move-hook): Add :group keyword.
+ (w3m-auto-show): Check `truncate-lines' before scrolling.
+ (w3m-check-current-position): Do not check `truncate-lines'.
+
+ * mime-w3m.el: Changes to display URI of the current anchor.
+ (mime-w3m-after-cursor-move-hook): New option.
+ (mime-w3m-add-local-hook): New advice.
+ (mime-w3m-check-current-position): New funcion.
+
+2004-01-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-start-and-wait): Abolished.
+ (w3m-process-with-wait-handler): Reimplemented.
+
+ * w3m.el (w3m-input-url): Accept other symbols than `popup'.
+ (w3m-copy-buffer): Fix the bug that drops an asynchronous handler
+ returned by `w3m-goto-url'.
+
+2004-01-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Register a url to the history even if it is
+ failed to retrieve. Suggested by Fujishima-san.
+
+2004-01-23 Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>
+
+ * w3m.el (w3m-input-url): Fix a bug which causes an error when there's
+ neither a frame nor a window for the emacs-w3m session and `url' is the
+ symbol `popup' (it is because there's a url-like text around the cursor
+ but deleted by a user in the minibuffer).
+
+2004-01-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-input-url): Add "http://" to its return value, when its
+ return value contains no scheme part.
+
+2004-01-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-dump-extra): Check cache control headers before
+ caching headers and contents. This change is suggested by Mr. Amagai
+ in [emacs-w3m:06255].
+ (w3m-message): Make it verbose, even if a buffer related to emacs-w3m
+ is not displayed. w3m-print-this-url() has been broken in buffers
+ displaying text/html messages, because w3m-message() was too silent.
+
+2004-01-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-safe-view-this-url): Bind `w3m-pop-up-windows' to nil
+ locally, in order to keep MUA's window configuration.
+
+ * w3m-proc.el (w3m-process-do-with-temp-buffer): Save the current
+ buffer while executing an asynchronous body.
+
+ * w3m-util.el (w3m-insert-string): Define its `edebug-form-spec'.
+
+2004-01-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-util.el (w3m-keep-region-active): Renamed from
+ `w3m-activate-zmacs-regions'.
+ (w3m-deactivate-region): Declared as a macro.
+
+ * w3m-search.el (w3m-search-read-query): Call `w3m-deactivate-region'
+ instead of `w3m-deactivate-mark'; Call `region-beginning' and
+ `region-end' instead of `point' and `mark'.
+
+ * w3m.el (w3m-next-anchor, w3m-previous-anchor, w3m-next-form,
+ w3m-previous-form, w3m-next-image, w3m-previous-image,
+ w3m-scroll-up-or-next-url, w3m-scroll-down-or-previous-url,
+ w3m-beginning-of-line, w3m-end-of-line): Call `w3m-keep-region-active'
+ instead of `w3m-activate-zmacs-regions'.
+ (w3m-active-region-or-url-at-point): Call `region-beginning' and
+ `region-end' instead of `point' and `mark'.
+
+2004-01-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (w3m-process-wait-discard-input): New variable.
+ (w3m-process-wait-process): If `w3m-process-wait-discard-input' is
+ non-nil, call `discard-input'.
+
+2004-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-deactivate-mark): New function alias.
+
+ * w3m.el (w3m-active-region-or-url-at-point): Use it.
+ (w3m-open-all-links-in-new-session): Use it.
+
+ * w3m-search.el (w3m-search-read-query): Use it.
+
+2004-01-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-active-region-or-url-at-point): New function.
+ (w3m-input-url, w3m-view-this-url, w3m-goto-url): Call
+ `w3m-active-region-or-url-at-point' instead of `w3m-url-at-point'.
+
+2004-01-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-util.el (w3m-region-active-p): New macro.
+
+ * w3m.el (w3m-open-all-links-in-new-session): Deactivate the mark when
+ it is active.
+ (w3m-view-this-url-new-session): Use `w3m-region-active-p'.
+
+ * w3m-search.el (w3m-search-read-query): Use `w3m-region-active-p'.
+
+ * w3m-namazu.el (w3m-namazu): Use `w3m-search-read-query' to read a
+ query from the minibuffer.
+
+ * w3m-search.el (w3m-search-read-query): New function.
+ (w3m-search): Use the above function.
+
+2004-01-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (w3m-search): Use the region as an initial string if
+ Transient Mark mode.
+ (w3m-search-word-at-point): Follow the above change in its docstring.
+
+ * w3m-e21.el (w3m-tab-line): Check the length of the current title,
+ before checking the breadth of its first character.
+
+2003-12-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-accept-languages): Split the option of w3m with a comma
+ surrounded by some spaces.
+ (w3m-dump-head-source-command-arguments): Use a comma instead of a
+ white space to concatenate elements of `w3m-accept-languages'.
+ Cf. Section 14.4 of RFC2047.
+
+2003-12-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Add an advice to byte-optimize-form-code-walker to avoid
+ the warning ``...called for effect'' for the pop form when running
+ Emacs 21.3.
+
+2003-12-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-create-text-page): Use the last directory as a title of
+ text/plain page when its uri is terminated by a slash.
+
+
+2003-12-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (emacs-w3m-version): Release 1.3.80.
+
+2003-12-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-wait-process): Return exit status; Use
+ `accept-process-output' instead of `sit-for' in order to flush pending
+ output.
+ (w3m-process-with-wait-handler): Follow the above change.
+
+2003-12-21 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-mode): Small doc fix.
+ (w3m-relationship-estimate-rules): Relax the regular expression to
+ detect result pages of Google.
+
+2003-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-safe-toggle-inline-image): New function.
+ (w3m-toggle-inline-images): Revoke the recent changes.
+ (w3m-safe-toggle-inline-images): New function.
+ (w3m-safe-view-this-url): Doc fix.
+ (w3m-minor-mode-command-alist): Use `w3m-safe-toggle-inline-image' and
+ `w3m-safe-toggle-inline-images'.
+
+ * w3m-util.el (w3m-find-w3m-buffer): Abolish.
+ (w3m-with-w3m-buffer): Abolish.
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Revert.
+
+ * attic/vm-w3m.el (vm-w3m-safe-toggle-inline-images): New function.
+
+2003-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images): Ignore `w3m-safe-url-regexp' when
+ the prefix argument is given.
+
+ * w3m-util.el (w3m-find-w3m-buffer): Bind `w3m-safe-url-regexp' to the
+ value specified peculiarly by each MUA.
+ (w3m-with-w3m-buffer): Ditto.
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Don't bind
+ `w3m-safe-url-regexp' there.
+
+2003-12-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Fix last change.
+
+2003-12-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Use
+ `w3m-toggle-inline-images'.
+ (mew-mime-text/html-w3m): Put the `w3m-images' text property in the
+ message buffer.
+
+ * w3m-util.el (w3m-find-w3m-buffer): Fix for Mew.
+
+2003-12-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images): Wrap it with
+ `w3m-with-w3m-buffer'.
+
+ * w3m-util.el (w3m-find-w3m-buffer): New function.
+ (w3m-with-w3m-buffer): New macro.
+
+2003-12-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-string): Renamed from
+ `string-with-default'.
+ (w3m-antenna-string-create): Renamed from
+ `string-with-default-value-create'.
+ (w3m-antenna-sites): Change its customize spec.
+
+ * w3m-xmas.el (w3m-window-hscroll, w3m-current-column,
+ w3m-set-window-hscroll): Import definitions from w3m.el.
+ (w3m-run-at-time): Renamed from `w3m-xmas-run-at-time'.
+
+ * w3m.el (w3m-window-hscroll, w3m-current-column,
+ w3m-set-window-hscroll): Export definitions for XEmacs to w3m-xmas.el.
+
+2003-12-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_SET_VANILLA_FLAG): New function specifying the
+ `VANILLA_FLAG' variavle. XEmacs 21.5 needs to be given `-vanilla'
+ rather than `-q -no-site-file'.
+ (AC_EMACS_LISP): Use `VANILLA_FLAG'.
+ (AC_PATH_EMACS): Call `AC_SET_VANILLA_FLAG'.
+ (AC_ADD_LOAD_PATH): Use `VANILLA_FLAG'.
+ (AC_CHECK_ELISP): Ditto.
+
+ * configure.in: Check for `EGREP' before calling `AC_PATH_EMACS'.
+
+ * Makefile.in (VANILLA_FLAG): New variable.
+ (FLAGS): Use it.
+ (very-slow): Use it.
+
+ * doc/Makefile.in (VANILLA_FLAG): New variable.
+ (FLAGS): Use it.
+
+ * w3m-xmas.el (w3m-xmas-run-at-time): Use a simple function definition
+ if there is not a bug in `start-itimer'.
+
+2003-12-11 KAMO Tomoyuki <kamo@ITmanage.co.jp>
+
+ * octet.el (octet-suffix-type-alist): Add suffix of bzip-ed files.
+ (octet-type-filter-alist): Add an entry of bzip2.
+ (octet-guess-type-from-name): Relax the regular expression to detect
+ suffix, in order to handle bzip-ed files.
+
+2003-12-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Experimentally implement the estimation layer of
+ relationships between pages.
+ (w3m-relationship-estimate-rules): New option.
+ (w3m-relationship-estimate, w3m-relationship-simple-estimate,
+ w3m-relationship-magicpoint-estimate,
+ w3m-relationship-search-patterns): New functions.
+ (w3m-use-filter): Cancel the last change; its default value is changed
+ to nil.
+
+ * w3m-filter.el (w3m-filter-rules): Remove rules to find relationships.
+ (w3m-filter-find-relationships): Abolished.
+
+ * w3m-util.el (w3m-html-string-regexp): Import from w3m.el.
+
+2003-12-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-filter): Change its default value to t.
+
+ * w3m-filter.el: Reconstructed completely.
+ (w3m-filter-rules): Change its spec and its default value.
+ (w3m-filter): Reimplemented.
+ (w3m-filter-delete-regions, w3m-filter-find-relationships): New
+ functions.
+ (w3m-filter-db, w3m-filter-db-size, w3m-filter-server-regexp,
+ w3m-filter-setup, w3m-filter-delete-region, w3m-filter-lwn.net,
+ w3m-filter-google.com, w3m-filter-www.zdnet.co.jp): Removed.
+
+2003-12-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-xmas-run-at-time): Rewrite w/o using fsf-compat.
+
+ * w3m.el (w3m-run-at-time): New function alias.
+ (w3m-refresh-at-time): Use it.
+
+2003-12-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-xmas-run-at-time): New function.
+
+ * w3m.el (w3m-refresh-at-time): Use it.
+
+2003-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url-new-session): Abolish the optional arg.
+ (w3m-mouse-view-this-url-new-session): Ditto.
+
+2003-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-buffer-setup): Use `defun' instead of `defsubst'.
+
+2003-12-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-current-anchor-face): Replace backquote with quote.
+ (w3m-select-buffer-current-buffer): Ditto.
+ (w3m-header-line-insert): Ditto.
+ (w3m-about-retrieve): Use `defun' instead of `defsubst'.
+ (w3m-cid-retrieve): Ditto.
+ (w3m-current-column): Make it a function, not a macro.
+
+2003-11-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-minor-mode): Run hooks only when this minor mode is
+ enabled.
+ * w3m-bookmark.el (w3m-bookmark-mode): Ditto.
+ * w3m-antenna.el (w3m-antenna-mode): Ditto.
+
+ * w3m-antenna.el (w3m-antenna-alist): Simplified.
+
+2003-11-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el: Define a new minor mode `w3m-antenna-mode'.
+ (w3m-antenna-mode-map, w3m-antenna-mode): New variables.
+ (w3m-antenna-mode, w3m-antenna-mode-setter, w3m-antenna-edit): New
+ functions.
+
+ * w3m-bookmark.el (w3m-bookmark-mode): Change its interactive spec, and
+ improve its document.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Abolish the 4th argument
+ `handler' and wrap the asynchronous processing forms with
+ `w3m-process-with-null-handler', in order to clarify this function's
+ purpose.
+
+ * w3m.el (w3m-message): Use `walk-windows' instead of `window-list',
+ because the latter is not available at Meadow and Mule2.
+ (w3m-w3m-retrieve): Check the status code.
+ (w3m-show-error-information): Also use retrieved error pages.
+ (w3m-minor-mode): Change its interactive spec.
+
+2003-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-convert): Make sure data of the ico type
+ contains the correct magic numbers.
+
+2003-11-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-util.el (w3m-last-visited-buffer): Abolished.
+ (w3m-popup-buffer): Do not reset the above variable.
+
+ * w3m.el (w3m-close-window): Do not set the above variable.
+ (w3m): Do not refer the above variable.
+
+2003-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-retrieve-and-render): Use `w3m-message' instead of
+ `message'; don't let it be controlled by `w3m-verbose'.
+ (w3m-alive-p): Don't sort the return value of `list-buffers' so that it
+ returns the last visited emacs-w3m buffer as much as possible; don't
+ inline the `w3m-list-buffers' function.
+
+2003-11-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-verbose): Change its default value to nil.
+ (w3m-message): When `w3m-verbose' is nil, display messages without
+ logging.
+ (w3m-make-help-echo, w3m-toggle-inline-image, w3m-zoom-in-image,
+ w3m-zoom-out-image, w3m-view-this-url, w3m-submit-form, w3m-view-image,
+ w3m-save-image, w3m-view-url-with-external-browser,
+ w3m-download-this-url, w3m-print-this-url, w3m-edit-current-url,
+ w3m-edit-this-url, w3m-quit, w3m-goto-ftp-url, w3m-select-buffer,
+ w3m-select-buffer-show-this-line,
+ w3m-select-buffer-show-this-line-and-switch): Call `w3m-message'
+ instead of `w3m-display-message'.
+
+ * w3m-util.el (w3m-display-message): Removed.
+ (w3m-display-message-enable-logging): Abolished.
+
+2003-11-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-message): Silent when the cursor is in minibuffer.
+
+ * w3m-util.el (w3m-display-message): Ditto.
+
+2003-11-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-html-string-regexp): Fix my fault; enclose it with
+ `eval-and-compile' which is needed for compiling since it is used in a
+ macro.
+
+2003-11-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-wait-process): Invert the return value of
+ sit-for() that waits an asynchronous process.
+ (w3m-process-kill-process): Relax the condition that checks whether a
+ given process has already finished or not.
+
+2003-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search): Use `w3m-goto-url' instead of `w3m'.
+ * w3m-weather.el (w3m-weather): Ditto.
+
+ * w3m.el (w3m-obey-w3m-pop-up-frames): Abolish.
+ (w3m-goto-url-new-session): Find an existing emacs-w3m buffer and then
+ make a copy of it; use `w3m-goto-url' instead of `w3m' if there is no
+ emacs-w3m buffer.
+ (w3m-browse-url): Revert last change; rename the optional arg to
+ `new-session'; call `w3m-goto-url-new-session' or `w3m-goto-url'.
+ (w3m-select-buffer): Use `w3m-goto-url' instead of `w3m'.
+ (w3m-safe-view-this-url): Ditto.
+
+2003-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna): Don't pass the interactive flag to
+ `w3m-goto-url'.
+ * w3m-bookmark.el (w3m-bookmark-view): Ditto.
+ * w3m-cookie.el (w3m-cookie): Ditto.
+ * w3m-dtree.el (w3m-dtree): Ditto.
+ * w3m-namazu.el (w3m-namazu): Ditto.
+ * w3m-perldoc.el (w3m-perldoc): Ditto.
+
+ * w3m.el (w3m-copy-buffer): Don't pop up a window or a frame if
+ `w3m-goto-url' is called.
+ (w3m-goto-url): Abolish the 8th arg `interactive-p'; pop up a window or
+ a frame anyway.
+ (w3m-goto-url-new-session): Abolish the `interactive-p' argument; don't
+ pass it to `w3m-goto-url'.
+ (w3m-gohome): Ditto.
+ (w3m): Don't pop up a window or a frame there.
+ (w3m-browse-url): Make it work as `browse-url-w3'.
+
+2003-11-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el (w3m-process-wait-process): Don't specify 3 args to
+ `sit-for' for XEmacs.
+
+2003-11-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-sites): Change its default value. Allow
+ a list that consists of a function and its options, as the third
+ element of each site.
+ (w3m-antenna-html-skeleton): Remove the link to the antenna editor.
+ (w3m-antenna-setup): Removed.
+ (w3m-antenna-shutdown): Removed.
+ (w3m-antenna-alist): New function.
+ (w3m-antenna-site-update): Ditto.
+ (w3m-antenna-check-hns): Ditto.
+ (w3m-antenna-check-anchor): Ditto.
+ (w3m-antenna-check-page): Ditto.
+ (w3m-antenna-check-site): Use the above three functions.
+ (w3m-antenna-check-all-sites): Follow the above change. Use
+ w3m-antenna-alist() and w3m-save-list() instead of w3m-antenna-setup()
+ and w3m-antenna-shutdown().
+ (w3m-antenna-check-site-after): Removed.
+ (w3m-antenna-make-summary): Use a key attribute instead of an url
+ attribute, when the latter is not set.
+ (w3m-antenna-make-summary-like-natsumican): Ditto.
+ (w3m-about-antenna): Call w3m-antenna-alist() instead of
+ w3m-load-list().
+ (w3m-about-antenna-edit): Removed.
+ (w3m-antenna-edit-reset-post-data): Ditto.
+
+2003-11-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna): Pass the interactive flag to
+ `w3m-goto-url'.
+ * w3m-bookmark.el (w3m-bookmark-view): Ditto.
+ * w3m-cookie.el (w3m-cookie): Ditto.
+ * w3m-dtree.el (w3m-dtree): Ditto.
+ * w3m-namazu.el (w3m-namazu): Ditto.
+ * w3m-perldoc.el (w3m-perldoc): Ditto.
+ * w3m.el (w3m-gohome): Ditto.
+ (w3m-browse-url): Ditto.
+
+2003-11-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-rendering-half-dump): Move point to the end of the region
+ in order to avoid a bug of `call-process-region' in XEmacs 21.5.7+ (see
+ the comment).
+ (w3m-decode-encoded-contents): Ditto.
+ (w3m-x-moe-decode-buffer): Ditto.
+
+ * w3m-perldoc.el (w3m-about-perldoc): Ditto.
+
+ * w3m-xmas.el (w3m-initialize-graphic-icons): Ditto.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Say "no favicon" if it is not
+ available.
+
+ * w3m-proc.el (w3m-process-with-environment): Rely on the
+ `temp-directory' function and modify TEMP and TMPDIR env vars for
+ XEmacs.
+
+2003-11-20 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-normalize-action): New inline function.
+ (w3m-form-parse-and-fontify): Use it.
+ (w3m-form-new): Simply set action.
+ (w3m-form-submit): Don't treat !CURRENT_URL! here.
+
+2003-11-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_ADD_LOAD_PATH): Refine the help message for the
+ --with-attic option.
+
+2003-11-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-buffer-setup): Make sure that `truncate-lines' is t.
+ (w3m-view-source): Don't set `truncate-lines' to nil when quitting
+ viewing a source.
+ (w3m-view-header): Set `truncate-lines' to nil when viewing a header.
+
+2003-11-18 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-put-by-name): New function.
+ (w3m-form-resume): Use w3m-form-get-by-name and w3m-form-put-by-name
+ instead of w3m-form-get and w3m-form-put for radio buttons.
+ (w3m-form-parse-and-fontify): Ditto.
+ (w3m-form-input-radio): Ditto.
+
+2003-11-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-check-current-position): Don't allow horizontal scrolling
+ when `truncate-lines' is nil.
+ (w3m-view-source): Set `truncate-lines' to nil.
+
+ * w3m-favicon.el (w3m-favicon-setup): Retrieve favicon even when
+ viewing the header or the page source.
+
+2003-11-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (very-slow): Fix echo messages.
+
+ * w3m.el (w3m-follow-redirection): Fix customization type.
+
+ * w3m-e21.el: Bind `w3m-current-title' when compiling.
+
+ * /: Bind `w3m-work-buffer-list' when compiling in: w3m-e21.el,
+ w3m-favicon.el, w3m-image.el, w3m-proc.el and w3m-xmas.el.
+
+ * /: Require `cl' when compiling in: w3m-cookie.el, w3m-form.el and
+ w3m-tabmenu.el.
+
+ * /: Remove unused non-global variables in: octet.el, w3m-cookie.el,
+ w3m-tabmenu.el and w3m-weather.el.
+
+2003-11-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Make `w3m-local-find-file-function' don't
+ handle directories.
+
+2003-11-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el: Bind `w3m-current-process', `w3m-pop-up-frames',
+ `w3m-pop-up-windows', `w3m-popup-frame-parameters',
+ `w3m-select-buffer-name' and `w3m-use-tab', and fbind
+ `select-frame-set-input-focus' when compiling.
+ (w3m-popup-frame-parameters): Move from w3m.el.
+ (w3m-popup-frame-p): Ditto.
+ (w3m-use-tab-p): Ditto.
+ (w3m-popup-window-p): Ditto.
+ (w3m-initial-frames): Ditto.
+ (w3m-last-visited-buffer): Ditto.
+ (w3m-popup-buffer): Ditto; also move the program to make
+ `select-frame-set-input-focus' unbound from w3m.el.
+ (w3m-add-w3m-initial-frames): Ditto; also move the program to add it to
+ `create-frame-hook', `after-make-frame-functions' or
+ `after-make-frame-hook' from w3m.el.
+ (w3m-delete-frames-and-windows): Ditto.
+ (w3m-display-progress-message): Mark a progress message with the
+ `w3m-progress-message' text property.
+
+ * w3m.el: Don't fbind `select-frame-set-input-focus'.
+ (w3m-local-find-file-function): Use `w3m-popup-frame-p'.
+ (w3m-initial-frames): Move to w3m-util.el.
+ (w3m-popup-frame-parameters): Ditto.
+ (w3m-popup-frame-p): Ditto.
+ (w3m-use-tab-p): Ditto.
+ (w3m-popup-window-p): Ditto.
+ (w3m-last-visited-buffer): Ditto.
+ (w3m-popup-buffer): Ditto; also move the program to make
+ `select-frame-set-input-focus' unbound to w3m-util.el.
+ (w3m-add-w3m-initial-frames): Ditto; also move the program to add it to
+ `create-frame-hook', `after-make-frame-functions' or
+ `after-make-frame-hook' to w3m-util.el.
+ (w3m-delete-frames-and-windows): Ditto.
+ (w3m-delete-buffer-if-empty): New function.
+ (w3m-view-this-url-1): Use it.
+ (w3m-goto-url-new-session): Use it.
+ (w3m): Use it.
+
+ * w3m-e21.el (w3m-euc-japan-encoder): Compute the ccl program in each
+ time to load w3m-e21.elc to keep the compatibility of the module with
+ Emacs 21.3 and the later versions.
+ (w3m-iso-latin-1-encoder): Ditto.
+
+2003-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-horizontal-scroll-division): Mega doc fix; eliminate
+ illegal values.
+ (w3m-horizontal-on-screen): Rearrange.
+
+2003-11-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-last-visited-buffer): New variable.
+ (w3m-popup-buffer): Clear `w3m-last-visited-buffer'.
+ (w3m-close-window): Set the last emacs-w3m buffer as
+ `w3m-last-visited-buffer'.
+ (w3m): Preferably use the last emacs-w3m buffer kept in
+ `w3m-last-visited-buffer'.
+
+2003-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-horizontal-recenter): Do nothing besides resetting the
+ window's hscroll if `truncate-lines' is nil.
+ (w3m-beginning-of-line): Replace `w3m-set-window-hscroll' with
+ `set-window-hscroll'.
+ (w3m-end-of-line): Make it work identically as `end-of-line' if
+ `truncate-lines' is nil.
+ (w3m-display-width): Move downward (see the comment).
+
+2003-11-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-parse-header): Because a broken server returns a
+ relative URL in the location field, convert a URL to absolute.
+
+ * w3m-proc.el (w3m-process-wait-process): New function.
+ (w3m-process-start-and-wait): Call the above function.
+
+ * w3m-weather.el (w3m-weather-run-filter-functions): New function to
+ call filter functions asynchronously.
+ (w3m-about-weather): Call the above.
+ (w3m-weather-get-seikatu-sisu): Asynchronized.
+ (w3m-weather-insert-seikatu-sisu): Ditto.
+
+2003-11-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-initial-frames): Rename from `w3m-initial-frame'; keep a
+ list of the frame-IDs.
+ (w3m-popup-window-p): Return nil if there is the selection window.
+ (w3m-popup-buffer): Copy a copy of `w3m-initial-frames' from a visible
+ emacs-w3m buffer to a popped-up emacs-w3m buffer; don't set
+ `w3m-initial-frames' for newly created frames there.
+ (w3m-add-w3m-initial-frames): New function; add it to
+ `create-frame-hook', `after-make-frame-functions' or
+ `after-make-frame-hook'.
+ (w3m-copy-buffer): Copy a copy of `w3m-initial-frames'.
+ (w3m-delete-buffer): Pop up another emacs-w3m buffer instead of
+ deleting a frame; remove a deleted frame from `w3m-initial-frames'.
+ (w3m-delete-frames-and-windows): Also allow a window or a frame as the
+ optional argument; emulate XEmacs version's `one-window-p'.
+ (w3m): Set the value for `w3m-initial-frames' even if it is invoked in
+ the batch mode.
+ (w3m-select-buffer): Delete other emacs-w3m frames and windows.
+ (w3m-select-buffer-copy-buffer): Revert the 2003-11-11 change.
+ (w3m-select-buffer-delete-buffer): Simplify.
+
+ (w3m-display-width): New function for showing pages as if there is no
+ selection window.
+ (w3m-halfdump-command-common-arguments): Use it.
+ (w3m-make-separator): Use it.
+ (w3m-about-db-history): Use it.
+ (w3m-header-line-insert): Work as if there is no selection window.
+
+ * w3mhack.el (w3mhack-generate-colon-keywords-file): Preset
+ `:strike-through' and `:strikethru' which aren't supported by the old
+ cus-face.el.
+
+2003-11-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-popup-buffer): Reuse an existing window or frame if it
+ exists; set the value for `w3m-initial-frame' properly; raise, select
+ and focus the new frame.
+ (TopLevel): Make `select-frame-set-input-focus' unbound if it is a
+ dummy.
+ (w3m-view-this-url-1): Show a progress message.
+ (w3m-copy-buffer): Simplify the code to call `w3m-popup-buffer'.
+ (w3m-alive-p): Add an optional arg `visible' (see docs); use inlining
+ `w3m-list-buffers'.
+ (w3m): Simplify the code using `w3m-popup-buffer'; specify the optional
+ arg to `w3m-alive-p'; protect against the case of no url.
+ (w3m-select-buffer-copy-buffer): Bind `w3m-pop-up-windows' to nil.
+
+ * w3m-util.el (w3m-list-buffers): Make it into a normal function; don't
+ call itself recursively.
+
+2003-11-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-function-max-args): Move to mew-shimbun.el.
+
+ * w3m.el (w3m-popup-buffer): New function (it still needs to improved
+ in order for the `w3m' function to use).
+ (w3m-view-this-url-1): Specify the value of
+ `w3m-view-this-url-new-session-in-background' to the 3rd arg of
+ `w3m-copy-buffer'; don't pop up a window or a frame there.
+ (w3m-copy-buffer): Change the meaning of the 3rd arg (see docs); don't
+ pop up a window or a frame if it is non-nil, otherwise call
+ `w3m-popup-buffer'.
+ (w3m-goto-url): Change the name of the 8th arg to `interactive-p';
+ don't pop up a window or a frame unless this function is called
+ interactively, otherwise call `w3m-popup-buffer'.
+ (w3m-goto-url-new-session): Specify nil to the 3rd arg of
+ `w3m-copy-buffer'.
+ (w3m-select-buffer-saved-window-config): Abolish.
+ (w3m-select-buffer): Revert the 2003-11-05 change; delete other windows
+ except for the current emacs-w3m window or create a new emacs-w3m
+ buffer when it is called initially.
+ (w3m-select-buffer-current-buffer): Use `line-beginning-position'.
+ (w3m-select-buffer-copy-buffer): Revert the 2003-11-05 change;
+ simplify.
+ (w3m-select-buffer-delete-buffer): Call `w3m-quit' if there is the sole
+ emacs-w3m buffer.
+ (w3m-select-buffer-delete-other-buffers): Revert the 2003-11-07 change.
+ (w3m-select-buffer-quit): Revert the 2003-11-05 change; bind
+ `pop-up-frames'.
+
+2003-11-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-stop): Change `w3m-current-process' in the
+ buffer specified in the argument, instead of changing it in the current
+ buffer.
+
+2003-11-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-canonicalize-url): New function.
+ (w3m-w3m-attributes-1): New function.
+ (w3m-w3m-attributes): Call the above functions to follow redirection.
+ (w3m-w3m-retrieve): Call `w3m-w3m-canonicalize-url' before retrieving.
+
+ * w3m-proc.el (w3m-process-start-process): Check the value of
+ `w3m-current-url' before calling `w3m-url-authinfo'.
+ (w3m-process-start-and-wait): Make sure synchronization with
+ sub-process.
+ (w3m-process-do-with-temp-buffer): Call `w3m-kill-buffer' instead of
+ calling `kill-buffer' directly.
+
+ * w3m-antenna.el (w3m-antenna-mapcar): Simplified and follow the change
+ of `w3m-process-do-with-temp-buffer'.
+ (w3m-antenna-mapcar-after): Ditto.
+
+2003-11-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-other-buffers): Use
+ `w3m-delete-frames-and-windows'.
+ (w3m-delete-frames-and-windows): Take an optional argument for the
+ exception; assume a buffer may be at two or more windows.
+ (w3m-close-window): Assume a buffer may be at two or more windows.
+ (w3m-select-buffer-delete-other-buffers): Save-window-excursion.
+
+2003-11-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-popup-frame-parameters): Rename from
+ `w3m-pop-up-frame-parameters' to make it easy to complete the
+ `w3m-pop-up-frames' variable name.
+ (w3m-popup-frame-parameters): Rename from
+ `w3m-pop-up-frame-parameters'.
+ (w3m-popup-frame-p): Make it a generic macro.
+ (w3m-use-tab-p): New macro.
+ (w3m-popup-window-p): Use `w3m-use-tab-p'.
+ (w3m-view-this-url-1): Use `w3m-use-tab-p' and `w3m-popup-frame-p'.
+ (w3m-copy-buffer): Ditto.
+ (w3m-delete-buffer): Use `w3m-use-tab-p'.
+ (w3m-goto-url): Use `w3m-use-tab-p' and `w3m-popup-frame-p'.
+ (w3m): Modify to use new `w3m-popup-frame-p'.
+ (w3m-header-line-insert): Use `w3m-use-tab-p'.
+
+2003-11-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-current-redirect): Abolished.
+ (w3m-clear-local-variables, w3m-copy-local-variables): Follow the above
+ change.
+
+ * w3m-proc.el (w3m-process-do-with-temp-buffer): Keep the current
+ buffer after given FORM and BODY are evaluated.
+
+2003-11-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-follow-redirection): Fix its docstring.
+ (w3m-w3m-retrieve): When the above option is equal to nil, it is
+ treated as 0.
+ (w3m-retrieve-and-render): Check content type and charsets with
+ redirected real URI instead of user-specified URI.
+
+ * w3m-antenna.el (w3m-antenna-hns-last-modified): Do not accept
+ `no-cache' argument.
+ (w3m-antenna-check-site): Ditto.
+ (w3m-antenna-mapcar, w3m-antenna-mapcar-after): New functions.
+ (w3m-antenna-check-all-sites): Use the above functions.
+
+2003-11-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-buffer): New implementation.
+ (w3m-delete-frame-maybe): Abolish.
+ (w3m-delete-frames-and-windows): New function.
+ (w3m-quit): Use it.
+ (w3m-close-window): New implementation.
+ (w3m-select-buffer-show-this-line): Specify the 1st arg to
+ `one-window-p'.
+ (w3m-select-buffer-quit): Ditto.
+ (w3m-select-buffer-close-window): Ditto.
+
+2003-11-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-strike-through): Support <strike> element.
+ (w3m-fontify): Change the turn `w3m-fontify-strike-through' and
+ `w3m-fontify-underline'.
+
+2003-11-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * attic/vm-w3m.el: New file.
+
+2003-11-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Fbind `select-frame-set-input-focus' when compiling.
+ (w3m-popup-window-p): Rename from `w3m-pop-up-window-p'; use
+ 'emacs-major-version' instead of `MULE' to examine the version.
+ (w3m-view-this-url-1): Use `pop-to-buffer' instead of
+ `switch-to-buffer' in order to be able to popup a window or a frame.
+ (w3m-copy-buffer): Ditto; set the `w3m-initial-frame' variable only
+ when `w3m-pop-up-frames' is non-nil.
+ (w3m-delete-buffer): Select the most suitable buffer.
+ (w3m-goto-url): Use `pop-to-buffer' instead of `switch-to-buffer' in
+ order to be able to popup a window or a frame.
+ (w3m): Ditto; rearrange the source code.
+ (w3m-select-buffer-saved-window-config): New variable.
+ (w3m-select-buffer): Save the window configuration.
+ (w3m-select-buffer-copy-buffer): Bind `pop-up-frames'.
+ (w3m-select-buffer-quit): Restore the window configuration; protect
+ agains the absence of an emacs-w3m buffer.
+
+ * w3m-xmas.el: Bind `w3m-use-tab' when compiling.
+ (w3m-xmas-show-current-title-in-buffer-tab): Examine the value for the
+ `gutter-buffers-tab-enabled' variable directly.
+ (w3m-xmas-setup-tab-in-gutter): New function; add it to
+ `w3m-mode-setup-functions' and `w3m-select-buffer-mode-hook'.
+ (w3m-xmas-update-tab-in-gutter): Do update only when `w3m-use-tab' and
+ `gutter-buffers-tab-enabled' are non-nil; always add it to
+ `w3m-display-functions'.
+
+ * octet.el: Don't make sure the `emacs-major-version' variable is
+ bound.
+ * w3m-bitmap: Ditto.
+ * w3m-bug.el: Ditto.
+ * w3m-proc.el: Ditto.
+ * w3m-ucs.el: Ditto.
+ * w3m-util.el: Ditto.
+ * w3m.el: Ditto.
+ * w3mhack.el: Ditto.
+
+2003-11-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-delete-buffer, w3m-delete-other-buffers)
+ (w3m-select-buffer-delete-buffer): Call `w3m-process-stop'.
+
+ * w3m-proc.el (w3m-process-kill-stray-processes): New function.
+ (w3m-process-start-queued-processes): Call
+ `w3m-process-kill-stray-processes'.
+ (w3m-process-filter): When parent-buffer was killed, call
+ `w3m-process-kill-stray-processes'
+
+2003-11-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-pop-up-windows): Default to t.
+ (w3m-pop-up-window-p): New macro examining the value for the
+ `w3m-use-tab' variable and the present situation.
+ (w3m-copy-buffer): Use it.
+
+2003-11-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-meta-content-type-charset-regexp)
+ (w3m-meta-charset-content-type-regexp)
+ (w3m-meta-refresh-content-regexp)
+ (w3m-meta-content-refresh-regexp): Allow `\n' as whitespaces.
+
+2003-10-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-backward): Return the current history if the
+ number zero is given as an argument.
+
+2003-10-29 OHASHI Akira <bg66@koka-in.org>
+
+ * w3m.el (w3m-process-connection-type): Set t when system is darwin
+ version 7.0.0 or later.
+
+2003-10-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-strike-through (var)): Make it into the variable
+ which is not a user option.
+ (w3m-fontify-strike-through (fn)): Check dynamically whether the window
+ system is used.
+ (w3m-url-at-point): Unify iso646 chars to ascii on XEmacs-mule.
+
+ * mew-w3m.el: Silence the compile warning for `mew-coding-system-p' for
+ people having the Mew XEmacs package installed.
+
+2003-10-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-obey-w3m-pop-up-frames): New variable.
+ (w3m-copy-buffer): Inherit the value of `w3m-initial-frame' into the
+ new buffer if a new frame is not created for the new buffer.
+ (w3m-delete-frame-maybe): Simplify it in the different way.
+
+ * w3m-search.el (w3m-search): Specify the 3rd arg of `w3m'.
+
+2003-10-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Revive `w3m-initial-frame' throughout.
+ (w3m-delete-frame-maybe): Revert 2003-10-20 change.
+
+2003-10-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-strike-through-face): Use the :strikethru attribute in
+ XEmacs.
+ (w3m-fontify-strike-through): Enable it also for XEmacs.
+
+2003-10-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-retrieve): Insert no data when either retrieval or
+ decoding is failed.
+ (w3m-w3m-parse-header): Do not return a base URI of retrieved page.
+
+2003-10-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Fix some comments and docstrings (to be continued).
+ (w3m-copy-local-variables, w3m-open-all-links-in-new-session,
+ w3m-horizontal-scroll): Remove unused non-global variables.
+
+2003-10-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Abolish `w3m-initial-frame' throughout.
+ (w3m-delete-frame-maybe): Simplify.
+
+2003-10-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-base-url): Removed.
+ (w3m-attributes, w3m-local-attributes, w3m-w3m-attributes): Do not
+ return a base URI of retrieved page.
+
+2003-10-14 Jose A. Ortega Ruiz <jao@gnu.org>
+
+ * w3m.el (w3m-decode-entities-string): Move `save-match-data' to the
+ exterior of `with-temp-buffer'.
+
+2003-10-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-half-space, w3m-tab-separator): Use `:width'
+ instead of `:relative-width' to specify the space width.
+ (w3m-tab-line): Tidy it up.
+
+ * w3m-favicon.el (w3m-favicon-set-image): Use `:width' instead of
+ `:relative-width' to specify the space width.
+
+2003-10-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-unselected-face,
+ w3m-tab-unselected-retrieving-face, w3m-tab-selected-face,
+ w3m-tab-selected-face): Exchange the default TTY colors between
+ selected faces and unselected faces.
+ (w3m-tab-drag-mouse-function): Compare buffer objects instead of buffer
+ names.
+ (w3m-tab-make-keymap): Use buffer objects instead of buffer names.
+ (w3m-tab-line): Make all tab widths the same even if there are wide
+ characters; never use graphic icons in TTY; close the left margin
+ unless there's an icon; add a keymap to favicon; don't put mouse-face
+ on icons.
+ (w3m-initialize-graphic-icons): Don't make graphic icons for TTY; don't
+ put mouse-face on icons.
+
+ * w3m-favicon.el: Bind `w3m-modeline-favicon' when compiling.
+ (w3m-favicon-set-image): Add a half space after favicon.
+
+ * w3m-util.el (w3m-current-title): New function.
+ (w3m-buffer-title): Use it.
+
+ * w3m.el: Silence the byte-compiler for `w3m-info-like-map',
+ `w3m-lynx-like-map', `w3m-minor-mode-map', `w3m-mode-map', and
+ `w3m-setup-menu'.
+
+2003-10-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el: Silence the compile warning for `w3m-message'.
+
+ * w3m.el (w3m-url-to-file-name): Enable it to interpret
+ file://localhost/ urls.
+
+2003-10-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Fix for textarea on w3mmee.
+
+2003-10-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (frame-current-scroll-bars): Alias to `ignore' if it is
+ not available.
+ (window-fringes): Ditto.
+ (w3m-tab-width): Protect against setting illegal values.
+ (w3m-tab-unselected-face): Don't specify the underline color.
+ (w3m-tab-unselected-retrieving-face): Ditto.
+ (w3m-tab-selected-face): Ditto.
+ (w3m-tab-selected-retrieving-face): Ditto.
+ (w3m-tab-background-face): Ditto.
+ (w3m-tab-timer): Rename from `w3m-tab-line-timer'.
+ (w3m-tab-half-space): New variable.
+ (w3m-tab-separator): New variable.
+ (w3m-tab-line): Show many tabs as far as possible.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Clear the minibuffer after
+ retrieving favicon.
+
+2003-10-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ We shouldn't use too simple elements like ".+" in the deep nested
+ regexps. It may cause high cpu or may make Emacs hang.
+
+2003-10-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-use-favicon): Modify the doc-string.
+ (w3m-show-graphic-icons-in-mode-line): New variable.
+ (w3m-show-graphic-icons-in-header-line): New variable.
+ (w3m-buffer-setup): Modify the value for
+ `mode-line-buffer-identification' not to show favicon if
+ `w3m-show-graphic-icons-in-mode-line' is nil.
+
+ * w3m-e21.el: Bind `w3m-show-graphic-icons-in-header-line' and
+ `w3m-show-graphic-icons-in-mode-line' when compiling.
+ (w3m-tab-line): Don't show spinners nor favicons if
+ `w3m-show-graphic-icons-in-header-line' is nil; call
+ `w3m-make-spinner-image' only once.
+ (w3m-initialize-graphic-icons): Don't make graphic icons if
+ `w3m-show-graphic-icons-in-mode-line' is nil.
+
+ * w3m-xmas.el: Bind `w3m-show-graphic-icons-in-mode-line' when
+ compiling.
+ (w3m-initialize-graphic-icons): Don't make graphic icons if
+ `w3m-show-graphic-icons-in-mode-line' is nil.
+
+2003-10-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-replace): Call `set-buffer-modified-p'.
+ (w3m-form-field-parse): Do nothing when fid is nil.
+ (w3m-form-input-radio): Likewise.
+ (w3m-form-get-by-name): New function.
+ (w3m-form-input-map): Use it.
+
+2003-10-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-line): Fix the logic determining whether to
+ display favicon.
+
+2003-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-spinner-map-on-header-line): Abolish.
+ (w3m-modeline-spinner-map): Rename from `w3m-spinner-map-on-mode-line'.
+ (w3m-setup-header-line): Don't initialize
+ `w3m-spinner-map-on-header-line'.
+ (w3m-tab-spinner-map): New variable.
+ (w3m-tab-make-keymap): Initialize it.
+ (w3m-tab-line): Use it.
+
+2003-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-modeline-separator): New variable.
+ (w3m-modeline-favicon): New variable.
+ (w3m-favicon-image): Move from w3m-favicon.el.
+ (w3m-buffer-setup): Also call `w3m-initialize-graphic-icons' when Emacs
+ 21 is running; simplify the value for
+ `mode-line-buffer-identification'.
+
+ * w3m-e21.el: Bind `w3m-favicon-image' and
+ `w3m-modeline-process-status-on' when compiling.
+ (w3m-spinner-map-on-header-line): New variable.
+ (w3m-spinner-map-on-mode-line): New variable.
+ (w3m-spinner-map-help-echo): New variable.
+ (w3m-setup-header-line): Initialize the value for
+ `w3m-spinner-map-on-header-line'; remove an excessive `list' from the
+ value for `header-line-format'.
+ (w3m-tab-map): New variable.
+ (w3m-tab-make-keymap): Set the value for `w3m-tab-map' in the current
+ buffer.
+ (w3m-tab-line): Add a keymap to the spinner; don't call
+ `w3m-tab-make-keymap', use `w3m-tab-map' instead.
+ (TopLevel): Add-hook `w3m-tab-make-keymap' to
+ `w3m-mode-setup-functions'.
+ (w3m-space-before-modeline-icon): New variable.
+ (w3m-modeline-process-status-on-icon,
+ w3m-modeline-image-status-on-icon, w3m-modeline-status-off-icon,
+ w3m-modeline-ssl-image-status-on-icon,
+ w3m-modeline-ssl-status-off-icon): New variables.
+ (w3m-initialize-graphic-icons): New function.
+ (w3m-make-spinner-image): Don't initialize the value for
+ `w3m-spinner-image-file' here; set the value for
+ `w3m-modeline-process-status-on-icon'.
+
+ * w3m-favicon.el: Bind `w3m-favicon-image' when compiling.
+ (w3m-favicon-image): Move to w3m.el.
+ (w3m-space-before-favicon): Move from w3m-xmas.el.
+ (TopLevel): Make `w3m-modeline-favicon' and `w3m-favicon-image'
+ buffer-local; modify the value or put the `risky-local-variable'
+ property for `w3m-modeline-favicon'.
+ (w3m-favicon-set-image): New macro.
+ (w3m-favicon-setup): Use it.
+ (w3m-favicon-retrieve): Use it.
+
+ * w3m-xmas.el (w3m-xmas-space-before-favicon): Move to w3m-favicon.el
+ and rename to `w3m-space-before-favicon'.
+ (w3m-space-before-modeline-icon): Rename from
+ `w3m-xmas-space-before-modeline-icon'.
+
+2003-10-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-filter): Relax the regular expression to
+ detect progress status.
+
+2003-10-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-expand-arguments): Redefine as a function rather than
+ a macro.
+ (w3m-dump-head-source-command-arguments): Simplify.
+ (w3m-halfdump-command-arguments): Ditto.
+
+2003-10-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-filter): Check return value of
+ `w3m-process-handler-parent-buffer' to move current buffer safely.
+
+2003-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-modeline-image-status-on, w3m-modeline-process-status-on,
+ w3m-modeline-ssl-image-status-on, w3m-modeline-ssl-status-off,
+ w3m-modeline-status-off): Use `defvar' instead of `defconst'.
+ (w3m-buffer-setup): Call `w3m-initialize-graphic-icons' instead of
+ `w3m-make-spinner-image'; simplify the value for
+ `mode-line-buffer-identification'.
+
+ * w3m-xmas.el (w3m-xmas-space-before-modeline-icon): Rename from
+ `w3m-xmas-space-before-spinner'.
+ (w3m-modeline-process-status-on-icon,
+ w3m-modeline-image-status-on-icon, w3m-modeline-status-off-icon,
+ w3m-modeline-ssl-image-status-on-icon,
+ w3m-modeline-ssl-status-off-icon): New variables.
+ (w3m-spinner-image): Abolish.
+ (w3m-make-spinner-image): Abolish.
+ (w3m-initialize-graphic-icons): New function.
+
+ * icons/state-00.xpm:
+ * icons/state-01.xpm:
+ * icons/state-10.xpm:
+ * icons/state-11.xpm: New files.
+
+2003-10-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-halfdump-command-arguments): Add "ucs_conv" option when
+ using w3m-m17n; check w3m-output-coding-system at run time.
+
+2003-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el (w3m-process-start-after): Make sure the value for
+ `w3m-current-buffer' is non-nil.
+
+2003-10-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-process-modeline-format): New option.
+ (w3m-buffer-setup): Set `mode-line-process'.
+
+ * w3m-proc.el: Bind `w3m-process-modeline-format' to suppress
+ byte-compile warning.
+ (w3m-process-modeline-string): New buffer-local variable.
+ (w3m-process-start-after): Reset the above variable.
+ (w3m-process-filter): Check size of retrieved data and set the above
+ variable.
+ (w3m-process-modeline-format): New function.
+
+2003-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-make-spinner-image): Make sure the gifsicle program
+ is available.
+
+2003-09-30 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-use-symbol): Use `w3m-mule-unicode-p'.
+
+ * w3m-symbol.el (w3m-mule-unicode-symbol): Ditto.
+
+2003-09-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-proc.el (w3m-process-stop): Redisplay the header-line.
+
+ * w3m-e21.el (w3m-tab-line-format, w3m-tab-line-timer, w3m-tab-line):
+ Revive the timer operation.
+ (w3m-tab-line): Wobble the window size to force redisplay of the
+ header-line using a timer; include spinner images in the return value
+ when external processes are running.
+ (w3m-spinner-image-file): New variable.
+ (w3m-spinner-image-frames): New variable.
+ (w3m-spinner-image-index): New variable.
+ (w3m-make-spinner-image): New function.
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Always redraw Emacs frame
+ using the timer; wobble the window size instead of redrawing; increase
+ the delay time for the timer.
+
+2003-09-30 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Fix problem when form_int
+ appears after input_alt and action is specified.
+
+2003-09-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-symbol.el (w3m-mule-unicode-symbol): Fix customization type.
+
+2003-09-29 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-symbol.el: Bind `w3m-output-coding-system' when compiling.
+ (w3m-mule-unicode-symbol): New variable.
+ (w3m-symbol): Add it for candidate.
+ (w3m-symbol): Use it.
+
+ * w3m.el (w3m-use-symbol): Check capability for
+ `w3m-mule-unicode-symbol'.
+
+2003-09-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-line-format, w3m-tab-line-timer, w3m-tab-line):
+ Remove the timer operation temporally.
+
+2003-09-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-xmas.el (w3m-make-spinner-image): Bind `format-alist' to nil.
+
+2003-09-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-tab-line-timer): New variable.
+ (w3m-tab-line): Use it to control this function running too frequently;
+ simplify the source code.
+
+ * w3m-favicon.el (w3m-favicon-image-of): Abolish.
+ (w3m-favicon-retrieve): Use a timer to redraw Emacs frame.
+
+ * w3m-xmas.el (w3m-xmas-space-before-favicon): New user option.
+ (w3m-xmas-space-before-spinner): New user option.
+ (w3m-make-spinner-image): Make sure the `gif' feature is available.
+
+ * w3m.el (w3m-buffer-setup): Use `w3m-xmas-space-before-spinner' and
+ `w3m-xmas-space-before-favicon'.
+
+2003-09-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * icons/spinner.gif: New file (without LZW compression).
+ * icons30/spinner.gif: Ditto.
+
+ * Makefile.in (install-icons, install-icons30): Also install gifs.
+
+ * w3m-xmas.el (w3m-make-spinner-image): Use the spinner.gif file.
+
+ * w3m-e21.el (w3m-tab-line-format): New variable (see doc-string).
+ (w3m-tab-line): Use it; use a timer to suppress this function running
+ too frequently.
+
+2003-09-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-spinner-image): New variable.
+ (w3m-make-spinner-image): New function.
+
+ * w3m.el (w3m-buffer-setup): Call `w3m-make-spinner-image', show a
+ spinner in the modeline under XEmacs.
+
+2003-09-24 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-put-property): Don't call intern if it is not a
+ string.
+ (w3m-form-get-property): Ditto.
+ (w3m-form-put): Added argument ID.
+ (w3m-form-get): Changed argument from NAME to ID.
+ (w3m-form-make-form-data): Changed process to get NAME and VALUE.
+ (w3m-form-resume): Follow the API change in w3m-form-put and
+ w3m-form-get.
+ (w3m-fontify-textareas): Ditto.
+ (w3m-form-parse-and-fontify): Ditto.
+ (w3m-form-input): Ditto.
+ (w3m-form-input-password): Ditto.
+ (w3m-form-input-checkbox): Ditto.
+ (w3m-form-input-radio): Ditto.
+ (w3m-form-input-file): Ditto.
+ (w3m-form-input-textarea-set): Ditto.
+ (w3m-form-textarea-info): Ditto.
+ (w3m-form-input-select): Ditto.
+ (w3m-form-submit): Ditto.
+ (w3m-form-real-reset): Follow the structure change.
+ (w3m-form-input-select-id): New buffer local variable.
+ (w3m-form-input-select-set): Use it.
+ (w3m-form-field-parse): New inline function.
+ (w3m-form-parse-and-fontify): Put id for selectinfo.
+ (w3m-form-resume): Fixed regexp.
+ (w3m-form-input-textarea): Fixed line number.
+ (w3m-fontify-textareas): Put w3m-form-id property.
+ (w3m-form-parse-and-fontify): Store id to the textareainfo.
+
+2003-09-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-favicon-retrieve): Redisplay Emacs frame; rename
+ from `w3m-retrieve-favicon'.
+ (w3m-favicon-image): Rename from `w3m-current-favicon-image'.
+ (w3m-favicon-setup): Rename from `w3m-setup-favicon'.
+ (w3m-favicon-image-of): Rename from `w3m-buffer-favicon'.
+ (w3m-favicon-convert): Rename from `w3m-convert-favicon'.
+ (w3m-favicon-retrieve): Rename from `w3m-retrieve-favicon'.
+
+ * w3m-e21.el (w3m-tab-line): Rename `w3m-buffer-favicon' with
+ `w3m-favicon-image-of'.
+
+ * w3m.el (w3m-clean-hook-options): Rename `w3m-setup-favicon' with
+ `w3m-favicon-setup'.
+ (w3m-buffer-setup): Rename `w3m-current-favicon-image' with
+ `w3m-favicon-image'.
+
+2003-09-23 OHASHI Akira <bg66@koka-in.org>
+
+ * w3m.el (w3m-process-connection-type): Set nil when system-type is
+ darwin.
+
+2003-09-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el: Bind `w3m-icon-data' when compiling.
+ (w3m-current-favicon-data): Abolish.
+ (w3m-favicon-converted): Abolish.
+ (w3m-favicon-cache-data): Contain image data.
+ (w3m-favicon-cache-favicon): Return an image instead of raw data.
+ (w3m-setup-favicon): Fix the condition to check whether Emacs can
+ display images; set the value of `w3m-current-favicon-image' instead of
+ `w3m-current-favicon-data' for the about: pages.
+ (w3m-buffer-favicon): Make it simply get the value of
+ `w3m-current-favicon-image'.
+ (w3m-convert-favicon): Accept raw data and type; simply return an
+ image.
+ (w3m-retrieve-favicon): Rearrange the arguments to accept url and type
+ independently; set the value of `w3m-current-favicon-image' instead of
+ `w3m-current-favicon-data'; store an image into
+ `w3m-favicon-cache-data'.
+ (w3m-favicon-save-cache-file): Save data only if they contained images;
+ strip images from the cache for saving.
+ (w3m-favicon-load-cache-file): Create images for all the cache.
+
+ * w3m.el (w3m-buffer-setup): Use `w3m-current-favicon-image' instead of
+ `w3m-favicon-converted' for `mode-line-buffer-identification' under
+ XEmacs in order to check whether the favicon image is available.
+ (w3m-examine-command-line-args): Use `member' instead of `memq' under
+ XEmacs to check whether `command-line-args' contains the same string as
+ the car of `command-line-args-left'.
+
+2003-09-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el: Autoload w3m for `w3m-expand-url' when compiling.
+ (w3m-setup-favicon): Fix the change of 2003-09-12 which was gone to
+ far.
+
+ * w3m.el (w3m-open-all-links-in-new-session): Improve the regexp.
+ (w3m-examine-command-line-args): Don't let it misunderstand the next
+ command as a url string; modify the arguments in `command-line-args'
+ instead of removing them.
+ (w3m): Use `w3m-examine-command-line-args' even if it is called
+ non-interactively.
+
+2003-09-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-open-all-links-in-new-session): Don't use
+ `w3m-select-buffer'.
+
+2003-09-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-popup-frame-p): Make it accept the `interactive-p'
+ argument.
+ (w3m-examine-command-line-args): New function.
+ (w3m): Use it.
+
+2003-09-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el: Bind some external variables when compiling.
+
+2003-09-19 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-make-form-data): Insert "--" before the
+ multipart post boundary.
+
+2003-09-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-underline-face): New face.
+ (w3m-strike-through-face): New user variable.
+ (w3m-fontify-strike-through): New function.
+ (w3m-fontify): Call `w3m-fontify-strike-through'
+
+2003-09-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-favicon.el (w3m-setup-favicon): Convert favicon data to an image
+ for the about: pages using `w3m-convert-favicon'.
+ (w3m-buffer-favicon): Move the data conversion procedure to
+ `w3m-convert-favicon'.
+ (w3m-convert-favicon): New function detached from `w3m-buffer-favicon';
+ make it work synchronously.
+ (w3m-retrieve-favicon): Convert favicon data to an image.
+
+ * w3m-image.el (w3m-imagick-convert-buffer): Erase buffer before
+ calling the convert program.
+
+ * w3m.el (w3m-buffer-setup): Modify the value for
+ `mode-line-buffer-identification' in order to make it possible to show
+ favicon under XEmacs.
+
+2003-09-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-open-all-links-in-new-session): New function. Suggested
+ by Yoichi NAKAYAMA <yoichi@geiin.org>.
+ (w3m-view-this-url-new-session): Call
+ `w3m-open-all-links-in-new-session' if the region is active.
+
+2003-09-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-key-binding): Don't use `custom-set-default'.
+ (w3m-use-favicon): Ditto.
+ * w3m-favicon.el (w3m-favicon-size): Ditto.
+
+ * icons/*.xpm: Remove text.
+
+2003-09-17 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-new): Use `application/x-www-form-urlencoded'
+ instead of `urlencoded'.
+ (w3m-form-parse-and-fontify): Ditto.
+ (w3m-form-make-form-data): Use `multipart/form-data' instead of
+ `multipart'.
+ (w3m-form-mee-new): Likewise.
+
+2003-09-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-e21-toolbar-configurations): Don't modify the values
+ for `tool-bar-button-margin' and `tool-bar-button-relief'.
+
+ * w3mhack.el (w3mhack-nonunix-install): Use icons30 for XEmacs.
+ (w3mhack-make-package): Use icons30.
+
+ * Makefile.in (SUBDIRS): Add icons30.
+ (install-icons30): New rule.
+ (install-package, install-package-ja): Use it.
+
+ * icons/*.xpm: Shrink the size of all icons.
+ * icons30/: Old icons are here.
+
+2003-09-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-activate-zmacs-regions): New macro.
+ * w3m.el (w3m-next-anchor, w3m-previous-anchor, w3m-next-form,
+ w3m-previous-form, w3m-next-image, w3m-previous-image,
+ w3m-scroll-up-or-next-url, w3m-scroll-down-or-previous-url,
+ w3m-beginning-of-line, w3m-end-of-line): Use it.
+
+2003-09-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-backward): Return nil if there is no
+ previous element.
+
+ * w3m.el (w3m-view-previous-page): Skip the current page if it seems
+ broken; warn if there's no more history.
+ (w3m-copy-buffer): Use the current history for the url string if the
+ current page seems broken.
+ (w3m-goto-url): Use `lexical-let' to pass the history position data to
+ the asynchronous w3m process.
+
+2003-09-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el: Move the favicon stuff to w3m-favicon.el.
+
+ * w3m-favicon.el: New file detached from w3m-e21.el.
+ (w3m-favicon-type): Adapt it to XEmacs as well.
+ (w3m-setup-favicon): Ditto.
+ (w3m-buffer-favicon): Ditto.
+ (w3m-retrieve-favicon): Replace `float-time' with `w3m-float-time'.
+ (w3m-arrived-setup-functions): Don't add-hook it here.
+ (w3m-arrived-shutdown-functions): Ditto.
+
+ * w3m-xmas.el: Require `w3m-favicon'.
+
+ * w3m.el (w3m-arrived-setup-functions): Add
+ `w3m-favicon-load-cache-file' if w3m-favicon is loaded.
+ (w3m-arrived-shutdown-functions): Add `w3m-favicon-save-cache-file' if
+ w3m-favicon is loaded.
+
+ * w3m-util.el (w3m-float-time): New function.
+
+ * w3mhack.el (w3mhack-examine-modules): Exclude w3m-favicon.el from the
+ files to be byte-compiled.
+
+2003-09-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url-1): Fix a window configuration only when
+ the buffer's major mode has changed from the w3m-mode to another.
+ (w3m-goto-url): Don't erase a buffer when retrieving a local file.
+
+2003-08-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-copy-buffer): Copy the history before visiting a page in
+ order to show the about://history/ page correctly; adjust the position
+ in the history after copying.
+ (w3m-goto-url): Use buffer-local properties instead of global
+ properties for form data.
+ (w3m-reload-this-page): Specify the history element to the
+ `w3m-goto-url' function in order to submit the form data.
+
+2003-08-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url-1): Don't kill the emacs-w3m buffer when a
+ process is in progress.
+ (w3m-goto-url-new-session): Ditto.
+
+2003-08-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-previous-page): Specify a history element of the
+ previous page to the `w3m-goto-url' function as the 7th arg.
+ (w3m-goto-url): Accept a history element as the 7th argument; specify
+ nil as the 7th argument when recursively calling itself; use a given
+ history element to examine the form data of the url to be visited.
+ (w3m-goto-url-new-session): Specify nil to the `w3m-goto-url' function
+ as the 7th argument.
+ (w3m): Ditto.
+
+2003-08-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-minimize-in-new-session): New user option.
+ (w3m-history-set-current): Redefine as an inline function rather than a
+ macro.
+ (w3m-history-current-1): Abolish the function.
+ (w3m-history-current-2): Abolish the function.
+ (w3m-history-element): New function.
+ (w3m-history-current): Abolish the funtction.
+ (w3m-history-backward): Don't modify the current position pointer in
+ the `w3m-history' variable.
+ (w3m-history-forward): Simplify using `w3m-history-backward'.
+ (w3m-history-copy): Minimize the history when
+ `w3m-history-minimize-in-new-session' is non-nil.
+ (w3m-history-plist-get): Abolish the `url' argument; complement the
+ meaning of the `local' argument.
+ (w3m-history-add-properties): Ditto.
+ (w3m-history-plist-put): Ditto.
+ (w3m-history-remove-properties): Ditto.
+ (w3m-history-store-position): Don't specify the optional arguments to
+ `w3m-history-add-properties'.
+ (w3m-history-restore-position): Abolish the `url' argument; don't
+ specify the optional arguments to `w3m-history-plist-get'.
+ (w3m-history-minimize): Simplify using `w3m-history-element'.
+
+ * w3m.el (w3m-view-previous-page): Don't specify the optional arguments
+ to `w3m-history-plist-get' and `w3m-history-restore-position'.
+ (w3m-goto-url): Don't specify the optional arguments to
+ `w3m-history-plist-put', `w3m-history-plist-get',
+ `w3m-history-remove-properties' and `w3m-history-add-properties'.
+ (w3m-reload-this-page): Don't specify the optional arguments to
+ `w3m-history-plist-get' and `w3m-history-remove-properties'.
+
+2003-08-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-flat): Reduce the deepness of local
+ prpoerties in the list structure.
+ (w3m-history-assoc): Simplify; redefine as an inline function.
+ (w3m-history-with-element): Abolish the macro.
+ (w3m-history-current-2): New function.
+ (w3m-history-set-plist): New function.
+ (w3m-history-modify-properties): Rewrite.
+ (w3m-history-seek-properties): Abolish the function.
+ (w3m-history-seek-element): New function.
+ (w3m-history-share-properties): Abolish the function.
+ (w3m-history-tree): Tiny change.
+ (w3m-history-push): Rewrite.
+ (w3m-history-copy): Tiny change.
+ (w3m-history-plist-get): Synch to the change of `w3m-history-flat'.
+ (w3m-history-plist-put): Rewrite.
+ (w3m-history-add-properties): Rewrite.
+ (w3m-history-remove-properties): Rewrite.
+ (w3m-history-rename-url): Abolish the function.
+ (w3m-history-store-position): Abolish the optional argument.
+ (w3m-history-minimize): New command.
+
+2003-08-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-current-1): Redefine as a function rather
+ than a macro.
+ (w3m-history-previous-position): Ditto.
+ (w3m-history-next-position): Ditto.
+ (w3m-history-modify-properties): Ditto.
+ (w3m-history-save-position): Abolish the macro.
+ (w3m-history-forward-1): Ditto.
+ (w3m-history-backward-1): Ditto.
+ (w3m-history-with-element): Abolish the `set-current' argument.
+ (w3m-history-assoc): Ditto.
+ (w3m-history-plist-get): Ditto.
+ (w3m-history-plist-put): Ditto.
+ (w3m-history-add-properties): Ditto.
+ (w3m-history-remove-properties): Ditto.
+ (w3m-history-rename-url): Ditto.
+ (w3m-history-set-current): New macro.
+ (w3m-history-forward): Abolish the `set-current' argument; use
+ `w3m-history-set-current'.
+ (w3m-history-backward): Ditto.
+ (w3m-history-tree): Use `w3m-history-set-current' instead of
+ `w3m-history-forward-1'.
+ (w3m-history-push): Use `w3m-history-set-current'.
+ (w3m-history-store-position): Don't specify the `set-current' argument
+ to `w3m-history-add-properties'.
+ (w3m-history-restore-position): Don't specify the `set-current'
+ argument to `w3m-history-plist-get'.
+
+ * w3m.el (w3m-view-previous-page): Don't specify the `set-current'
+ argument to `w3m-history-plist-get'.
+ (w3m-goto-url): Don't specify the `set-current' argument to
+ `w3m-history-plist-put', `w3m-history-plist-get',
+ `w3m-history-remove-properties' and `w3m-history-add-properties'.
+ (w3m-reload-this-page): Don't specify the `set-current' argument to
+ `w3m-history-plist-get' and `w3m-history-remove-properties'.
+
+2003-08-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url-1): Fix a window configuration if a new
+ buffer visiting the specified url is not in the `w3m-mode'; remove a
+ newly created buffer if it is useless.
+ (w3m-goto-url): Don't use `save-excursion' when performing find-file
+ directly.
+ (w3m-goto-url-new-session): Remove a newly created buffer if it is
+ useless.
+
+2003-08-12 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * Makefile.in (what-where): Add space to avoid error on Solaris.
+
+ * w3m-namazu.el (w3m-about-namazu): Fix last change.
+
+2003-08-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-previous-position): New macro.
+ (w3m-history-next-position): New macro.
+ (w3m-history-forward-1): Simplified using new macro(s).
+ (w3m-history-backward-1): Ditto.
+ (w3m-history-regenerate-pointers): Ditto.
+ (w3m-history-assoc): Ditto.
+ (w3m-history-current-1): Don't use old-fashioned backquotes.
+ (w3m-history-save-position): Ditto.
+ (w3m-history-modify-properties): Ditto.
+ (w3m-history-with-element): Ditto.
+
+2003-08-10 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-namazu.el (w3m-about-namazu): Fixed problem when further links
+ contain "&amp;".
+
+2003-08-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-get-header): Removed.
+ (w3m-w3m-parse-header, w3m-w3m-dump-head): New function.
+ (w3m-w3m-attributes): Call the above functions.
+ (w3m-w3m-dump-head-source): Removed.
+ (w3m-w3m-dump-extra): New function.
+ (w3m-w3m-retrieve, w3m-w3m-retrieve-1): Reimplemented.
+ (w3m-about-header): Call `w3m-w3m-dump-head' instead of
+ `w3m-w3m-get-header'.
+
+ * w3m-proc.el: Changes to support recursive call of functions creating
+ asynchronous processes.
+ (w3m-process-waited): Abolished.
+ (w3m-process-handler-new): Add result slot.
+ (w3m-process-handler-functions): Renamed from
+ `w3m-process-handler-function'.
+ (w3m-process-handler-result): New macro.
+ (w3m-process-with-null-handler): Reimplemented.
+ (w3m-process-start-and-wait): New function.
+ (w3m-process-with-wait-handler): Reimplemented.
+ (w3m-process-do): Reimplemented.
+ (w3m-process-do-with-temp-buffer): Reimplemented.
+ (w3m-process-sentinel): Accept the 3rd argument. Follow the above
+ changes.
+
+2003-08-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-reuse-history-elements): New user option.
+ (w3m-history-forward): Return a cons of a new history element and new
+ position pointers of a history.
+ (w3m-history-backward): Ditto.
+ (w3m-history-regenerate-pointers): New function.
+ (w3m-history-push): If `w3m-history-reuse-history-elements' is nil,
+ sprout a new history branch even if history elements for the same url
+ already exist.
+ (w3m-history-add-arrived-db): Abolish the optional argument; bind
+ `w3m-history-reuse-history-elements' to t.
+
+ * w3m.el (w3m-view-previous-page): Assume `w3m-history-backward'
+ returns cons data; bind `w3m-history-reuse-history-elements' to t; fix
+ position pointers of a history after visiting a page.
+ (w3m-goto-url): Fix position pointers of a history when a page is
+ referred to by the about://history/ page.
+ (w3m-about-history): Include position pointers in an html form.
+ (w3m-history-highlight-current-url): Make history position data
+ invisible.
+
+2003-07-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-entities): Don't trust in the `match-data' after
+ the `w3m-entity-value' function is performed.
+
+2003-07-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-command, w3m-user-agent, w3m-command-arguments,
+ w3m-command-arguments-alist, w3m-no-proxy-domains,
+ w3m-command-environment, w3m-fill-column, w3m-mailto-url-function,
+ w3m-mailto-url-popup-function-alist, w3m-imitate-widget-button,
+ w3m-pixels-per-character, w3m-coding-system,
+ w3m-terminal-coding-system, w3m-input-coding-system,
+ w3m-output-coding-system, w3m-file-coding-system,
+ w3m-file-name-coding-system, w3m-default-coding-system,
+ w3m-coding-system-priority-list, w3m-profile-directory, w3m-init-file,
+ w3m-default-save-directory, w3m-accept-languages, w3m-icon-directory,
+ w3m-home-page, w3m-arrived-file, w3m-keep-arrived-urls,
+ w3m-keep-cache-size, w3m-follow-redirection, w3m-resize-image-scale,
+ w3m-default-content-type, w3m-content-type-alist,
+ w3m-encoding-type-alist, w3m-decoder-alist,
+ w3m-charset-coding-system-alist, w3m-correct-charset-alist,
+ w3m-horizontal-scroll-columns, w3m-horizontal-shift-columns,
+ w3m-edit-function, w3m-url-local-directory-alist,
+ w3m-pop-up-frame-parameters, w3m-horizontal-scroll-division,
+ w3m-mbconv-command, w3m-local-find-file-regexps,
+ w3m-local-find-file-function, w3m-local-directory-view-method,
+ w3m-dirlist-cgi-program, w3m-add-referer-regexps, w3m-touch-command,
+ w3m-uri-replace-alist, w3m-db-history-display-size,
+ w3m-select-buffer-window-ratio): Improve the customizing widgets.
+
+ * w3m-symbol.el (w3m-symbol-custom-type): New variable.
+ (w3m-default-symbol, w3m-Chinese-BIG5-symbol, w3m-Chinese-CNS-symbol,
+ w3m-Chinese-GB-symbol, w3m-Japanese-symbol, w3m-Korean-symbol): Use it.
+ (w3m-symbol): Improve the customizing widgets.
+
+ * w3m-search.el (w3m-search-engine-alist, w3m-search-default-engine):
+ Improve the customizing widgets.
+ * w3m-perldoc.el (w3m-perldoc-command, w3m-perldoc-pod2html-command,
+ w3m-perldoc-pod2html-arguments): Ditto.
+ * w3m-filter.el (w3m-filter-rules): Ditto.
+
+2003-07-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-namazu.el (w3m-namazu-command, w3m-namazu-arguments,
+ w3m-namazu-page-max, w3m-namazu-default-index-customize-spec,
+ w3m-namazu-index-alist, w3m-namazu-output-coding-system,
+ w3m-namazu-input-coding-system): Improve the customizing widgets.
+ * w3m-image.el (w3m-imagick-convert-program): Ditto.
+ * w3m-form.el (w3m-form-input-textarea-buffer-lines,
+ w3m-form-input-select-buffer-lines, w3m-form-input-map-buffer-lines):
+ Ditto.
+ * w3m-filter.el (w3m-filter-rules): Ditto.
+ * w3m-e21.el (w3m-favicon-size, w3m-favicon-cache-file,
+ w3m-favicon-cache-expire-wait, w3m-favicon-type, w3m-tab-width): Diito.
+ * w3m-dtree.el (w3m-dtree-directory-depth, w3m-dtree-indent-strings,
+ w3m-dtree-stop-strings): Ditto.
+ * w3m-cookie.el (w3m-cookie-accept-domains, w3m-cookie-reject-domains,
+ w3m-cookie-accept-bad-cookies, w3m-cookie-file): Ditto.
+ * w3m-bookmark.el (w3m-bookmark-file, w3m-bookmark-file-coding-system,
+ w3m-bookmark-default-section): Ditto.
+ * w3m-bitmap.el (w3m-bitmap-convert-arguments): Ditto.
+ * w3m-antenna.el (w3m-antenna-sites, w3m-antenna-make-summary-function,
+ w3m-antenna-sort-changed-sites-function,
+ w3m-antenna-sort-unchanged-sites-function, w3m-antenna-file): Ditto.
+ * mime-w3m.el (mime-w3m-safe-url-regexp): Ditto.
+
+2003-07-27 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-accept-japanese-characters): Checked loosely.
+
+2003-07-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (clean): Do not remove `shimbun-servers.el'.
+
+ * w3mhack.el: Do not generate `shimbun-servers.el'.
+ (shimbun-servers-file): Abolished.
+ (w3mhack-compile, w3mhack-batch-compile): Do not call
+ `w3mhack-check-shimbun-servers-file'.
+ (w3mhack-generate-shimbun-servers-file): Removed.
+ (w3mhack-check-shimbun-servers-file): Removed.
+
+ * w3m.el (w3m-fontify-anchors): Handle `id' attributes of anchors.
+ Thanks to Shinichiro HIDA and TAKAISHI Hayato for their reports.
+ (w3m-fontify-bold, w3m-fontify-underline): Stricten regular expressions
+ to detect tags. For more detail, see [emacs-w3m:05600].
+
+2003-07-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-display-inline-images): Improve the customizing
+ widget.
+
+2003-07-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-language, w3m-command-environment,
+ w3m-content-type-alist, w3m-encoding-type-alist, w3m-decoder-alist,
+ w3m-charset-coding-system-alist, w3m-correct-charset-alist,
+ w3m-url-local-directory-alist, w3m-pop-up-frame-parameters): Improve
+ the customizing widgets.
+
+2003-07-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-shimbun-servers-file): Exclude rss.
+
+2003-07-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-set-method): New inline function, that is a
+ `setf' method of `w3m-form-method'.
+
+ * w3mhack.el (w3mhack-examine-modules): Because Mew 2.x and later do
+ not support Mule2.3 and Emacs19, ignore mew-shimbun.el when compiling
+ on such Emacsen.
+
+2003-07-24 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-output-coding-system): Changed condition to use utf-8
+ with w3m-m17n.
+ (w3m-halfdump-command-arguments): Ditto.
+
+2003-07-24 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Fix for the pages in which
+ form_int appears after input_alt.
+
+2003-07-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Force texinfmt.elc to load texinfo.elc
+ from the correct place. <cf. [emacs-w3m:05573]>
+
+2003-07-19 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-e21.el (w3m-euc-japan-encoder): Fixed comment.
+
+
+2003-07-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.6 from emacs-w3m-1_3 branch.
+
+2003-07-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (w3m-ccl-get-ucs-codepoint-with-emacs-unicode): Remove
+ `translate-character'.
+ (w3m-euc-japan-encoder, w3m-iso-latin-1-encoder): Select appropriate
+ encoders when thie file is loaded.
+
+ * w3m-ccl.el (w3m-ccl-write-repeat): Use a literal list of unibyte
+ character sets, instead of calling `charset-bytes', in order to avoid
+ difference between FSF Emacs and XEmacs.
+ (w3m-euc-japan-encoder, w3m-iso-latin-1-encoder): Do not overwrite, if
+ they have already been defined.
+
+2003-07-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Ignore w3m-ccl.el when XEmacs
+ doesn't provide the mule feature.
+
+2003-07-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-correct-charset-alist): New user option.
+ (w3m-correct-charset): New inline macro.
+ (w3m-detect-meta-charset): New function.
+ (w3m-decode-buffer): Use `w3m-correct-charset' and
+ `w3m-detect-meta-charset'.
+ (w3m-create-page): Set `charset' to `w3m-current-content-charset' if it
+ is nil.
+ (w3m-region): If `charset' is nil, check `content-charset' in `META
+ Tag'.
+
+2003-07-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-ccl.el (toplevel): Add autoload for `charset-id' defined at
+ w3m-om.el.
+ (w3m-ccl-write-repeat): Simplified.
+ (w3m-ccl-write-euc-japan-character): Set nil, when
+ `read-multibyte-character' is not available.
+ (w3m-ccl-write-iso-latin-1-character): Ditto.
+
+ * w3m-om.el: Remove redundant `function'.
+ (w3m-om-character-set-alist): New variable.
+ (charset-id): New function.
+
+ * w3m.el (w3m-input-coding-system): Change its default value for
+ Mule2.3 and Emacsen without Mule.
+
+2003-07-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Ignore w3m-ccl.el when ccl.el
+ is missing.
+
+ * w3m-e21.el (w3m-ccl-get-ucs-codepoint-with-emacs-unicode): Import
+ from w3m-ccl.el.
+
+ * w3m-ucs.el (w3m-ccl-get-ucs-codepoint-with-mule-ucs): Import from
+ w3m-ccl.el.
+
+ * w3m-ccl.el: Export the above constants.
+
+ * w3m.el (w3m-retrieve-and-render): Check current content charset
+ before `w3m-create-page' is called.
+
+2003-07-17 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (toplevel): Do not require `ccl'.
+ (w3m-input-coding-system): Change its default value.
+ (w3m-internal-characters-alist): Moved to w3m-ccl.el
+ (w3m-ccl-write-repeat): Ditto.
+ (w3m-euc-japan-decoder): Ditto.
+ (w3m-euc-japan-encoder): Ditto.
+ (w3m-iso-latin-1-decoder): Ditto.
+ (w3m-iso-latin-1-encoder): Ditto.
+
+ * w3m-ccl.el: New file.
+
+ * w3m-ucs.el: Completely rewritten.
+ (w3m-euc-japan-mule-ucs, w3m-iso-latin-1-mule-ucs): New coding systems.
+
+ * w3m-e21.el (toplevel): Require `w3m-ccl'.
+ (w3m-euc-japan-encoder, w3m-iso-latin-1-encoder): New encoder.
+
+ * w3m-om.el, w3m-e20.el, w3m-xmas.el (toplevel): Require `w3m-ccl'.
+
+2003-07-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history): Call `w3m-arrived-time' with string.
+
+2003-07-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-uri-replace-alist): Improve the customizing widget.
+
+2003-07-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-copy-buffer): Fix the logical error installed by the last
+ change at 2003-07-15.
+
+2003-07-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-image-only-page): Abolished.
+ (w3m-show-error-information): Return nil.
+ (w3m-create-text-page): Return 'text-page.
+ (w3m-create-image-page): Return 'image-page.
+ (w3m-create-page): Return 'external-view when `w3m-external-view' is
+ called.
+ (w3m-goto-url): Do not encode a given URL when it points a local page.
+ Bind `w3m-current-buffer' locally. Follow the change of
+ `w3m-create-page'.
+ (w3m-copy-buffer): Wrap `w3m-goto-url' with
+ `w3m-process-with-wait-handler', to avoid unexpected asynchronous
+ processes.
+ (w3m-region): Bind `w3m-current-buffer' locally.
+
+ * w3m-util.el (w3m-url-local-p): Stricten its regexp.
+ (w3m-url-dtree-p): Removed.
+
+2003-07-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-uri-replace-alist): Revert 2003-07-09 change; improve the
+ customizing widget.
+
+ * doc/ptexinfmt.el (texinfo-discard-command-and-arg): New function for
+ old Emacsen.
+
+2003-07-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-decoder-alist): Simplified.
+
+2003-07-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decoder-alist): Look for the newest inflate command.
+
+2003-07-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (w3m-mew-support-cid): Check `mew-version-number'.
+ (mew-w3m-cid-retrieve): Support Mew 4.0.53 and later. Thanks to Kazu
+ YAMAMOTO for his patch.
+
+2003-07-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-uri-replace-alist): Add `rpm', `waei', `eiwa', `kokugo'
+ and `eiei'.
+ (w3m-input-url): Do not encode its return value.
+ (w3m-goto-url): Call `w3m-url-transfer-encode-string' to encode a given
+ URL.
+
+
+2003-07-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.5 from emacs-w3m-1_3 branch.
+
+2003-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url-1): Simply copy buffer's contents to the
+ new session rather than to call `w3m-goto-url'.
+
+2003-07-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-local-file-type): Check whether a regular expression is
+ specified, before matching it on a URL.
+
+ * Following changes are to check whether required libraries are
+ available.
+
+ * w3mhack.el (toplevel): Do not create `shimbun/shimbun-servers.el' and
+ `w3m-kwds.el' only when this file is loaded, to suppress excessive
+ messages.
+ (w3mhack-check-shimbun-servers-file): New function.
+ (w3mhack-check-colon-keywords-file): New function.
+ (w3mhack-compile): Call these functions explicitly.
+ (w3mhack-batch-compile, w3mhack-locate-library, w3mhack-print-status):
+ New functions.
+
+ * configure.in: Check that egrep is available and that regexp-opt.el
+ and xml.el are available.
+
+ * aclocal.m4 (AC_EMACS_LISP): Add `-q' option and `-no-site-file'
+ option.
+ (AC_ADD_LOAD_PATH): Define `--with-attic' option.
+ (AC_CHECK_ELISP): New function.
+
+ * Makefile.in (.el.elc): Call `w3mhack-batch-compile' instead of
+ `batch-byte-compile'.
+ (very-slow): Always call `keywords' target.
+ (keywords): Call `w3mhack-check-colon-keywords-file'.
+
+2003-07-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-about-antenna): Fix the expression to decide
+ changed sites.
+
+ * w3m.el (w3m-retrieve-and-render): Do not overwrite an arrived time
+ with a modified time, even if the modified time is newer than the
+ arrived time. Store a real URL to arrived DB.
+ (w3m-about-db-history): Small clean up.
+
+ * attic/xml.el: Import contrib/xml.el of Oort Gnus. Require cl and
+ poe.
+
+2003-07-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el (w3m-bookmark-add): Encode special characters
+ included in a URL and a title.
+
+ * w3m-antenna.el (w3m-antenna-check-all-sites): Use `w3m-antenna-alist'
+ instead of `w3m-antenna-sites'; this change must have no ill effects
+ because `w3m-use-setup' merges site informations kept by
+ `w3m-antenna-sites' into `w3m-antenna-alist'.
+ (w3m-about-antenna): Fix.
+ (w3m-antenna-add-current-url): Encode special characters included in
+ `w3m-current-title'.
+
+ * w3m.el: Changes of functions handling the arrived database, and clean
+ up w3m-retrieve-and-render() and related parts.
+ (w3m-content-type-alist): Change spec.
+ (w3m-attributes): Strip authentication part from URL before checking
+ charsets given by a user.
+ (w3m-arrived-add-1): Removed.
+ (w3m-arrived-add): Reimplemented.
+ (w3m-arrived-modify): Removed.
+ (w3m-arrived-time): Define its `setf' method.
+ (w3m-arrived-get, w3m-arrived-put): New inline functions.
+ (w3m-arrived-title): Define as a macro using `w3m-arrived-get'.
+ (w3m-arrived-last-modified): Ditto
+ (w3m-arrived-content-charset): Ditto
+ (w3m-arrived-content-type): Ditto.
+ (w3m-arrived-shutdown): Modify a predicate used for comparing arrived
+ elements, to ensure that every URL precedes its variants with
+ fragments.
+ (w3m-encode-specials-string): New function.
+ (w3m-safe-decode-buffer): New function.
+ (w3m-rendering-extract-title): Simplified.
+ (w3m-rendering-half-dump): Define as a normal function.
+ (w3m-rendering-buffer): Do not call `w3m-filter'.
+ (w3m-retrieve-and-render): Reimplemented.
+ (w3m-show-error-information): Change its argument spec.
+ (w3m-content-prepare-functions): Abolished.
+ (w3m-prepare-content): Reimplemented.
+ (w3m-prepare-text-content, w3m-prepare-image-content): Removed.
+ (w3m-create-text-page, w3m-create-image-page): New functions; the
+ successors of the aboves.
+ (w3m-create-page): New function.
+ (w3m-goto-url): Follow above changes and clean up.
+ (w3m-redisplay-and-reset): Call `setf' methods instead of using
+ `w3m-arrived-modify'.
+ (w3m-redisplay-with-charset): Ditto.
+ (w3m-redisplay-with-content-type): Ditto.
+ (w3m-about-header): Strip authentication part from URL before
+ extracting titles.
+ (w3m-about-history): Encode special characters included in a title.
+ (w3m-about-db-history): Encode special characters in the title. Ignore
+ URLs that include fragments.
+
+2003-07-01 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * doc/ptexinfmt.el: @verb, @tie, @/ support.
+ (ptexinfmt-broken-facility): Abolish NO-NOTICE argument. Use
+ `ptexinfmt-disable-broken-notice-flag' instead.
+
+2003-07-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Add CHARSET argument of
+ `w3m-region' when no w3m-m17n.
+
+2003-07-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Call `w3m-region' with
+ `charset' option.
+
+2003-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Use `w3m-url-strip-fragment' instead of
+ `w3m-base-url' for local files.
+
+2003-07-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-load-list): Check that `w3m-arrived-file' exists
+ before deleting it.
+ (w3m-check-refresh-attribute): Condition relaxed.
+ (w3m-region): Disable checking refresh attribute.
+
+2003-06-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Some miscellaneous changes and large changes to make a filter
+ module cooperate with w3mmee and w3m-m17n.
+ (w3m-language): Stricten its customize spec.
+ (w3m-attributes): Call `w3m-url-strip-fragment' instead of using a
+ literal regular expression.
+ (w3m-arrived-load-list): New function.
+ (w3m-arrived-setup, w3m-arrived-shutdown): Use the above.
+ (w3m-url-decode-string): Call `vector' instead of `string' to avoid
+ making unexpected multibyte characters.
+ (w3m-decode-buffer): Do not call `w3m-decode-get-refresh'.
+ (w3m-decode-get-refresh): Removed.
+ (w3m-check-refresh-attribute): New function, the successor of the
+ above.
+ (w3m-rendering-half-dump): Encode a content for w3mmee and w3m-m17n
+ with `w3m-current-coding-system' instead of giving it as a binary data.
+ Because `w3m-current-coding-system' keeps a coding system used to
+ decode the current buffer, all characters should be recovered by this
+ encoding.
+ (w3m-rendering-buffer-1): Removed.
+ (w3m-rendering-buffer): New function, the successor of the above.
+ (w3m-rendering-unibyte-buffer): Removed.
+ (w3m-rendering-multibyte-buffer): Removed.
+ (w3m-prepare-text-content): Always call `w3m-decode-buffer'. Call
+ `w3m-rendering-buffer' instead of `w3m-rendering-unibyte-buffer'.
+ (w3m-goto-url): Fix regular expressions.
+ (w3m-region): Accept the 4th optional argument, `charset'. Set
+ `w3m-current-coding-system' to the coding system based on the given
+ charset. Call `w3m-rendering-buffer' with the charset.
+
+2003-06-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Include other files first.
+
+2003-06-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-shimbun-modules-using-rss): Don't use
+ `with-temp-buffer'.
+
+2003-06-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-shimbun-modules-using-rss): New function.
+ (w3mhack-examine-modules): Call the above instead of a literal list.
+
+2003-06-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/Makefile.in (install): Don't run install-info for non- existent
+ info files.
+
+ * w3mhack.el (w3mhack-examine-modules): Also examine
+ "sb-pukiwiki-rss.el".
+
+2003-06-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-namazu.el (w3m-namazu-complete-index): Consider `predicate'
+ option.
+
+ * w3m-weather.el (w3m-weather-completion-table): Add `oki' as the
+ shortend form of `shimanekenoki'.
+
+2003-06-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-fontify-anchors): Do not encode fragment parts.
+
+2003-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Ignore the shimbun modules
+ which need xml.el if it is not available.
+
+2003-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Improve the last change.
+
+
+2003-06-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.4 from emacs-w3m-1_3 branch.
+
+2003-06-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-ignored-regexp): Use "\`" instead of "^".
+ (w3m-history-ignored-regexp): Ditto.
+ (w3m-url-transfer-encode-string): New inline function.
+ (w3m-fontify-anchors): Encode URL with the attribute `charset'.
+ (w3m-input-url): Encode URL with `w3m-default-coding-system'.
+ (w3m-about-header): Display the current anchor information.
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Encode URL with the
+ attribute `charset'.
+
+2003-06-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Encode messages to terminal while
+ formatting info pages.
+
+2003-06-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-attributes): Improve the regexp to extract
+ content-types.
+
+2003-06-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Apply
+ `w3m-decode-anchor-string' to the form action url.
+
+2003-06-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * doc/emacs-w3m.texi, doc/emacs-w3m-ja.texi: Their license is changed
+ from GNU Free Documentation License to GNU General Public License.
+
+2003-05-30 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (toplevel): Require poe.
+ (octet-filter-call1): Use `make-temp-file' instead of `make-temp-name'.
+ (octet-filter-call2): Ditto.
+ (octet-filter-call2-extra): Ditto.
+ (octet-temp-directory): Changed default value to
+ `temporary-file-directory'.
+
+2003-05-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (DOCS): FAQ, FAQ.ja, README.namazu.ja, README.shimbun.ja,
+ TIPS and TIPS.ja are merged into Info.
+
+2003-05-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * doc/Makefile.in (dvi): New target to create dvi files; related
+ targets and macros are installed.
+
+ * doc/.cvsignore: Ignore dvi files.
+
+ * configure.in: Check whether texi2dvi, ptex and jbibtex exists.
+
+2003-05-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * .cvsignore: Ignore tarballs.
+
+ * Makefile.in (SUBDIRS): New macro.
+ (tarball): Refer the above macro, and put texinfo sources into a
+ tarball.
+
+ * aclocal.m4 (AC_ADD_LOAD_PATH): Use the variable `EGREP' instead of
+ the literal `grep'.
+
+2003-05-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (byte-optimizer for match-string-no-properties): `lenght'
+ -> `length'.
+
+2003-05-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Simplify functions that rewrite URIs.
+ (toplevel): Autoload `w3m-search-uri-replace' instead of
+ `w3m-search-quick-search-handler'.
+ (w3m-uri-replace-alist): Changed its default value and its customize
+ spec.
+ (w3m-pattern-uri-replace): New function.
+ (w3m-uri-replace): Reimplemented.
+
+ * w3m-search.el (w3m-search-quick-search-engine-alist): Abolished.
+ (w3m-search-quick-search-engines): Removed.
+ (w3m-search-quick-search-handler): Removed.
+ (w3m-search-uri-replace): New function.
+
+2003-05-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-highlight-current-anchor): Don't infloop even if a w3m
+ buffer is narrowed.
+
+2003-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-make-package): Make it work under non-Mule
+ XEmacs.
+
+2003-05-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-use-safe-url-regexp): New variable.
+ (mew-w3m-view-inline-image, mew-mime-text/html-w3m): Use
+ `mew-w3m-use-safe-url-regexp' for `w3m-safe-url-regexp'.
+
+2003-05-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (Top): Use w3m-treat-drive-letter for `w3m-expand-path-name'.
+
+2003-05-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Apply the patch posted by
+ Yoichi NAKAYAMA <yoichi@geiin.org> in [emacs-w3m:04836], that correct
+ the wrong usage of `message'.
+
+2003-05-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-anchors): Invalidate the widget keymap in XEmacs;
+ add a help-echo to the widget button.
+ (w3m-make-minor-mode-keymap): Bind [down-mouse-2] to `undefined' to
+ invalidate the `widget-button-click' command in FSF Emacs.
+
+2003-04-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-imitate-widget-button): New variable.
+ (w3m-imitate-widget-button): New function.
+ (w3m-fontify-anchors): Imitate the widget button.
+ (w3m-next-anchor): Look for the widget button.
+ (w3m-previous-anchor): Ditto.
+
+2003-04-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-retrieve-and-render): Hide a exit status from an error
+ message unless `w3m-process-exit-status'.
+
+2003-04-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Improve and bug fix the find-file code.
+
+2003-04-16 Chihiro Kuroda <chee@iijmio-mail.jp>
+
+ * w3m.el (w3m-download): Download a directory url to index.html
+ (by default) instead of signaling an error.
+
+2003-04-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-local-find-file-regexps): New user option.
+ (w3m-local-find-file-function): New user option.
+ (w3m-goto-url): Use the function specified by the
+ `w3m-local-find-file-function' variable for local files when the file
+ name matches the `w3m-local-find-file-regexps' variable.
+
+2003-04-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Change coding-system to
+ `euc-japan' of "waei" and "kokugo". Tnx, Mr. Saito (sai@yedo.com) for
+ his report.
+
+2003-03-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-check-all-sites): Call `make-symbol'
+ instead of `gensym', in order to make this function free from runtime
+ CL functions.
+
+2003-03-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug): Make it possible to send a bug
+ report even if emacs-w3m is not running.
+
+2003-03-03 Michael Shields <shields@msrl.com>
+
+ * w3m-xmas.el (w3m-create-image): Protect against images which are not
+ permitted to be loaded according to `w3m-safe-url-regexp'.
+
+2003-02-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-util.el (w3m-get-server-hostname): Rename and move from
+ `w3m-process-get-server-root' in `w3m-proc.el'.
+
+ * w3m-proc.el (w3m-process-set-authinfo, w3m-process-read-user)
+ (w3m-process-read-passwd, w3m-process-y-or-n-p): Use
+ `w3m-get-server-hostname' instead of `w3m-process-get-server-root'.
+
+ * w3m.el (w3m-show-error-information): New customized variable.
+ (w3m-w3m-attributes): Message strange `Location:' like lynx.
+ (w3m-retrieve-and-render): When error occur, show error message in `w3m
+ buffer' to be accompanied by `w3m-show-error-information'.
+ (w3m-show-error-information): New function.
+ (w3m-reload-this-page, w3m-redisplay-this-page)
+ (w3m-redisplay-and-reset, w3m-redisplay-with-charset)
+ (w3m-view-source, w3m-view-header): If `w3m-current-url' is nil, dont'
+ execute command.
+ (w3m): Guard from the bug of `select-frame-set-input-focus' in
+ Emacs-21.3.x. If `w3m-current-url' is nil in `w3m buffer'
+
+2003-02-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-shimbun-servers-file): Exclude fml,
+ glimpse, lump, mailarc, mailman, mhonarc and text; indent.
+ (w3mhack-generate-colon-keywords-file): indent.
+
+2003-02-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add www.alltheweb.com
+ suggested by Chris Beggy <chrisb@kippona.com>; make the default value
+ more suitable to the language environment; don't use the old fashioned
+ backquotes.
+ (w3m-search-default-engine): Always default to google.
+ (w3m-search-prefer-japanese-site): Remove.
+ (w3m-search-inhibited-japanese-engines): Remove.
+ (w3m-search): Bind `completion-ignore-case' to t.
+ (w3m-search-quick-search-handler): Remove
+ `w3m-search-prefer-japanese-site' and
+ `w3m-search-inhibited-japanese-engines'.
+
+2003-02-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-attributes): Allow imperfect Status-Line like no
+ Reason-Phrase. Guard broken header like no location field.
+
+2003-02-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-util.el (w3m-url-local-p): Use `\`' instead of `^'.
+
+2003-02-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Treat a `local cookie file', again.
+
+2003-02-16 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-type): Support "release candidate" of w3m.
+
+2003-02-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-insert-image): Use `map-extents' instead of
+ `extent-at' repeatedly.
+ (w3m-remove-image): Ditto.
+
+2003-02-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-submit): Remove `!CURRENT_URL!' from action
+ tag.
+
+2003-02-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (TopLevel): Don't gererate the w3m-kwds.el file if there
+ is no permission to write.
+
+ * Makefile.in (clean): Remove shimbun/shimbun-servers.el.
+
+2003-02-04 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+ Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-shimbun-servers-file): New function.
+ (TopLevel): Call it.
+
+2003-02-04 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+
+ * w3mhack.el (shimbun-servers-file): New constant.
+
+2003-02-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mode): Bind `auto-hscroll-mode' for Emacs-21.3.
+
+2003-01-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-image-type): Move forward.
+ (w3m-fontify-images): Use `w3m-action' and `w3m-anchor' instead of
+ `get-text-property'.
+ (w3m-toggle-inline-images-internal): Use `w3m-image' instead of
+ `get-text-property'.
+ (w3m-toggle-inline-image): Don't specify the arg to `w3m-image'.
+ (w3m-resize-inline-image-internal): Use `w3m-image' instead of
+ `get-text-property'.
+ (w3m-zoom-in-image): Don't specify the arg to `w3m-image'.
+ (w3m-zoom-out-image): Ditto.
+ (w3m-view-this-url): Don't bother to call `w3m-anchor' if it is
+ needless.
+ (w3m-print-this-url): Don't pull-in the point into the link if it is
+ called non-interactively.
+ (w3m-highlight-current-anchor-1): Use `w3m-anchor-sequence' instead of
+ `get-text-property'.
+ (w3m-next-anchor): Don't put `nil' element into `w3m-goto-anchor-hist';
+ use `push' instead of `cons'.
+ (w3m-previous-anchor): Ditto.
+ (w3m-next-form): Use `w3m-action' instead of `get-text-property'; don't
+ put `nil' element into `w3m-goto-anchor-hist'; specify the current
+ position to `w3m-action'; use `push' instead of `cons'.
+ (w3m-goto-previous-form): indent.
+ (w3m-previous-form): Use `w3m-action' instead of `get-text-property';
+ don't put `nil' element into `w3m-goto-anchor-hist'; specify the
+ current position to `w3m-action'; use `push' instead of `cons'.
+ (w3m-next-image): Use `w3m-image' instead of `get-text-property'; don't
+ put `nil' element into `w3m-goto-anchor-hist'; specify the current
+ position to `w3m-image'; use `push' instead of `cons'.
+ (w3m-previous-image): Ditto.
+
+ * w3m-form.el (w3m-form-resume): Use `w3m-action' instead of
+ `get-text-property'; specify the current position to `w3m-action'.
+ (w3m-fontify-textareas): Use `w3m-anchor-sequence' instead of
+ `get-text-property'.
+ (w3m-form-replace): Use `w3m-action' instead of `get-text-property'.
+ (w3m-form-textarea-info): Use `get-text-property' instead of
+ `w3m-get-text-property-around'.
+ (w3m-form-reset): Use `w3m-action' instead of `get-text-property'.
+
+ * w3m-util.el (w3m-get-text-property-around): Always search for the
+ text prop around there and pull-in the point into the position where
+ the prop exists.
+ (w3m-action, w3m-anchor, w3m-image, w3m-submit): Use
+ `get-text-property' if the argument is omitted.
+ (w3m-image-scale): Abolished.
+ (w3m-anchor-sequence): Simplified.
+
+ * mime-w3m.el (mime-w3m-mode-map): Bind it when compiling.
+
+2003-01-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (top): Move the last addition (modifying the value for
+ `shell-file-name') just after loading `cl'.
+
+2003-01-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3mhack.el (top): Set `cmdproxy.exe' to `shell-file-name' when Win32
+ environment.
+
+2003-01-28 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Treat a `local cookie file'.
+
+2003-01-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-ucs.el (w3m-ucs-to-char): Guard error for Mule-UCS 0.85.
+
+2003-01-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-byte-optimize-letX): Add `pathname-coding-system'
+ to be removed from `let' bindings.
+
+2003-01-26 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp>
+
+ * w3m-e21.el (w3m-favicon-type): Add BMP at the head of the list.
+ (w3m-favicon-type): Undo the last change and make the priority of BMP
+ the lowest.
+
+2003-01-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Withdraw the change of 2003-01-09.
+
+2003-01-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-examine-modules, w3mhack-load-path): Check the
+ existence of Gnus for shimbun/nnshimbun.el.
+
+2003-01-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-function-max-args): Don't use the arglist
+ destructively.
+
+ * mime-w3m.el (kill-new): Don't refer to the whole arglist of the
+ original function.
+
+2003-01-21 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-scroll-down-or-previous-url): Added doc string.
+
+2003-01-19 TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
+
+ * w3m.el (toplevel): Strict checking that buggy `w3m-time-parse-string'
+ is used.
+
+2003-01-14 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by KURIHARA Kenichi <kenichi_kurihara@nifty.com>.
+
+ * w3m.el (w3m-async-exec): Always default to `t'.
+ (w3m-process-connection-type): Default to `nil' under MacOS X.
+
+2003-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Insert one excessive newline after a
+ @foo{bar} thing to prevent clinging of a line and a line
+ (old texinfmt bug?) if it should be considered only one thing in a
+ line.
+
+2003-01-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-ext-url-show): Use `mew-buffer-message' instead
+ of `mew-window-configure'.
+
+2003-01-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-ext-url-show): New funcition.
+ (mew-w3m-ext-url-fetch): Ditto.
+ (top): Modify comment. Avoid byte-compile warning for
+ `mew-window-configure'.
+
+2002-12-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history): Display the information of page.
+
+2002-12-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Treat a local cookie.
+
+2002-12-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-favicon-type): Change default value and type of
+ custom.
+ (w3m-favicon-type-alist): New internal variable.
+ (w3m-setup-favicon): Don't check 'xpm.
+ (w3m-buffer-favicon): Decide image type of Emacs use
+ `w3m-favicon-type-alist'.
+
+2002-12-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-type): Suppert `stable version notation' of w3m-m17n.
+
+2002-12-12 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-use-favicon): Moved from w3m-e21.el.
+
+ * w3m-image.el (w3m-favicon-usable-p): Moved from w3m-e21.el.
+
+ * w3m-e21.el : Bind `w3m-use-favicon' when compiling.
+ (w3m-favicon-usable-p): Moved to w3m-image.el.
+ (w3m-use-favicon): Moved to w3m.el.
+
+2002-12-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-text-chop): Added nil check.
+
+2002-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-what-where): Don't say [-ja] especially.
+
+2002-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/ptexinfmt.el: Modify it not to use APEL functions.
+
+ * w3mhack.el (w3mhack-makeinfo): Remove last temporal mod.
+
+2002-12-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Temporally fix to help users who don't
+ have APEL that use texinfmt if loading doc/ptexinfmt.el is failed.
+
+2002-12-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * doc/Makefile.in: Remove GNU make things.
+
+2002-12-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-makeinfo): Don't format Japanes info if the mule
+ feature is not provided.
+
+ * aclocal.m4 (AC_PATH_LISPDIR, AC_PATH_ICONDIR): Undo last change.
+
+ * doc/Makefile.in (INSTALL_INFO): New variable.
+ (install): Use it.
+
+2002-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (srcdir): New variable.
+ (FLAGS): Specify an absolute path to w3mhack.el.
+ (all-en): New rule.
+ (all-ja): Made it make only Japanese info.
+ (info-en): New rule.
+ (install-en): New rule.
+ (install-ja): Made it install only Japanese info.
+ (install-lisp): Use `$(srcdir)/' instead of `./'.
+ (install-icons): Ditto.
+ (install-info-en): New rule.
+ (Makefile): Use `$(srcdir)/' instead of `./'.
+ (config.status): Ditto.
+ (very-slow): Specify an absolute path to attic/addpath.el.
+
+ * doc/.cvsignore: Add version.texi.
+
+ * doc/ChangeLog: Removed.
+
+ * doc/Makefile.in (srcdir, subdir, top_srcdir): New variables.
+ (FLAGS): Specify an absolute path to w3mhack.el.
+ (EMACSINFO): Use `$(top_srcdir)' instead of `..'.
+ (INFO_DEPS): Include both emacs-w3m.info and emacs-w3m-ja.info.
+ (INFO_DEPS_EN): New variable.
+ (en): New rule.
+ (version.texi): New rule.
+ (emacs-w3m.info): Made it depend on version.texi.
+ (emacs-w3m-ja.info): Ditto.
+ (install): Use `$(top_srcdir)/' instead of `../'.
+ (install-en): New rule.
+
+ * doc/version.texi: Removed from the CVS repository.
+
+2002-11-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * doc/Makefile.in (clean): Fix target.
+
+2002-11-29 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3mhack.el (w3mhack-nonunix-install): Create parent directories.
+
+2002-11-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/texinfo.tex: Replaced with the latest version.
+
+2002-11-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-header-line-map): Prevent tool-bar from being doubled
+ under Emacs 21.
+
+2002-11-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (infodir): Add a variable.
+ (default): Use `all'.
+ (all, all-ja): New rules.
+ (lisp): Renamed from `default'.
+ (what-where): Pass `infodir' to `w3mhack-what-where'.
+ (info, info-ja): New rules.
+ (install): Use `install-lisp' and `install-info'.
+ (install-ja): New rule.
+ (install-lisp): Renamed from `install'.
+ (install-info, install-info-ja): New rules.
+ (install-package): Use `install-lisp' instead of `install'; install
+ info files as well.
+ (install-package-ja): New rule.
+ (clean): Remove info files as well.
+ (distclean): Remove doc.Makefile as well.
+
+ * aclocal.m4 (AC_PATH_LISPDIR, AC_PATH_ICONDIR): Modify a message for
+ `install-package'.
+
+ * configure.in: Check for the makeinfo command; create doc/Makefile.
+
+ * w3mhack.el (w3mhack-make-package): Add info file names into a
+ MANIFEST file.
+ (w3mhack-what-where): Show where info files will go.
+ (w3mhack-makeinfo): New function.
+
+2002-11-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/Makefile.in, .cvsignore: New file.
+
+ * doc/emacs-w3m.texi, emacs-w3m-ja.texi: Correct copyright holder.
+
+ * doc/emacs-w3m.texi: Renamed from emacs-w3m-en.texi.
+
+ * doc/txi.tex: Renamed from txi-en.tex.
+
+2002-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Specify coding-system for
+ the waei and kokugo entries. Suggested by Hideyuki SHIRAI.
+
+2002-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * doc/emacs-w3m-en.texi, emacs-w3m-en.texi: Convert to GFDL.
+
+2002-11-27 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+
+ * doc/emacs-w3m-en.texi: New files.
+ * doc/emacs-w3m-ja.texi:
+ * doc/ptexinfmt.el:
+ * doc/texinfo.tex:
+ * doc/txi-en.tex:
+ * doc/txi-ja.tex:
+ * doc/version.texi:
+
+2002-11-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-tabmenu.el (w3m-tab-menubar-update): Do nothing when there's no
+ menubar.
+
+2002-11-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-this-url-1): Keep position when new-session and
+ `w3m-view-this-url-new-session-in-background' is non-nil.
+
+2002-11-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Use `match-string-no-properties'
+ if it exist.
+
+2002-11-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Use an optional argument and the function
+ `interactive' to examine whether it is called interactively instead of
+ the function `interactive-p'. Suggested by TSUCHIYA Masatoshi.
+ (w3m-goto-url-new-session): Ditto.
+ (w3m): Ditto.
+ (w3m-select-buffer-show-this-line): Ditto.
+
+2002-11-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-attributes): Bind `case-fold-search' to t.
+
+2002-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Add some dictionaries.
+ (w3m-search-default-engine): Default to google.
+ (w3m-search-quick-search-engine-alist): Add iij-archie; add
+ customization type.
+ (w3m-search-prefer-japanese-site): New user option.
+ (w3m-search-inhibited-japanese-engines): New user option.
+ (w3m-search-quick-search-engines): New function.
+ (w3m-search-quick-search-handler): Maybe use a Japanese site; use
+ `w3m-search-quick-search-engines' to merge `w-s-engine-alist' and
+ `w-s-quick-search-engine-alist'.
+
+ * w3m.el (w3m): Allow quicksearch urls if interactive.
+
+2002-11-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3.el (w3m-view-this-url-1): Copy `w3m-current-url' into a copied
+ buffer.
+ (w3m-goto-url): Allow the 7th argument `qsearch'; use it to recursive
+ call the function itself if the quicksearch feature is permitted.
+ (w3m-goto-url-new-session): Specify the 7th arg of `w3m-goto-url' if it
+ is called interactively.
+
+2002-11-08 Romain FRANCOISE <romain@orebokech.com>
+
+ * w3m-search.el (w3m-search-engine-alist): Add "google groups".
+ (w3m-search-quick-search-engine-alist): New user option.
+ (w3m-search-quick-search-handler): New function.
+
+ * w3m.el: Autoload `w3m-search-quick-search-handler'.
+ (w3m-goto-url): Use `w3m-search-quick-search-handler' to parse
+ quicksearch url schemes.
+
+2002-11-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el (w3m-bookmark-safe-string): Abolish its 2nd `coding'
+ argument. Instead of it, use the coding system to be used for encoding
+ the buffer contents on saving.
+ (w3m-bookmark-write-file): Follow the above change.
+
+2002-11-06 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-fontify-textareas): Replace textarea string only
+ when form data contains non-nil data.
+
+2002-11-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (toplevel): Added autoload setting for
+ `w3m-fontify-textareas'.
+ (w3m-fontify): Don't remove tag strings in the textareas; Call
+ `w3m-fontify-textareas'.
+
+ * w3m-form.el (w3m-form-treat-textarea-size): New option.
+ (w3m-form-resume): Do nothing if forms is nil.
+ (w3m-fontify-textareas): New function.
+ (w3m-form-parse-and-fontify): Decode entities for form value; Record
+ textarea rows as text property.
+ (w3m-form-parse-and-fontify): Treat CRLF as a newline character.
+ (w3m-form-search-textarea): New function.
+ (w3m-form-textarea-replace): Rewrite.
+ (w3m-form-textarea-info): Ditto.
+
+2002-11-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el (w3m-bookmark-file-coding-system): Fix its docstring.
+ (w3m-bookmark-verify-modtime): Keep buffer modified status.
+ (w3m-bookmark-safe-string): New function.
+ (w3m-bookmark-write-file): Call it to make given strings be safe.
+
+2002-11-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el: Use non-visiting working buffer; Auto-detection of
+ bookmark file coding system.
+ (w3m-bookmark-file-coding-system): Fix its docstring.
+ (w3m-bookmark-buffer-file-name): New internal variable.
+ (w3m-bookmark-mode): Add documents for commands.
+ (w3m-bookmark-mode-setter): Set `default-directory'.
+ (w3m-bookmark-buffer): Use non-visiting working buffer.
+ (w3m-bookmark-sections): Follow the above change.
+ (w3m-bookmark-kill-entries): Likewise.
+ (w3m-bookmark-file-modtime, w3m-bookmark-verify-modtime)
+ (w3m-bookmark-save-buffer): New functions.
+ (w3m-bookmark-write-file): Use it; Stricten check.
+ (w3m-bookmark-add-current-url-group): Call `w3m-bookmark-add' without
+ 2nd argument.
+ (w3m-about-bookmark): Give unique id to sections.
+ (w3m-bookmark-current-number): Follow the above change.
+ (w3m-bookmark-kill-entry): If the bookmark file is reverted, reload it.
+ (w3m-bookmark-undo): Ditto.
+ (w3m-bookmark-edit): New function.
+
+2002-11-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el (w3m-about-bookmark): Fix.
+ (w3m-bookmark-current-number): Return nil on no entry line.
+ (w3m-bookmark-kill-entry): On no entry line, do not call
+ `w3m-bookmark-kill-entries'.
+ (w3m-bookmark-kill-entries): Fix.
+
+2002-11-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-namazu.el (w3m-namazu): Change prompt.
+ (w3m-namazu): Change prompt; Small fix.
+
+ * w3m-bookmark.el: Experimental bookmark editer.
+ (w3m-bookmark-read-file): Removed.
+ (w3m-bookmark-buffer): New function.
+ (w3m-bookmark-sections): Use it.
+ (w3m-bookmark-write-file): Use it; Call `basic-save-buffer'.
+ (w3m-bookmark-view): View about://bookmark/ instead of
+ w3m-bookmark-file directly.
+ (w3m-about-bookmark, w3m-bookmark-current-number)
+ (w3m-bookmark-kill-entry, w3m-bookmark-kill-entries)
+ (w3m-bookmark-undo): New functions.
+ (w3m-bookmark-mode, w3m-bookmark-mode-map): New variables.
+ (w3m-bookmark-mode-hook): New hook.
+ (w3m-bookmark-mode): New minor mode.
+ (w3m-bookmark-mode-setter): New function.
+ (toplevel): Register it to `w3m-display-functions'.
+
+2002-10-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-generate-colon-keywords-file): Protect against
+ unexpected data structure.
+
+2002-10-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-attributes): Remove workaround for servers which do
+ not support HEAD operations.
+
+
+2002-10-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.3 from emacs-w3m-1_3 branch.
+
+2002-10-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (find-charset): Alias to ignore if no-Mule.
+
+2002-10-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-entity-alist): Use `w3m-mule-unicode-p' instead of
+ `w3m-use-mule-ucs'.
+
+ * w3m-xmas.el (w3m-mule-unicode-p): New function.
+
+ * w3m-fsf.el (w3m-mule-unicode-p): New function.
+
+ * w3m-om.el (w3m-mule-unicode-p): Set aliase to `ignore'.
+
+ * w3m-e19.el (w3m-mule-unicode-p): Set aliase to `ignore'.
+
+2002-10-25 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-entity-alist): Support all entities using Mule-UCS.
+
+2002-10-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mew-w3m.el: Cancel the last change. Use `w3m-minor-mode'.
+
+ * mime-w3m.el (mime-w3m-display-inline-images): Fix its docstring.
+ (mime-w3m-safe-url-regexp): Fill its docstring.
+ (mime-w3m-setup-hook): New hook.
+ (mime-w3m-setup): Do not initialize `mime-w3m-mode-map'; Run the above
+ hook.
+ (mime-w3m-mode-map): It is not defined for XEmacs and Emacs21.
+ (mime-w3m-local-map-property): New function.
+ (mime-w3m-preview-text/html): Call it.
+
+ * w3m.el (w3m-key-binding): Cancel the last change.
+ (w3m-region): Change the interactive form; Do not process <base> tag by
+ itself.
+ (w3m-minor-mode-command-alist): Cancel the last change.
+ (w3m-minor-mode-map, w3m-minor-mode-hook, w3m-minor-mode): Revival.
+
+2002-10-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-toggle-inline-images-internal)
+ (w3m-toggle-inline-image, w3m-view-this-url, w3m-view-this-url)
+ (w3m-submit-form, w3m-external-view, w3m-view-image)
+ (w3m-save-image, w3m-view-url-with-external-browser)
+ (w3m-download-this-url, w3m-edit-this-url, w3m-goto-url)
+ (w3m-goto-url-with-timer, w3m-safe-view-this-url)
+ (w3m-safe-view-this-url): Check validity of the URL.
+ (w3m-print-current-url, w3m-edit-current-url): Check `w3m-current-url'.
+
+ * w3m-util.el (w3m-url-fallback-base): Move from `w3m.el'.
+ (w3m-url-invalid-regexp): New constant.
+ (w3m-url-valid): New inline function.
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Remove any properties from
+ `xref'.
+
+2002-10-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (coding-system-list): Use `defalias' and `lambda' instead
+ of `defun'; allow an optional dummy argument; don't ignore `*noconv*'.
+ (read-passwd): Use `defalias' and `lambda' instead of `defun'.
+ (compose-mail): Ditto.
+
+2002-10-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-key-binding): Remove the code to reset
+ `w3m-minor-mode-map'.
+ (w3m-minor-mode-command-alist): Update its docstring.
+ (w3m-minor-mode-map, w3m-minor-mode-hook, w3m-minor-mode): Abolished.
+ (w3m-minor-mode): Removed.
+
+ * mime-w3m.el (mime-w3m-setup): Call `w3m-make-minor-mode-keymap'
+ without using `w3m-minor-mode-map'.
+
+ * mew-w3m.el (mew-use-w3m-minor-mode): Update its docstring.
+ (mew-w3m-minor-mode-map): New variable.
+ (toplevel): Revival the code to add a minor mode.
+ (mew-w3m-minor-mode-setter): Cancel the last change.
+
+2002-10-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-key-binding): Revival the code to reset
+ `mime-w3m-mode-map'.
+
+ * mime-w3m.el (mime-w3m-mode-map): Revival.
+ (mime-w3m-setup): Initialize `mime-w3m-mode-map' based on
+ `w3m-minor-mode-map'; Modify it to set its parent map to
+ `mime-view-mode-default-map'.
+ (mime-w3m-preview-text/html) [XEmacs,Emacs21]: Unify `local-map' as
+ text property.
+
+ * w3m.el (w3m-make-minor-mode-keymap): Call `make-spase-keymap' instead
+ of `make-keymap'.
+
+2002-10-22 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-entity-regexp): As simple regexp. Existance of final
+ semi-collon is to be detected.
+ (w3m-entity-value): 2nd argument STRICT is added. If not STRICT, find
+ entity from db by maxmum length matching, and returns it with appending
+ unused chars. Returns nil if not match. And also use defun instead of
+ defsubst.
+ (w3m-decode-entities): Use new `w3m-entity-value' with 2nd arg.
+
+2002-10-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-minor-mode): Define without `define-minor-mode'.
+ (w3m-minor-mode): Ditto.
+ (w3m-minor-mode-hook): Ditto.
+ (w3m-entity-regexp): Set 3000 to `max-specpdl-size' locally to avoid
+ max-specpdl-size error.
+
+ * w3m-e19.el: Cancel the last change to define `define-minor-mode'.
+ * w3m-fsf.el: Ditto.
+ * w3m-om.el: Ditto.
+
+ * attic/easy-mmode.el: Removed.
+
+2002-10-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e19.el: Require `easy-mmode'; make the alias `define-minor-mode'
+ to `easy-mmode-define-minor-mode'.
+ * w3m-fsf.el: Ditto.
+ * w3m-om.el: Ditto.
+
+ * attic/easy-mmode.el: New file imported from Emacs 20.7.
+
+2002-10-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-lynx-like-map, w3m-info-like-map): Add [tab] for
+ `w3m-next-anchor'.
+ (w3m-safe-view-this-url, w3m-mouse-safe-view-this-url): New command.
+ (w3m-minor-mode-command-alist): New constant.
+ (w3m-make-minor-mode-keymap): New function.
+ (w3m-minor-mode-map): New keymap.
+ (w3m-minor-mode): New function.
+
+ * mime-w3m.el (mime-w3m-mode-map): Abolished.
+ (mime-w3m-mode-command-alist): Abolished.
+ (mime-w3m-mode-dont-bind-keys): Abolished.
+ (mime-w3m-mode-ignored-keys): Abolished.
+ (mime-w3m-setup): Do not initialize `mime-w3m-mode-map'.
+ (mime-w3m-preview-text/html): Use `w3m-minor-mode-map' instead of
+ `mime-w3m-mode-map'.
+ (mime-w3m-view-this-url, mime-w3m-mouse-view-this-url): Removed.
+
+ * mew-w3m.el (mew-w3m-minor-mode): Abolished.
+ (mew-w3m-minor-mode-setter): Call `w3m-minor-mode'.
+
+2002-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e19.el: Cancel last change for providing the base64 codec.
+
+2002-10-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-goto-url): Use 'group:' scheme instead of
+ 'about://group/...'; Use url encoding for the member of URL group
+ instead of base64 encoding.
+
+ * w3m-bookmark.el (w3m-bookmark-add-current-url-group): Follow the
+ change above.
+
+2002-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e19.el: Require `poe' and `path-util'; attempt to define the
+ functions `base64-decode-string' and `base64-encode-string'.
+
+ * w3m-util.el (w3m-display-progress-message): New function.
+ * w3m.el (w3m-goto-url-new-session): Use it.
+ (w3m): Use it.
+
+2002-10-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-goto-url): Process 'about://group/...'.
+
+ * w3m-bookmark.el (w3m-bookmark-add-current-url-group): New function.
+
+2002-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-buffer): Run `w3m-delete-buffer-hook' only when a
+ buffer is killed.
+ (w3m-pack-buffer-numbers): Arrange buffers sequentially from 1 instead
+ of 0.
+ (w3m-select-buffer-next-line): Update gutter tabs for XEmacs.
+ (w3m-select-buffer-delete-buffer): Run `w3m-delete-buffer-hook'.
+
+ * w3m-util.el (w3m-buffer-number): Assume the buffer number has begun
+ from 1 instead of 0.
+ (w3m-buffer-set-number): Ditto.
+ (w3m-buffer-name-lessp): Ditto.
+
+2002-10-19 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-entity-alist): Support Greek.
+
+2002-10-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Display a help message to stop asynchronous
+ process.
+
+2002-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-input-textarea-keymap): Don't bind C-g.
+ (w3m-form-input-select-keymap): Ditto.
+ (w3m-form-input-map-keymap): Ditto.
+
+ * w3m.el (w3m-select-buffer-mode): Add some key descriptions to the
+ doc-string.
+
+2002-10-17 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * icons/db-history-up.xpm: Add missing comma.
+
+2002-07-19 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-symbol.el: New file.
+
+ * w3m.el: Autoload "w3m-symbol" for `w3m-replace-symbol'.
+ (w3m-use-symbol): New variable.
+ (w3m-fontify): Call `w3m-replace-symbol'.
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile
+ w3m-symbol.el if no-MULE.
+
+2002-10-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (w3m-buffer-favicon): Bind local null handler with
+ `w3m-process-with-null-handler' instead of `lexical-let'.
+
+2002-10-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (w3m-process-push, w3m-process-start): Fix last change.
+
+2002-10-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-rendering-half-dump): To decide whether
+ `w3m-treat-image-size' is ignored, use `w3m-display-inline-images-p'
+ instead of `w3m-display-graphic-p'. Thanks to Mito for his report.
+ (w3m-about): Add `witdh' and `height' property to <img> tag.
+
+2002-10-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-emacs-w3m-icon): Use helvetica-bold to widen image.
+
+2002-10-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-lynx-like-map): Don't define key bindings for
+ `w3m-zoom-out-image' and `w3m-zoom-in-image' when emacs-w3m in running
+ in non-graphical display.
+ (w3m-info-like-map): Ditto.
+
+2002-10-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+ Mito <mito@mxa.nes.nec.co.jp>
+
+ * w3m.el (w3m-rendering-half-dump): Ignore `w3m-treat-image-size' when
+ emacs-w3m is running in non-graphical display.
+
+2002-10-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Follow the change of
+ `w3m-process-start'.
+ (w3m-w3m-get-header): Ditto.
+ (w3m-w3m-dump-head-source): Ditto.
+
+ * w3m-image.el (w3m-imagick-convert-async-exec): Abolished.
+ (w3m-imagick-start): Removed.
+ (w3m-imagick-start-convert-buffer): Call `w3m-process-start' instead of
+ the above function.
+
+ * w3m-proc.el (w3m-process-push): Accept `command' argument.
+ (w3m-process-start): Ditto.
+
+2002-10-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-dump-head-source): Do not display the help message
+ when `w3m-process-with-wait-handler' is evaluated.
+ (w3m-make-separator): New function.
+ (w3m-about-header): Use the above function.
+
+ * w3m-proc.el (w3m-process-waited): New variable.
+ (w3m-process-error-handler): New function.
+ (w3m-process-with-wait-handler): Wrap the critical part with
+ `condition-case' to clean running processes up when `quit' signal is
+ occured.
+
+2002-10-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-dump-head-source): Display the message which
+ describes how to stop asynchronous process.
+ (w3m-lynx-like-map): Changed the key binded to `w3m-process-stop' from
+ `C-c C-g' to `C-c C-k'.
+ (w3m-info-like-map): Ditto.
+
+2002-10-08 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp>
+
+ * README.shimbun.ja: Add notice that f1express requires Mule-UCS.
+
+ * README.shimbun.ja: Ditto.
+
+2002-10-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Simplify the code.
+ (w3m-resize-inline-image-internal): Remove an existing bitmap image
+ first.
+
+ * w3m-bitmap.el (w3m-bitmap-image-insert): Replace
+ `insert-before-markers' with `insert' (return to the state before
+ 2002-04-15).
+
+2002-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-create-resized-image): Return nil when resizing is
+ failed; set buffer multibyte before converting xbm to bitmap.
+
+ * w3m-xmas.el (w3m-create-resized-image): Return nil when resizing is
+ failed.
+
+ * w3m-image.el (w3m-resize-image-by-rate): Undo last change.
+
+2002-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-create-resized-image): New function.
+
+ * w3m-e19.el (w3m-create-resized-image): Alias to `ignore'.
+ * w3m-e20.el (w3m-create-resized-image): Alias to `ignore' if the
+ BITMAP-MULE is not available.
+ * w3m-om.el (w3m-create-resized-image): Ditto.
+
+ * w3m-image (w3m-resize-image-by-rate): Limit the minimum scale.
+
+ * w3m.el (w3m-resize-inline-image-internal): Remove an existing image
+ only for XEmacs.
+
+2002-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-create-resized-image): New function.
+
+ * w3m.el (w3m-resize-inline-image-internal): Remove an existing image
+ before resizing.
+
+2002-10-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-favicon-type): New user variable.
+ (w3m-setup-favicon): Check `w3m-favicon-type'.
+ (w3m-buffer-favicon): Convert image to `w3m-favicon-type' instead of
+ 'xpm.
+
+2002-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-filter.el (w3m-filter-server-regexp): Fix the value; translate
+ the comment into English.
+
+2002-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-lynx-like-map): Bind key M-] to `w3m-zoom-in-image'; bind
+ key M-[ to `w3m-zoom-out-image'.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Document those new keys.
+
+2002-09-30 KURODA Chihiro <chee@iijmio-mail.jp>
+
+ * w3m.el (w3m-resize-image-scale): New user option.
+ (w3m-toggle-inline-image): Call `w3m-zoom-in-image' without resizing.
+ (w3m-resize-inline-image-internal): New inline function.
+ (w3m-zoom-in-image): New command.
+ (w3m-zoom-out-image): New command.
+
+ * w3m-util.el (w3m-image-scale): New macro.
+
+ * w3m-image.el (w3m-resize-image-by-rate): New function.
+
+ * w3m-e21.el (w3m-create-resized-image): New function.
+
+2002-09-21 Kahlil HODGSON <dorge@tpg.com.au>
+
+ * w3m.el (ffap-url-regexp): Make sure it is non-nil.
+
+2002-09-27 Katsumi Yamaoka <yamaoka@jpl.org>
+ Follow the change in Gnus.
+
+ * mime-w3m.el (mime-w3m-mode-ignored-keys): New variable.
+ (mime-w3m-setup): Use it.
+
+2002-09-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-lynx-like-map): Unbind the key "N" to the command
+ `w3m-namazu' in order to avoid binding collision to
+ `w3m-view-next-page'. Thanks to Satoshi TAOKA for his report.
+ (w3m-mode): Fix its docstring for `w3m-antenna-add-current-url'.
+ Thanks to Satoshi TAOKA and Yoichi NAKAYAMA for the advice.
+
+2002-09-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Ignore byte-compile warnings for the dummy autoloads,
+ mis-judging of cl run-time functions and the obsoleteness of
+ `make-local-hook' under Emacs CVS.
+
+2002-09-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Do not compile `mew-shimbun.el'
+ with old Mew.
+
+ * mew-w3m.el (top): Avoid byte-compile error and warning for old
+ Mew. Do not push 'mew-w3m-cid-retrieve' for old Mew.
+
+2002-09-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-setup): Use 0 instead of nil as the initial value
+ for the new obarray.
+
+ * w3m-filter.el (w3m-filter-setup): Use 0 instead of nil as the initial
+ value for the new obarray.
+
+2002-09-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-mode): Fix typo in its docstring.
+
+2002-09-20 Kahlil HODGSON <dorge@tpg.com.au>
+
+ * w3m.el (w3m-fontify-bold): Permit class attributes, newlines or
+ whitespaces in the tag.
+ (w3m-fontify-underline): Ditto.
+
+2002-09-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-treat-drive-letter): New constant.
+ (w3m-url-to-file-name): Check `w3m-treat-drive-letter'.
+
+ * w3m-dtree.el (w3m-dtree-directory-name): Check
+ `w3m-treat-drive-letter'.
+
+2002-09-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-filter.el (w3m-filter-rules): Add 'assahi shimbun' rule.
+ (w3m-filter-asahi-shimbun): New function.
+
+2002-09-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-setup): Check new entries registered in
+ `w3m-antenna-sites'.
+ (w3m-antenna-shutdown): Return the value of `w3m-antenna-alist'.
+ (w3m-antenna-check-all-sites): Simplified.
+ (w3m-about-antenna): Do not call `w3m-antenna-setup'.
+
+
+2002-09-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.2 from emacs-w3m-1_3 branch.
+
+ * w3m.el (w3m-init-file): Changed its default value.
+
+ * Makefile.in (PACKAGE): Use `emacs-w3m' instead of `w3m_el'.
+
+ * w3m-antenna.el (w3m-antenna-make-summary-function): Use
+ `function-item' instead of `const'.
+ (w3m-antenna-sort-changed-sites-function): Ditto.
+ (w3m-antenna-sort-unchanged-sites-function): Ditto.
+ (w3m-antenna-hns-last-modified): Asynchronized.
+ (w3m-antenna-last-modified): Removed.
+ (w3m-antenna-check-site): New function
+ (w3m-antenna-check-site-after): New function.
+ (w3m-antenna-check-sites): Removed.
+ (w3m-antenna-check-all-sites): New function.
+ (w3m-about-antenna): Asynchronized.
+ (w3m-about-antenna-edit): Reset post-data after its content is
+ displayed.
+ (w3m-antenna-edit-reset-post-data): New function.
+
+2002-09-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-init-file): Changed its default value.
+ (toplevel): When Emacs is running without interactive terminal, do not
+ load the startup file and do not evaluate `w3m-load-hook'. Load a byte
+ compiled startup file safely.
+
+2002-09-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mailto-url-popup-function-alist): New user option.
+ (w3m-view-this-url-1): Don't save a window configuration for mailto
+ urls here.
+ (w3m-goto-mailto-url): Save a window configuration while composing a
+ mail message; popup a mail window if the major-mode of a mail buffer
+ matches to `w3m-mailto-url-popup-function-alist'.
+
+2002-09-01 Andrew M. Scott <ascott@sedona.ch.intel.com>
+
+ * w3m-weather.el (w3m-weather-default-area): Fix typo in its docstring.
+
+2002-08-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Provide the feature `w3m' before loading an init file or
+ evaluating `w3m-load-hook'. Suggested by Seiichi NAMBA
+ <sn@asahi-net.email.ne.jp>.
+
+2002-08-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-init-file, w3m-load-hook): New option.
+ (toplevel): Load `w3m-init-file' and run `w3m-load-hook'.
+
+2002-08-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el: Require `custom' for Emacs 19 because of the function
+ `custom-initialize-set'.
+
+2002-08-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Clean up hook options.
+ (toplevel): Define the dummy function of `w3m-update-tab-line'.
+ (w3m-mode-hook, w3m-fontify-after-hook, w3m-select-buffer-hook): Clean
+ up its default value to nil.
+ (w3m-display-hook, w3m-delete-buffer-hook): Minimize its default value
+ and use `w3m-custom-hook-initialize' as the initialize function.
+ (w3m-arrived-setup-hook, w3m-arrived-shutdown-hook): Abolished.
+ (w3m-arrived-setup-functions, w3m-arrived-shutdown-functions,
+ w3m-mode-setup-functions, w3m-display-functions): New interanal
+ variables.
+ (w3m-arrived-setup): Refer `w3m-arrived-setup-functions' instead of
+ `w3m-arrived-setup-hook'.
+ (w3m-arrived-shutdown): Refer `w3m-arrived-shutdown-functions' instead
+ of `w3m-arrived-shutdown-hook'.
+ (w3m-fontify): Call `w3m-header-line-insert' by itself.
+ (w3m-next-buffer, w3m-delete-buffer, w3m-delete-other-buffers): Call
+ `w3m-select-buffer-update' by itself.
+ (w3m-clean-hook-options): New function.
+ (w3m-mode): Call `w3m-clean-hook-options', and run functions registered
+ to `w3m-mode-setup-functions'.
+ (w3m-goto-url): Call `w3m-select-buffer-update' by itself, and Run
+ functions registered to `w3m-display-functions'.
+ (w3m-select-buffer-update): Call `w3m-update-tab-line'.
+
+ * w3m-util.el (w3m-custom-hook-initialize): New function.
+
+ * w3m-xmas.el: Cancel the last change and refer `w3m-display-functions'
+ instead of `w3m-display-hook'.
+
+ * w3m-e21.el (toplevel): Add `w3m-setup-favicon' to
+ `w3m-display-functions', `w3m-favicon-load-cache-file' to
+ `w3m-arrived-setup-functions', `w3m-favicon-save-cache-file' to
+ `w3m-arrived-shutdown-functions', and add `w3m-setup-header-line' and
+ `w3m-setup-widget-faces' to `w3m-mode-setup-functions'
+
+ * w3mhack.el (w3mhack-load-path) [Mule]: Add the path of bitmap.el to
+ `load-path'.
+
+ * w3m.el (w3m-select-buffer-hook): Renamed from
+ `w3m-change-buffer-hook'.
+ (w3m-next-buffer): Accept a numerical argument.
+ (w3m-previous-buffer): Accept a numerical argument, and call
+ `w3m-next-buffer'.
+ (w3m-delete-buffer): Call `w3m-next-buffer' instead of
+ `w3m-previous-buffer'.
+
+ * w3m.el (w3m-delete-buffer-hook): Change its default value.
+ (w3m-change-buffer-hook): New option.
+ (w3m-delete-other-buffers-hook, w3m-previous-buffer-hook,
+ w3m-next-buffer-hook): Abolished.
+ (w3m-next-buffer): Run `w3m-change-buffer-hook' instead of
+ `w3m-next-buffer-hook'.
+ (w3m-previous-buffer): Run `w3m-change-buffer-hook' instead of
+ `w3m-previous-buffer-hook'.
+ (w3m-delete-buffer): Not call `w3m-select-buffer-update', which is
+ added to `w3m-delete-buffer-hook'.
+ (w3m-delete-other-buffers): Likewise. Run `w3m-delete-buffer-hook'
+ instead of `w3m-delete-other-buffers-hook'.
+
+2002-08-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (toplevel): Remove expressions to register hook functions to
+ `w3m-delete-buffer-hook', `w3m-delete-other-buffers-hook',
+ `w3m-display-hook', and `w3m-fontify-after-hook'.
+ (w3m-mode-hook, w3m-fontify-after-hookk, w3m-display-hook,
+ w3m-arrived-setup-hook, w3m-arrived-shutdown-hook,
+ w3m-delete-buffer-hook, w3m-delete-other-buffers-hook,
+ w3m-previous-buffer-hook, w3m-next-buffer-hook): Changed their default
+ values to avoid inconsistency of their customize.
+ (w3m-toolbar): Fix its help messages.
+ (w3m-arrived-file, w3m-keep-arrived-urls, w3m-db-history-display-size):
+ Fix their docstrings.
+ (w3m-history): Moved to avoid a byte compile warning.
+
+ * w3m-xmas.el (toplevel): Remove an expression to register
+ `w3m-xmas-update-tab-in-gutter' to `w3m-display-hook'.
+ (w3m-xmas-show-current-title-in-buffer-tab): Remove expressions to
+ handle `w3m-display-hook' from the form to change its value.
+
+ * w3m-e21.el (toplevel): Remove expressions to register hook functions
+ to `w3m-display-hook', `w3m-arrived-setup-hook',
+ `w3m-arrived-shutdown-hook', `w3m-mode-hook', `w3m-fontify-after-hook',
+ `w3m-next-buffer-hook', `w3m-previous-buffer-hook',
+ `w3m-delete-buffer-hook' and `w3m-delete-other-buffers-hook'.
+
+2002-08-28 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-delete-buffer-hook): New hook.
+ (w3m-other-delete-buffers-hook): Ditto.
+ (w3m-previous-buffer-hook): Ditto.
+ (w3m-next-buffer-hook): Ditto.
+ (w3m-view-this-url-new-session-in-background): Fixed docstring.
+ (w3m-next-buffer): Run `w3m-next-buffer-hook'.
+ (w3m-previous-buffer): Run `w3m-previous-buffer-hook'.
+ (w3m-delete-buffer): Run `w3m-delete-buffer-hook'.
+ (w3m-delete-other-buffers): Run `w3m-delete-other-buffers-hook'.
+ (w3m-pack-buffer-numbers): New function.
+ (w3m-delete-buffer-hook): Add `w3m-pack-buffer-numbers'.
+ (w3m-delete-other-buffer-hook): Add `w3m-pack-buffer-numbers'.
+
+ * w3m-util.el (w3m-buffer-number): New inline function.
+ (w3m-buffer-set-number): Ditto.
+
+ * w3m-e21.el (w3m-update-tab-line): New function.
+ (w3m-mode-hook): Add `w3m-update-tab-line'.
+ (w3m-fontify-after-hook): Ditto.
+ (w3m-previous-buffer-hook): Ditto.
+ (w3m-next-buffer-hook): Ditto.
+ (w3m-delete-buffer-hook): Ditto.
+ (w3m-delete-other-buffers-hook): Ditto.
+ (w3m-tab-width): Changed default value to 16.
+ (w3m-tab-line): Calculate tab width dynamically.
+
+2002-08-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-output-coding-system, w3m-halfdump-command-arguments):
+ Use 'utf-8 when `w3m-m17n' with Mule-UCS environment.
+ (w3m-charset-coding-system-alist): Add Windows Code Point.
+ (w3m-current-content-charset): New buffer-local variable.
+ (w3m-clear-local-variables, w3m-copy-local-variables): Handle it.
+ (w3m-decode-buffer): Set `w3m-current-content-charset'.
+ (w3m-rendering-half-dump): Use `w3m-current-content-charset' when
+ `w3m-m17n' or `w3mmee'.
+
+2002-08-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-lynx-like-map): Change the key `C-c w' to `C-c M-w' for
+ the command `w3m-delete-other-buffers'.
+ (w3m-info-like-map): Ditto.
+
+2002-08-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (emacs-w3m-version): Reset for development series toward
+ emacs-w3m-1.4.
+
+2002-08-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-history): Call `w3m-db-history' instead of goto
+ `about://db-history/'.
+
+2002-08-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-delete-other-buffers): New user command.
+ (w3m-lynx-like-map): Bind the key `C-c w' to the command
+ `w3m-delete-other-buffers'.
+ (w3m-info-like-map): Ditto.
+ (w3m-select-buffer-mode-map): Bind the key to the command
+ `w3m-select-buffer-delete-other-buffers'.
+ (w3m-select-buffer-delete-other-buffers): New user command.
+
+2002-08-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-check-header-tags): Ignore case of tags.
+ (w3m-about-db-history): Accept range specification in URL.
+ (w3m-db-history-display-size): New option.
+ (w3m-db-history): Refer it.
+
+ * w3m-antenna.el (w3m-antenna-html-skeleton): Add link to
+ about://antenna-edit/.
+ (w3m-about-antenna-edit): New function. This is an experimental
+ imprement of the editor for Antenna sites.
+
+2002-08-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (char-after): Byte-optimize it for old Emacsen.
+ (char-before): Ditto.
+
+2002-08-23 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-view-this-url-new-session-in-background): New user
+ option.
+ (w3m-view-this-url-1): Use it; enclose `w3m-goto-url' with
+ `save-window-excursion'.
+
+ * w3m-form.el (w3m-form-resume): Confirm `value' for text form is a
+ string.
+
+2002-08-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (ffap-url-regexp): Fix last change.
+
+2002-08-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (ffap-url-regexp): Modify the value to make it match to nntp
+ urls.
+
+2002-08-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (very-slow): New rule.
+
+ * attic/addpath.el: New file.
+
+2002-08-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el: Require `cl' when compiling to provide the function
+ `gensym'. It is needed to byte-compile this file alone because of the
+ w3m-proc macros.
+ * w3m-image.el: Ditto.
+ * w3m-bitmap.el: Don't bother to load cl-macs.
+
+2002-08-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-display-message-enable-logging): New variable.
+ (w3m-display-message): Use it.
+
+2002-08-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-retrieve-1): Do not make error but return nil, even
+ if decoding is failed.
+
+2002-08-08 Nishimoto Masaki <nishimoto@gaju.org>
+
+ * w3m-proc.el (w3m-process-with-environment): Copy
+ `process-environment' before `getenv' is called, in order to avoid
+ putting side effects to environment variables.
+
+2002-07-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-ucs-to-char): Return char for tilde by default.
+
+
+2002-07-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3.1 from emacs-w3m-1_3 branch.
+
+2002-07-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (toplevel): Bind `mime-preview-condition' to avoid
+ byte-compile warnings.
+ (mime-w3m-insinuate): Install code to overwrite
+ `mime-preview-condition' which is already initialized before this
+ functions is called.
+
+2002-07-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-image-viewer): New option.
+ (w3m-content-type-alist): Refer it.
+
+2002-07-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decoder-alist): Don't examine the existence of w3m
+ command when compiling.
+ (w3m-dirlist-cgi-program): Ditto.
+
+2002-07-09 Hironori FUJII <fujii@chi.its.hiroshima-cu.ac.jp>
+
+ * w3m.el (w3m-highlight-current-anchor): Don't infloop at the beginning
+ of a buffer.
+
+2002-07-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-perldoc.el (w3m-about-perldoc): Install workaround to specify the
+ place in which pod2html generates its cache files. Adjust links
+ pointing other perldocs.
+
+2002-07-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mode): Make `list-buffers-directory' to buffer local
+ variable.
+ (w3m-goto-url): Set title of the URL to `list-buffers-directory'.
+
+ * w3m-tabmenu.el (w3m-switch-buffer): Bind `completion-ignore-case' to
+ `t'.
+
+2002-07-08 OKAZAKI Tetsurou <okazaki@be.to>
+
+ * configure.in: Use `AC_PATH_EMACS' instead of `AC_CHECK_EMACS'.
+
+ * aclocal.m4 (AC_PATH_EMACS): New macro.
+ (AC_CHECK_EMACS): Removed.
+
+
+2002-07-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.3 from emacs-w3m-1_3 branch.
+
+2002-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (byte-optimize-form-code-walker): Advise to make it
+ optimize throughout the and/or forms.
+ (max-specpdl-size): Increase the value by 5 times for Mule 2.
+
+2002-07-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-accept-japanese-characters): Don't call the external
+ command when compiling.
+ (examining the value for `w3m-command'): Ditto.
+
+2002-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-lynx-like-map): Use the key `(control space)' instead of
+ `C- ' for the command `w3m-history-store-position' under XEmacs.
+
+2002-06-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-nonunix-lispdir): New option.
+ (w3mhack-nonunix-icondir): Ditto.
+ (w3mhack-nonunix-dryrun): Ditto.
+ (w3mhack-nonunix-install): New function.
+
+2002-06-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (DOCS): Add `TIPS'.
+
+2002-06-26 Ando Tsutomu <ando-tom@ff.iij4u.or.jp>
+
+ * w3m-weather.el (w3m-weather-completion-table): Fix typo.
+
+2002-06-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-info-like-map): Remove redundant code.
+
+2002-06-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Put `w3m-name-anchor' property to
+ point-max().
+ (w3m-fontify): Remove `w3m-name-anchor' handling.
+ (w3m-search-name-anchor): Move in the screen.
+
+2002-06-26 Tadashi Watanabe <watanabe@sigmaitec.co.jp>
+
+ * w3m.el (w3m-info-like-map): Don't use FSF Emacs style key format for
+ XEmacs.
+
+2002-06-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (toplevel): Stricten the pattern to detect w3m version.
+ (w3m-info-like-map): Changed key bindings of `w3m-shift-left' and
+ `w3m-shift-right'.
+
+2002-06-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-ange-ftp): Chenged its default value to nil.
+
+2002-06-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-retrieve-1): Specify -no-cookie option only when the
+ w3m command is configured to accept it.
+
+2002-06-20 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-type-filter-alist): Fixed parenthesis.
+ (octet-filter-call1, octet-filter-call2, octet-filter-call2-extra):
+ Enclose call-process with as-binary-process.
+
+2002-05-31 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * octet.el (octet-find-file): Bind `buffer-read-only', only while
+ calling `octet-buffer'.
+
+
+2002-06-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.8 from emacs-w3m-1_2 branch.
+
+2002-06-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el: Require `w3m-e19' for Emacs 19 to be able to compile this
+ module alone.
+
+2002-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el (w3m-search): Don't extract a default word from the
+ header line.
+
+2002-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-header-line-insert): Use the property `keymap' instead of
+ `local-map' for the recent Emacsen; add a help echo; fix a typo.
+
+ * w3m-xmas.el (w3m-setup-header-line): Remove.
+
+2002-06-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e19.el: Remove many emulating functions on the condition that
+ APEL should be used; require `cl' only when compiling; require
+ `pcustom' instead of `custom'.
+ (compose-mail): New function.
+ (read-passwd): Autoload "ange-ftp".
+
+ * w3m-proc.el (read-passwd): Autoload "w3m-e19" for Emacs 19.
+
+ * w3m-util.el (cancel-timer): Autoload "timer" for not only Mule 2 but
+ also Emacs 19.
+
+ * w3m.el: Require `w3m-e19' for Emacs 19.
+
+ * w3mhack.el (w3mhack-emacs-major-version): New constant.
+ (TopLevel): Silence the byte-compiler for not only Mule 2 but also
+ Emacs 19.
+ (w3mhack-mdelete): New function.
+ (w3mhack-examine-modules): Use it to make the code simple.
+ (w3mhack-generate-colon-keywords-file): Be sure to go to the beginning
+ of each file before looking for colon keywords (I noticed that
+ `insert-file-contents' doesn't always position point to the top).
+
+ * README.ja: Update for the use of Emacs 19.
+
+2002-05-30 Kevin Rodgers <kevin.rodgers@ihs.com>
+
+ NOTE: The following changes have been posted to the emacs-w3m
+ mailing list, they were not installed in the CVS repository at the
+ time. The original article has been archived in:
+
+ http://emacs-w3m.namazu.org/ml/msg03472.html
+
+ * w3m-e19.el: New file.
+
+ * w3m.el: Require `w3m-e19' for Emacs 19.
+ (w3m-key-binding): Replace the widget `other' with `const'.
+
+ * w3mhack.el (w3mhack-examine-modules): Include w3m-e19.el in the
+ listing for Emacs 19.
+
+ * README: Update for the use of Emacs 19.
+
+2002-06-13 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-prepare-content): When cdr of
+ `w3m-content-prepare-functions' element is not function, call
+ `w3m-prepare-content' recursively.
+ (w3m-content-prepare-functions): Add "application/xhtml+xml" entry.
+
+2002-06-12 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-uri-replace-alist): New user option.
+ (w3m-uri-replace): New function.
+ (w3m-goto-url): Call `w3m-uri-replace'.
+
+2002-06-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-e21.el (w3m-ucs-to-char): Don't define it when already defined.
+
+ * w3m-xmas.el (w3m-ucs-to-char): Ditto.
+
+
+2002-06-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.7 from emacs-w3m-1_2 branch.
+
+ * w3m-weather.el: Require CL when this module is byte-compiled.
+ (w3m-weather-completion-table): Fix typos, which are noticed by Ando
+ Tsutomu <ando-tom@ff.iij4u.or.jp> in [emacs-w3m:03487].
+
+2002-05-31 Mito <mito@mxa.nes.nec.co.jp>
+
+ * w3m-weather.el (w3m-weather-completion-table): Fix "niigata-kaetsu".
+
+2002-05-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-make-ccl-coding-system): Make it recallable for the
+ existing coding-systems (we can now reload w3m.elc under XEmacs 21.5-b6
+ and later).
+
+2002-05-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-retrieve-1): Don't decode the contents when redirect.
+
+2002-05-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (define-ccl-program): Remove advice when non-MULE. It
+ might be specified by pccl.elc if it has been mis-compiled for XEmacs
+ with MULE.
+
+ * w3m.el (w3m-delete-frame-maybe): Don't delete the current frame if it
+ is the sole frame in the screen.
+
+2002-05-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (unicode-to-char): Shut XEmacs 21.5-b5 and earlier up
+ when compiling.
+
+2002-05-28 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-e21.el (w3m-ucs-to-char): New function.
+
+ * w3m-xmas.el (w3m-ucs-to-char): New function for XEmacs-21.5.
+
+2002-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (tarball): Chmod 755 configure.
+
+2002-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-auto-show): Check multiple command like a
+ `previous|next-line' or `beginning|end-of-buffer' at the buffer's edge.
+ (w3m-window-hscroll): New function to rescue for XEmacs with Mule.
+ (w3m-current-column, w3m-set-window-hscroll): Chenge method of the
+ calculation point. the difference points.
+ (w3m-horizontal-scroll, w3m-horizontal-on-screen)
+ (w3m-horizontal-recenter): Use `w3m-window-hscroll'.
+ (w3m-redisplay-this-page): Don't handle store|restore position.
+ (w3m-goto-url): If reload or redisplay, restore position of history.
+
+2002-05-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-after-cursor-move-hook): Add `w3m-auto-show'.
+ (w3m-auto-show, w3m-horizontal-scroll-division): New options.
+ (w3m-next-anchor, w3m-previous-anchor, w3m-next-form)
+ (w3m-previous-form, w3m-next-image, w3m-previous-image): Call
+ `w3m-horizontal-on-screen'.
+ (w3m-mode): Bind many variables for automatic scrolling when
+ `w3m-auto-show' is non-nil.
+ (w3m-scroll-left, w3m-scroll-right, w3m-shift-left)
+ (w3m-shift-right): Call `w3m-horizontal-scroll'.
+ (w3m-horizontal-scroll-done): New buffer local variable.
+ (w3m-current-position): Modify initial value.
+ (w3m-auto-show, w3m-horizontal-scroll, w3m-horizontal-on-screen): New
+ functions.
+ (w3m-horizontal-recenter, w3m-beginning-of-line)
+ (w3m-end-of-line): Use `w3m-set-window-hscroll' and
+ `w3m-current-column'.
+ (w3m-store-current-position): Set markers of beginning of line and end
+ of line.
+ (w3m-check-current-position): Check car of `w3m-current-position'.
+ (w3m-current-column, w3m-set-window-hscroll): New functions to rescue
+ for XEmacs with Mule.
+
+2002-05-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-replace): Don't pad the form slot with spaces
+ if a string is longer than that width.
+
+2002-05-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-p): Move its definition in order to avoid
+ byte-compile warning.
+
+ * Makefile.in (default, what-where): Change order.
+
+2002-05-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Modify the error message that XEmacs APEL package
+ versions 1.23 and later can barely be used to run emacs-w3m.
+
+2002-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mode): Suppress compile warning under old Emacsen.
+
+ * Makefile.in (what-where): New rule.
+
+ * w3mhack.el (w3mhack-what-where): New function.
+ (locate-library): Make the function silent for Mule first.
+
+2002-05-13 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-horizontal-shift-columns): New user option.
+ (w3m-shift-left, w3m-shift-right): New commands.
+ (w3m-lynx-like-map, w3m-info-like-map): Add keybind `w3m-shift-left'
+ and `w3m-shift-right'.
+ (w3m-mode): Modify doc-string for new commands. Bind `auto-show-mode'
+ to nil.
+
+2002-05-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-add-arrived-db): Force update the page.
+
+2002-05-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug-system-informations): Don't include
+ useless infos; eval the value for each time to load it.
+ (report-emacs-w3m-bug): Bind `print-length' and `print-level' with nil.
+
+2002-05-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-menubar): Modify the label for report-emacs-w3m-bug.
+ (w3m-lynx-like-map): Replace the key `C-c C-b' with `C-c C-v' for
+ `w3m-history-restore-position'; replace the key `C-c b' with `C-c C-b'
+ for `report-emacs-w3m-bug'.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Add a document for `report-emacs-w3m-bug'.
+
+ * w3mhack.el: Check for the validity on APEL also for XEmacs with MULE.
+
+ * w3m-bug.el (report-emacs-w3m-bug-system-informations): Add
+ (featurep 'mule) and (featurep 'file-coding).
+
+2002-05-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-download): Modify string of the prompt.
+ (w3m-prepare-content): Add 5th optional argument `retry'. If not
+ determine content-type, ask its.
+
+2002-04-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug): Bind `after-load-alist' to nil
+ while loading the file itself; examine system info in the `w3m-mode'
+ buffer.
+
+2002-04-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-bug.el (report-emacs-w3m-bug-system-informations): Add
+ `mule-version' and `Meadow-version'.
+ (report-emacs-w3m-bug): Fix when info is a function.
+
+ * w3m.el (w3m-menubar): Add many functions.
+
+2002-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bug.el: New file.
+
+ * w3m.el: Autoload "w3m-bug" for `report-emacs-w3m-bug'.
+ (w3m-lynx-like-map): Bind `report-emacs-w3m-bug' to C-cb.<
+ (w3m-info-like-map): Ditto.
+
+ * w3m-om.el (compose-mail): New function.
+
+ * w3mhack.el: Check for the validity on APEL.
+
+2002-04-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-arrived-modify): New function.
+ (w3m-local-attributes): If set Content-type in arrived DB, return it.
+ (w3m-redisplay-this-page, w3m-redisplay-and-reset)
+ (w3m-redisplay-with-content-type): New commands.
+ (w3m-redisplay-with-charset): Use `w3m-arrived-modify'.
+ (w3m-lynx-like-map): Bind all new commands and modify bind for
+ `w3m-redisplay-with-charset'.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Document them.
+ (w3m-goto-url): If reload is 'redisplay, do redisplay only. Modify
+ content-type decided method at local URL.
+ (w3m-about-header): Display `Modifer Information'.
+ (w3m-header-line-insert): Display modifers when type are setting.
+
+2002-04-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-horizontal-recenter): New command.
+ (w3m-beginning-of-line): New command.
+ (w3m-end-of-line): New command.
+ (w3m-lynx-like-map): Bind them.
+ (w3m-info-like-map): Bind them.
+ (w3m-mode): Document them.
+
+2002-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-face-inherit): Default to t.
+
+ * w3m-om.el (w3m-om-use-overstrike-to-make-face-bold): New var.
+ (custom-declare-face): Advise it to use `set-face-bold-p' to make faces
+ bold by overstriking.
+
+ * w3m-util.el (w3m-default-face-colors): New constant.
+ * w3m.el (w3m-bold-face, w3m-underline-face): Use it.
+
+2002-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-insert): Don't put the transparent
+ face except for Emacs 20.
+
+ * w3m.el (w3m-key-binding): Don't manipulate key bindings if w3m.elc
+ has not been loaded (it will fix the problem that the face colors might
+ not be specified under Mule 2).
+
+2002-04-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-transparent-face): Remove.
+ (w3m-bitmap-image-insert): Use the list form instead of
+ `w3m-bitmap-transparent-face' to make the overlay transparent.
+
+2002-04-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-bitmap.el (w3m-bitmap-convert-arguments)
+ (w3m-bitmap-image-face-inherit): New customize values.
+ (w3m-create-image): Append argument `w3m-bitmap-convert-arguments' when
+ call `w3m-imagick-start-convert-buffer'.
+ (w3m-insert-image): If `w3m-bitmap-image-face-inherit' is non-nil,
+ inherit the face of bitmap image from the face of text at point.
+
+2002-04-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (distclean): Remove autom4te*.cache rather than
+ autom4te.cache.
+
+ * w3m-bitmap.el (w3m-bitmap-transparent-face): New face.
+ (w3m-bitmap-image-insert): Put `w3m-bitmap-transparent-face' to
+ overlays; don't use overlays to highlight bitmap images.
+ (w3m-insert-image): Add `w3m-bitmap-image-face' to a bitmap image as a
+ text property.
+
+2002-04-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Call `w3m-insert-image'
+ with the url of image.
+
+ * w3m-xmas.el (w3m-insert-image): Add dummy argument.
+
+ * w3m-e21.el (w3m-insert-image): Add dummy argument.
+
+ * w3m-bitmap.el (w3m-bitmap-cache-image-hook): New hook.
+ (w3m-create-image): Run `w3m-bitmap-cache-image-hook' with `url' when
+ use the cached image.
+ (w3m-insert-image): Add 4th argument `url'. Do nothing which have no
+ 'w3m-image property or differ its url.
+
+2002-04-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ Make emacs-w3m can be compiled by `make slow' with no warnings.
+ * Makefile.in (slow): Don't echo the values for EMACS and FLAGS.
+ * octet.el: Require `w3m-util' for `w3m-insert-string'.
+ * w3m-bitmap.el: Autoload w3m-om for `move-to-column-force'.
+ * w3m-hist.el: Load w3m-kwds.el for old Emacsen.
+ * w3m-image.el: Require `pcustom' for old Emacsen; bind some external
+ vars when compiling.
+ * w3m.el: Enclose the definitions for `w3m-current-title' and
+ `w3m-current-url' with `eval-and-compile', and move them forward.
+ (w3m-url-at-point): Enclose with `eval-and-compile'.
+ (w3m-add-local-hook): Ditto.
+ (w3m-about-retrieve): Call `base64-decode-string' indirectly to avoid
+ compile warn under old Emacsen.
+
+ * w3m-util.el (w3m-insert-string): Fix doc-string.
+
+2002-04-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-region): Call `w3m-process-stop' first.
+
+ * mew-w3m.el (mew-w3m-view-inline-image): Toggle
+ `mew-w3m-auto-insert-image'.
+ (mew-w3m-cid-retrieve-hook): New customize hook.
+ (mew-w3m-cid-retrieve): Run `mew-w3m-cid-retrieve-hook'.
+
+2002-04-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-insert-string): Prevent doubling expansion on the
+ arg.
+
+2002-04-20 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * mime-w3m.el (mime-w3m-cid-retrieve): Use `w3m-insert-string' instead
+ of `insert' to prevent multibyte/unibyte problems.
+ * octet.el (mime-preview-octet, mime-view-octet): Ditto.
+
+ * w3m-util.el (w3m-insert-string): Moved from shimbun/shimbun.el.
+
+2002-04-20 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-attributes): Set type to downcase.
+
+2002-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-header): Don't use `make-string' to make a
+ separator text under Mule.
+
+2002-04-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Support w3m-bitmap.el when
+ retrieve `cid image' (Mew cache has multibyte strings, but work buffer
+ is unibyte).
+
+2002-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (TopLevel): Not to get the byte-code for `current-column'
+ inlined under old Emacsen.
+
+ * w3m-bitmap.el (w3m-bitmap-emacs-broken-p): Use
+ `ad-Orig-current-column' rather than `current-column' if it has already
+ been defined.
+ (TopLevel): Not to get the byte-code for `current-column' inlined under
+ the broken Emacsen in case when compiling manually.
+
+2002-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (TopLevel) Require `cl' and possibly load cl-macs. The
+ following changes are for old Emacsen.
+ (w3m-bitmap-emacs-broken-p): New constant.
+ (TopLevel): Warn if Emacs has a bug on managing column numbers.
+ (w3m-bitmap-move-to-column): Allow the 3rd arg `strictly'; don't modify
+ the buffer contents unless the 3rd arg has been set.
+ (w3m-bitmap-defadvice-if-broken): New macro; use it to advise the
+ functions `current-column', `move-to-column', `move-to-column-force',
+ `next-line' and `previous-line' to work under the broken Emacsen.
+ (w3m-bitmap-byte-indexed-characters-p): Remove.
+ (TopLevel): Don't alias `w3m-bitmap-current-column' to
+ `current-column'; don't alias `w3m-bitmap-move-to-column-force' to
+ `move-to-column-force'.
+ (w3m-bitmap-substitute-key-definitions): Remove.
+ (w3m-bitmap-image-insert): Replace `w3m-bitmap-current-column' with
+ `current-column'; replace `w3m-bitmap-move-to-column-force' with
+ `move-to-column-force'.
+ (w3m-bitmap-image-delete-internal): Ditto.
+
+ * w3m-om.el (move-to-column-force): New function using
+ `move-to-column-strictly'.
+
+2002-04-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-next-line): Handle `temporary-goal-column'.
+
+2002-04-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-halfdump-command-arguments): Fix last change.
+
+2002-04-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-byte-indexed-characters-p): New macro. The
+ following changes are for old Emacsen.
+ (w3m-bitmap-move-to-column): New function.
+ (w3m-bitmap-move-to-column-force): Use it.
+ (w3m-bitmap-next-line): New command.
+ (w3m-bitmap-previous-line): New command.
+ (w3m-bitmap-substitute-key-definitions): New function; add it to
+ `w3m-mode-hook' as the one-shot function.
+
+2002-04-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-halfdump-command-arguments): Add `-I e' option to w3m
+ under Japanese environment.
+
+2002-04-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-cid-retrieve): Use `mime-decode-string',
+ `mime-entity-body' and `mime-entity-encoding' instead of
+ `mime-insert-entity-content' to make it work even if the entity buffer
+ is multibyte.
+
+2002-04-16 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-check-header-tags): Renamed from w3m-check-link-tags.
+ (w3m-check-header-tags): Parse base tag too.
+ (w3m-rendering-buffer-1): Use it.
+ (w3m-prepare-text-content): Don't use w3m-base-url.
+
+2002-04-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-insert): Replace `insert' with
+ `insert-before-markers'.
+ (w3m-bitmap-image-delete-internal): Delete trailing newlines.
+ (w3m-insert-image): Don't check for the existence of an image.
+
+ * w3m.el (w3m-history-current-url-face): Provide `font' temporally to
+ avoid loading it and `cl'.
+
+2002-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-get-overlay): Don't clear the
+ `evaorate' property here.
+ (w3m-bitmap-image-insert-internal): Rename to
+ `w3m-bitmap-image-insert'; change the meaning of the 2nd arg `image'
+ (see docs); allow the optional arg `ovr'; don't scan for an overlay
+ here; handle `w3m-bitmap-image-count'; use overlays to highlight bitmap
+ images.
+ (w3m-bitmap-image-insert): Remove old one.
+ (w3m-bitmap-image-delete-internal): Allow the 2nd arg `ovr'; don't scan
+ for an overlay here; clear the `evaorate' property here.
+ (w3m-bitmap-image-delete): Allow the 2nd arg `ovr'; don't scan for an
+ overlay here; don't delete an overlay.
+ (w3m-bitmap-image-delete-string): Remove.
+ (w3m-insert-image): Scan for an overlay here; don't use text props to
+ highlight bitmap images.
+ (w3m-remove-image): Scan for an overlay here.
+
+2002-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-cleanup): Remove.
+ (w3m-bitmap-image-get-overlay): Clear the `evaorate' property in an
+ overlay temporally.
+ (w3m-bitmap-image-insert-internal): Put the `evaorate' property in an
+ overlay; return an overlay.
+ (w3m-bitmap-image-insert): Use the return value of
+ `w3m-bitmap-image-insert-internal' instead of to call
+ `w3m-bitmap-image-get-overlay'.
+ (w3m-bitmap-image-insert-string): Remove.
+ (w3m-insert-image): Use `w3m-modify-plist' to cleanup plist; don't move
+ the point.
+ (w3m-remove-image): Replace `w3m-bitmap-image-insert-string' with
+ `w3m-bitmap-image-insert-internal'.
+
+ * w3m-util.el (w3m-modify-plist): New function.
+
+2002-04-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (w3m-process-kill-surely): New internal variable.
+ (w3m-process-kill-process): When `w3m-process-kill-surely' is non-nil,
+ wait for the completion to kill process surely.
+
+2002-04-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-get-overlay): Speed up a bit.
+ (w3m-bitmap-image-insert-internal): Replace `current-column' with
+ `w3m-bitmap-current-column'; call `w3m-add-text-properties' only when
+ props are specified; use `overlay-end' dynamically (fix a bug I've
+ made); replace `move-to-column-force' with
+ `w3m-bitmap-move-to-column-force'.
+ (w3m-bitmap-image-delete-internal): Make the 2nd arg optional; replace
+ `current-column' with `w3m-bitmap-current-column'; replace
+ `move-to-column-force' with `w3m-bitmap-move-to-column-force'; guess
+ the end position of an overlay by itself when the 2nd arg is omitted.
+ (w3m-bitmap-image-delete): Remove the 2nd arg.
+ (w3m-bitmap-image-delete-string): Alias to
+ `w3m-bitmap-image-delete-internal' instead of defining as a function.
+ (w3m-insert-image): Don't use the length of a bitmap image.
+ (w3m-remove-image): Ditto.
+
+ * w3m-om.el (move-to-column-force): Remove.
+
+2002-04-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-image.el (w3m-imagick-convert-async-exec): Change default value
+ for Meadow.
+
+2002-04-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-favicon-converted): New buffer-local variable.
+ (w3m-setup-favicon): Set w3m-favicon-converted as nil.
+ (w3m-buffer-favicon): If w3m-favicon-converted is non-nil, don't start
+ conversion. Set w3m-favicon-converted as t before conversion.
+
+2002-04-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-retrieve): Change behavior according to whether the
+ return value of `base64-decode-string' is multibyte or not.
+
+ * w3m-image.el (w3m-imagick-convert-async-exec): New user option.
+ (w3m-imagick-start): Use `call-process' when
+ `w3m-imagick-convert-async-exec' is nil.
+ (w3m-imagick-convert-buffer): Don't use stdin because `convert' can not
+ handle an animation GIF that it input from stdin.
+
+2002-04-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-bitmap.el (w3m-create-image): Use w3m-process-do-with-temp-buffer
+ instead of w3m-process-do.
+ (w3m-create-image): Don't call `set-buffer-multibyte' if old mule.
+
+ * w3m-image.el (w3m-imagick-start-convert-buffer): Removed needless
+ `concat'.
+
+ * w3m-bitmap.el (w3m-create-image): Call
+ `w3m-imagick-start-convert-buffer' instead of
+ `w3m-imagick-convert-data'.
+
+2002-04-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-current-column): New function for old
+ Emacsen; alias to `current-column' for the recent Emacsen.
+ (w3m-bitmap-move-to-column-force): New function for old Emacsen; alias
+ to `move-to-column-force' for the recent Emacsen.
+
+2002-04-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-image.el (w3m-imagick-convert-data): Check buffer size.
+ (w3m-imagick-start-convert-data): Ditto.
+ (w3m-imagick-start-convert-buffer): Don't use output file
+ (Because it sometimes causes multiple files).
+
+2002-04-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Reverse the turn of the load
+ with `bitmap' and `un-define'.
+
+2002-04-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-face): New face.
+ (w3m-bitmap-image-insert-internal): Put text properties.
+ (w3m-bitmap-image-insert): Pass text properties argument to
+ `w3m-bitmap-image-insert-internal'.
+ (w3m-bitmap-image-add-text-properties): Remove.
+ (w3m-insert-image): Pass text properties to `w3m-bitmap-image-insert'.
+
+2002-04-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-bitmap.el (w3m-bitmap-image-get-overlay): Use
+ `line-beginning-position' and/or `line-end-position'.
+ (w3m-bitmap-image-insert-internal): Ditto.
+ (w3m-bitmap-image-delete-internal): Ditto.
+ (w3m-bitmap-image-add-text-properties): Ditto.
+
+ * w3m-om.el: Require `w3m-bitmap' if BITMAP-MULE is available.
+ (move-to-column-force): Define it if void.
+
+2002-04-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-bitmap.el: Convert CRLF to LF.
+ (w3m-display-graphic-p): Ruturn nil if no window-system.
+ (w3m-image-type-available-p): Ruturn nil if not found "convert".
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile
+ w3m-bitmap.el under XEmacs or FSF Emacs-21.
+
+ * w3m.el (w3m-fontify): When delete duplicated empty line, keep
+ 'w3m-name-anchor property surely.
+
+ * w3m-e20.el (top): Require 'w3m-bitmap if have BITMAP.
+
+2002-04-09 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile
+ w3m-bitmap.el if bitmap.el is not installed.
+ (w3mhack-examine-modules): Add condition to w3m-bitmap.el check.
+
+ * w3m-bitmap.el: New file.
+
+ * w3m-e20.el (w3m-create-image, w3m-insert-image, w3m-remove-image,
+ w3m-image-type-available-p, w3m-display-graphic-p,
+ w3m-display-inline-images-p): Alias to `ignore'. Bitmap image
+ implementation is moved to w3m-bitmap.el.
+ (w3m-bitmap-image-cache-alist, w3m-bitmap-image-use-cache,
+ w3m-bitmap-image-cleanup, w3m-bitmap-image-buffer,
+ w3m-bitmap-image-get-overlay, w3m-bitmap-image-insert-internal,
+ w3m-bitmap-image-insert, w3m-bitmap-image-insert-string,
+ w3m-bitmap-image-delete-internal, w3m-bitmap-image-delete,
+ w3m-bitmap-image-delete-string, w3m-bitmap-image-add-text-properties):
+ Move to w3m-bitmap.el.
+
+2002-04-09 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m-e20.el (w3m-create-image): Return nil if
+ w3m-imagick-convert-buffer is failed.
+ (w3m-insert-image): Not insert image if image is nil.
+
+2002-04-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-coding-system): Change default value to
+ 'iso-2022-7bit-ss2 when use w3mmee under mule environment.
+
+2002-04-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-xmas.el (w3m-create-image): Resize gif images, too.
+
+2002-04-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-make-glyph): Remove unused var.
+
+2002-04-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-char-to-int): New alias.
+ (w3m-form-mee-attr-unquote): Use it.
+ (w3m-form-mee-new): Ditto.
+
+ * w3m-xmas.el (toplevel): Require 'w3m-image.
+ (w3m-make-glyph): New inline function.
+ (w3m-create-image): Resize images when w3m-resize-images is non-nil.
+
+ * w3m-form.el (w3m-string-to-char-list)[XEmacs]: Use string-to-list
+ instead of string-to-char-list.
+ (w3m-int-to-char): New alias.
+ (w3m-form-mee-select-value): Use it.
+
+2002-04-08 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m-e20.el (w3m-bitmap-image-insert-internal): Begin the overlay on
+ `begion-of-line'.
+
+2002-04-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el: Update URL for xlhtml.
+
+2002-04-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el: Don't require `pcustom'.
+
+2002-04-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-image.el: New file.
+
+ * w3m.el (w3m-halfdump-command-arguments): Specify single-row-image
+ dump option instead of image.
+ (w3m-goto-mailto-url): Added optional post-data argument and use it.
+ (w3m-goto-url): Set post-data of w3m-goto-mailto-url.
+
+ * w3m-util.el (w3m-imagick-convert-program, w3m-imagick-convert-buffer,
+ w3m-imagick-convert-data): Moved to w3m-image.el.
+
+ * w3m-e21.el (toplevel): Require 'w3m-image.
+ (w3m-resize-images, w3m-imagick-start-convert-data,
+ w3m-imagick-start-convert-buffer, w3m-imagick-start, w3m-resize-image):
+ Moved to w3m-image.el;
+ (w3m-create-image): Follow the change in w3m-resize-image.
+ (w3m-favicon-usable-p): Renamed from w3m-imagick-convert-usable-p.
+ (w3m-use-favicon): Follow the change above.
+ (w3m-favicon-cache-data): Fixed typo.
+ (w3m-favicon-cache-retrieved): Ditto.
+ (w3m-retrieve-favicon): Ditto.
+
+ * w3m-e20.el (w3m-image): Require 'w3m-image.
+
+2002-04-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (multibyte-string-p): Alias to `stringp' if MULE,
+ otherwise `ignore'.
+
+ * w3m-om.el (multibyte-string-p): Alias to `stringp'.
+
+ * w3m-util.el: Require `pcustom' for old Emacsen.
+
+2002-04-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-retrieve): Revert previous change.
+ (w3m-w3m-dump-head-source): Add argument orig-url; Cache header and
+ body using orig-url.
+ (w3m-w3m-retrieve): Don't cache header here; Return error response when
+ follow redirection number exceeds w3m-follow-redirection; Pass orig-url
+ to w3m-w3m-retrieve-1.
+ (w3m-w3m-retrieve-1): Add argument orig-url; Call w3m-dump-head-source
+ with orig-url argument.
+ (w3m-redirect-with-get): Changed default value to t.
+
+2002-04-05 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m-e20.el (w3m-bitmap-image-insert): Fix (point) -> pos.
+
+2002-04-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-input-map): If menu string is empty, use href
+ string instead.
+
+ * w3m.el (w3m-w3m-dump-head-source): Fixed caching logic.
+ (w3m-w3m-retrieve): Use cache if available after redirection.
+
+2002-04-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e20.el (top): Avoid byte-compile warnings when not found
+ `bitmap'.
+ (w3m-image-type-available-p): Return nil if not have `bitmap'.
+
+2002-04-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-fontify-anchors): Set default icon type as ico.
+
+ * w3m-e21.el (w3m-buffer-favicon): Asynchronous implementation.
+
+2002-04-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3mhack.el (top): Avoid byte-compile error for `w3m-ucs.el' with
+ Emacs20 when it has `un-define' and `bitmap'.
+ (w3mhack-load-path): Add the path of `bitmap.el' on Emacs20.
+
+2002-04-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-request-arguments): Use -header option if no cookie nor
+ no body.
+ (w3m-w3m-retrieve-1): Delete temp-file only when it exists.
+
+ * w3m-e21.el (w3m-imagick-start-convert-data): Don't use
+ string-as-unibyte (no use).
+
+2002-04-04 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m.el (w3m-toggle-inline-images-internal): Support w3m-bitmap-image.
+
+ * w3m-e21.el (w3m-imagick-convert-program): Move to w3m-util.el.
+ (w3m-imagick-convert-buffer): Ditto.
+ (w3m-imagick-convert-data): Ditto.
+
+ * w3m-util.el (w3m-imagick-convert-program): Move from w3m-e21.el.
+ (w3m-imagick-convert-buffer): Ditto.
+ (w3m-imagick-convert-data): Ditto.
+
+ * w3m-e20.el (w3m-bitmap-image-cache-alist): New variable.
+ (w3m-bitmap-image-use-cache): Ditto.
+ (w3m-bitmap-image-cleanup): New function.
+ (w3m-bitmap-image-buffer): Ditto.
+ (w3m-bitmap-image-get-overlay): Ditto.
+ (w3m-bitmap-image-insert-internal): Ditto.
+ (w3m-bitmap-image-insert): Ditto.
+ (w3m-bitmap-image-insert-string): Ditto.
+ (w3m-bitmap-image-delete-internal): Ditto.
+ (w3m-bitmap-image-delete): Ditto.
+ (w3m-bitmap-image-delete-string): Ditto.
+ (w3m-bitmap-image-add-text-properties): Ditto.
+ (w3m-display-graphic-p): New implementation.
+ (w3m-display-inline-images-p): Ditto.
+ (w3m-image-type-available-p): Ditto.
+ (w3m-create-image): New implementation. It use w3m-bitmap-image-*.
+ (w3m-insert-image): Ditto.
+ (w3m-remove-image): Ditto.
+
+2002-04-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify): Put invisible and intangible properties at the
+ duplicated empty lines instead of delete them.
+
+2002-04-03 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-resize-image): Asynchronous implementation.
+ (w3m-imagick-start-convert-data): New function.
+ (w3m-imagick-start-convert-buffer): Ditto.
+ (w3m-imagick-start): Ditto.
+ (w3m-create-image): Rewrite to resize images asynchronously.
+ (w3m-insert-image): Don't resize.
+
+2002-04-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-check-link-tags): Relax the pattern to detect headers.
+
+2002-04-02 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-submit): Confirm when posting from secure page
+ to normal page.
+
+ * w3m.el (w3m-redirect-with-get): New user option.
+ (w3m-w3m-retrieve): If w3m-redirect-with-get is non-nil, use GET method
+ after redirection; Ask user to use POST data after redirection.
+ (w3m-w3m-attributes): Set w3m-current-redirect as a cons cell of
+ (CODE . LOCATION).
+ (w3m-w3m-dump-head-source): Don't cache content if the response code is
+ one of 302, 303, 307.
+ (w3m-w3m-retrieve): Change POST redirection behavior according to
+ response code.
+ (w3m-retrieve-and-render): Confirm leaving secure pages.
+
+ * octet.el (mime-preview-octet): Change behavior according to whether
+ the return value of mime-entity-content is multibyte or not.
+ (mime-view-octet): Ditto.
+
+ * w3m.el (w3m-w3m-retrieve): Don't call w3m-cache-request-header when
+ type is nil.
+
+2002-04-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-follow-redirection): New user option.
+ (w3m-w3m-attributes): Set w3m-current-redirect as nil.
+ (w3m-cookie-command-arguments): Abolish.
+ (w3m-request-arguments): Use cookie only when w3m-use-cookies is
+ non-nil.
+ (w3m-header-arguments): New function.
+ (w3m-w3m-retrieve): Treat redirection when w3m-follow-redirection is
+ non-nil.
+ (w3m-w3m-retrieve-1): Renamed from w3m-w3m-retrieve.
+ (w3m-prepare-content): Don't care w3m-current-redirect.
+ (w3m-goto-url): Ditto.
+
+ * w3m-form.el (w3m-form-new): Added argumnet enctype.
+ (w3m-form-enctype): New macro.
+ (w3m-form-plist): Changed definition.
+ (w3m-form-put-property): Ditto.
+ (w3m-form-make-form-data): Removed optional argument urlencode; Encode
+ form data acording to w3m-form-enctype.
+ (w3m-form-mee-new): Set enctype field.
+ (w3m-form-parse-and-fontify): Parse enctype.
+ (w3m-form-submit): Don't pass enctype argumnet.
+
+2002-04-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-fontify-anchors): Put a property of `w3m-name-anchor' as
+ a list.
+ (w3m-move-point-for-localcgi): Use `w3m-search-name-anchor'.
+ (w3m-search-name-anchor): Use `member' when compare a name with
+ `w3m-name-anchor'. Fix continuous name-anchor.
+
+2002-03-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Use `match-string' instead of
+ `mew-match'.
+
+ * w3m.el (w3m-fontify-anchors): Modify the point for 'w3m-name-anchor
+ property when its has an empty body.
+
+2002-03-28 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-dump-head-source-command-arguments)[w3mmee]: Don't add
+ Accept-Language header option.
+ (w3m-cookie-command-arguments)[w3mmee]: Don't add Cookie header option.
+ (w3m-request-arguments): New function to generate -request option.
+ (w3m-w3m-retrieve)[w3mmee]: Use w3m-request-arguments to make request
+ header and body.
+
+2002-03-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-url-at-point (ffap)): Strip text props under XEmacs.
+ (ffap-url-regexp): Modify the value to make it match to https urls for
+ Emacs 19, 20 and XEmacs.
+
+2002-03-27 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-tab-drag-mouse-function): Fix problem when dragged
+ mouse position is outside of the original frame.
+
+ * w3m.el (w3m-version): New variable.
+ (toplevel): Detect w3m version.
+ (w3m-user-agent): New user option.
+ (w3m-add-user-agent): Ditto.
+ (w3m-w3m-retrieve): Add User-Agent: field if w3m-add-user-agent is
+ non-nil.
+
+ * w3m-e21.el (w3m-tab-drag-mouse-function): New function.
+ (w3m-tab-make-keymap): Add mouse-1, mouse-2, drag-mouse-1 and
+ drag-mouse-2.
+
+ * w3m-cookie.el (w3m-cookie-set): Fixed docstring.
+
+2002-03-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-find-coding-system): Alias to ignore if the function
+ `find-coding-system' is not available.
+ (w3m-make-ccl-coding-system): Check whether the function
+ `make-ccl-coding-system' is available instead of checking the feature
+ `mule' to determine what function should be aliased to.
+ (coding-system-list): Alias to ignore if it is not available.
+ (define-ccl-program): Check whether it is available instead of checking
+ the feature `mule' to determine if it is aliased to `ignore'.
+ (w3m-detect-coding-with-priority): Quote `w3m-default-coding-system'.
+
+2002-03-24 Nix <nix@esperi.demon.co.uk>
+
+ * w3m-xmas.el (w3m-detect-coding-with-priority): New macro, handle
+ non-MULE XEmacsen.
+ (w3m-detect-coding-region): Use it.
+
+2002-03-26 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-cookie.el (w3m-cookie-1-set): Fixed problem when no `Expires',
+ ignore is ignored.
+
+2002-03-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-cookie.el (w3m-cookie-url, w3m-cookie-domain, w3m-cookie-secure,
+ w3m-cookie-name, w3m-cookie-value, w3m-cookie-path, w3m-cookie-version,
+ w3m-cookie-expires, w3m-cookie-ignore): Define as macro.
+ (w3m-cookie-set-url, w3m-cookie-set-domain, w3m-cookie-set-secure,
+ w3m-cookie-set-name, w3m-cookie-set-value, w3m-cookie-set-path,
+ w3m-cookie-set-version, w3m-cookie-set-expires, w3m-cookie-set-ignore):
+ Removed.
+ (w3m-cookie-create): New implementation.
+ (w3m-about-cookie): Call `setf' instead of `w3m-cookie-set-ignore'.
+
+2002-03-26 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-fontify-anchors): Changed anchor name property position.
+ (w3m-lynx-like-map): Bind w3m-cookie as `M-k'.
+ (w3m-info-like-map): Ditto.
+
+2002-03-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-cookie.el (w3m-cookie-save): Use `w3m-time-newer-p' instead of
+ `w3m-time-lapse-seconds'.
+
+2002-03-26 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-cookie.el (w3m-cookie): New command.
+ (w3m-about-cookie): Do nothing if w3m-use-cookies is nil.
+
+ * w3m.el (toplevel): Added autoload setting for w3m-about-cookie; Added
+ autoload setting for w3m-cookie.
+
+ * w3m-cookie.el (w3m-cookie-store): Don't replace if ignored cookie.
+ (w3m-cookie-retrieve): Don't use cookie which is ignored.
+ (w3m-about-cookie): New function.
+
+ * w3m-e21.el (w3m-setup-favicon): Do nothing when w3m-current-url is
+ nil.
+
+ * w3m.el (w3m-goto-url): Force reload if w3m-current-redirect is set.
+ (w3m): If w3m-current-url is nil, erase buffer.
+
+ * w3m-util.el (w3m-time-less-p): Abolish.
+ (w3m-assoc-ignore-case): Moved from w3m-cookie.el and rewrote not to
+ use assoc* (because it's cl function).
+
+ * w3m-cookie.el (w3m-cookie-retrieve): Use w3m-time-newer-p instead of
+ w3m-time-less-p.
+ (w3m-cookie-1-set): Ditto.
+ (w3m-assoc-ignore-case): Moved to w3m-util.el.
+
+2002-03-25 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-cookie.el (w3m-cookie-1-set): Use w3m-time-less-p instead of
+ w3m-time-lapse-seconds.
+ (w3m-cookie-retrieve): Ditto.
+
+ * w3m-util.el (w3m-time-less-p): New inline function.
+
+ * w3m.el (w3m-current-redirect): New buffer local variable.
+ (w3m-clear-local-variables): Add w3m-current-redirect.
+ (w3m-copy-local-variables): Treat w3m-current-redirect.
+ (w3m-w3m-attributes): Set w3m-current-redirect instead of
+ w3m-current-refresh when 30x response.
+ (w3m-prepare-content): Use w3m-current-redirect instead of
+ w3m-current-refresh.
+ (w3m-goto-url): Do nothing but w3m-goto-url after retrieval if
+ w3m-current-redirect is set.
+
+2002-03-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-cookie.el (w3m-cookie-file): Changed default value.
+ (w3m-cookie-save): Follow the above change.
+ (w3m-cookie-load): Ditto.
+
+2002-03-25 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-attributes): Don't call w3m-cookie-set.
+ (w3m-w3m-dump-head-source): Call w3m-cookie-set.
+ (w3m-cookie-command-arguments): Set `-no-cookie'; Don't set
+ cookie_accept_domains, cookie_reject_domains.
+
+ * w3m-cookie.el (toplevel): Require 'w3m.
+ (w3m-cookie-accept-domains): Moved from w3m.el.
+ (w3m-cookie-reject-domains): Ditto.
+ (w3m-cookie-accept-bad-cookies): New user option.
+ (w3m-cookie-file): Ditto.
+ (w3m-cookie-set-ignore): Fix.
+ (w3m-cookie-retrieve): Remove expired cookies.
+ (w3m-cookie-trusted-host-p): Fixed domain match.
+ (w3m-cookie-1-set): Treat all cookies. Accept bad cookies according to
+ w3m-cookie-accept-bad-cookies.
+ (w3m-cookie-init): New variable.
+ (w3m-cookie-clear): New function.
+ (w3m-cookie-save): Ditto.
+ (w3m-cookie-load): Ditto.
+ (w3m-cookie-setup): Ditto.
+ (w3m-cookie-shutdown): Rewrite.
+ (w3m-cookie-set): Call w3m-cookie-setup; Changed API.
+ (w3m-cookie-get): Call w3m-cookie-setup.
+
+ * w3m.el (w3m-goto-url): Don't resume form from history when POST.
+
+2002-03-24 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-cookie.el: New file.
+
+ * w3m-form.el (w3m-form-resume): Use cdr of forms if car is t
+ (Just in case).
+ (w3m-form-parse-and-fontify)[w3m]: Search form structure according to
+ fid.
+
+ * w3m.el (toplevel): Added autoload setting for w3m-cookie.
+ (w3m-use-cookies): New user option.
+ (w3m-cookie-accept-domains): Ditto.
+ (w3m-cookie-reject-domains): Ditto.
+ (toplevel): Bind system-time-locale as "C" while calling
+ format-time-string.
+ (w3m-w3m-attributes): Call w3m-cookie-set; When 30x response is
+ received, set w3m-current-refresh as
+ (0 . Location).
+ (w3m-cookie-command-arguments): New function.
+ (w3m-w3m-retrieve): Use it.
+ (w3m-retrieve-and-render): Mark w3m-current-forms as `not history' if
+ retrieval failed.
+ (w3m-prepare-content): If w3m-current-refresh rate is 0, do nothing.
+ (w3m-quit): Call `w3m-cookie-shutdown'.
+
+2002-03-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-decode-encoded-contents): Convert encoding to lower case
+ before checking alist.
+
+2002-03-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-remove-redundant-spaces): New implementation.
+ (w3m-about-retrieve): Call `insert-buffer-substring' instead of
+ `insert-buffer'.
+ (w3m-rendering-unibyte-buffer): Ditto.
+ (w3m-rendering-multibyte-buffer): Ditto.
+ (w3m-prepare-text-content): Ditto.
+
+2002-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-attributes): Ignore trailing whitespaces in header
+ lines.
+
+2002-03-20 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-view-this-url): Eval action even when anchor is set.
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Clear mapval if it is set.
+
+ * w3m.el (w3m-halfdump-command-arguments)[w3mmee]: Add `image' to the
+ -dump argument only if `w3m-treat-image-size' is non-nil.
+
+2002-03-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-parse-and-fontify): If not detect `usemap'
+ attribute of `img_alt', use `value' attribute of `input_alt' for the
+ select map name; W3M removes `usemap' attribute when
+ "display_image=off".
+
+2002-03-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-attributes): Ignore `w3m-document-charset' when
+ w3m-m17n.
+
+2002-03-19 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-fontify-images): Parse width and height attributes of
+ img_alt.
+ (w3m-toggle-inline-images-internal): Set `size' argument of
+ w3m-create-image.
+ (w3m-highlight-current-anchor): Fixed logic.
+
+ * w3m-xmas.el (w3m-create-image): Added optional argument `size'
+ (ignored currently).
+
+ * w3m-e21.el (w3m-imagick-convert-program): Use w3m-which to set
+ initial value.
+ (w3m-resize-images): New user option.
+ (w3m-resize-image): New function.
+ (w3m-create-image): Added optional argument `size'; Changed return
+ value.
+ (w3m-insert-image): Call w3m-resize-image if size is specified.
+ (w3m-imagick-convert-buffer): Accept nil for from-type and to-type.
+
+2002-03-18 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-mee-select-value): Fix.
+ (w3m-form-parse-and-fontify): If w3m-type is not w3mmee, use last form
+ object as current form.
+
+2002-03-18 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-highlight-current-anchor): New implementation.
+ (w3m-highlight-current-anchor-1): New function.
+
+ * w3m-form.el (w3m-form-replace): Fixed problem when string is nil.
+
+2002-03-16 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-string-to-char-list): Fixed.
+
+2002-03-15 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-mee-select-value): Use w3m-output-coding-system
+ instead of w3m-current-coding-system.
+ (w3m-form-parse-and-fontify)[w3mmee]: Ditto.
+ (w3m-form-mee-select-value): Fixed select value.
+ (w3m-form-resume): Fixed checkbox resuming.
+ (w3m-form-parse-and-fontify): Use `form' instead of `(car forms)';
+ Search the form which corresponds to input_alt by fid; Use `nconc'
+ instead of `push'.
+
+ * w3m-form.el (w3m-form-mee-select-value): New function.
+ (w3m-form-parse-and-fontify)[w3mmee]: Set select value.
+
+ * w3m.el (w3m-halfdump-command-arguments)[w3mmee]: Added image.
+
+ * w3m-form.el (w3m-form-parse-and-fontify): Set the value of form only
+ if the method is not internal; Add internal form to the
+ w3m-current-forms; Treat input type `image' as same as `submit'.
+ (w3m-form-mee-attr-unquote): New function.
+ (w3m-string-to-char-list): New function/alias.
+ (w3m-form-mee-new): New function.
+ (w3m-form-parse-and-fontify): Parse w3mmee's form info.
+ (w3m-form-input-textarea-keymap): Bind C-g.
+ (w3m-form-input-select-keymap): Bind C-g, h,j,k,l.
+ (w3m-form-input-map-keymap): Ditto.
+ (w3m-form-parse-and-fontify): Set textarea value.
+
+2002-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-resume): Typo.
+
+2002-03-13 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (toplevel): Removed autoload setting for
+ `w3m-form-parse-buffer'.
+ (w3m-clear-local-variables): Don't treat w3m-current-forms any more.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-additional-command-arguments): Fixed problem when no-proxy host
+ has port number other than 80.
+ (w3m-rendering-buffer-1): Don't call w3m-form-parse-buffer.
+ (w3m-goto-url): Setup w3m-current-forms from history structure.
+
+ * w3m-form.el (w3m-form-parse-buffer): Abolish.
+ (w3m-form-parse-forms): Ditto.
+ (w3m-form-resume): Set value of `w3m-current-forms'.
+ (w3m-fontify-forms): Call `w3m-form-parse-and-fontify' instead of
+ `w3m-form-fontify'.
+ (w3m-form-parse-and-fontify): New function.
+ (w3m-form-input-select): Fix problem when candidate label is "".
+
+2002-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by HAYASHI Chifumi <chifumi@mscom.or.jp>.
+
+ * w3m-form.el (w3m-form-new): Ignore the 2nd arg `action' if it is nil.
+ (w3m-form-parse-forms): Don't parse the value of `w3m-current-url' if
+ it is nil.
+
+
+2002-03-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.6 from emacs-w3m-1_2 branch.
+
+2002-03-11 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Treat japanese-jisx0208-1978 as
+ japanese-jisx0208.
+
+2002-03-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url, w3m-goto-url-new-session,
+ w3m-select-buffer-copy-buffer): Remove unused non-global variables.
+
+2002-03-11 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by Yuuichi Teranishi <teranisi@gohome.org> with mod.
+
+ * w3m.el (w3m-no-proxy-domains): New user option renamed from
+ `w3m-no-proxy-hosts' and changed the meaning.
+ (w3m-additional-command-arguments): Refer to it.
+
+2002-03-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (tarball): Fix permissions.
+
+2002-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-command-arguments-alist): Change the meaning that the car
+ of each element will be compared with a url instead of a hostname.
+ (w3m-no-proxy-hosts): New user option.
+ (w3m-additional-command-arguments): Look into it.
+
+2002-03-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-command-arguments-alist): New user option.
+ (w3m-additional-command-arguments): New function.
+ (w3m-w3m-retrieve): Use it.
+ (w3m-history-current-url-face, w3m-copy-buffer, w3m-about-header):
+ Remove unused non-global variables.
+
+2002-03-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-attributes) [w3mmee]: Fetch content-encoding from
+ "x-w3m-content-encoding" filed.
+
+2002-03-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Return lowercase string always
+ because `w3m-image-type-alist' has lowercase keys.
+
+2002-03-07 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+
+ * w3m.el (w3m-lynx-like-map): Switch J and K so as to behave like w3m.
+
+2002-03-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_EXAMINE_PACKAGEDIR): Use `(eq 0 foo)' instead of
+ `(zerop foo)' because foo might not be a number.
+ (AC_PATH_ICONDIR): Ditto.
+
+2002-03-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-decoder-alist): Change default commands to `gzip' and
+ `bzip2' instead of `gunzip' and `bunzip2' because some broken OS and
+ its environment does not work them.
+
+2002-03-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (datadir): New variable.
+
+2002-03-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (w3m-process-filter): Modify a regexp for "Password:".
+
+2002-03-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install): Don't chdir to shimbun/ while installing
+ shimbun modules.
+ (install-icons): Don't chdir to icons/ while installing icons.
+
+2002-03-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install): Install all ChangeLog files.
+ * w3mhack.el (w3mhack-make-package): List all ChangeLog files in the
+ manifest.
+
+2002-03-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Set `w3m-current-url' for avoid error
+ in `w3m-process-start-process()'.
+ (w3m-goto-url): When use w3m-dtree and the URL is local directory,
+ change the URL to `about://dtree' securely.
+
+2002-03-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-function-max-args): Alias to `function-max-args'
+ under XEmacs, otherwise define it as a function.
+ (symbol-for-testing-whether-colon-keyword-is-available-or-not): Use
+ `dont-compile' instead of `eval'.
+
+
+2002-03-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.5 from emacs-w3m-1_2 branch.
+
+2002-03-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-find-file): Decode even in the read-only buffer.
+
+2002-02-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (DOCS): Add ChangeLog.1.
+
+
+Local Variables:
+coding: iso-2022-7bit
+fill-column: 79
+indent-tabs-mode: t
+End:
diff --git a/share/emacs/site-lisp/w3m/ChangeLog.1 b/share/emacs/site-lisp/w3m/ChangeLog.1
new file mode 100644
index 00000000000..f1000a2745f
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/ChangeLog.1
@@ -0,0 +1,6731 @@
+2002-02-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-filter): Use `ignore-errors' instead of
+ `condition-case'.
+ (w3m-process-y-or-n-p): Regist answers only when they have non-nil
+ values.
+
+2002-02-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-perldoc.el: New file.
+
+ * w3m.el (top): Add autoload for `w3m-perldoc.el'.
+ (w3m-tmp-urluser-alist): Abolished.
+ (w3m-read-file-name): Call `w3m-url-strip-query'.
+ (w3m-download): Ditto.
+ (w3m-w3m-get-header): Accept URLs which includes authentication
+ information like scheme://user:pass@netloc/. Set `w3m-current-url'
+ before `w3m-process-start' is called.
+ (w3m-w3m-dump-head-source): Ditto.
+ (w3m-retrieve): Call `w3m-url-strip-fragment'.
+ (w3m-retrieve-and-render): Modified to accept URLs which includes
+ authentication information. Do not set `w3m-current-url'.
+ (w3m-goto-url): Modified to accept URLs which includes authentication
+ information and to pass them through to sub-routines.
+ (w3m): Small modified to accept URLs which includes authentication
+ information.
+
+ * w3m-util.el (w3m-url-authinfo-regexp): New internal constant.
+ (w3m-url-authinfo): New function.
+ (w3m-url-strip-authinfo): Ditto.
+ (w3m-url-strip-fragment): Ditto.
+ (w3m-url-strip-query): Ditto.
+
+ * w3m-proc.el (top): No bind `w3m-tmp-urluser-alist'.
+ (w3m-process-authinfo-alist): Renamed from `w3m-process-user-alist'.
+ (w3m-process-accept-list): Abolished.
+ (w3m-process-accept-alist): New internal variable.
+ (w3m-process-user-counter): Abolished.
+ (w3m-process-start-process): In order to set `w3m-process-user' and
+ `w3m-process-passwd' call `w3m-url-authinfo', instead of refering
+ `w3m-tmp-urluser-alist'.
+ (w3m-process-stop): Reset `w3m-process-authinfo-alist' and
+ `w3m-process-accept-alist'.
+ (w3m-process-sentinel): Regist an authentication information only when
+ `w3m-process-realm' is set.
+ (w3m-process-filter): Call `w3m-process-y-or-n-p' instead of
+ `w3m-process-accept-get' and `w3m-process-accept-set'. When a user
+ name and a password of a proxy server are reasked, their old values are
+ discarded. Reconstruct the part checking user names and passwords.
+ (w3m-process-get-server-root): Its regular expression are small
+ modified. Call `w3m-url-strip-authinfo'.
+ (w3m-process-get-user): Removed.
+ (w3m-process-get-passwd): Ditto.
+ (w3m-process-set-user): Ditto.
+ (w3m-process-accept-get): Ditto.
+ (w3m-process-accept-set): Ditto.
+ (w3m-process-set-authinfo): New function.
+ (w3m-process-read-user): Ditto.
+ (w3m-process-read-passwd): Ditto.
+ (w3m-process-y-or-n-p): Ditto.
+
+2002-02-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-modeline-ssl-image-status-on)
+ (w3m-modeline-ssl-status-off): New constants.
+ (w3m-current-ssl): New buffer local variable.
+ (w3m-clear-local-variables, w3m-copy-local-variables): Handling
+ `w3m-current-ssl'.
+ (w3m-w3m-attributes): When detect `W3m-ssl-certificate:' header, set
+ `w3m-current-ssl'. Skip reading of folded lines of each header.
+ (w3m-buffer-setup): Display SSL indicator at mode-line.
+ (w3m-about-header): Display SSL information when exist
+ `W3m-ssl-certificate:' header.
+
+2002-02-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-read-file-name): Strip the query part from a default file
+ name.
+ (w3m-download): Ditto.
+ (w3m-url-components-regexp): Move forward.
+
+ * mime-w3m.el: Always require `font' under XEmacs.
+
+2002-02-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-async-exec): Default to nil under MacOS X.
+
+2002-02-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-setup-favicon): Fix handling of
+ `w3m-about-xxxx-favicon'.
+
+2002-02-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-icon-data): New buffer local variable.
+ (w3m-clear-local-variables): Add `w3m-icon-data'.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-fontify-anchors): Setup `w3m-icon-data'.
+ (w3m-check-link-tags): Parse `type' of link attribute; Set
+ `w3m-icon-data' if `icon' rel attribute exist.
+ (w3m-goto-url): Added local variable real-data.
+
+ * w3m-e21.el (w3m-favicon-cache-favicon): Added compatibility code.
+ (w3m-setup-favicon): Use w3m-icon-data if it exists; Changed first
+ argument for `w3m-retrieve-favicon'.
+ (w3m-buffer-favicon): Use car of `w3m-current-favicon-data' as image
+ data and cdr as image type.
+ (w3m-retrieve-favicon): Changed first argument to cons cell of image
+ data and its type.
+
+2002-02-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-save-list): Allow the 4th arg `escape-ctl-chars'.
+ (w3m-arrived-shutdown): Call it with the 4th arg.
+
+ * w3m-antenna.el (w3m-antenna-shutdown): Call `w3m-save-list' with the
+ 4th arg.
+
+2002-02-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-pixels-per-line): Renamed from w3m-pixel-per-line; Fixed
+ custom type.
+ (w3m-pixels-per-character): Likewise.
+ (w3m-rendering-half-dump): Follow the changes above.
+
+2002-02-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-type): Considerd as an internal variable.
+ (w3m-options): Removed.
+ (w3m-compile-options): New internal variable.
+ (toplevel): Set `w3m-compile-options' instead of `w3m-options'.
+ (w3m-treat-image-size): Refer `w3m-compile-options' instead of
+ `w3m-options'.
+ (w3m-rendering-half-dump): Ditto.
+ (w3m-local-file-type): When a remote URL is passed, refer its
+ non-directory part to decide its content type.
+ (w3m-touch-file): Bind `default-directory' locally.
+
+2002-02-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-pixel-per-line): New user option.
+ (w3m-rendering-half-dump): Use `w3m-pixel-per-line' as the -ppl
+ argument of the w3m command.
+ (w3m-pixel-per-character): New user option.
+ (w3m-rendering-half-dump): Use `w3m-pixel-per-character' as the -ppc
+ argument of the w3m command.
+
+2002-02-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-favicon-size): Set default value to nil.
+ (w3m-buffer-favicon): If w3m-favicon-size is nil, detect frame char
+ height and use it.
+
+ * w3m.el (w3m-command): Set default value to nil.
+ (w3m-type): Ditto.
+ (w3m-options): New user option.
+ (toplevel): Set w3m-command, w3m-type and w3m-options.
+ (w3m-treat-image-size): New user option.
+ (w3m-rendering-half-dump): Set rendering options -o
+ display_image=on/off, -ppc, -ppl according to the value of
+ `w3m-treat-image-size'.
+
+2002-02-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-display-message): New macro.
+
+ * w3m.el (w3m-make-help-echo): Clear the echo area when Emacs 21 is
+ running; use the modern styles of backquote.
+ (w3m-make-balloon-help): Use the modern styles of backquote.
+ (w3m-toggle-inline-image): Use `w3m-display-message' instead of
+ `message' to say a trivial message.
+ (w3m-view-this-url): Ditto.
+ (w3m-submit-form): Ditto.
+ (w3m-view-image): Ditto.
+ (w3m-save-image): Ditto.
+ (w3m-download-this-url): Ditto.
+ (w3m-print-current-url): Ditto.
+ (w3m-print-this-url): Ditto.
+ (w3m-edit-this-url): Ditto.
+ (w3m-quit): Ditto.
+ (w3m-goto-ftp-url): Ditto.
+ (w3m-select-buffer): Ditto.
+ (w3m-select-buffer-show-this-line): Ditto.
+ (w3m-select-buffer-show-this-line-and-switch): Ditto.
+
+2002-02-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-after-cursor-move-hook): New option.
+ (w3m-check-current-position): New function.
+ (w3m-print-this-url-after-command): Removed.
+ (w3m-buffer-setup): Set `w3m-check-current-position' to
+ `post-command-hook', instead of `w3m-print-this-url-after-command'.
+ (w3m-add-local-hook): Check version of Emacsen dynamically.
+
+ * w3m-e21.el (w3m-add-local-hook): New function.
+
+2002-02-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-fontify-images): Changed regexp to more generic one to
+ search img_alt tag.
+ (w3m-toggle-inline-images-internal): Fixed image redisplay flickers.
+
+2002-02-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-halfdump-command-common-arguments): Replace `frame-width'
+ with `window-width'.
+ (w3m-about-db-history): Ditto.
+
+2002-02-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-proc.el (w3m-process-accept-list): New internal variable.
+ (w3m-process-filter): Watch `accept? (y/n)' for certification.
+ (w3m-process-accept-get, w3m-process-accept-set): New functions.
+
+2002-02-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-make-ccl-coding-system): Alias to `ignore' if
+ no-MULE (the feature `mule' is not provided).
+ (coding-system-category): Ditto.
+ (define-ccl-program): Define it as an empty macro if no-MULE.
+
+ * w3m.el (TopLevel): Don't require `ccl' if no-MULE.
+ (w3m-accept-japanese-characters): Default to nil if no-MULE.
+ (w3m-coding-system): Default to `iso-8859-1' if no-MULE.
+ (w3m-output-coding-system): Ditto.
+ (w3m-file-coding-system): Ditto.
+ (w3m-toolbar): Don't express some Japaneses chars directly.
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile w3m-ucs.el,
+ shimbun modules, mime-w3m.el, octet.el and w3m-weather.el if no-MULE.
+
+2002-02-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-meta-content-type-charset-regexp)
+ (w3m-meta-charset-content-type-regexp)
+ (w3m-meta-refresh-content-regexp)
+ (w3m-meta-content-refresh-regexp): Remove redundant double quote.
+
+ * w3m.el (w3m-content-prepare-functions): New internal contsant.
+ (w3m-prepare-content): Refer it.
+ (w3m-prepare-text-content): New function.
+ (w3m-prepare-image-content): Ditto.
+
+2002-02-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-meta-charset-content-type-regexp)
+ (w3m-meta-content-refresh-regexp): Allow broken quotation mark.
+
+2002-02-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-touch-file): Robust checking.
+
+2002-02-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-util.el (w3m-which-command): If called with `not string', return
+ nil.
+
+2002-02-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-touch-file-avaiable-p): New internal variable.
+ (w3m-touch-file): Check the validity of `touch' command.
+
+2002-02-05 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-touch-file): Call touch command with "-t time" instead of
+ "-d time".
+
+2002-02-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-touch-command): New option.
+ (w3m-touch-file): New function.
+ (w3m-download): Call it.
+ (w3m-toggle-inline-images-internal): Fix inconsistency of text
+ properties when images are not downloaded.
+ (w3m-toggle-inline-image): Simplified.
+ (w3m-toggle-inline-images): Ditto.
+
+2002-02-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el (w3m-prin1): New function.
+ * w3m.el (w3m-save-list): Use it instead of `prin1'.
+
+ * w3mhack.el, w3m.el, w3m-xmas.el, w3m-om.el: Say emacs-w3m not
+ Emacs-W3M.
+
+2002-02-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-mode-dont-bind-keys): New variable.
+ (mime-w3m-setup): Don't bind keys listed in the above.
+
+ * w3m.el (w3m-key-binding): Switch key bindings also in w3m-mode
+ buffers when customizing; don't manipulate keymaps when Emacs is
+ running in the batch mode.
+
+2002-02-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-suffix-type-alist): Added lzh, tar, pdf.
+ (octet-type-filter-alist): Ditto.
+ (octet-content-type-alist): Added application/x-msexcel, text/html,
+ application/x-tar, application/pdf.
+ (octet-magic-type-alist): Fixed magic for html.
+ (octet-tar-mode): New function.
+ (octet-guess-type-from-name): Downcase suffix.
+ (octet-mime-setup): Add action for application/vnd.ms-powerpoint.
+
+2002-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-safe-url-regexp): New user option.
+ (mime-w3m-preview-text/html): Use it.
+
+ * w3m.el (w3m-key-binding): Don't eval a part of the `set:' form when
+ compiling nnshimbun.el in the Gnus source tree.
+
+2002-02-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-buffer): Fixed problem when 'Quit'.
+ (mime-preview-octet-hook): New hook.
+ (mime-preview-octet): Run it.
+ (w3m-about-octet-attachments): Fixed problem when there's no
+ octet-attachment which corresponds to the src url.
+ (mime-view-octet): Set content-type argument for `octet-buffer'.
+ (mime-preview-octet): Ditto.
+
+2002-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Bind `w3m-force-redisplay'
+ with nil.
+
+2002-02-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-buffer): Set default of `completing-read'.
+
+2002-02-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-key-binding): Switch `w3m-mode-map', `mime-w3m-mode-map'
+ and `mm-w3m-mode-map' when customizing.
+
+2002-01-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mime-w3m.el (mime-w3m-mode-command-alist): New variable.
+ (mime-w3m-setup): Use it; invalidate widget button in
+ `mime-w3m-mode-map'.
+ (mime-w3m-keymap-property): Removed.
+ (mime-w3m-preview-text/html): Add `text-rendered-by-mime-w3m' text
+ property to the rendered area.
+ (kill-new): Strip keymap properties from a killed string only if it has
+ `text-rendered-by-mime-w3m' property.
+
+2002-01-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-url-at-point): Remove all text-properties from url.
+
+ * w3m-search.el (w3m-search): Remove all text-properties from default
+ search value.
+
+2002-01-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (w3m-search-word-at-point): New option.
+ (w3m-search): Refer `w3m-search-word-at-point'.
+
+2002-01-31 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-content-type-alist): Added text/html.
+ (octet-magic-type-alist): Likewise.
+ (octet-type-filter-alist): Likewise; Added `guess'; Changed result type
+ of gzip as `guess'.
+ (octet-find-file-hook): New hook.
+ (octet-find-file): Run it.
+ (octet-filter-guess): New function.
+ (octet-buffer): Fix.
+
+2002-01-30 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (toplevel): Require 'static.
+ (octet-html-render-function): Changed default value to
+ `octet-w3m-region.'
+ (octet-type-filter-alist): Changed filter function to
+ `octet-filter-call2-extra'.
+ (octet-attachments): New buffer-local variable.
+ (w3m-about-octet-attachments): New function.
+ (octet-w3m-region): Ditto.
+ (octet-filter-call2-extra): New function.
+ (octet-find-file): Do nothing when buffer is read-only.
+
+ * w3m.el (w3m-about-retrieve): Decode buffer only if the content-type
+ is text.
+
+ * octet.el (octet-guess-type-from-name): Return nil if guess failed.
+ (octet-buffer): Ask octet type if guess failed.
+ (octet-content-type-alist): New variable.
+ (octet-guess-type-from-content-type): New function.
+ (octet-buffer): Added optional argument `content-type'.
+ (octet-buffer): Ignore `quit'.
+ (octet-suffix-type-alist): Added images.
+ (octet-content-type-alist): Ditto.
+ (octet-type-filter-alist): Ditto.
+ (octet-magic-type-alist): Renamed from mime-magic-type-alist.
+ (octet-decode-image): New function.
+ (octet-guess-type-from-magic): New function.
+ (octet-buffer): Use it.
+ (octet-insert-buffer): New function.
+ (mime-preview-octet): Use it.
+
+2002-01-29 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * octet.el (octet-type-filter-alist): Changed default value for xlhtml
+ and ppthtml.
+ (octet-filter-call2): Fixed problem when return value of call-process
+ is not numeric.
+ (octet-filter-call1): Ditto.
+ (octet-find-file): Use unwind-protect.
+ (octet-filter-call2): Fixed docstring.
+ (octet-filter-call1): Ditto.
+ (octet-buffer): Fixed argument for `interactive'.
+
+2002-01-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-encoding-type-alist): New option.
+ (w3m-local-file-type): New function.
+ (w3m-local-content-type): New implementation.
+ (w3m-local-attributes): Call `w3m-local-file-type' instead of
+ `w3m-local-content-type'.
+ (w3m-download): `url' is lexically binded. Call `message' to display
+ error messages.
+
+ * w3mhack.el (w3mhack-examine-modules): Fix to avoid that octet.el is
+ byte-compiled repeatedly.
+
+2002-01-29 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Add octet.el to the module list
+ if FLIM is installed.
+
+ * octet.el: New file.
+
+2002-01-25 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-highlight-current-anchor): Don't search for the anchor
+ points which are out of sight.
+
+2002-01-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-tmp-urluser-alist): New variable.
+ (w3m-goto-url): If URL include user and passwd, set
+ `w3m-tmp-urluser-alist' for process handling. Remove passwd from URL.
+ (w3m): Remove passwd from URL when insert it in buffer.
+
+ * w3m-util.el (w3m-get-user-passwd-from-url)
+ (w3m-remove-passwd-from-url): New functions.
+
+ * w3m-proc.el (top): Define `w3m-tmp-urluser-alist' to avoid
+ byte-compile warning.
+ (w3m-process-start-process): If URL include user or passwd, set them to
+ default values.
+ (w3m-process-filter): Use default values of `w3m-process-user' and
+ `w3m-process-passwd'.
+ (w3m-process-get-server-root): Remove `about://.../' from server root.
+
+ * w3m-search.el (w3m-search): Insert default string in minibuffer.
+
+2002-01-25 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-about-history): Don't add to history if url is nil.
+ (w3m-print-this-url-after-command): Call
+ `w3m-highlight-current-anchor'.
+ (w3m-delete-all-overlays): New macro.
+ (w3m-highlight-current-anchor): New function.
+ (w3m-current-anchor-face): New face.
+ (w3m-arrived-anchor-face): Removed underline property.
+ (w3m-anchor-face): Ditto.
+
+2002-01-18 OHASHI Akira <bg66@koka-in.org>
+
+ * w3m.el (w3m-header-line-map): Inherit `w3m-mode-map'.
+
+2002-01-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (w3m-setup-favicon): Reversed the condition that decide
+ whether favicons are used.
+
+2002-01-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-setup-favicon): If url is `ftp://', not retrieve a
+ favicon data.
+
+ * w3m.el (w3m-current-directory): New function.
+ (w3m-goto-url): Use `w3m-current-directory' when set
+ `default-directory'.
+
+2002-01-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-ange-ftp): New option.
+ (w3m-w3m-attributes): Handle ftp scheme URLs.
+ (w3m-download): Refer `w3m-use-ange-ftp'.
+ (w3m-goto-url): Ditto.
+
+2002-01-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-read-file-name): Remove an optional argument
+ `initial'. Call `read-file-name' without `default' option.
+
+2002-01-11 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-url-encode-string): Fixed for Mule2.
+
+ * w3m-util.el (w3m-truncate-string): New function.
+
+ * w3m-form.el (w3m-form-replace): Use `w3m-truncate-string' instead of
+ `truncate-string'.
+
+2002-01-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-region): Process <base> tag.
+
+2002-01-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-content-type): Fix handling of the remote url.
+ (w3m-file-directory-p): New function.
+ (w3m-goto-ftp-url): Use `w3m-file-directory-p' instead of
+ `file-directory-p'.
+
+
+2002-01-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.4 from emacs-w3m-1_2 branch.
+
+2002-01-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-arrived-setup-hook): New hook.
+ (w3m-arrived-shutdown-hook): Ditto.
+ (w3m-arrived-setup): Run `w3m-arrived-setup-hook'.
+ (w3m-arrived-shutdown): Run `w3m-arrived-shutdown-hook'.
+ (w3m-quit): Don't remove `w3m-arrived-shutdown' from `kill-emacs-hook'.
+
+ * w3m-e21.el (w3m-favicon-cache-expire-wait): New user option.
+ (w3m-favicon-cache-p): New macro.
+ (w3m-favicon-cache-favicon): Ditto.
+ (w3m-favicon-cache-retrived): Ditto.
+ (w3m-retrieve-favicon): Don't use old cache data.
+ (w3m-favicon-cache-data): Renamed from `w3m-favicon-data-cache'.
+ (w3m-favicon-save-cache-file): Follow above change.
+ (w3m-favicon-load-cache-file): Ditto.
+ (w3m-arrived-setup-hook): Regist `w3m-favicon-load-cachee-faile'.
+ (w3m-arrived-shutdown-hook): Regist `w3m-favicon-save-cache-file'.
+
+2002-01-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Use a URL-like string under the cursor as the
+ initial value of the target URL when interactively called.
+ (w3m-view-this-url): When a URL-like string is found under the cursor,
+ view it.
+ (w3m-view-this-url-1): New internal function.
+
+2002-01-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-display-hook): Change default variable to `nil'.
+ (top): Use `add-hook' when `w3m-history-highlight-current-url',
+ `w3m-move-point-for-localcgi' and `w3m-select-buffer-update' set to
+ `w3m-display-hook'.
+ (w3m-local-dirlist-cgi): When use `dirlist.cgi', decode filename tag.
+
+2002-01-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-to-file-name): When the pointed file is not found,
+ decode the specified URL and recheck it.
+
+2002-01-07 Shiro Takeda <zbc08106@park.zero.ad.jp>
+
+ * w3m.el (w3m-bold-face, w3m-underline-face): New faces.
+ (w3m-fontify-bold): Use `w3m-bold-face' instead of `bold'.
+ (w3m-fontify-underline): Use `w3m-underline-face' instead of
+ `underline'.
+
+2002-01-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w32-browser-with-fiber): Fix handling of the local url.
+
+ * w3m-util.el (w3m-url-local-p): Fix its regexp for Windows.
+
+2002-01-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-about-header): Protect against null title.
+ (w3m-arrived-setup): Ignore database of arrived URLs in too old style.
+
+2002-01-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-encode-string): Add a period to the set of characters
+ which are not encoded. From Fabrice Bauzac <noon@noon.dnsalias.net>
+
+2001-12-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-add-local-hook): New function.
+ (w3m-current-position): New buffer local variable.
+ (w3m-store-current-position): New hook function.
+ (w3m-print-this-url-after-command): New hook funtcion.
+ (w3m-buffer-setup): Regist these hook functions.
+ (w3m-header-line-location-title-face): Integrated with the defition in
+ w3m-e21.el
+ (w3m-header-line-location-content-face): Ditto.
+ (w3m-header-line-map): Ditto.
+ (w3m-header-line-insert): Renamed from `w3m-insert-header-line'.
+
+ * w3m-e21.el (w3m-header-line-location-title-face): Integrated to the
+ defition in w3m.el.
+ (w3m-header-line-location-content-face): Ditto.
+ (w3m-header-line-map): Ditto.
+ (w3m-setup-header-line): Clean up.
+ (w3m-insert-header-line): Removed.
+
+2001-12-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-url-to-file-name): Fix its regexp.
+
+2001-12-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-print-this-url): Display a message when it is called
+ interactively.
+
+2001-12-29 OHASHI Akira <bg66@koka-in.org>
+
+ * w3m.el (w3m-print-this-url): Don't print any messages when there is
+ no url or form under point.
+
+2001-12-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-local-directory-alist): Renamed from
+ `w3m-edit-url-directory-alist'.
+ (w3m-url-to-file-name): Return nil, when the specified URL points no
+ local file.
+ (w3m-url-completion): Modified its regexp. Fix completion of dot
+ files.
+ (w3m-edit-url): Simplified.
+ (w3m-goto-url): Removed the redundant local variable. Set
+ `default-directory' to the local directory to which the current URL is
+ related by `w3m-url-local-directory-alist'.
+ (w3m-about-history): Installed the ad-hoc workaround.
+
+ * w3m-util.el (w3m-url-dtree-p): Modified its regexp.
+
+2001-12-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-decode-get-refresh): Not run Refresh timer if the URI is
+ matched `about://', .
+ (w3m-goto-url): Modify the timing to call `w3m-cancel-refresh-timer'.
+
+2001-12-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-util.el: Autoload "timer" for the function `cancel-timer' when
+ Mule 2 is running.
+
+2001-12-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-refresh-at-time): Run `w3m-goto-url-with-timer'
+ immediately, if the delay of refresh is zero.
+
+ * w3m-xmas.el (w3m-refresh-at-time): Removed.
+
+2001-12-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-refresh): New user option.
+ (w3m-refresh-timer, w3m-current-refresh): New buffer-local variables.
+ (w3m-clear-local-variables, w3m-copy-local-variables): Handle
+ `w3m-current-refresh'.
+ (w3m-meta-refresh-content-regexp)
+ (w3m-meta-content-refresh-regexp): New constant.
+ (w3m-decode-buffer): Call `w3m-decode-get-refresh' first.
+ (w3m-decode-get-refresh): New function.
+ (w3m-view-previous-page): Bind `w3m-use-refresh' to nil.
+ (w3m-quit, w3m-close-window): Call `w3m-cancel-refresh-timer' at any
+ buffers.
+ (w3m-goto-url): Call `w3m-cancel-refresh-timer' first. Call
+ `w3m-refresh-at-time' at last; start REFRESH timer.
+ (w3m-goto-url-with-timer): New function.
+ (w3m-refresh-at-time): New function for FSF Emacs.
+
+ * w3m-xmas.el (w3m-refresh-at-time): New function for XEmacs.
+
+ * w3m-util.el (w3m-cancel-refresh-timer): New function.
+ (w3m-current-refresh, w3m-refresh-timer, w3m-use-refresh): Avoid
+ byte-compiled warnings.
+
+ * w3m-proc.el (w3m-process-stop): Call `w3m-cancel-refresh-timer'.
+
+2001-12-24 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-dump-head-source-command-arguments) [w3mmee]: Support
+ `w3m-accept-languages'.
+
+
+2001-12-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.3 from emacs-w3m-1_2 branch.
+
+2001-12-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-type): Changed condition to decide type.
+ (w3m-decoder-alist): Call `file-name-nondirectory' before `w3m-command'
+ is refered.
+ (w3m-dirlist-cgi-program): Ditto.
+
+2001-12-21 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-type): Changed condition to decide type.
+ (w3m-decoder-alist): Use `w3m-command' for inflate command path.
+ (w3m-dirlist-cgi-program): Use `w3m-command'.
+ (w3m-dump-head-source-command-arguments) [w3mmee]: Don't add "-o
+ accept_language=xxx".
+
+2001-11-16 OKAZAKI Tetsurou <okazaki@be.to>
+
+ * w3m.el (w3m-type): Use "w3m-m17n" if exists.
+
+2001-12-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-mailto-url): Use the property `composefunc' to get
+ the function to compose a mail from `mail-user-agent'.
+
+2001-12-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-load-list): Removed a bogus code for XEmacs; don't bind
+ the value of `file-coding-system-for-read' if the optional arg is nil
+ and `w3m-file-coding-system-for-read' is nil.
+
+2001-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3m-use-favicon): Don't bind it.
+
+ * w3m-e21.el (w3m-use-favicon): Set it to nil anyway when Emacs is
+ running in the batch mode.
+ (w3m-imagick-convert-buffer): Reverted.
+
+2001-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-imagick-convert-buffer): Don't growl errors when
+ Emacs is running in the batch mode.
+
+2001-12-18 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-e21.el (w3m-favicon-use-cache-file): New user option.
+ (w3m-favicon-cache-file): Ditto.
+ (w3m-favicon-data-cache): New variable.
+ (w3m-retrieve-favicon): Use `w3m-favicon-data-cache' or store it.
+ (w3m-favicon-save-cache-file): New function.
+ (w3m-favicon-load-cache-file): Ditto.
+
+2001-12-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-e21-toolbar-configurations): Replace
+ `auto-resize-tool-bar' to `auto-resize-tool-bars'.
+
+2001-12-17 OHASHI Akira <bg66@koka-in.org>
+
+ * README.shimbun.ja: Add information for sb-debian-jp.el and
+ sb-debian.el.
+
+2001-12-17 Taiki SUGAWARA <t-suga@atomsystem.co.jp>
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-parse-forms): Change the separater string for
+ option tag.
+
+2001-12-12 Taiki SUGAWARA <t-suga@atomsystem.co.jp>
+
+ * w3m-form.el (w3m-form-parse-forms): If not find selected, first
+ element is made into default.
+
+2001-12-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-about-dtree): Ignore arguments on and after 4th.
+
+2001-12-14 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>.
+
+ * w3m-e21.el (w3m-use-favicon): Default to t, but it will be altered to
+ nil automatically if ImageMagick does not support a favicon; never use
+ ImageMagick if it has been set to nil.
+
+ * w3mhack.el (w3m-use-favicon): Bind it to nil to inhibit the use of
+ ImageMagick.
+
+2001-12-12 Kazuyoshi Koreeda <k_koreed@d2.dion.ne.jp>
+
+ * w3m-weather.el (w3m-weather-insert-seikatu-sisu): New function.
+ (w3m-weather-get-seikatu-sisu): Ditto.
+
+2001-12-10 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-parse-forms): Use `w3m-decode-entities-string'
+ to value in the textarea and option menu.
+
+2001-12-11 Mito <mito@mxa.nes.nec.co.jp>
+
+ * w3m.el (w3m-scroll-left): Modify doc-string.
+ (w3m-scroll-right): Ditto.
+
+2001-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-imagick-convert-usable-p): New function.
+ (w3m-use-favicon): Use it.
+
+2001-12-06 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (top): Installed the check of the validity of ImageMagick.
+
+
+2001-12-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.2 from emacs-w3m-1_2 branch.
+
+2001-12-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-type): Follow the new official release of w3m.
+ (w3m-attributes): Follow the change of error symbols which are defined
+ in w3m-proc.el.
+ (w3m-retrieve): Ditto.
+ (w3m-about-header): Likewise. Ignore optional arguments safely.
+ (w3m-message): Display message only when original w3m buffer is
+ displayed.
+ (w3m-about-retrieve): Asynchronized.
+ (w3m-retrieve-and-render): Follow the change of `w3m-message'.
+ (w3m-prepare-content): Install the measure against narrowed buffers.
+
+ * w3m-proc.el (w3m-process-start-process): Accept the 2nd optional
+ argument to reset the sentinel funtcion for the generated asynchronous
+ process.
+ (w3m-process-failure): Removed.
+ (w3m-process-timeout): Simplified its error condition.
+ (w3m-process-with-wait-handler): No sentinel function is registered and
+ the sentinel function is called from this macro itself.
+
+ * w3m-weather.el (w3m-weather-filter-functions): Add
+ `w3m-weather-expand-anchors'.
+ (w3m-about-weather): Asynchronized.
+ (w3m-weather-remove-headers): Follow changes of original content.
+ (w3m-weather-remove-footers): Ditto.
+ (w3m-weather-expand-anchors): New filter function.
+
+2001-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-emacs-w3m-icon): Made it interlaced and endlessly
+ animated.
+
+2001-12-06 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-decode-buffer): When content-charset is unknown, detect
+ coding-system automatically.
+
+2001-12-04 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-e21.el (w3m-buffer-favicon): Reset `w3m-current-favicon-data' to
+ nil when conversion was failure.
+
+2001-12-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-imagick-convert-buffer): Say errors and return nil if
+ the process returns a non-zero status (possibly a string).
+
+2001-12-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-xmas.el (w3m-create-image): Bind some arguments lexically for
+ w3m-fix-gif().
+
+2001-12-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-setup-favicon): Fix for "about://" url.
+ (w3m-buffer-favicon): Renamed local variable.
+ (w3m-tab-line): Call `w3m-buffer-favicon' only when w3m-use-favicon is
+ non-nil.
+
+2001-12-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-modeline-process-status-on): Modify default value.
+ (w3m-buffer-setup): Simplified `mode-line-buffer-identification'.
+
+2001-11-29 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-imagick-convert-program): New user option.
+ (w3m-favicon-size): Ditto.
+ (w3m-use-favicon): Ditto.
+ (w3m-favicon-name): New constant.
+ (w3m-current-favicon-data): New buffer local variable.
+ (w3m-current-favicon-image): Ditto.
+ (w3m-display-hook): Added 'w3m-setup-favicon.
+ (w3m-imagick-convert-buffer): New function.
+ (w3m-imagick-convert-data): Ditto.
+ (w3m-setup-favicon): Ditto.
+ (w3m-buffer-favicon): Ditto.
+ (w3m-retrieve-favicon): Ditto.
+ (w3m-tab-line): Display favicon on tab.
+
+2001-11-28 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-xmas.el (w3m-insert-image): Rewrite.
+ (if displayed images exist on the right side, keep them and display
+ again)
+ (w3m-remove-image): Call `delete-extent' to destroy extents.
+
+2001-11-27 Yoichi NAKAYAMA <yoichi@eken.phys.nagoya-u.ac.jp>
+
+ * TIPS: New file.
+
+2001-11-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-download-this-url): Fix a problem of broken URL.
+
+2001-11-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top, w3m-about): Change the URL of w3m's official page.
+
+2001-11-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-max-anchor-sequence): New buffer local variable.
+ (w3m-copy-local-variables, w3m-clear-local-variables): Handle
+ `w3m-max-anchor-sequence'.
+ (w3m-fontify-anchors): Reset `w3m-max-anchor-sequence' to zero. Use
+ the text-property `w3m-anchor-sequence' insted of `w3m-cursor-anchor'.
+ (w3m-goto-next-anchor, w3m-next-anchor, w3m-goto-previous-anchor)
+ (w3m-previous-anchor): Rewrite use the text-property
+ `w3m-anchor-sequence'.
+ (w3m-next-form, w3m-goto-next-image, w3m-next-image)
+ (w3m-previous-image): Fix mistake as modified last time.
+
+ * w3m-util.el (w3m-anchor-sequence): New macro.
+ (w3m-cursor-anchor) Remove macro.
+
+ * w3m-form.el (w3m-form-fontify): Use the text-property
+ `w3m-anchor-sequence' insted of `w3m-cursor-anchor'.
+
+2001-11-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-download-this-url): Wrap the form which is evaluated in
+ asynchronous context with `w3m-process-with-null-handler', to fix the
+ bug reported by Hideyuki SHIRAI <shirai@meadowy.org>.
+
+ * w3m-xmas.el (w3m-create-image): Modified to avoid calling
+ `w3m-process-with-wait-handler'.
+
+2001-11-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-push): Set the buffer-local variable
+ `w3m-process-object' in the appropriate buffer.
+ (w3m-process-sentinel): Removed redundant call of
+ `with-current-buffer'.
+
+ * Makefile.in (default): Reintroduce of checking time stamps of
+ w3m-util.elc and w3m-proc.elc.
+
+ * w3m-proc.el (w3m-process-temp-file): Abolished.
+
+ * w3m.el (w3m-content-charset, w3m-content-encoding,
+ w3m-content-length, w3m-content-type, w3m-last-modified, w3m-real-url):
+ Fixed asynchrounization.
+ (w3m-download): Changed the argument spec and the body to accept an
+ asynchrounous context.
+ (w3m-external-view): Follow change of `w3m-download'.
+ (w3m-external-view-file): Changed the argument spec and the body;
+ `w3m-process-temp-file' is not refered.
+ (w3m-download-this-url): Follow change of `w3m-download'.
+ (w3m-scroll-left, w3m-scroll-right): Use `call-interactively' to avoid
+ a strange behavior of Emacs21. This change is suggested by Hironori
+ FUJII <fujii@chi.its.hiroshima-cu.ac.jp>.
+
+ * w3m-proc.el (w3m-process-failure): New error symbol.
+ (w3m-process-timeout): Change its error condition.
+ (w3m-process-with-wait-handler): Install adhoc workaround.
+
+ * w3m.el (w3m-attributes, w3m-retrieve, w3m-about-header): Follow
+ change of `w3m-process-with-wait-handler'.
+
+2001-11-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-modeline-process-status-on): New constant.
+ (w3m-modeline-status-off): Rename from `w3m-modeline-image-status-off'.
+ (w3m-buffer-setup): Show the string of `w3m-modeline-process-status-on'
+ when process running.
+ (w3m-download): Add 4th argument `extview' for w3m-external-view(). If
+ `extview' is gived, apply `extview' on process-sentinel like (apply
+ (car extview) (cdr extview)).
+ (w3m-external-view): When execute `w3m-download', call with `extview'
+ argument.
+ (w3m-external-view-file): New function.
+
+2001-11-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-print-this-url): View current image info.
+ (w3m-goto-next-image, w3m-next-image, w3m-goto-previous-image)
+ (w3m-previous-image): New functions.
+ (w3m-lynx-like-map, w3m-info-like-map): Bind "}" as the key to call
+ `w3m-next-image'. Bind "{" as the key to call `w3m-previous-image'.
+ (w3m-mode): Modify dos-string.
+
+2001-11-19 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-goto-next-form, w3m-next-form)
+ (w3m-goto-previous-form, w3m-previous-form): New functions.
+ (w3m-lynx-like-map, w3m-info-like-map): Bind "]" as the key to call
+ `w3m-next-form'. Bind "[" as the key to call `w3m-previous-form'.
+
+2001-11-19 Kazuhiko <kazuhiko@ring.gr.jp>
+
+ * w3m-xmas.el (w3m-create-image): Fix a problem in handling XBM on
+ XEmacs.
+
+2001-11-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-attributes): Establish the error handler for
+ `w3m-process-timeout' when the argument `handler' is equal to nil.
+ (w3m-retrieve): Ditto.
+ (w3m-about-header): Establish the error handler for
+ `w3m-process-timeout' before `w3m-w3m-get-header' is called.
+ (w3m-select-buffer-close-window): Check whether the menu's window
+ exists.
+
+ * w3m-proc.el: Changes to avoid endless loop.
+ (w3m-process-start-process): Changed the spec of its return value.
+ (w3m-process-timeout): New error symbol.
+ (w3m-process-with-wait-handler): Bind `inhibit-quit' to nil, in order
+ to accept user's quit; Signal `w3m-process-timeout' when time out is
+ detected.
+ (w3m-process-do): Accept null variable.
+ (w3m-process-do-with-temp-buffer): Ditto.
+
+ * Makefile.in (default): Cancel the last change.
+
+2001-11-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (default): When files which define macros and inline
+ functions such as w3m-util.el and w3m-proc.el are newer than their
+ byte-compiled files, run clean target before compile.
+
+ * w3m.el (w3m-about-db-history-today): Removed.
+ (w3m-about-db-history): Call `w3m-time-lapse-seconds' to classify
+ entries.
+
+ * w3m-proc.el: Changes to avoid endless loop.
+ (w3m-process-inhibit-quit): New internal variable.
+ (w3m-process-timeout): New variable.
+ (w3m-process-with-wait-handler): Strict check when asynchrounous
+ processes finish; Refer `w3m-process-timeout' to check idle time.
+ (w3m-process-sentinel): Bind `inhibit-quit' according to
+ `w3m-process-sentinel'.
+
+ * w3m-e21.el: Changes to display tabs which are retieving contents in
+ the other face.
+ (top): Define `w3m-current-process' to avoid byte-compile warning.
+ (w3m-tab-unselected-retrieving-face): New face.
+ (w3m-tab-selected-retrieving-face): Ditto.
+ (w3m-tab-line): Refer `w3m-current-process' in order to select the face
+ of the tab which is retriving some pages.
+
+ * w3m-util.el (w3m-time-lapse-seconds): New inline function.
+
+ * w3m-antenna.el (top): Add autoload of `w3m-filter' to avoid
+ byte-compile warning.
+
+2001-11-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-select-buffer): If nomsg eq 'update, don't save
+ selected-window; so called `w3m-select-buffer-update' any window to
+ differ original window executed process, is broken
+ `w3m-select-buffer-window'.
+ (w3m-select-buffer-update): Call `w3m-select-buffer' with 'update.
+
+2001-11-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-keymap-property): New macro.
+ (mime-w3m-preview-text/html, kill-new): Use the above macro instead of
+ `w3m-static-if'.
+
+2001-11-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-select-buffer-window-ratio): New user option.
+ (w3m-select-buffer-window-size): Remove user option.
+ (w3m-select-buffer-window-size): New function.
+ (w3m-select-buffer-toggle-style): Ditto.
+ (w3m-select-buffer): Use `w3m-select-buffer-window-size' when calculate
+ window size. When call with prefix argument, toggle
+ `w3m-select-buffer-horizontal-window'.
+ (w3m-select-buffer-show-this-line): Use `w3m-select-buffer-window-size'
+ when calculate window size. If exist w3m-buffer another window under
+ control, use it.
+ (w3m-select-buffer-mode-map): Modify the key binding 'C-cC-s' for
+ toggle `w3m-select-buffer-horizontal-window'.
+ (w3m-select-buffer-update): Call `w3m-select-buffer' with two
+ arguments.
+ (w3m-select-buffer-mode): Modify doc-string.
+
+ * w3m-tabmenu.el (w3m-switch-buffer): Change the rule of detecting
+ default buffer.
+ (w3m-tab-menubar-make-items): Ditto.
+
+2001-11-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el: Changes to make installation of this module be easy;
+ Comments updated; Initialize code is moved to `mime-w3m-setup'; Changed
+ requirement of other modules.
+ (mime-w3m-display-inline-images): Changed the default value.
+ (mime-w3m-insinuate, mime-w3m-setup): New function.
+ (mime-w3m-preview-text/html): Call `mime-w3m-setup'.
+
+2001-11-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-search.el: Require `cl' when compiling.
+
+2001-11-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Changes to avoid that multi async processes are started in
+ the same buffer.
+ (w3m-current-process): New internal variable to protect parallel
+ retriving.
+ (w3m-attributes, w3m-base-url, w3m-content-charset,
+ w3m-content-encoding, w3m-content-length, w3m-content-type,
+ w3m-last-modified, w3m-real-url): Asynchronized.
+ (w3m-toggle-inline-images-internal): Set `w3m-current-buffer' to this
+ buffer locally, in order to classify the generated async process to the
+ appropriate buffer.
+ (w3m-toggle-inline-images): Stop processes which are retrieving images
+ of this buffer.
+ (w3m-retrieve-and-render): Remove redundant `let'.
+ (w3m-view-this-url): Refontify anchor.
+ (w3m-lynx-like-map, w3m-info-like-map): Bind `C-cC-g' as the key to
+ call `w3m-process-stop'.
+ (w3m-goto-url): Check `w3m-current-process' to avoid reenterant and set
+ it to the value of `w3m-retrieve-and-render'; Before the retrieving
+ process of the next page is started, select this buffer in the current
+ window and stop processes which are retrieving images of this buffer.
+ (w3m): Not select this buffer in the current window.
+
+ * w3m-proc.el (top): Define `w3m-current-process' to avoid byte-compile
+ warning.
+ (w3m-process-queue-registrable-p): Abolished.
+ (w3m-process-new): Its argument spec is changed; Changed the strucuture
+ of `w3m-process' object.
+ (w3m-process-command): New macro.
+ (w3m-process-arguments): Follow the structural change of `w3m-process'
+ object.
+ (w3m-process-push): Likewise; Follow change of `w3m-process-new'; No
+ check for `w3m-process-queue-registrable-p'.
+ (w3m-process-kill-process): Check process status before stopping them.
+ (w3m-process-start-process): Follow the structural change of
+ `w3m-process' object.
+ (w3m-process-stop): Ditto; Start queued processes.
+ (w3m-process-with-null-handler): No check for
+ `w3m-process-queue-registrable-p'.
+
+ * w3m-util.el (w3m-kill-buffer): Fix code to kill this buffer.
+
+2001-11-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-select-buffer): Fix window height calculation when
+ w3m-select-buffer-horizontal-window is nil.
+ (w3m-select-buffer-mode-map): Add the key bind of
+ `w3m-select-buffer-show-this-line-and-down'. Modify the key bind of
+ `w3m-select-buffer-show-this-line'.
+ (w3m-select-buffer-show-this-line): Fix window height calculation when
+ w3m-select-buffer-horizontal-window is nil. If already displayed
+ w3m-buffer and call interactively, call `w3m-scroll-up-or-next-url'.
+ (w3m-select-buffer-show-this-line-and-down): New function.
+
+2001-11-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Merge experimental-async branch to main trunk.
+
+ * w3m-util.el: Rename from w3m-macro.el; Require `poe' and `poem'
+ module for XEmacs and Mule; Import some functions from w3m.el and
+ w3m-proc.el.
+
+ * w3m.el: Require `w3m-util' instead of `w3m-macro'; Export
+ `w3m-kill-all-buffer' to w3m-util.el.
+ (w3m-work-binary-buffer-name): Removed.
+ (w3m-rendering-half-dump): Accept an optional argument for w3mmee and
+ w3m-m17n.
+ (w3m-rendering-buffer-1): Accept two optional arguments for w3mmee and
+ w3m-m17n.
+ (w3m-rendering-unibyte-buffer): Generate a new working buffer for
+ w3mmee and w3m-m17n, in order to avoid racing.
+ (w3m-rendering-multibyte-buffer): Ditto.
+
+ * w3m-proc.el: Require `w3m-util' instead of `w3m-macro'; Export
+ `w3m-buffer-title', `w3m-buffer-name-lessp' and `w3m-list-buffers' to
+ w3m-util.el.
+
+ * mime-w3m.el, w3m-antenna.el, w3m-bookmark.el, w3m-e21.el,
+ w3m-form.el, w3m-tabmenu.el, w3m-xmas.el: Require `w3m-util' instead of
+ `w3m-macro'.
+
+ * w3mhack.el (w3mhack-examine-modules): Handle w3m-util.el instead of
+ w3m-macro.el.
+
+2001-11-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): Colon keywords definition are moved to `w3m-macro.el'.
+ (w3m-process-connection-type): Imported from `w3m-proc.el'.
+ (w3m-next-buffer, w3m-previous-buffer): Simplified.
+ (w3m-delete-buffer): Call `w3m-quit' when the number of w3m-mode
+ buffers is equal to 1.
+ (w3m-quit): Kill all w3m-mode buffers.
+ (w3m-close-window): Call `w3m-select-buffer-close-window'.
+ (w3m-select-buffer-generate-contents): Simplified.
+ (w3m-select-buffer-close-window): New function.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items): Use `w3m-buffer-title'
+ and `w3m-list-buffers'.
+
+ * w3m-proc.el (top): Require `poe' module in XEmacs; Require `w3m-om'
+ in Mule; Define `w3m-current-title' to avoid byte-compile warning.
+ (w3m-process-connection-type): Exported to `w3m.el'.
+ (w3m-buffer-title, w3m-buffer-name-lessp, w3m-list-buffers): New
+ functions.
+
+ * w3m-macro.el (top): Colon keywords definition are imported from
+ `w3m.el'.
+ (w3m-pullout-buffer-number): Removed.
+
+ * w3m-e21.el (w3m-tab-line): Use `w3m-buffer-title' and
+ `w3m-list-buffers'.
+
+ * w3m.el (w3m-attributes): Wrap `w3m-w3m-attributes' with
+ `w3m-process-with-wait-handler'.
+ (w3m-w3m-attributes): Changed the argument spec. Now, this function
+ can be used only in asynchronous context.
+ (w3m-rendering-unibyte-buffer): Changed the argument spec, and the
+ first argument `url' is refered instead of `w3m-current-url'. This
+ change is made to avoid using `w3m-process-with-wait-handler' in
+ asynchronous context.
+ (w3m-prepare-content): Follow the change of
+ `w3m-rendering-unibyte-buffer'.
+
+2001-11-14 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-next-buffer): Use `w3m-pullout-buffer-number' when sort
+ buffer-name.
+ (w3m-previous-buffer): Ditto.
+ (w3m-select-buffer): Change the turn to call of functions.
+ (w3m-select-buffer-generate-contents): Use `w3m-pullout-buffer-number'
+ when sort buffer-name. Use text-property instead of point when move to
+ point.
+ (w3m-select-buffer-recheck): Fix read-only error.
+ (w3m-select-buffer-copy-buffer): Rewrite.
+
+ * w3m-tabmenu.el (w3m-tab-menubar-make-items): Use
+ `w3m-pullout-buffer-number' instead of `w3m-tab-menubar-pull-bufnum'.
+ (w3m-tab-menubar-pull-bufnum): Remove.
+
+ * w3m-macro.el (w3m-pullout-buffer-number): New defsubst.
+
+ * w3m-e21.el (w3m-tab-line): Use `w3m-pullout-buffer-number' when sort
+ buffer-name.
+
+2001-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-parse-attributes): Moved it again to w3m-macro.el.
+ * w3m-macro.el: The opposite of above.
+
+2001-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Moved back some macros and inline functions from
+ w3m-macro.el.
+
+ * w3m-macro.el (w3m-parse-attributes, w3m-real-url, w3m-last-modified,
+ w3m-content-type, w3m-content-length, w3m-content-encoding,
+ w3m-content-charset, w3m-base-url, w3m-attributes): Moved back to
+ w3m.el.
+
+2001-11-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-retrieve) Call `w3m-w3m-attributes' instead of
+ `w3m-attributes'.
+
+ * w3m-proc.el (w3m-process-with-wait-handler): Reimplemented.
+
+2001-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Moved some macros and inline functions to w3m-macro.el.
+
+ * w3m-macro.el (w3m-time-newer-p, w3m-url-local-p, w3m-url-dtree-p,
+ w3m-parse-attributes, w3m-real-url, w3m-last-modified,w3m-content-type,
+ w3m-content-length, w3m-content-encoding, w3m-content-charset,
+ w3m-base-url, w3m-attributes, w3m-cursor-anchor, w3m-submit, w3m-image,
+ w3m-anchor, w3m-action, w3m-get-text-property-around): Moved from
+ w3m.el.
+ (w3m-condition-case): Use old-fashioned backquotes.
+
+ * w3m.el, w3m-xmas.el, w3m-tabmenu.el, w3m-form.el, w3m-e21.el,
+ w3m-bookmark.el, w3m-antenna.el, mime-w3m.el: Require `w3m-macro'.
+
+2001-11-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-get-header, w3m-w3m-attributes): Asynchronized.
+ (w3m-w3m-retrieve): Argument spec is changed.
+ (w3m-w3m-dump-head-source): Follow change of `w3m-w3m-attributes'.
+ (w3m-copy-buffer): Removed redundant code.
+ (w3m-about-header): Follow change of `w3m-w3m-get-header'.
+
+ * w3m-proc.el (w3m-process-do): The generated asynchronous process in
+ the post handler is started at the end of `w3m-process-sentinel'.
+ (w3m-process-do-with-temp-buffer): Ditto.
+ (w3m-process-sentinel): Fixed.
+
+ * w3m.el (w3m-download): Use `progn' instead of `inline', in order to
+ make debugging be easy.
+ (w3m-retrieve-and-render): Ditto.
+
+ * w3m-proc.el: Changed the order of asynchronous form evaluation and
+ starting asynchronous processes.
+ (w3m-process-queue): Renamed from `w3m-processes'.
+ (w3m-process-queue-registrable-p): New internal variable.
+ (w3m-process-with-coding-system): New macro.
+ (w3m-process-with-environment): Redefine with new backquote style.
+ (w3m-process-push): Refer `w3m-process-queue-registrable-p' to add the
+ handler to processes registered in `w3m-process-queue' safely.
+ (w3m-process-start-process): New internal function.
+ (w3m-process-start-queued-processes): Renamed from
+ `w3m-process-start-internal'; Call `w3m-process-start-process'; Follow
+ renaming of variables.
+ (w3m-process-stop, w3m-process-shutdown): Follow renaming of variables.
+ (w3m-process-with-null-handler): Start asynchronous processes at the
+ end of this macro.
+ (w3m-process-do, w3m-process-do-with-temp-buffer): Reimplemented.
+ (w3m-process-start): Reimplemented. Asynchronous processes are not
+ started in this function.
+ (w3m-process-start-after): New internal function.
+ (w3m-process-sentinel): Follow renaming of variables and functions.
+
+2001-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-macro.el (w3m-condition-case): New macro.
+
+2001-11-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in: Fix the macro rule to generate *.elc files.
+
+ * w3m.el (w3m-display-hook): Add `w3m-select-buffer-update'.
+ (w3m-select-buffer-name): Move the definition position to avoid
+ byte-compile warning.
+ (w3m-goto-url): Removed the code to update the select buffer.
+ (w3m-select-buffer-update): New function.
+
+ * w3m-proc.el (w3m-process-with-wait-handler): Adhoc workaround.
+ (w3m-process-start): Fix.
+
+2001-11-13 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-lynx-like-map): Bind `C-cC-a' as the key to call
+ `w3m-switch-buffer'.
+ (w3m-info-like-map): Ditto. Bind `\C-c\C-@' and `C-c\C- ' as the key to
+ call `w3m-history-store-position'. Bind `C-cC-b' as the key to call
+ `w3m-history-restore-position'.
+ (w3m-mode): Modify doc-string.
+ (w3m-select-buffer-show-this-line-and-switch): New function.
+ (w3m-select-buffer-name): New internal constant.
+ (w3m-select-buffer-mode-map): Bind `w' and `h' as the key to call
+ `w3m-select-buffer-show-this-line-and-switch'.
+ (w3m-select-buffer-mode): Modify doc-string.
+ (w3m-select-buffer): Use `w3m-select-buffer-name'. If alive
+ select-buffer, use it. Add optional argument `nomsg'.
+ (w3m-select-buffer-generate-contents): If w3m-current-title is
+ `<no-title>', use w3m-current-url.
+ (w3m-select-buffer-show-this-line): Return selected buffer.
+ (w3m-select-buffer-quit): Always pop up the w3m window when quit.
+ (w3m-select-buffer-show-this-line-and-quit): Rewrite.
+ (w3m-goto-url): If alive w3m-select-buffer, update it.
+ (w3m-copy-buffer): If w3m-pop-up-windows is nil, use
+ switch-to-buffer. Block to change w3m-select-buffer to w3m buffer, if
+ w3m-pop-up-windows is t.
+ (top): Add autoload of `w3m-setup-tab' and `w3m-switch-buffer'.
+ (w3m-setup-menu): Call `w3m-setup-tab-menu' when w3m-use-tab-menubar is
+ t.
+ (w3m-mode): Remove to call `w3m-setup-tab-menu'.
+
+ * w3m-e21.el (TOP): Remove `(require 'w3m-tabmenu)'.
+
+ * w3m-e20.el (TOP): Ditto.
+
+ * w3m-om.el (TOP): Ditto.
+
+ * w3m-xmas.el (w3m-setup-tab-menu, w3m-tab-menubar-pull-bufnum)
+ (w3m-tab-menubar-make-items, w3m-select-buffer): Remove.
+ (w3m-setup-menu): Call `w3m-setup-tab-menu' when w3m-use-tab-menubar is
+ t.
+
+ * w3mhack.el (w3mhack-examine-modules): Revival byte-compile
+ `w3m-tabmenu.el' when XEmacs.
+
+ * w3m-tabmenu.el (ALL): Full rewrite to use `easymenu'.
+
+2001-11-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-select-buffer-horizontal-window): New user option.
+ (w3m-select-buffer-window-size): Ditto.
+ (w3m-lynx-like-map): Bind `C-cC-b' as the key to call
+ `w3m-switch-buffer.
+ (w3m-info-like-map): Ditto.
+ (w3m-select-buffer-window): New internal variable.
+ (w3m-select-buffer-message): New internal constant.
+ (w3m-select-buffer): New implementation.
+ (w3m-select-buffer-generate-contents): New function.
+ (w3m-select-buffer-mode-map): New keymap.
+ (w3m-select-buffer-mode): New function.
+ (w3m-select-buffer-recheck): New command.
+ (w3m-select-buffer-current-buffer): New macro.
+ (w3m-select-buffer-show-this-line): New command.
+ (w3m-select-buffer-next-line): Ditto.
+ (w3m-select-buffer-previous-line): Ditto.
+ (w3m-select-buffer-copy-buffer): Ditto.
+ (w3m-select-buffer-delete-buffer): Ditto.
+ (w3m-select-buffer-quit): Ditto.
+ (w3m-select-buffer-show-this-line-and-quit): Ditto.
+
+ * w3m-xmas.el (w3m-switch-buffer): Renamed from `w3m-select-buffer'.
+
+ * w3m-tabmenu.el (w3m-switch-buffer): Renamed from `w3m-select-buffer'.
+
+2001-11-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e20.el (w3m-display-inline-images-p): Renamed from
+ `w3m-display-inline-image-p'.
+
+ * w3m-om.el (w3m-display-inline-images-p): Ditto.
+
+2001-11-12 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Bind `w3m-display-inline-images'
+ instead of `w3m-current-image-status'.
+
+ * mime-w3m.el (mime-w3m-display-inline-images): Renamed from
+ `mime-w3m-display-inline-image'.
+ (mime-w3m-preview-text/html): Follow the change above; Bind
+ `w3m-display-inline-images' instead of `w3m-current-image-status'.
+
+ * w3m-xmas.el (w3m-display-inline-images-p): Renamed from
+ `w3m-display-inline-image-p'; Refer `w3m-display-inline-images' instead
+ of `w3m-current-image-status'.
+
+ * w3m-e21.el (w3m-display-inline-images-p): Renamed from
+ `w3m-display-inline-image-p'; Refer `w3m-display-inline-images' instead
+ of `w3m-current-image-status'.
+
+ * w3m.el (w3m-display-inline-image): Abolish.
+ (w3m-current-image-status): Ditto.
+ (w3m-display-inline-images): New buffer local variable.
+ (w3m-default-display-inline-images): New user option.
+ (w3m-toggle-inline-images-permanently): Ditto.
+ (w3m-toggle-inline-image): Added docstring.
+ (w3m-toggle-inline-images): Ditto; Refer `w3m-display-inline-images'
+ instead of `w3m-current-image-status'.
+ (w3m-view-url-with-external-browser): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-toggle-inline-images): Change the value of
+ `w3m-display-inline-images' even when displaying images is not
+ completed.
+ (w3m-copy-buffer): Set `w3m-display-inline-images' according to
+ `w3m-toggle-inline-images-permanently'.
+ (w3m-mode): Set value of `w3m-display-inline-images' according to
+ `w3m-default-display-inline-images'.
+ (w3m-goto-url): Set `w3m-display-inline-images' according to
+ `w3m-toggle-inline-images-permanently'; Use
+ `w3m-display-inline-images-p' instead of `w3m-display-inline-image-p'.
+ (w3m-redisplay-with-charset): Use `w3m-display-inline-images' instead
+ of `w3m-display-inline-image'.
+ (w3m-region): Use `w3m-display-inline-images-p' instead of
+ `w3m-display-inline-image-p'.
+
+2001-11-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (Top): Abolished autoload of `w3m-setup-tab'.
+ (w3m-use-tab-menubar): Revival.
+ (w3m-lynx-like-map): Bind `C-cC-s' as the key to call
+ `w3m-select-buffer'.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Update the doc-string for the commands `w3m-next-buffer',
+ `w3m-previous-buffer', `w3m-delete-buffer' and `w3m-select-buffer'.
+ Use `w3m-use-tab-menubar' and `w3m-setup-tab-menu()'.
+
+ * w3m-e21.el (Top): Require `w3m-tabmenu'.
+
+ * w3m-e20.el (Top): Ditto.
+
+ * w3m-om.el (Top): Ditto.
+
+ * w3m-tabmenu.el: Rename from `w3m-tab.el'.
+ (w3m-setup-tab-menu): Rename from `w3m-setup-tab'.
+ (w3m-tab-menubar-make-items): Add new option `nomenu' for
+ w3m-select-buffer().
+ (w3m-select-buffer): New function.
+
+ * w3m-xmas.el (w3m-setup-tab-menu): Use `defun' insted of `ignore' to
+ avoid byte-compile warnings.
+ (w3m-tab-menubar-pull-bufnum, w3m-tab-menubar-make-items)
+ (w3m-select-buffer): Copy from w3m-tabmenu.el
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile
+ `w3m-tabmenu.el' when XEmacs.
+
+
+2001-11-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2.1 from emacs-w3m-1_2 branch.
+
+2001-11-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-expand-url): Remove the last segment of the base URL
+ before concatination the specified URL which has only a query part and
+ the base URL.
+
+2001-11-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-proc.el (w3m-process-new): Argument spec is changed.
+ (w3m-process-process): New macro.
+ (w3m-process-handlers): Follow the change of `w3m-process-new'.
+ (w3m-process-kill-process): New inline function.
+ (w3m-process-start-internal): Strict checking.
+ (w3m-process-stop): Fixed.
+ (w3m-process-with-wait-handler): Simplified.
+ (w3m-process-do): Strict checking of redundant evaluation.
+ (w3m-process-do-with-temp-buffer): Ditto.
+ (w3m-process-start): Not bind `w3m-process-exit-status' as a local
+ variable.
+ (w3m-process-sentinel): Ensure that this function will be never called
+ repeatedly; Strict checking.
+
+2001-11-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (top): Abolished a ignore() of `w3m-use-tab'.
+
+2001-11-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-dump-head-source): Fix the problem which occurs when
+ no content is retrieved.
+
+2001-11-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Handle `w3m-proc.el'.
+
+ * w3m.el: Modified to retrieve contents asynchronously.
+ (top): Require `w3m-proc.el' instead of `w3m-macro.el'.
+ (w3m-command-environment): Old name is `w3m-process-environment'.
+ (w3m-display-hook): Changed the default value.
+ (w3m-current-buffer): New internal variable.
+ (w3m-arrived-user-alist): Renamed to `w3m-process-user-alist' and
+ exported to `w3m-proc.el'.
+ (w3m-process-connection-type, w3m-process-user, w3m-process-passwd,
+ w3m-process-user-counter, w3m-process-realm, w3m-process-temp-file,
+ w3m-process-exit-status): Exported to `w3m-proc.el'.
+ (w3m-toggle-inline-images-internal): Follow change of
+ `w3m-create-image'.
+ (w3m-exec-process): Removed.
+ (w3m-exec-get-user): Renamed to `w3m-process-get-user' and exported to
+ `w3m-proc.el'.
+ (w3m-exec-get-passwd): Renamed to `w3m-process-get-passwd' and exported
+ to `w3m-proc.el'.
+ (w3m-exec-set-user): Renamed to `w3m-process-set-user' and exported to
+ `w3m-proc.el'.
+ (w3m-get-server-root): Renamed to `w3m-process-get-server-root' and
+ exported to `w3m-proc.el'.
+ (w3m-proxy-user): Renamed to `w3m-process-proxy-user' and exported to
+ `w3m-proc.el'.
+ (w3m-proxy-passwd): Renamed to `w3m-process-proxy-passwd' and exported
+ to `w3m-proc.el'.
+ (w3m-exec-filter): Renamed to `w3m-process-filter' and exported to
+ `w3m-proc.el'; Slightly modified to protect illegal type of
+ `w3m-current-url'.
+ (w3m-decode-encoded-contents, w3m-x-moe-decode-buffer,
+ w3m-local-dirlist-cgi, w3m-rendering-half-dump): Use
+ `w3m-process-with-environment' to adjust the environment variables.
+ (w3m-local-retrieve, w3m-cid-retrieve): Insert the retrieved content to
+ this current buffer.
+ (w3m-w3m-get-header): Call `w3m-process-start' instead of
+ `w3m-exec-process'.
+ (w3m-w3m-dump-head-source, w3m-w3m-retrieve, w3m-about-retrieve,
+ w3m-retrieve, w3m-download): Reconstructed to support asynchronous
+ operation.
+ (w3m-exec): Removed.
+ (w3m-retrieve-and-render, w3m-prepare-content): New function.
+ (w3m-quit): Call `w3m-process-shutdown'.
+ (w3m-buffer-setup): New inline function.
+ (w3m-goto-url): Accept the 6th optional argument, and modified for
+ asynchronous processing.
+ (w3m-goto-url-localcgi-movepoint): Removed.
+ (w3m-move-point-for-localcgi): New function.
+ (w3m): Removed redundant quote from the definition of
+ `focusing-function'; Display the browsing buffer.
+ (w3m-region): Set `w3m-current-buffer' to this current buffer.
+ (w3m-about, w3m-about-header): Insert the generated content to this
+ current buffer.
+ (w3m-about-history, w3m-about-db-history): To access buffer-local
+ variables, refer the value of `w3m-current-buffer'.
+
+ * w3m-xmas.el (top): Require `w3m-proc.el' instead of `w3m-macro.el'.
+ (w3m-create-image): Accept the 4th optional argument, and modified for
+ asynchronous processing.
+
+ * w3m-weather.el (w3m-about-weather): Insert the generated content to
+ this current buffer.
+
+ * w3m-proc.el: New file.
+
+ * w3m-namazu.el (w3m-about-namazu): Insert the generated content to
+ this current buffer.
+
+ * w3m-macro.el (w3m-with-work-buffer): Removed.
+ (w3m-kill-buffer): New inline function.
+
+ * w3m-filter.el (w3m-filter): Filtering the content in this current
+ buffer.
+
+ * w3m-e21.el (top): Require `w3m-proc.el' instead of `w3m-macro.el'.
+ (w3m-create-image): Accept the 4th optional argument, and modified for
+ asynchronous processing.
+
+ * w3m-antenna.el (w3m-about-antenna): Insert the generated content to
+ this current buffer.
+
+ * mime-w3m.el (mime-w3m-cid-retrieve): Insert the retrieved content to
+ this current buffer.
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Insert the retrieved content to
+ this current buffer.
+
+2001-11-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-tab-menubar): Abolished.
+ (w3m-pop-up-windows): Changed the expression to decide its default
+ value.
+ (w3m-setup-menu): Removed the code to set the menubar item of TAB.
+ (w3m-fontify-images): Accept an image-type input tag.
+ (w3m-fontify): To accept an image-type input tag, changed the order of
+ calling fontify functions.
+ (top): Add autoload of `w3m-setup-tab'.
+ (w3m-mode): Call `w3m-setup-tab'.
+ (w3m-tab-menubar-open-buffer): Moved to `w3m-tab.el'.
+ (w3m-tab-menubar-update): Ditto.
+ (w3m-tab-menubar-pull-bufnum): Ditto.
+ (w3m-tab-menubar-make-items): Ditto.
+
+ * w3m-tab.el: New file.
+
+ * w3m-e21.el (top): Define `w3m-use-tab' to avoid byte-compile warning.
+ (w3m-use-tab): Moved to `w3m.el'.
+ (w3m-setup-tab): Define as a dummy function.
+
+ * w3m-xmas.el (w3m-setup-tab): Define as a dummy function.
+
+ * w3m-form.el: Changes of the structure of the `w3m-form' object.
+ (w3m-form-put-property): New inline function.
+ (w3m-form-get-property): New macro.
+ (w3m-form-put): Use `w3m-form-put-property'.
+ (w3m-form-get): Use `w3m-form-get-property'.
+ (w3m-form-make-form-data): Follow change of structure of the `w3m-form'
+ object.
+ (w3m-form-parse-forms): Accept an image-type input tag.
+ (w3m-form-resume): Ditto.
+ (w3m-form-fontify): Ditto.
+
+2001-11-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-tab-menubar): New user variable.
+ (w3m-setup-menu): Handling tab-menubar.
+ (w3m-tab-menubar-open-buffer, w3m-tab-menubar-update,
+ w3m-tab-menubar-make-items): New functions.
+ (w3m-tab-menubar-pull-bufnum): New macro.
+ (top-level): Add define-key-after() to avoid byte-compile warnings, if
+ XEmacs.
+
+2001-11-08 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m.el (w3m-start-url, w3m-contents-url): New buffer-local vars.
+ (w3m-clear-local-variables): Also clear `w3m-start-url' and
+ `w3m-contents-url'.
+ (w3m-copy-local-variables): Also copy `w3m-start-url' and
+ `w3m-contents-url'.
+ (w3m-fontify-anchors, w3m-check-link-tags): Add support the tags
+ "previous", "start" and "contents".
+
+2001-11-02 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (autoload): Added w3m-antenna-add-current-url.
+ (w3m-lynx-like-map): Likewise.
+ (w3m-info-like-map): Likewise.
+ (w3m-mode): Added w3m-antenna-add-current-url to doc string.
+
+ * w3m-antenna.el (string-with-default): New widget.
+ (string-with-default-value-create): New function.
+ (w3m-antenna-sites): Use string-with-default widgets instead of string
+ widgets.
+ (w3m-antenna-tmp-url): New variable.
+ (w3m-antenna-tmp-title): New variable.
+ (w3m-antenna-add-current-url): New function.
+ (w3m-antenna-add): New function.
+
+2001-11-08 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-replace): Don't use `save-excursion' because
+ point at start time may be deleted at end time.
+ (w3m-form-textarea-replace): Ditto.
+ (w3m-form-textarea-info): Use `w3m-get-text-property-around'.
+
+2001-11-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-ftp-url): Rewrote.
+ (w3m-download): Use `w3m-goto-ftp-url' for ftp files.
+
+ * w3m-e20.el (w3m-make-ccl-coding-system): Copied from w3m-fsf.el;
+ don't call `make-coding-system' if a coding-system already exists.
+ * w3m-e21.el (w3m-make-ccl-coding-system): Moved from w3m-fsf.el.
+ * w3m-fsf.el (w3m-make-ccl-coding-system): Moved to w3m-e21.el.
+
+2001-11-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): Removed autoload of `w3m-remove-image'.
+
+ * w3m-om.el (w3m-remove-image): Define as a dummy function.
+
+ * w3m-e20.el (w3m-remove-image): Define as a dummy function.
+
+ * w3m.el (w3m-quick-start): New option.
+ (w3m-input-url): When the default string is equal to nil, it is not
+ displayed in the prompt.
+ (w3m): Refer `w3m-quick-start' to decide the action when interactively
+ called.
+
+2001-11-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-current-title, w3m-current-url): Define them before
+ loading the version specific modules.
+
+2001-11-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-xmas.el (format-buffers-tab-line): Protect aginst errors caused
+ by the illegal type of `w3m-current-url'.
+
+ * w3m-e21.el (top): Define `w3m-current-url' and `w3m-current-title' to
+ avoid byte-compile warnings.
+ (w3m-insert-header-line): Protect aginst errors caused by the illegal
+ type of `w3m-current-url'.
+ (w3m-tab-line): Protect aginst errors caused by illegal types of
+ `w3m-current-url' and `w3m-current-title'.
+
+2001-11-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (format-buffers-tab-line): Don't use the value of
+ `w3m-current-title' if it is nil.
+
+2001-11-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-exec-filter): Modify regexp pattern of "Wrong username or
+ passwd".
+
+
+2001-11-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.2 from emacs-w3m-1_2 branch.
+
+ * w3m.el (emacs-w3m-version): Modified.
+ (top): Protect against the error occurs when `w3m-ucs.el' isn't found.
+
+2001-11-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * README.shimbun.ja (mew-shimbun.el): Modify description.
+
+2001-11-03 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-copy-buffer): Added argument `empty'.
+ (w3m-goto-url-new-session): Call `w3m-copy-buffer' with argument
+ `empty' non-nil; If new url has `name' portion, goto the base url
+ first.
+ (w3m-view-this-url): Likewise.
+
+2001-11-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (DOCS): Add `FAQ'.
+
+2001-11-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-parse-forms): Decode value of input tag.
+ (w3m-form-replace): Use `w3m-get-text-property-around'.
+
+ * w3m.el (w3m-parse-attributes): Add :decode-entity attribute.
+ (w3m-decode-entities-string): New function.
+
+2001-11-02 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-lynx-like-map): Remove binding of `C-tab' and `C-S-tab'
+ Bind `C-cC-t' as the key to call `w3m-copy-buffer'. Bind `C-cC-p' as
+ the key to call `w3m-previous-buffer'. Bind `C-cC-n' as the key to
+ call `w3m-next-buffer'. Bind `C-cC-w' as the key to call
+ `w3m-delete-buffer'.
+ (w3m-info-like-map): Ditto.
+
+2001-11-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-reload-this-page): When execute with prefix argument,
+ clear post-data certainty.
+
+2001-11-01 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-goto-url): Remove processing url's forms from the history
+ when post data.
+ (w3m): Use `select-frame-set-input-focus' instead of `x-focus-frame'.
+
+ * w3m-form.el (w3m-form-resume): Fix typo.
+
+2001-11-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-delete-buffer): New function.
+ (w3m-copy-buffer): Call `w3m-goto-url' instead of copying buffer
+ content.
+
+2001-10-31 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-resume): Remove submit button status to support
+ forms containing multiple submit buttons.
+
+2001-10-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-accept-languages): Don't use config file if there are no
+ contents for "accept_language".
+
+2001-10-31 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-tab-unselected-face): Setup color for tty.
+ (w3m-tab-selected-face): Ditto.
+ (w3m-tab-background-face): Ditto.
+
+ * w3m.el (w3m-next-buffer): New function.
+ (w3m-previous-buffer): Ditto.
+ (w3m-lynx-like-map): Bind `C-tab' as the key to call `w3m-next-buffer';
+ Bind `C-S-tab' as the key to call `w3m-previous-buffer'.
+ (w3m-info-like-map): Ditto.
+
+2001-10-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-accept-languages): New option.
+ (w3m-dump-head-source-command-argument): Abolished.
+ (w3m-dump-head-source-command-arguments): New constant.
+ (w3m-w3m-expand-arguments): New macro.
+ (w3m-w3m-dump-head-source): To generate command arguments for w3m, use
+ `w3m-w3m-expand-arguments' and refer
+ `w3m-dump-head-source-command-arguments'.
+ (w3m-rendering-half-dump): To generate command arguments for w3m, use
+ `w3m-w3m-expand-arguments'.
+
+2001-10-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-reload-this-page): Change the semantic of the prefix
+ argument to `clear form and post datas'.
+
+2001-10-31 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-pop-up-windows): Changed default value
+ (See [emacs-w3m: 01999]).
+
+ * w3m-e21.el (w3m-tab-unselected-face): Changed underline color.
+ (w3m-tab-selected-face): Ditto.
+ (w3m-tab-background-face): Ditto.
+ (w3m-tab-line): Removed needless local variable `len'.
+
+2001-10-30 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-header-line-location-title-face): Specify background
+ color.
+ (w3m-header-line-location-title-face): Ditto.
+ (w3m-use-tab): New user option.
+ (w3m-tab-width): Ditto.
+ (w3m-tab-unselected-face): New face.
+ (w3m-tab-selected-face): Ditto.
+ (w3m-tab-background-face): Ditto.
+ (w3m-header-line-map): New variable.
+ (w3m-setup-header-line): If w3m-use-tab is non-nil, use header-line as
+ a tab area.
+ (w3m-insert-header-line): New function.
+ (w3m-tab-make-keymap): New function.
+ (w3m-tab-line): New function.
+ (w3m-fontify-after-hook): Add 'w3m-insert-header-line.
+
+2001-10-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-reload-this-page): If form data exist, ask to make use of
+ its. Check form data modified.
+
+ * README.shimbun.ja (mew-shimbun.el): Modify description.
+
+2001-10-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-parse-forms): Dismantle `w3m-current-url' of
+ its query part before the rest is refered as the default value of the
+ action.
+
+ * w3m.el (w3m-ccl-write-repeat): Accept optional arguments to avoid
+ difference between Emacesn on CCL.
+ (w3m-iso-latin-1-decoder): Call `w3m-ccl-write-repeat' with optional
+ argument.
+
+2001-10-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * README.shimbun.ja: Add information for mew-shimbun.el
+
+2001-10-29 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-terminal-coding-system): Changed default value for
+ w3m(en).
+ (w3m-input-coding-system): Ditto.
+ (w3m-default-coding-system): Ditto.
+ (w3m-iso-latin-1-decoder): Fixed for latin-iso8859-1 under old Emacsen.
+ (w3m-ccl-write-repeat): Ditto.
+
+2001-10-29 ORI Manabu <ori@tahoo.org>
+
+ * w3m.el (w3m-type): Added the expression to detect `w3m-m17n'.
+
+2001-10-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-accept-japanese-characters): Use `-halfdump' option
+ instead of `-dump' option in order to detect the real internal
+ character set of `w3m-command'.
+ (w3m-profile-directory): Fixed the expression to determine the default
+ value for the environment where `w3m-command' includes redundant
+ suffixes.
+ (w3m-default-save-directory): Ditto.
+ (w3m-euc-japan-encoder): Define in the old-style backquote.
+ (w3m-iso-latin-1-encoder): Ditto.
+
+ * w3m.el (w3m-use-mule-ucs): Simplified.
+ (w3m-ccl-write-repeat): Fixed.
+ (w3m-euc-japan-decoder): Ditto.
+
+2001-10-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-ccl-write-repeat): Avoid a byte-compile warning.
+
+2001-10-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-info-like-map): Bind `\M-g' as the key to call
+ `goto-line'.
+
+ * w3m.el (w3m-use-mule-ucs): More safe default value.
+ (w3m-accept-japanese-characters): Improved automatic detection.
+ (w3m-ccl-write-repeat): Fix typo.
+
+ * w3m.el (w3m-type): Use the default value which detected
+ automatically.
+ (w3m-accept-japanese-characters): New internal variable.
+ (w3m-terminal-coding-system): Changed the default value for w3m which
+ doesn't accept Japanese characters.
+ (w3m-input-coding-system): Ditto.
+ (w3m-output-coding-system): Ditto.
+ (w3m-default-coding-system): Changed the default value for the
+ environment that `w3m-language' doesn't equal to "Japanese".
+ (w3m-internal-characters-alist): New constant.
+ (w3m-ccl-write-repeat): New internal function to generate a part of CCL
+ decoder.
+ (w3m-euc-japan-decoder): Modified.
+ (w3m-iso-latin-1-decoder): New CCL program.
+ (w3m-iso-latin-1-encoder): New CCL program which is used when
+ `w3m-use-mule-ucs' equals to nil.
+ (w3m-iso-latin-1): New coding system.
+
+ * w3m-ucs.el (w3m-ucs-generate-ncr-program): New constant.
+ (w3m-euc-japan-encoder): Refer `w3m-ucs-generate-ncr-program'.
+ (w3m-iso-latin-1-encoder): New CCL program.
+
+ * w3m-macro.el (w3m-static-when): New macro.
+ (w3m-static-unless): Ditto.
+
+ * w3m-e21.el (w3m-setup-header-line): Protect aginst the error occurs
+ when `w3m-current-url' isn't string.
+
+2001-10-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Support `Xref' header in SHIMBUN
+ article.
+
+2001-10-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Call `w3m-mode' for a new session; use
+ `generate-new-buffer' instead of `get-buffer-create' for a new session;
+ allow the optional 2nd arg NEW-SESSION.
+ (w3m-goto-url-new-session): New command.
+ (w3m-goto-url): Always set the value of
+ `mode-line-buffer-identification'.
+ (w3m-mode): Update the doc-string for the new command
+ `w3m-goto-url-new-session'.
+ (w3m-info-like-map): Bind the key "G" to the command
+ `w3m-goto-url-new-session'.
+ (w3m-lynx-like-map): Bind the key "G" to the command
+ `w3m-goto-url-new-session'; replace the key "G" to "\M-g" for the
+ command `goto-line'.
+ (w3m-copy-buffer): Make all the arguments optional; make the 1st arg
+ BUF default to the current buffer.
+ (w3m-view-this-url): Call `w3m-copy-buffer' with the 1st arg nil.
+ (w3m-region, w3m-find-file, w3m-browse-url, w3m-gohome, w3m-download):
+ Add autoload magic cookie.
+ (w3m-popup-frame-p): Allow the optional arg FORCE.
+
+2001-10-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Don't byte-compile w3m-ucs.el
+ when the version of XEmacs is not greater than or equal to 21.2.37.
+
+ * w3m.el (w3m-pop-up-frames, w3m-pop-up-windows): Add a recommendation
+ to the doc-string about the use of XEmacs' buffers tab.
+
+ * w3m-xmas.el (w3m-xmas-update-tab-in-gutter): New function; add it to
+ `w3m-display-hook'.
+ (format-buffers-tab-line): Advise the function to show the current
+ title string in the buffer tab.
+ (w3m-xmas-show-current-title-in-buffer-tab): New user option.
+ (TopLevel): When compiling, use `autoload' "w3m" for the void functions
+ instead of the use of `defalias' to `ignore'; autoload "gutter-items"
+ for `update-tab-in-gutter'.
+
+2001-10-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-copy-buffer): Bind `pop-up-windows' to the value of
+ `w3m-pop-up-windows'.
+ (w3m-pop-up-windows): New user option.
+
+2001-10-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-rendering-buffer-1): Redundant argument is removed.
+
+2001-10-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url): Fixed the interactive spec.
+
+2001-10-24 Katsumi Yamaoka <yamaoka@jpl.org>
+ Suggested by Clifford Caoile <piyokun@email.com>.
+
+ * w3m.el (w3m-info-like-map, w3m-lynx-like-map): Bind S-SPC key to the
+ command `w3m-scroll-down-or-previous-url'.
+
+2001-10-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-mule-ucs): Changed.
+ (w3m-url-encode-string): Refer `w3m-default-coding-system' and
+ `w3m-coding-system' when `coding' argument is lacked.
+ (w3m-url-decode-string): Ditto.
+ (w3m-rendering-buffer-1): Define as a normal function.
+ (w3m-lynx-like-map): Changed the key which calls `w3m-save-image' from
+ `M-I' to `M-i'.
+ (w3m-info-like-map): Ditto; Registerd `O' as the key which calls
+ `w3m-db-history'.
+
+ * aclocal.m4 (AC_ADD_LOAD_PATH): Remove empty lines from auto detection
+ result.
+
+ * Makefile.in (DOCS): Add FAQ.ja, README.namazu.ja and
+ README.shimbun.ja.
+ (tarball): Handle attic/ and patches/.
+
+2001-10-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-mode): Update the doc-string about making a new session.
+ (w3m-info-like-map, w3m-lynx-like-map): Bind keys for the new commands
+ to make a new session.
+ (w3m-mouse-view-this-url-new-session): New command.
+ (w3m-view-this-url-new-session): New command.
+ (w3m-mouse-view-this-url): Make it can create a new session.
+ (w3m-view-this-url): Ditto.
+
+2001-10-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): Add autoload for `w3m-form-parse-buffer'.
+ (w3m-display-hook): New option.
+ (w3m-decoder-alist): Reindent.
+ (w3m-use-form): Changed default value.
+ (w3m-dirlist-cgi-program): Changed the expression to get default path.
+ (w3m-work-binary-buffer-name): New constant.
+ (w3m-attributes): Handle URLs which start `about://source/'; It isn't
+ defined as an inline function but a normal function to avoid
+ byte-compile error.
+ (w3m-arrived-add): Fixed codes to remove fragments in the specified
+ URL.
+ (w3m-local-retrieve): Clean up.
+ (w3m-about-retrieve): Handle URLs which start `about://source/'.
+ (w3m-retrieve): Doesn't call `w3m-filter'.
+ (w3m-remove-meta-charset-tags): Renamed from `w3m-remove-meta-tags'.
+ (w3m-rendering-region): Removed.
+ (w3m-rendering-extract-title): New function.
+ (w3m-rendering-half-dump): Ditto.
+ (w3m-rendering-buffer-1): Ditto.
+ (w3m-rendering-unibyte-buffer): Ditto.
+ (w3m-rendering-multibyte-buffer): Ditto.
+ (w3m-exec): Call `w3m-rendering-unibyte-buffer' instead of
+ `w3m-rendering-region'.
+ (w3m-edit-url): Improved to handle URLs which start `about://source/'
+ or `about://header/'.
+ (w3m-goto-url): Removed code to highlight current line in the history;
+ Call hook functions in `w3m-display-hook'.
+ (w3m-region): Call `w3m-rendering-multibyte-buffer' instead of
+ `w3m-rendering-region'.
+ (w3m-about): Clean up.
+ (w3m-about-source): Removed.
+ (w3m-view-source): Make URLs which start `about:' available.
+ (w3m-about-header): Simplified.
+ (w3m-history-highlight-current-url): New function.
+
+ * w3m-form.el (w3m-form-parse-buffer): New function.
+ (w3m-form-parse-region): Removed.
+
+ * w3m-filter.el (w3m-filter-rules): Add the rule to call
+ `w3m-filter-www.zdnet.co.jp'.
+ (w3m-filter): Protect against wrong type argument.
+ (w3m-filter-www.zdnet.co.jp): New function.
+
+ * w3m-antenna.el (w3m-antenna-size): Call `w3m-remove-comments' and
+ `w3m-filter' before checking size of contents.
+
+ * w3mhack.el (w3mhack-load-path): Search `un-define' instead of
+ `un-define.el' to check the path where Mule-UCS is installed.
+
+2001-10-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Handle `mew-shimbun.el'.
+
+ * w3m-dtree.el (w3m-dtree-indent-strings, w3m-dtree-stop-strings):
+ Throw out the "Japanese Character" for non-mule's environments.
+
+2001-10-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * aclocal.m4 (AC_ADD_LOAD_PATH): When `yes' or null string is passed as
+ an argument, call `w3mhack-load-path' to search places of required
+ modules automatically.
+
+ * w3mhack.el (w3mhack-load-path): New function.
+
+2001-10-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-create-image): Call `w3m-fix-gif' if
+ `w3m-should-convert-interlaced-gifs' is non-nil.
+ (w3m-fix-gif): Renamed from `w3m-unoptimize-animated-gif'; convert an
+ interlaced gif to be non-interlaced as well as unoptimization.
+ (w3m-cache-fixed-gif-images-max-length): Renamed from
+ `w3m-cache-unoptimized-gif-images-max-length'.
+ (w3m-cache-fixed-gif-images): Renamed from
+ `w3m-cache-unoptimized-gif-images'.
+ (w3m-should-convert-interlaced-gifs): New variable.
+
+2001-10-16 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * README.ja: Add description about "new custom".
+
+ * README: Ditto.
+
+ * w3m.el (w3m-attributes): When URL matches `about://source/', returns
+ nil as its content-charset.
+ (w3m-about-retrieve): When URL matches `about://source/', don't call
+ `encode-coding-region'.
+ (w3m-about-source): Don't call `w3m-decode-region'.
+ (w3m-exec): Use `set-buffer-file-coding-system' instead of to set
+ `buffer-file-coding-system'.
+
+2001-10-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-exec): Substitute `w3m-current-coding-system' for
+ `buffer-file-coding-system' to show the current coding system in the
+ mode line.
+
+2001-10-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-use-mule-ucs): Don't use Mule-UCS package for XEmacs
+ versions prior to 21.2.37.
+
+2001-10-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): It doesn't require `thingatpt'.
+ (w3m-url-at-point): New function.
+ (w3m-input-url): Call `w3m-url-at-point' instead of `thing-at-point';
+ The 4th optional argument is added.
+ (w3m): Call `w3m-input-url' with the 4th argument.
+
+2001-10-15 NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>
+
+ * README: Add description about ftp site of FLIM.
+
+2001-10-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-auto-insert-image): Change from 'defcont' to
+ 'defcustom', again.
+ (mew-w3m-safe-url-regexp): New constant.
+ (mew-w3m-view-inline-image): Rewrite.
+ (mew-mime-text/html-w3m): Bind 'w3m-safe-url-regexp' to
+ 'mew-w3m-safe-url-regexp'.
+
+2001-10-15 NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>
+
+ * README.ja: Divided original section 2. a) into two parts, 2. a) and
+ 2. b). Add new section 2. c), 2. e) about APEL, FLIM, shimbun library.
+ * README: Ditto.
+
+ * FAQ.ja (Q. ~~~~ Emacs ~?): Add description about where to get APEL.
+
+2001-10-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-expand-url): Accept URL which has the scheme part only.
+
+2001-10-15 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-url-components-regexp): Don't except `\' for scheme,
+ authority and path.
+
+2001-10-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): Removed autoload for `regexp-opt'.
+
+ * w3m-weather.el (top): Likewise.
+
+ * w3m-om.el (top): Add autoload for `regexp-opt'.
+
+2001-10-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-entity-regexp): Unified to the use of `regexp-opt';
+ autoload regexp-opt for old Emacsen.
+
+ * attic/regexp-opt.el: New file.
+
+ * README.ja, README: Emacs-w3m requires the module regexp-opt.
+
+ * w3m-weather.el: Autoload regexp-opt for old Emacsen.
+
+2001-10-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-safe-url-regexp): New variable.
+ (w3m-retrieve): When `w3m-safe-url-regexp' has non-nil value and it
+ matches the requested URL, doesn't fetch its contents.
+
+ * mime-w3m.el (mime-w3m-display-inline-image): New option.
+ (mime-w3m-preview-text/html): In order to avoid web bug which is
+ described in [mew-dist 19267], restrict accesible URLs.
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Likewise.
+
+ * w3m-weather.el (w3m-weather-url-alist): Abolished.
+ (w3m-weather-completion-table): New constant.
+ (w3m-weather-default-area): Refer `w3m-weather-completion-table'
+ instead of `w3m-weather-url-alist' to decide customize spec.
+ (w3m-weather-input-history): New variable.
+ (w3m-weather-input-area): New function.
+ (w3m-weather-area-completion): Ditto.
+ (w3m-weather): Call `w3m-weather-input-area'.
+ (w3m-about-weather): Refer `w3m-weather-completion-table' instead of
+ `w3m-weather-url-alist' to convert the area to the real URL.
+
+2001-10-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m-auto-insert-image): Change from 'defcustom' to
+ 'defconst' and default value to 'nil'.
+ (mew-w3m-view-inline-image): New function.
+
+2001-10-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-input-url): Accept the 3rd optional argument.
+ (w3m): Improved interactive form.
+
+2001-10-12 Yuuichi Teranishi <teranisi@gohome.org>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-e21.el (w3m-form-button-keymap): Renamed from
+ `w3m-widget-keymap'.
+ (w3m-form-make-button): Fixed.
+ (w3m-setup-widget-faces): Revived.
+
+2001-10-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Always prompts user for a URL string.
+
+2001-10-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-weather.el (w3m-weather-url-alist): Refer
+ `http://weather.yahoo.co.jp'.
+ (w3m-weather-default-area): Change default region.
+ (w3m-weather-filter-functions): Change default value.
+ (w3m-about-weather): Accept `no-cache' argument.
+ (w3m-weather-remove-headers): Modified for Yahoo.
+ (w3m-weather-remove-footers): Ditto.
+ (w3m-weather-insert-title): Ditto.
+ (w3m-weather-remove-weather-images): Removed.
+ (w3m-weather-remove-washing-images): Removed.
+ (w3m-weather-remove-futon-images): Removed.
+ (w3m-weather-remove-week-weather-images): Removed.
+
+ * w3m-e21.el (w3m-widget-keymap): New keymap.
+ (w3m-form-make-button): Set `w3m-widget-keymap' as keymap on buttons;
+ Fix condition to make buttons.
+ (w3m-setup-widget-faces): Removed.
+
+2001-10-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mew-w3m.el, w3m-form.el, w3m.el: Remove useless whitespaces.
+
+2001-10-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Replace `re-search-forward' to
+ `search-forward'; bind `beg' as a non-global variable.
+
+2001-10-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-dirlist-cgi): Remove <from>...</form>.
+
+2001-10-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-expand-path-name): Fix incompatibility of drive letter.
+
+2001-10-11 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (toplevel): Require 'wid-edit.
+ (w3m-form-button-face): Set background and foreground color; Set box
+ line-width as 2.
+ (w3m-form-button-pressed-face): Ditto.
+ (w3m-form-button-mouse-face): New face.
+ (w3m-form-button): New widget button.
+ (w3m-form-make-button): Use `widget-convert-button' to put
+ w3m-form-button.
+ (w3m-setup-widget-faces): New function.
+ (w3m-mode-hook): Add `w3m-setup-widget-faces'.
+ (w3m-form-make-button): Don't check :box attribute when
+ w3m-form-use-fancy-faces is non-nil.
+
+2001-10-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-decoder-alist): Fix for Windows or OS/2 environments.
+
+2001-10-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-display-inline-image): Update document.
+ (w3m-decoder-alist): Change default value.
+ (w3m-current-image-status): New buffer-local variable.
+ (w3m-which-command): Export to w3m-macro.el.
+ (w3m-decode-encoded-contents): Small change.
+ (w3m-expand-url): Fix to remove an empty query part and an empty
+ fragment part correctly.
+ (w3m-toggle-inline-images): Refer `w3m-current-image-status' instead of
+ `w3m-display-inline-image'.
+ (w3m-view-url-with-external-browser): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-reload-this-page): Ditto.
+ (w3m-redisplay-with-charset): Ditto.
+
+ * w3m-e21.el (top, w3m-display-inline-image-p): Refer
+ `w3m-current-image-status' instead of `w3m-display-inline-image'.
+
+ * w3m-om.el (w3m-expand-path-name): Add 2nd optional argument.
+
+ * w3m-macro.el (w3m-which-command): Import from w3m.el.
+
+ * w3m-xmas.el (top, w3m-display-inline-image-p): Refer
+ `w3m-current-image-status' instead of `w3m-display-inline-image'.
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Refer `w3m-current-image-status'
+ instead of `w3m-display-inline-image'.
+
+2001-10-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-cache-header): Add 3rd optional argument.
+ (w3m-w3m-dump-head-source): Call `w3m-cache-header' with `overwrite'
+ option.
+
+ * w3m.el (w3m-cache-header-delete-variable-part): New function.
+ (w3m-cache-header): Remove cached contents when inconsistency between
+ new header and cached header is found.
+
+ * w3m.el (w3m-expand-url): Fix the last change.
+ (w3m-url-hierarchical-schemes): Add `file'.
+ (w3m-goto-url): Use `\`' instead of `^' as a meta character.
+
+ * w3m.el (w3m-fontify-anchors): Fix.
+ (w3m-url-fallback-base): New constant.
+ (w3m-expand-url): Make it robust against illegal base-URL.
+
+ * w3m.el (w3m-url-components-regexp): New constant.
+ (w3m-url-hierarchical-schemes): Ditto.
+ (w3m-expand-url): Reimplemented.
+ (w3m-view-this-url): Remove a redundant local variable.
+ (w3m-mouse-view-this-url): Call `w3m-view-this-url'.
+ (w3m-goto-url): Refer `w3m-url-components-regexp' to delete a fragment
+ part of URL.
+
+ * mime-w3m.el (mime-w3m-view-this-url): When there is an inline image
+ under point, display it.
+ (mime-w3m-mouse-view-this-url): Call `mime-w3m-view-this-url'.
+
+2001-10-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-expand-url): Emergency fixed.
+
+2001-10-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-expand-url): Make it work correctly when a url begins
+ with "//".
+
+2001-10-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-language): New option.
+ (w3m-default-coding-system): Refer `w3m-language' to decide default
+ value.
+ (w3m-coding-system-priority-list): Ditto.
+ (w3m-toolbar): Ditto.
+ (w3m-url-to-file-name): Moved to avoid byte-compile warnings.
+ (w3m-expand-file-name-as-url): Ditto.
+ (w3m-url-local-p): Ditto.
+ (w3m-url-dtree-p): Ditto.
+ (w3m-view-this-url): When there is an inline image under point, display
+ it.
+ (w3m-mouse-view-this-url): Ditto.
+ (w3m-view-url-with-external-browser): Renamed from
+ `w3m-view-current-url-with-external-browser'. Handle an inline image
+ under point.
+ (w3m-download-this-url): Handle an inline image under point.
+ (w3m-info-like-map): Reconstructed.
+
+ * w3m-search.el (w3m-search-default-coding-system): Abolished.
+ (w3m-search-engine-alist): Refer `w3m-language' to decide default
+ value.
+ (w3m-search-escape-query-string): Refer `w3m-default-coding-system'
+ instead of `w3m-search-default-coding-system'.
+
+2001-10-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-use-fancy-faces): New option.
+ (w3m-form-make-button): New function.
+ (w3m-form-fontify): Call `w3m-form-make-button'.
+
+ * w3m-e21.el (w3m-form-button-face): New face.
+ (w3m-form-button-pressed-face): Ditto.
+ (w3m-form-make-button): New function.
+
+2001-10-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (read-string): Unify the advice form.
+ (w3m-om-coding-system-alist): Fix doc-string.
+
+2001-10-04 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (read-string): Don't modify the value of
+ `current-load-list' when advising it.
+
+ * mime-w3m.el (mime-w3m-remove-text-properties): Don't modify the value
+ of `current-load-list' when advising the function `kill-new'; add a
+ doc-string.
+
+ * w3m.el (w3m-decode-entities): Save-match-data when `w3m-entity-value'
+ is called.
+
+2001-10-03 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-xmas.el (w3m-detect-coding-region): Return just the return value
+ of `detect-coding-with-priority' if it is not a list, again.
+
+2001-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (read-string): Advise the function to allow the 4th
+ argument `default-value'.
+
+2001-10-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-remove-text-properties): New advice to protect
+ `kill-ring-save' against the `local-map' text property.
+
+2001-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (w3m-detect-coding-region): Use the fixed value for the
+ list of coding-categories; suppress the duplication of coding-
+ categories.
+ (TopLevel): Protect against non-existent coding-systems when creating
+ the modern coding-systems.
+ (w3m-om-coding-category-alist): Reinforce the default value.
+ (w3m-om-coding-categories): Abolish.
+ (w3m-om-coding-system-alist): Add some new coding-systems.
+
+ * w3m-fsf.el (w3m-detect-coding-region): Suppress the duplication of
+ coding-categories.
+ * w3m-xmas.el (w3m-detect-coding-region): Ditto; use
+ `coding-system-category' instead of `coding-system-type'.
+
+2001-10-03 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-show-inline-images-before-hook,
+ w3m-show-inline-images-after-hook,
+ w3m-remove-inline-images-before-hook,
+ w3m-remove-inline-images-after-hook): Abolished.
+ (w3m-modeline-image-status-on): New constant.
+ (w3m-modeline-image-status-off): Ditto.
+ (w3m-image-only-page): New buffer local variable.
+ (w3m-display-inline-image-status): Abolished.
+ (w3m-fontify-images): Put `w3m-image-status property'.
+ (w3m-toggle-inline-images-internal): New inline function.
+ (w3m-exec): Set w3m-image-only-page as t.
+ (w3m-lynx-like-map): Bind "T" to 'w3m-toggle-inline-images and "t" to
+ 'w3m-toggle-inline-image.
+ (w3m-goto-url): Set w3m-image-only-page as nil at first; Setup modeline
+ to display image display status; Display image if w3m-image-only-page
+ is nil.
+
+ * w3m-e21.el (w3m-cache-underline-faces): Abolished.
+ (w3m-insert-image): Set text property 'w3m-undeline-face to the image
+ instead of setting up w3m-cache-underline-faces.
+ (w3m-remove-image): Recover underline faces.
+ (w3m-fontify-before-hook, w3m-show-inline-images-before-hook,
+ w3m-show-inline-images-after-hook,
+ w3m-remove-inline-images-after-hook): Don't set up.
+
+2001-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (w3m-detect-coding-region): Make it work.
+
+ * w3m-xmas.el (w3m-detect-coding-region): Return just the return value
+ of `detect-coding-with-priority' if it is not a list, otherwise the car
+ of the value.
+
+2001-10-02 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-coding-system-priority-list): New user option.
+ (w3m-decode-buffer): Use it.
+
+ * w3m-fsf.el (w3m-detect-coding-region): Remove argument `highest';
+ always return the first possible coding system. Add new optional
+ argument `priority-list'. Use `detect-coding-with-priority'.
+
+ * w3m-xmas.el (w3m-detect-coding-region): Ditto.
+
+ * w3m-om.el (w3m-detect-coding-region): Remove argument `highest';
+ always return the first possible coding system. Add new optional
+ argument `priority-list'.
+
+2001-10-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (w3m-detect-coding-region): Return a non-list of a
+ coding-system if the number of return value is only one; use
+ `w3m-om-modernize-coding-system' and `w3m-om-coding-categories'; use
+ `code-detect-region' instead of `detect-coding-region'.
+ (w3m-om-modernize-coding-system): New function.
+ (w3m-om-coding-category-alist): Use `w3m-om-coding-categories'.
+ (w3m-om-coding-categories): New constant.
+ (w3m-om-coding-system-alist): Add `emacs-mule'.
+
+2001-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (TopLevel): Don't byte-compile the source form to bind colon
+ keywords for old Emacsen.
+
+2001-10-01 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-mode): Added `w3m-toggle-inline-images' to the mode
+ description.
+
+2001-10-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-edit-url-directory-alist): New option.
+ (w3m-edit-url): New function.
+ (w3m-edit-current-url): Call `w3m-edit-url'.
+ (w3m-edit-this-url): Ditto.
+
+2001-10-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (w3m-detect-coding-region): Prefer the coding-category that
+ the value of `w3m-default-coding-system' belongs to.
+ (w3m-om-coding-category-alist): New variable.
+ (w3m-om-coding-system-alist): New variable.
+
+ * w3m.el (w3m-default-coding-system): Default to `shift_jis' when Mule2
+ is running.
+
+2001-09-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Handle `w3m-fsf.el'.
+
+ * w3m.el (w3m-default-coding-system): New option.
+ (w3m-decode-buffer): Call `w3m-detect-coding-region' instead of
+ `detect-coding-region'.
+ (w3m-make-ccl-coding-system): Export it to `w3m-fsf.el'.
+
+ * w3m-xmas.el (coding-system-category): Removed.
+ (w3m-detect-coding-region): New function.
+
+ * w3m-om.el (coding-system-category): Removed.
+ (w3m-detect-coding-region): New function.
+
+ * w3m-fsf.el: New file.
+
+ * w3m-form.el (w3m-form-default-coding-system): Abolished.
+ (w3m-form-make-form-data): Refer `w3m-default-coding-system' instead of
+ `w3m-form-default-coding-system'.
+
+ * w3m-e21.el (top): Require `w3m-fsf'.
+ (w3m-find-coding-system): Export it to `w3m-fsf.el'.
+
+ * w3m-e20.el (top): Require `w3m-fsf'.
+ (w3m-find-coding-system): Export it to `w3m-fsf.el'.
+
+ * w3m.el (w3m-goto-url): Change effect of the 3rd argument `charset'.
+ (w3m-redisplay-with-charset): Reimplemented.
+ (w3m-view-source): Improved to handle `about://header/...'.
+ (w3m-about-header): Show title etc.
+ (w3m-view-header): Improved to handle `about://source/...'.
+
+2001-09-28 kkonishi <ironbeat@mail.st.rim.or.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): New search engines,
+ `excite-ja', `lycos-ja', `altavista' and `freebsd-users-jp'.
+
+2001-09-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Speed up the action to refer a name anchor in
+ the same document.
+
+2001-09-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-copy-local-variables): Simplified.
+ (w3m-region): Set `w3m-current-base-url'.
+
+ * w3m.el: Fix the bug reported in [emacs-w3m:01564].
+ (w3m-current-base-url): New buffer-local variable.
+ (w3m-clear-local-variables): Handle `w3m-current-base-url'.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-attributes): Change spec of return value.
+ (w3m-w3m-attributes): Ditto.
+ (w3m-local-attributes): Ditto.
+ (w3m-base-url): New macro.
+ (w3m-expand-url): Make the second argument `base' optional, and refer
+ `w3m-current-base-url' when a relative URL is canonicalized.
+ (w3m-fontify-anchors): Follow change of `w3m-expand-url'.
+ (w3m-fontify-images): Ditto.
+ (w3m-toggle-inline-images): Ditto.
+ (w3m-exec): Call `w3m-base-url' to set `w3m-current-base-url'.
+
+ * w3m-form.el (w3m-form-new): Canonicalize `action' whenever this
+ function is called.
+ (w3m-form-parse-forms): Follow change of `w3m-form-new'.
+ (w3m-form-submit): Ditto.
+ (w3m-form-input-map-set): Follow change of `w3m-expand-url'.
+
+2001-09-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Position point to the current url and
+ highlight the line when the page is for listing the history
+ (suggested by SHIRAI-san).
+ (w3m-history-current-url-face): New face.
+ (w3m-image-face, w3m-arrived-anchor-face, w3m-anchor-face): Fix
+ doc-string.
+
+2001-09-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history-today): New defsubst.
+ (w3m-about-db-history): If arrived time within 18 hours, display with
+ "HH:MM:SS".
+
+2001-09-18 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Convert lain-jisx0201 to ASCII;
+ Avoid deep nesting.
+ (TopLevel): Don't require `w3m-macro'.
+
+2001-09-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-om.el (w3m-expand-path-name): Cancel last change.
+
+2001-09-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-expand-path-name): Except Mule2, define alias of
+ `expand-file-name'.
+
+ * w3m-om.el (w3m-expand-path-name): Re-implemented.
+
+ * w3m-e20.el (w3m-expand-path-name): Removed.
+
+ * w3m-e21.el (w3m-expand-path-name): Ditto.
+
+ * w3m-xmas.el (w3m-expand-path-name): Ditto.
+
+2001-09-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-generate-colon-keywords-file): Renamed from
+ `w3mhack-bind-colon-keywords'; generate a file which contains a list of
+ colon keywords; don't bind colon keywords.
+ (w3mhack-colon-keywords-file): New constant.
+
+ * w3m.el: Load w3m-kwds.el if a colon keyword is not avaulable.
+ (w3m-colon-keywords): Abolished.
+
+ * Makefile.in (keywords): Create w3m-kwds.el instead of w3mkwds.el;
+ don't remove w3m-kwds.el in advance.
+ (clean): Remove w3m-kwds.el instead of w3mkwds.el.
+ (install): Install w3m-kwds.el if it exists.
+
+2001-09-17 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-expand-url): Use `w3m-expand-path-name' instead of
+ `expand-file-name'.
+
+ * w3m-om.el (w3m-expand-path-name): New function.
+
+ * w3m-e20.el (w3m-expand-path-name): New alias.
+
+ * w3m-xmas.el (w3m-expand-path-name): Ditto.
+
+ * w3m-e21.el (w3m-expand-path-name): Ditto.
+
+2001-09-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (w3m-search-engine-alist): Changed default value of
+ `google'. Add new engines `debian-pkg', `debian-bts', and
+ `iij-archie'.
+
+2001-09-17 Masayuki Ataka <ataka@milk.freemail.ne.jp>
+
+ * w3m-search.el (w3m-search-engine-alist): Changed default value of
+ `google-ja'.
+
+2001-09-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top): Require `ccl'.
+ (w3m-make-ccl-coding-system): New function for Emacs20 / Emacs21.
+ (w3m-euc-japan): Define with `w3m-make-ccl-coding-system'.
+
+ * w3m-macro.el (top): Delete garbage.
+
+ * w3m-e21.el (top): Fix to avoid byte-compile warnings.
+
+ * w3m-xmas.el (top): Require `pccl' and fix to avoid byte-compile
+ warnings.
+ (w3m-make-ccl-coding-system): New alias to `make-ccl-coding-system'.
+
+ * w3m-om.el (top): Require `pccl'.
+ (w3m-make-ccl-coding-system): New alias to `make-ccl-coding-system'.
+
+ * w3m-search.el (w3m-search): Fixed search engine specification error
+ when interactively called with prefix arguments.
+
+2001-09-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-macro.el (w3m-with-work-buffer): Keep `w3m-history' and
+ `w3m-history-flat' through buffers.
+
+ * w3m.el (w3m-current-buffer): Abolished.
+ (w3m-goto-url): Don't set `w3m-current-buffer'.
+ (w3m-region): Ditto.
+ (w3m-about-history): Don't refer `w3m-current-buffer'.
+
+ * w3m-form.el (w3m-form-parse-region): Simplified.
+ (w3m-form-parse-forms): Accept <OPTION> tag lacks `value' attribute.
+
+ * w3m.el (w3m-resume-forms): Abolished.
+ (w3m-clear-local-variables): Don't handle `w3m-resume-forms'.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-fontify): Don't call `w3m-form-resume'.
+ (w3m-cache-available-p): Protect against the illegal type of arguments.
+ (w3m-rendering-region): Removed the fourth optional argument, `forms'.
+ (w3m-exec): Follow change of `w3m-rendering-region'.
+
+ * w3m-form.el (w3m-form-parse-region): Check the cached form/map
+ objects are available, and if available return them with the flag.
+ (w3m-fontify-forms): Its real part is moved to `w3m-form-fontify'.
+ Call `w3m-form-resume' if `w3m-current-forms' includes the flag.
+ (w3m-form-fontify): New function.
+
+2001-09-15 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-resume): Ignore `hidden' type form; Fixed
+ problem when no item is selected in the select form.
+
+ * w3m.el (w3m-copy-local-variables): Bind local variable resume.
+
+2001-09-14 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-resume-forms): New buffer local variable.
+ (w3m-clear-local-variables): Add w3m-resume-forms.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-fontify): If w3m-resume-forms is non-nil, call w3m-form-resume.
+ (w3m-rendering-region): Set w3m-resume-forms if form is cached.
+
+ * w3m-form.el (w3m-form-replace-string): Eliminate.
+ (w3m-form-resume): New function.
+ (w3m-fontify-forms): Don't call `w3m-form-replace-string'.
+
+2001-09-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-form-replace-string): Protect against the illegal
+ type of arguments.
+
+2001-09-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-region): Defined new optional argument, `url'.
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Call `w3m-region' with an
+ optional argument `url'.
+
+2001-09-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-form.el (w3m-fontify-forms): Restore a string for the input
+ button from the history if it is available.
+ (w3m-form-replace-string): New function.
+
+ * w3m.el (w3m): Clear the startup screen on the new frame.
+ (w3m-reload-this-page, w3m-goto-url, w3m-view-previous-page):
+ Save/restore post-data and referer as buffer-local properties in the
+ history.
+
+2001-09-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Register the value of `w3m-current-forms' in
+ the history as a buffer-local property.
+ (w3m-view-previous-page): Specify a url string to
+ `w3m-history-restore-position'.
+ (w3m-exec): Use cached forms if it is valid.
+ (w3m-rendering-region): Allow the optional argument `forms'; use
+ `forms' if it is non-nil.
+ (w3m-close-window, w3m-copy-buffer, w3m-exec-set-user, w3m-input-url,
+ w3m-copy-local-variables): Remove unused non-global variables.
+
+ * w3m-hist.el (w3m-history-restore-position): Allow the optional
+ argument `url'.
+ (w3m-history-store-position): Ditto.
+ (w3m-history-plist-get): Return nil instead of to signal an error.
+
+ * w3m-form.el (w3m-form-parse-region): Don't set the value of
+ `w3m-current-forms' here.
+ (w3m-form-input-map, w3m-form-input-map-set): Remove unused non- global
+ variables.
+
+2001-09-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Don't use `w3m-cleanup-plist'.
+
+ * w3m-macro.el (w3m-cleanup-plist): Abolished.
+
+ * w3m-hist.el (w3m-history-push): Don't add property whose value is
+ nil.
+ (w3m-history-modify-properties): Don't infloop.
+
+ * Makefile.in (keywords): New rule.
+ (distclean): Remove the directory autom4te.cache which will be created
+ by autoconf v2.5x.
+ (clean): Remove w3mkwds.el.
+
+ * .cvsignore: Add autom4te.cache.
+
+ * w3mhack.el (w3mhack-bind-colon-keywords): Always define it.
+
+2001-09-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-current-referer, w3m-current-post-data): Abolished.
+ (w3m-copy-local-variables, w3m-clear-local-variables): Don't handle
+ them.
+ (w3m-reload-this-page, w3m-goto-url): Don't use them; use the history
+ instead.
+
+2001-09-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-add-referer): Removed.
+ (w3m-add-referer-regexps): Default value is changed.
+ (w3m-goto-url): No check `w3m-add-referer'.
+
+2001-09-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-retrieve): Don't send a referer if it does not
+ satisfy the rule of `w3m-add-referer-regexps'.
+ (w3m-add-referer-regexps): New user option.
+
+2001-09-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-cache-available-p): New function.
+
+2001-09-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el, w3m.el: Don't quote colon keywords.
+
+ * Makefile.in (install): Don't install w3mkwds.el.
+
+2001-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-colon-keywords): New variable; bind some colon keywords
+ for Emacs versions prior to 20.3.
+
+ * .cvsignore: Add w3mkwds.el.
+
+ * w3mhack.el (w3mhack-bind-colon-keywords): New function; byte- compile
+ and exec it.
+ (w3mhack-examine-modules): Don't byte-compile w3mkwds.el.
+
+ * w3m-macro.el (w3m-tag-regexp-of): Reverted; add a documentation.
+ (TopLevel): Require `cl' when compiling.
+
+2001-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Register post-data and a referer in the
+ history.
+ (w3m-info-like-map, w3m-lynx-like-map): Use `suppress-keymap'.
+ (w3m-view-previous-page): Give post-data and a referer to
+ `w3m-goto-url'.
+ (w3m-view-next-page): Use `w3m-view-previous-page'.
+
+ * w3m-macro.el (w3m-cleanup-plist): New macro.
+ (w3m-tag-regexp-of): Use backquote.
+
+ * w3m-hist.el (w3m-history-modify-properties): Don't infloop.
+
+2001-09-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-clear-local-variables): Not reset `w3m-initial-frame'.
+ (w3m-copy-local-variables): Not copy `w3m-initial-frame'.
+
+ * w3m-form.el (w3m-form-parse-region): Modify `w3m-current-forms' in
+ this buffer.
+
+2001-09-11 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-expand-url): Use `expand-file-name' to expand path; If
+ URL is a form like 'scheme://server/path?query', only path is expanded.
+
+2001-09-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-meta-content-type-charset-regexp): Relaxed to accept
+ <meta> tag in XML style.
+ (w3m-meta-charset-content-type-regexp): Ditto.
+ (w3m-tag-regexp-of): Exported to `w3m-macro.el'.
+
+ * w3m-macro.el (w3m-tag-regexp-of): Imported from `w3m.el'.
+
+ * w3m.el (w3m-goto-url): Changed timing when `w3m-current-referer' and
+ `w3m-current-post-data' are set.
+ (w3m-exec): Call `w3m-clear-local-variables' before image data is
+ inserted.
+
+ * w3m.el (w3m-current-forms): Definition imported from `w3m-form.el'.
+ (w3m-current-coding-system): New buffer local variable.
+ (w3m-clear-local-variables): New function.
+ (w3m-copy-local-variables): Ditto.
+ (w3m-arrived-p): Cancel the last change.
+ (w3m-arrived-auto-detected-coding-system): Removed.
+ (w3m-arrived-set-auto-detected-coding-system): Ditto.
+ (w3m-fontify-anchors): Expand `w3m-next-url' and `w3m-previous-url' on
+ `w3m-current-url'.
+ (w3m-decode-buffer): Set auto-detected coding system to
+ `w3m-current-coding-system'.
+ (w3m-remove-comments): Simplified. No point is saved.
+ (w3m-check-link-tags): `w3m-next-url' and `w3m-previous-url' are not
+ reseted.
+ (w3m-remove-meta-tags): New function.
+ (w3m-rendering-region): Call `w3m-remove-meta-tags'.
+ (w3m-exec): Clean up codes.
+ (w3m-redisplay-with-charset): Refer `w3m-current-coding-system'.
+ (w3m-region): Call `w3m-clear-local-variables'.
+
+ * w3m-form.el (w3m-current-forms): Definition moved to `w3m.el'.
+ (w3m-form-make-form-data): Refer `w3m-current-coding-system'.
+
+2001-09-10 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-expand-url): Changed regexp for detecting absolute spec;
+ Don't use `expand-file-name'.
+
+2001-09-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Simplified.
+
+2001-09-10 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Fixed for ASCII under XEmacs.
+
+2001-09-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Refer `coding-system-for-read' which is
+ specified by `universal-coding-system-argument'.
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Protect against invalid value
+ which `emacs-char-to-ucs-codepoint-conversion' returns.
+
+2001-09-09 ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+ * w3m-ucs.el (w3m-euc-japan-encoder): Fixed for katakana-jisx0201.
+
+2001-09-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-make-form-data): Call
+ `w3m-arrived-auto-detected-coding-system' when `w3m-content-charset'
+ returns nil.
+
+ * w3m.el (w3m-arrived-p): Strict checking.
+ (w3m-arrived-auto-detected-coding-system): New function.
+ (w3m-arrived-set-auto-detected-coding-system): Ditto.
+ (w3m-decode-buffer): Call `w3m-arrived-set-auto-detected-coding-system'
+ to store the coding system detectd by this function.
+ (w3m-w3m-attributes): Use content of w3m-document-charset: field as
+ charset, only when `w3m-type' equals `w3mmee' or `w3m-m17n'.
+ (w3m-redisplay-with-charset): Call
+ `w3m-arrived-auto-detected-coding-system' to get current coding-system.
+
+2001-09-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-mule-ucs): Strict checking.
+ (w3m-euc-japan-decode): Use `write-multibyte-character' except Mule2
+ and XEmacs21.1.
+ (w3m-find-file): Refer `coding-system-for-read' which is specified by
+ `universal-coding-system-argument'.
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Removed.
+
+2001-09-09 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp>
+
+ * README.shimbun.ja: Ditto.
+
+ * README.shimbun.ja: Ditto.
+
+2001-09-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-use-mule-ucs): New user option.
+ (w3m-input-coding-system): Changed default value.
+ (w3m-async-exec): Ditto.
+ (w3m-process-connection-type) [Solaris]: Changed default value.
+ (w3m-entity-alist): Enlarge a regular expression.
+ (w3m-ucs-to-char): New function.
+ (w3m-euc-japan-encoder): Follow the change of `w3m-ucs.el'.
+
+ * w3mhack.el (w3mhack-examine-modules): Handle `w3m-ucs.el'.
+
+ * w3m-ucs.el: New file.
+
+2001-09-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-use-toolbar): Use `w3m-image-type-available-p'.
+ (w3m-image-type-available-p): Use `display-images-p' instead of
+ `display-graphic-p'.
+ (w3m-display-inline-image-p): Ditto.
+ (w3m-display-graphic-p): Alias to `display-images-p' instead of
+ `display-graphic-p'.
+ (display-images-p): Make an alias to `display-graphic-p' if it is not
+ available. It is for Emacs version prior to 21.0.105.
+
+2001-09-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-filter.el (w3m-filter-lwn.net): Add link information to next
+ page.
+
+2001-08-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-load-list): Retry to read a file when failed.
+
+2001-08-26 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp>
+
+ * README.shimbun.ja: Add information on nikkansports.
+
+2001-08-24 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp>
+
+ * README.shimbun.ja: Add information on makanai, f1fan, f1express and
+ isize-sports.
+
+2001-08-13 NAKAGAWA Takayuki <tknakaga@kanagawa.hitachi.co.jp>
+
+ * w3m.el (w3m-w3m-attributes): Refer `w3m-base-url' as current url,
+ when it is available.
+
+2001-08-10 Takenobu Sugiyama <sugiyama@ae.advantest.co.jp>
+
+ * w3m-weather.el (w3m-weather-url-alist): Update data to follow the
+ most recent urls.
+ (w3m-weather-default-area): Ditto.
+ (w3m-weather-remove-weather-images): Ditto.
+
+2001-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-download): Made it to work as a command.
+
+2001-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-images): Use `w3m-decode-anchor-string' to
+ convert "&amp;" to "&" in the url string.
+
+2001-08-10 NOMIYA Masaru <nomiya@ttmy.ne.jp>
+
+ * w3m.el (w3m-content-type-alist): Fix typos for gif and tiff.
+
+2001-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Put the url in the history even if `w3m-exec'
+ returns nil.
+
+2001-08-09 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Bug fix. Guess charset in cache
+ buffer.
+
+2001-08-07 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-type): Remove `w3m-mnc' option.
+ (w3m-w3m-dump-source): Removed.
+ (w3m-w3m-retrieve): Don't use `w3m-w3m-dump-source'.
+
+2001-08-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-content-type-alist): [Win32] Executed 'fiber' with
+ synchronous mode
+ (w3m-w32-browser-with-fiber): Ditto.
+ (w3m-external-view): Add a suffix to the temporally file name if
+ possible.
+
+2001-08-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-async-exec): Fix doc-string.
+ (w3m-exec-get-user): Rewrite.
+ (w3m-exec-get-passwd): New funciton.
+ (w3m-exec-set-user): Rewrite.
+ (w3m-get-server-root): Set 'server root' to downcase.
+ (w3m-exec-filter): Modify the method of 'user' and 'passwd' handling.
+
+2001-08-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-next-url): New buffer local variable.
+ (w3m-previous-url): Ditto.
+ (w3m-arrived-ignored-regexp): Add 'about://namazu/'.
+ (w3m-history-ignored-regexp): Ditto.
+ (w3m-url-decode-string): New funtcion.
+ (w3m-fontify-anchors): Process `rel' element of anchor tag.
+ (w3m-check-link-tags): New funtcion.
+ (w3m-rendering-region): Call `w3m-check-link-tags'.
+ (w3m-exec): Set `w3m-next-url' and `w3m-previous-url'.
+ (w3m-lynx-like-map): Replace `scroll-up' with
+ `w3m-scroll-up-or-next-url'. Replace `scroll-down' with
+ `w3m-scroll-down-or-previous-url'.
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Ditto.
+ (w3m-scroll-up-or-next-url): New command.
+ (w3m-scroll-down-or-previous-url): Ditto.
+
+ * w3m-namazu.el (w3m-namazu-default-index-customize-spec): New
+ constant.
+ (w3m-namazu-index-alist): Change customize spec.
+ (w3m-namazu-default-index): Ditto.
+ (w3m-namazu-call-process): Change argument spec and followed change of
+ `w3m-namazu-index-alist'.
+ (w3m-about-namazu): Add link information to next or previous results.
+ (w3m-namazu): Stricter checking of arguments. Encoded index and query.
+
+ * w3m-filter.el (w3m-filter-rules): Add `w3m-filter-google.com'.
+ (w3m-filter-google.com): New function.
+
+2001-08-03 Masayuki Ataka <ataka@milk.freemail.ne.jp>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-namazu.el (w3m-namazu): Fixed the problem which is reported in
+ [emacs-w3m:01389].
+
+2001-08-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-download-save-directory): Abolished.
+ (w3m-goto-ftp-url, w3m-download): Reverted. ;; Those last changes were
+ nonsensical.
+
+2001-08-03 Masayuki Ataka <ataka@milk.freemail.ne.jp>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-namazu.el (w3m-namazu-default-index): Changed customize spec.
+ (w3m-namazu): Follow change of `w3m-namazu-default-index'.
+
+2001-08-03 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-toggle-inline-images): Display "Showing images..."
+ message only when there is at least one inline image.
+ (w3m-current-post-data): New buffer local variable.
+ (w3m-current-referer): Ditto.
+ (w3m-goto-url): Set up `w3m-current-post-data' and
+ `w3m-current-referer'.
+ (w3m-reload-this-page): Process post-data and referer.
+
+2001-08-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-download-save-directory): New user option.
+ (w3m-goto-ftp-url, w3m-download): Refer it.
+
+2001-08-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-antenna.el (w3m-antenna-shutdown): Don't specify a coding-system
+ to `w3m-save-list'.
+ (w3m-antenna-setup): Don't specify a coding-system to `w3m-load-list'.
+ (w3m-antenna-file-coding-system): Abolished.
+
+ * w3m.el (w3m-arrived-shutdown): Don't specify a coding-system to
+ `w3m-save-list'.
+ (w3m-arrived-shutdown, w3m-arrived-setup): Don't specify a
+ coding-system to `w3m-load-list'.
+ (w3m-save-list): Made the arg `coding-system' optional; refer to
+ `w3m-file-coding-system' by default; insert the file magic in the
+ beginning of a file.
+ (w3m-load-list): Made the arg `coding-system' optional; refer to
+ `w3m-file-coding-system-for-read' by default.
+ (w3m-arrived-file-coding-system): Abolished.
+ (w3m-file-coding-system-for-read): New variable.
+ (w3m-file-coding-system): New user option.
+
+2001-08-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-arrived-user-alist): Rename from w3m-arrived-user-list.
+ (w3m-process-realm): New variable.
+ (w3m-exec-process): Bind w3m-process-realm to nil. Call
+ w3m-exec-set-user() for the certification.
+ (w3m-exec-get-user): Rewrite.
+ (w3m-exec-set-user): New function.
+ (w3m-get-server-root): Ditto.
+ (w3m-exec-filter): Support a pair of 'rootserver' and 'realm'.
+
+2001-08-02 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-make-form-data): Fixed typo.
+ (w3m-form-input-file): Rewrite.
+ (w3m-fontify-forms): Parse hseq attribute as well; Changed textarea
+ properties.
+ (w3m-form-text-chop): New function.
+ (w3m-form-input-textarea-hseq): New buffer local variable.
+ (w3m-form-input-textarea-name): Eliminated.
+ (w3m-form-input-textarea-set): Use `w3m-form-textarea-info',
+ `w3m-form-textarea-replace' and `w3m-form-input-textarea-hseq'.
+ (w3m-form-input-textarea): Use `w3m-form-textarea-info'; Adjust cursor
+ line at start time.
+ (w3m-form-textarea-replace): New function.
+ (w3m-form-textarea-info): Ditto.
+
+2001-08-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-add-referer): New option.
+ (w3m-goto-url): When `w3m-add-referer' equals nil, no reference
+ information is given to `w3m-exec'.
+
+ * README, README.ja: Update documents for required version of w3m.
+
+ * w3m-0.2.1-mnc.patch: Removed.
+
+ * w3m.el (TOP): Add autoload for w3m-namazu.
+
+ * w3m-namazu.el: New file.
+
+2001-08-01 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-retrieve): Bind coding-system-for-write as 'binary.
+
+ * w3m-form.el (w3m-form-make-form-data): New function.
+ (w3m-form-make-form-urlencoded): Eliminated.
+ (w3m-fontify-forms): Added 'file' input processing.
+ (w3m-form-input-file): New function.
+ (w3m-form-input-textarea-keymap): Bind "\C-c\C-k" as well.
+ (w3m-form-input-select-keymap): Ditto.
+ (w3m-form-input-map-keymap): Ditto.
+ (w3m-form-submit): Call `w3m-form-make-form-data' instead of
+ `w3m-form-make-form-urlencoded'.
+
+2001-07-31 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el: Applied patch [emacs-w3m: 01330].
+ (w3m-exec-filter): Changed regexp for authentication realm.
+
+ * w3m.el (w3m-toggle-inline-images): Set `referer' argument of
+ `w3m-create-image'.
+
+ * w3m-e21.el (w3m-create-image): Added argument `referer'.
+
+ * w3m-xmas.el (w3m-create-image): Ditto.
+
+ * w3m-form.el (w3m-form-submit): Set `referer' argument of
+ w3m-goto-url.
+
+ * w3m.el (w3m-w3m-retrieve): Make a temporary file for POST; Use
+ -header option to specify Content-Type: field.
+ (w3m-w3m-retrieve): Added argument `referer'; Add -header option to
+ specify Referer: field.
+ (w3m-retrieve): Added argument `referer'.
+ (w3m-exec): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-view-this-url): Set `referer' argument of w3m-goto-url.
+
+2001-07-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-make-help-echo): For FSF Emacs 21, specify the third
+ argument of `get-text-property' where the buffer is to be checked; for
+ XEmacs, make it not to work if the buffer is not focused.
+ (w3m-make-balloon-help): Make it not to work if the buffer is not
+ focused.
+
+2001-07-27 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-parse-forms): Fixed for initial value in the
+ textarea.
+
+2001-07-27 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-input-textarea-exit): New function.
+ (w3m-form-input-select-exit): Ditto.
+ (w3m-form-input-map-exit): Ditt.
+ (w3m-form-input-textarea-keymap): Add key for 'exit'.
+ (w3m-form-input-select-keymap): Ditto.
+ (w3m-form-input-map-keymap): Ditto.
+ (w3m-form-input-textarea-mode): Modify doc-string.
+ (w3m-form-input-select-mode): Ditto.
+ (w3m-form-input-map-mode): Ditto.
+ (w3m-form-input-select-set-mouse): Add doc-string.
+ (w3m-form-input-map-set-mouse): Ditto.
+
+2001-07-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-x-moe-decode-buffer): Use 'w3m-coding-system' instead of
+ 'euc-jp.
+ (w3m-w32-browser-with-fiber): Ignore process output.
+
+ * w3m-form.el (w3m-form-mouse-face): New user option.
+ (w3m-form-input-select): Add mouse-face.
+ (w3m-form-input-map): Ditto.
+
+ * mew-w3m.el (toplevel): Require 'cl, when byte-compile.
+ (mew-mime-text/html-w3m): Guess charset with the use of the Mew's
+ funcion and use its charset, if executed a combination of Mew Ver.2 and
+ w3m-m17n.
+
+2001-07-25 NAKAGAWA Takayuki <tknakaga@kanagawa.hitachi.co.jp>
+
+ * w3m.el (w3m-fontify-anchors): Don't delete trailing whitespaces,
+ etc. from anchors.
+
+2001-07-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-parse-forms): Support the USEMAP attribute of
+ the IMG element.
+ (w3m-fontify-forms): Ditto.
+ (w3m-form-input-textarea-wincfg): New buffer local variable.
+ (w3m-form-input-select-wincfg): Ditto.
+ (w3m-form-input-textarea): Save the configuration of current window.
+ Guard error of the minimum height of window.
+ (w3m-form-input-select): Ditto.
+ (w3m-form-input-textarea-set): Restore the configuration of window.
+ (w3m-form-input-select-set): Ditto.
+ (w3m-form-input-map-buffer-lines): New user option.
+ (w3m-form-input-map-mode-hook): Ditto.
+ (w3m-form-input-map-set-hook): Ditto.
+ (w3m-form-input-map-keymap): New keymap.
+ (w3m-form-input-map-buffer): New buffer local variable.
+ (w3m-form-input-map-wincfg): Ditto.
+ (w3m-form-input-map-set): New function.
+ (w3m-form-input-map-mode): Ditto.
+ (w3m-form-input-map): Ditto.
+ (w3m-form-input-select-keymap): Added mouse operation.
+ (w3m-form-input-map-keymap): Ditto.
+ (w3m-form-input-select-set-mouse): New function.
+ (w3m-form-input-map-set-mouse): Ditto.
+
+2001-07-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-submit): New defmacro.
+ (w3m-mouse-view-this-url): Handle the action of form tag.
+ (w3m-submit-form): New function, submit the form.
+ (w3m-lynx-like-map): Add w3m-submit-form().
+ (w3m-info-like-map): Ditto.
+ (w3m-mode): Modify doc-string.
+
+ * w3m-form.el (w3m-fontify-forms): Add 'w3m-submit property on all tags
+ except the "reset".
+
+2001-07-18 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-retrieve): Added argument `post-data'.
+ (w3m-w3m-retrieve): Add -post and -post_ct to `w3m-command-arguments'
+ when `post-data' is specified.
+ (w3m-retrieve): Added argument `post-data'.
+ (w3m-exec): Ditto.
+ (w3m-goto-url): renamed `post-body' to `post-data'. Don't bind
+ w3m-command-arguments here.
+
+2001-07-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-dump-source, w3m-w3m-dump-head-source,
+ w3m-local-dirlist-cgi): Say where the url is being connected to.
+
+ * w3mhack.el (w3mhack-compile): Changed message convention.
+ * w3m.el (w3m-view-source, w3m-rendering-region, w3m-w3m-dump-source,
+ w3m-w3m-dump-head-source, w3m-w3m-get-header, w3m-local-dirlist-cgi,
+ w3m-fontify): Ditto.
+ * w3m-e21.el (w3m-setup-header-line): Ditto.
+ * w3m-dtree.el (w3m-about-dtree): Ditto.
+ * w3m-bookmark.el (w3m-bookmark-add-current-url,
+ w3m-bookmark-add-this-url, w3m-bookmark-add-this-url): Ditto.
+ * mime-w3m.el (mime-w3m-mouse-view-this-url): Ditto.
+
+ * w3m.el (w3m-gohome, w3m-convert-ftp-url-for-emacsen,
+ w3m-goto-mailto-url, w3m-edit-current-url, w3m-external-view,
+ w3m-local-dirlist-cgi, w3m-toggle-inline-images, w3m-parse-attributes):
+ Changed error message convention.
+ * w3m-hist.el (w3m-history-add-arrived-db, w3m-history-rename-url,
+ w3m-history-remove-properties, w3m-history-add-properties,
+ w3m-history-plist-put, w3m-history-plist-get): Ditto.
+ * w3m-bookmark.el (w3m-bookmark-add, w3m-bookmark-write-file): Ditto.
+
+2001-07-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mbconv-command): New customize variable.
+ (w3m-decode-buffer): If charset equal 'x-moe-internal', call
+ w3m-x-moe-decode-buffer().
+ (w3m-x-moe-decode-buffer): New funcion. A coding-system of buffer
+ converts 'x-moe-internal' to usual coding-system for emacsen.
+
+ * w3m-form.el (w3m-form-parse-region): If charset equal
+ 'x-moe-internal', call w3m-x-moe-decode-buffer().
+ (w3m-form-parse-forms): Handles value of 'charset', if w3m-type eq
+ 'w3mmee.
+
+2001-07-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-byte-optimize-letX): Remove `pop-up-frame-alist'
+ when compiling.
+
+ * w3m.el (w3m): Use the new macros; set the value of
+ `w3m-initial-frame' in the popped up frame.
+ (w3m-close-window): Use `w3m-delete-frame-maybe'.
+ (w3m-quit): Use `w3m-delete-frame-maybe'.
+ (w3m-delete-frame-maybe): New function.
+ (w3m-copy-buffer): Pop up a new frame if `w3m-pop-up-frames' is
+ non-nil; set the value of `w3m-initial-frame' in the new frame.
+ (w3m-popup-frame-p): New macro.
+ (w3m-pop-up-frame-parameters): New macro.
+ (w3m-initial-frame): New internal variable.
+
+ * w3m-xmas.el (w3m-setup-header-line): Use text-properties instead of
+ the raw extents for highlighting a header line.
+
+2001-07-13 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-new): Added 'charlst' option.
+ (w3m-form-charlst): New macro.
+ (w3m-form-plist): Move a indent of an array.
+ (w3m-form-put): Ditto.
+ (w3m-form-make-form-urlencoded): Remove 'coding' option. If
+ 'accept-charset' denotes within <form> tag, resolve coding-system
+ according to its list of charset.
+ (w3m-form-parse-forms): Handle value of 'accept-charset'.
+
+2001-07-12 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-tag-regexp-of): New macro to generate regexp of specified
+ tag(s).
+ (w3m-parse-attributes): Skip spaces before parsing.
+
+ * w3m-form.el (w3m-form-parse-forms): More flexible and simple tag
+ finding using `w3m-tag-regexp-of' macro.
+
+2001-07-12 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-charset-coding-system-alist): Added 'us_ascii'.
+ (w3m-w3m-attributes): Use content of w3m-document-charset: field as
+ charset if exists.
+
+2001-07-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (w3m-form-parse-forms): Parse the tags only within the
+ "<form ..> ... </form>".
+
+2001-07-12 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-remove-redundant-spaces): Don't cause an error when str
+ contains only spaces.
+
+2001-07-12 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * mew-w3m.el: Hand-over of copyright of this file from Goto to
+ Tsuchiya. This is consensual.
+
+2001-07-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-rendering-region): Add charset option when call
+ w3m-form-parse-region().
+
+ * w3m-form.el (w3m-form-parse-region): Add charset option. If w3m-type
+ is 'w3mmee or 'w3m-m17n, forms parse within a decoded temporally
+ buffer.
+ (w3m-form-parse-forms): New function.
+
+2001-07-11 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m-form.el (w3m-form-parse-region): Don't extract value from submit
+ button, again.
+ (w3m-form-submit): Don't set value when NAME is omitted.
+
+2001-07-11 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-rendering-region): Do not break matching data.
+
+2001-07-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-fontify-forms): Put text properties corresponding to
+ form types.
+ (w3m-form-input): Simplify.
+ (w3m-form-input-password): New function.
+ (w3m-form-input-checkbox): Ditto.
+ (w3m-form-input-radio): Ditto.
+ (w3m-form-input-textarea): Follow changes in `w3m-form-input'.
+ (w3m-form-input-select): Ditto.
+
+2001-07-11 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m-form.el (w3m-form-goto-next-field): New function.
+ (w3m-form-make-form-urlencoded): Refine to support value of check-box
+ type which is list of value string.
+ (w3m-form-parse-region): Support CHECKBOX type and RADIO type. Note
+ that CHECKBOX type has multiple values.
+ (w3m-fontify-forms): Use new property 'w3m-form-field-id to identify
+ each field to support RADIO type item. Also removed value putting code
+ because values are already set in parsing.
+ (w3m-form-input): Support action for CHECKBOX and RADIO type field.
+
+ * w3m.el (w3m-url-encode-string): Encode SPACE(0x20) as "+".
+ (w3m-rendering-region): Decode entities in title string.
+
+2001-07-10 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-attributes): Fixed problem when charset is quoted.
+
+ * w3m-form.el (w3m-form-parse-region): Don't extract value from submit
+ button.
+ (w3m-form-submit): If ACTION is not specified, send data to current
+ url.
+ (w3m-form-make-get-string): Removed.
+
+2001-07-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Bind `:bool' for old Emacsen.
+
+2001-07-10 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-parse-attributes): Support :bool type attribute.
+
+ * w3m-form.el (w3m-form-parse-region): Use :bool type for SELECTED
+ attribute of OPTION tag.
+
+2001-07-09 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-make-form-urlencoded): If second value of plist
+ is consp, use car value (for select).
+ (w3m-form-parse-region): Don't parse type attribute for textarea;
+ Process select.
+ (w3m-fontify-forms): Save value and name for submit.
+ (w3m-form-replace): Added optional argument `invisible'.
+ (w3m-form-input): Process SELECT and PASSWORD.
+ (w3m-form-input-select-buffer-lines): New user option.
+ (w3m-form-input-select-mode-hook): Ditto.
+ (w3m-form-input-select-set-hook): Ditto.
+ (w3m-form-input-select-keymap): New keymap.
+ (w3m-form-input-select-buffer): New buffer local variable.
+ (w3m-form-input-select-form): Ditto.
+ (w3m-form-input-select-name): Ditto.
+ (w3m-form-input-select-point): Ditto.
+ (w3m-form-input-select-candidates): Ditto.
+ (w3m-form-input-select-set): New function.
+ (w3m-form-input-select-mode): Ditto.
+ (w3m-form-input-select): Ditto.
+ (w3m-form-submit): Added optional argument name and value.
+
+ * w3m.el (w3m-remove-comments): New function.
+ (w3m-rendering-region): Call it.
+
+2001-07-06 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-form.el (w3m-form-default-coding-system): Changed default value
+ to shift_jis.
+ (w3m-form-make-form-urlencoded): Removed redundant local variable.
+
+ * w3m.el (w3m-url-encode-string): Encode newline as "%0D%0A"
+
+ * w3m-form.el (w3m-form-default-coding-system): New user option.
+ (w3m-form-make-form-urlencoded): Use it.
+ (w3m-form-input-textarea-set): Get values of buffer local variables
+ before changing buffer.
+ (w3m-form-input-textarea): Set values of buffer local variables after
+ changing buffer.
+
+2001-07-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (comment): Modify URI of emacs-w3m.
+ (w3m-form-input-textarea-mode-hook): New user option.
+ (w3m-form-input-textarea-point): New buffer local variable.
+ (w3m-form-input-textarea-set): Run 'w3m-form-input-textarea-set-hook'
+ hook first. Get 'w3m-buffer' from input buffer. Go to the point of
+ the orignal form when switch to 'w3m-buffer'.
+ (w3m-form-input-textarea): Save original point to
+ 'w3m-form-input-textarea-point'. Set 'w3m-form-input-textarea-buffer'
+ within the buffer of the input area.
+
+ * w3m.el (w3m-about): Modify URI of emacs-w3m.
+ * w3m-xmas.el (comment): Ditto.
+ * w3m-weather.el (comment): Ditto.
+ * w3m-search.el (comment): Ditto.
+ * w3m-om.el (comment): Ditto.
+ * w3m-macro.el (comment): Ditto.
+ * w3m-e21.el (comment): Ditto.
+ * w3m-e20.el (comment): Ditto.
+ * w3m-dtree.el (comment): Ditto.
+ * w3m-bookmark.el (comment): Ditto.
+ * w3m-antenna.el (comment): Ditto.
+
+2001-07-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-0.2.1-mnc.patch: Added [-post body] option.
+
+ * w3m.el (w3m-url-encode-string): Don't cause an error when str is nil.
+ (w3m-goto-url): Added post-body argument; Set -post option if post-body
+ is specified.
+
+ * w3m-form.el (w3m-form-make-form-urlencoded): New function.
+ (w3m-form-make-get-string): Use `w3m-form-make-form-urlencoded'.
+ (w3m-form-parse-region): Add textarea processing.
+ (w3m-form-replace): Delete newline characters.
+ (w3m-form-input): Added textarea processing.
+ (w3m-form-submit): If form method is POST, then set post-body argument
+ of `w3m-goto-url'.
+ (w3m-form-input-textarea-buffer-lines): New user option.
+ (w3m-form-input-textarea-mode-hook): Ditto.
+ (w3m-form-input-textarea-keymap): New keymap.
+ (w3m-form-input-textarea-buffer): New buffer local variable.
+ (w3m-form-input-textarea-form): Ditto.
+ (w3m-form-input-textarea-name): Ditto.
+ (w3m-form-input-textarea-set): New function.
+ (w3m-form-input-textarea-mode): Ditto.
+ (w3m-form-input-textarea): Ditto.
+
+2001-06-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Search xref in the root
+ entitiry.
+
+2001-06-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-version): Bind `print-level' and `print-length'
+ to nil.
+ (w3mhack-examine-modules): Ditto.
+ * w3m.el (w3m-rendering-region): Ditto.
+ * w3m-form.el (w3m-form-submit): Ditto.
+
+2001-06-12 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el: Added support code for w3m-m17n.
+ (w3m-type): Add new candidate.
+ (w3m-command, w3m-input-coding-system, w3m-output-coding-system)
+ (w3m-halfdump-command-arguments): Add default value for w3m-m17n.
+ (w3m-exec) [w3m-m17n]: No call `w3m-decode-buffer'.
+ (w3m-region) [w3m-m17n]: No call `encode-coding-region'.
+
+2001-06-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-dump-head-source-command-argument): Its old name is
+ `w3m-dump-head-source-command-arguments'.
+
+2001-06-11 Mito <mit@nines.nec.co.jp>
+
+ * w3m.el (w3m-broken-proxy-cache): New variable.
+ (w3m-dump-head-source-command-arguments): Defined as list.
+ (w3m-w3m-retrieve): Cache on proxy server isn't used when neither
+ `no-cache' nor `w3m-broken-proxy-cache' equal to nil.
+
+2001-06-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-form.el (w3m-form-parse-region): Check the value of
+ `w3m-current-buffer' to avoid wrong type argument error.
+
+ * w3m.el (w3m-rendering-region): Set `w3m-current-buffer' refered in
+ `w3m-form-parse-region'.
+
+2001-06-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-attributes): Remove URL fragments before checking its
+ attributes.
+ (w3m-retrieve): Remove URL fragments before getting its contents.
+ (w3m-w3m-retrieve): Follow changes in `w3m-retrieve'.
+ (w3m-arrived-add): Simplified regular expression.
+ (w3m-parse-attributes): Changed form spec for edebug.
+
+ * w3m-form.el (w3m-form-parse-region): Set `w3m-current-forms' in the
+ buffer `w3m-current-buffer'.
+
+ * mime-w3m.el (mime-w3m-save-background-color): Changed form spec for
+ edebug.
+
+2001-06-09 Kiyokazu SUTO <suto@ks-and-ks.ne.jp>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-fontify-anchors): Process w3m internal tag `<_id>' which
+ represents ID properties.
+
+2001-06-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-retrieve): Remove URL's fragment before checking
+ cache.
+
+2001-06-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-unoptimize-animated-gif): Truncate an animated gif
+ to have only one frame when the size is larger than the value of
+ `w3m-animated-gif-maximum-size'.
+ (w3m-animated-gif-maximum-size): New variable.
+
+2001-06-06 Kenichi OKADA <okada@opaopa.org>
+
+ * w3m-xmas.el: Require `path-util'.
+
+2001-06-07 NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>
+
+ * w3m.el (w3m-exec-process): Replace `delete' with `delq'.
+
+2001-06-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toolbar): Use the English language when the value of the
+ variable `current-language-environment' is not "Japanese".
+
+2001-06-04 Pavel Janik <Pavel@Janik.cz>
+
+ * w3m.el (w3m-about-db-history): Fix typo Titile -> Title.
+
+2001-06-01 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-halfdump-command-arguments): Changed default value to
+ "-dump=half-buffer" when w3m-type equal 'w3mmee.
+
+2001-05-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (iso-2022-7bit): New coding-system generated by copying
+ from `*iso-2022-jp*'.
+
+2001-05-31 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-coding-system): Changed default value to 'iso-2022-7bit.
+ (w3m-input-coding-system): Ditto.
+
+2001-05-31 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-dtree-create): Insert 'Meta tag' to the binding of
+ charset.
+
+ * w3m.el (w3m-local-dirlist-cgi): Fix charset handling.
+
+2001-05-30 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-file-name-coding-system): New customizable value.
+ (w3m-charset-coding-system-alist): Reverse list.
+ (w3m-dirlist-cgi-program): Change default value for OS/2.
+ (w3m-local-dirlist-cgi): Set "QUERY_STRING" to encoded string of
+ 'w3m-file-name-coding-system'. Insert 'Meta tag' to the binding of
+ charset.
+
+2001-05-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Set a string representing file interpreted as
+ a directory to `default-directory'.
+ (w3m-about-source): Call `w3m-decode-buffer'.
+
+2001-05-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-decode-buffer): Allow `detect-coding-region' to return
+ both a coding-system and a list of coding-systems.
+
+2001-05-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (XEmacs): Require `byte-optimize' expressly before
+ advising the function `byte-optimize-form-code-walker'.
+
+2001-05-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-rename-url): Don't use `with-current-buffer'
+ for old Emacsen.
+ (w3m-history-copy): Ditto.
+ (w3m-history-share-properties): Ditto.
+ (w3m-history-seek-properties): Ditto.
+
+2001-05-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (slow): New rule for the developers to check a
+ portability for each module.
+ * w3m-xmas.el (w3m-cache-unoptimized-gif-images): Fix typo.
+
+2001-05-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-directory-view-method): Modify default value.
+ (w3m-direlist-cgi-program): New variable.
+ (w3m-local-retrieve): Call w3m-local-dirlist-cgi() when local
+ directory.
+ (w3m-local-dirlist-cgi): New function. Execute either 'w3m' or
+ 'direlist.cgi'.
+ (w3m-goto-url-localcgi-movepoint): Use 'w3m-name-anchor instead of
+ 'patter-matching'.
+ (w3m-url-completion): Handling drive letter for any broken OSes.
+
+ * w3m-dtree.el (w3m-dtree-stop-strings): Add a new alternative.
+
+2001-05-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-decode-buffer): Removed reference of `w3m-coding-system'.
+
+2001-05-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-dtree-directory-depth): New variable.
+ (w3m-dtree-stop-strings): Ditto.
+ (w3m-dtree-create-sub): Add new arugument 'depth'. Stop recursive call,
+ if directory-depth over the 'w3m-dtree-directory-depth'.
+
+2001-05-25 NAKAGAWA Takayuki <tknakaga@kanagawa.hitachi.co.jp>
+
+ * w3m-dtree.el (w3m-dtree-create-sub): To avoid infinite recusion,
+ directory-files now returns absolute file names and expand-file-name is
+ omitted.
+
+2001-05-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Get the values of `w3m-current-url' and
+ `w3m-history-flat' from the buffer `w3m-current-buffer'.
+ (w3m-goto-url): Set the value of `w3m-current-buffer' as the current
+ buffer.
+ (w3m-current-buffer): New internal variable.
+
+2001-05-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Made it to return w3m-macro.elc
+ and the version specific module first.
+
+ * w3m.el (w3m-setup-menu): Define it if the feature `xemacs' is not
+ provided.
+ (TopLevel): Don't bind the functions `w3m-display-inline-image-p',
+ `w3m-display-graphic-p', `w3m-update-toolbar', `w3m-setup-toolbar',
+ `w3m-image-type-available-p', `w3m-insert-image' and
+ `w3m-create-image'.
+ (w3m-get-buffer-create, w3m-add-text-properties, w3m-with-work-buffer):
+ Moved to w3m-macro.el.
+ (w3m-charset-coding-system-alist): Use `w3m-find-coding-system'
+ directly.
+ (w3m-find-coding-system): Moved to the version specific modules.
+ (w3m-static-cond, w3m-static-if): Moved to w3m-macro.el.
+ (TopLevel): Require `w3m-e20' when the version of the running Emacs is
+ neither XEmacs, Emacs 21 nor Mule2.
+ (TopLevel): Require `w3m-macro'.
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Define it when the function
+ `ccl-compile-write-multibyte-character' is bound.
+ (widget-coding-system-action): Use `eval' instead of the funcall'ing
+ for the function `widget-coding-system-prompt-value'. It is only for
+ avoiding a byte-compile warning.
+ (w3m-should-unoptimize-animated-gifs): Check for both
+ `emacs-patch-level' and `emacs-beta-version' when XEmacs 21.2 is
+ running.
+ (TopLevel): Bind the functions `w3m-image-type' and `w3m-retrieve' when
+ compiling.
+ (TopLevel): Bind the variables `w3m-current-url',
+ `w3m-display-inline-image', `w3m-icon-directory', `w3m-menubar',
+ `w3m-toolbar', `w3m-toolbar-buttons', `w3m-use-header-line' and
+ `w3m-work-buffer-name' when compiling.
+ (TopLevel): Don't require `w3m'.
+ (TopLevel): Provide the feature `w3m-xmas' in the end of the file.
+
+ * w3m-om.el (read-passwd): Enclose it with `eval-and-compile'.
+ (w3m-find-coding-system): New inline function moved from w3m.el.
+ (w3m-display-inline-image-p, w3m-display-graphic-p, w3m-update-toolbar,
+ w3m-setup-toolbar, w3m-image-type-available-p, w3m-insert-image,
+ w3m-create-image): Alias to `ignore'.
+ (TopLevel): Bind the variables `w3m-menubar' and `w3m-mode-map' when
+ compiling.
+ (TopLevel): Don't require `w3m'.
+ (TopLevel): Provide the feature `w3m-om' in the end of the file.
+
+ * w3m-macro.el: New file which currently contains
+ `w3m-get-buffer-create', `w3m-add-text-properties',
+ `w3m-with-work-buffer', `w3m-static-cond' and `w3m-static-if'.
+
+ * w3m-e21.el (w3m-update-toolbar): Alias to `ignore'.
+ (w3m-find-coding-system): New inline function moved from w3m.el.
+ (TopLevel): Bind the functions `w3m-image-type' and `w3m-retrieve' when
+ compiling.
+ (TopLevel): Bind the variables `w3m-work-buffer-name',
+ `w3m-use-header-line', `w3m-toolbar-buttons', `w3m-toolbar',
+ `w3m-mode-map', `w3m-icon-directory' and `w3m-display-inline-image'
+ when compiling.
+ (TopLevel): Don't require `w3m'; require `w3m-macro'.
+ (TopLevel): Provide the feature `w3m-e21' in the end of the file.
+
+ * w3m-e20.el: New file.
+
+2001-05-25 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-expand-file-name-as-url): Remove handling
+ 'about://dtree'.
+ (w3m-local-content-type): Ditto.
+ (w3m-url-local-p): Ditto.
+ (w3m-local-directory-view-method): New variable.
+ (w3m-local-retrieve): If url is directory, call w3m by way of kick
+ 'dirlist.cgi'
+ (w3m-url-dtree-p): New defsubst.
+ (w3m-edit-current-url, w3m-edit-this-url): Use w3m-url-dtree-p().
+ (w3m-goto-url-localcgi-movepoint): New function.
+ (w3m-goto-url): If URL is a local directory, check and change URL by
+ the use of 'w3m-local-directory-view-method'. If URL type is a local
+ cgi, move to its directory point.
+
+2001-05-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Check if `emacs-major-version'
+ is 21 instead of 20 and check for `emacs-beta-version' instead of
+ `emacs-patch-level'.
+ (w3m-should-unoptimize-animated-gifs): Ditto.
+
+2001-05-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Fix typo.
+
+2001-05-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Don't check for the constant
+ `emacs-patch-level' when the beta versions of XEmacs is running.
+
+2001-05-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-euc-japan-decoder): Not define when it has been already
+ defined.
+
+ * w3m-xmas.el (w3m-euc-japan-decoder): Define when XEmacs whose version
+ is greater than 21.2.19 is used.
+
+2001-05-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Modify messages in `w3m-view-header', `w3m-view-source',
+ `w3m-edit-this-url', `w3m-print-this-url', `w3m-download-this-url',
+ `w3m-view-current-url-with-external-browser', `w3m-save-image',
+ `w3m-view-image', `w3m-mouse-view-this-url', `w3m-view-this-url' and
+ `w3m-search-name-anchor'.
+
+ * w3m.el (w3m-toggle-inline-images): Signal an error when the function
+ `w3m-display-graphic-p' returns nil.
+ (w3m-display-graphic-p): Alias to `ignore' by default.
+ (w3m-menubar): Disable a menu button "Toggle Images" when the function
+ `w3m-display-graphic-p' returns nil.
+ * w3m-xmas.el (w3m-display-graphic-p): Alias to
+ `device-on-window-system-p'.
+ * w3m-e21.el (w3m-display-graphic-p): Alias to `display-graphic-p'.
+
+2001-05-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-find-coding-system): New function to replace
+ `find-coding-system'.
+ (w3m-charset-to-coding-system): Use `w3m-find-coding-system'.
+ (make-ccl-coding-system): Removed.
+ (toplevel) [emacs20, emacs21]: Removed dependency on `pccl'.
+
+2001-05-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (toplevel): Fix condition for (require 'pccl).
+
+2001-05-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-charset-to-coding-system): Simplified.
+ (make-ccl-coding-system) [XEmacs, Mule]: Removed.
+
+2001-05-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-region): Use `w3m-display-inline-image-p'.
+ (w3m-goto-url): Ditto.
+ (w3m-display-inline-image-p): New function.
+ * w3m-xmas.el (w3m-display-inline-image-p): New function.
+ * w3m-e21.el (w3m-display-inline-image-p): New function.
+
+2001-05-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (toplevel): Define make-ccl-coding-system() myself, when
+ failed (require 'pccl).
+
+2001-05-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Made it can be called non-interactively or a batch job.
+
+ * w3m.el (w3m-goto-url): Add autoload magic cookie.
+ * w3m-weather.el (w3m-about-weather, w3m-weather): Ditto.
+ * w3m-search.el (w3m-search): Ditto.
+ * w3m-form.el (w3m-fontify-forms, w3m-form-parse-region): Ditto.
+ * w3m-filter.el (w3m-filter): Ditto.
+ * w3m-dtree.el (w3m-dtree, w3m-about-dtree): Ditto.
+ * w3m-bookmark.el (w3m-bookmark-view, w3m-bookmark-add-current-url,
+ w3m-bookmark-add-this-url): Ditto.
+ * w3m-antenna.el (w3m-antenna, w3m-about-antenna): Ditto.
+ * mime-w3m.el (mime-w3m-preview-text/html): Ditto.
+
+2001-05-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-coding-system): Changed default value to
+ 'iso-2022-7bit-ss2.
+ (w3m-terminal-coding-system): New user option.
+ (w3m-attributes): When URL whose scheme equals to `about' is specified,
+ returns `w3m-coding-system' as its content-charset.
+ (w3m-exec-process): Refer `w3m-terminal-coding-system'.
+ (w3m-decode-buffer): Decode buffer everywhen it is called.
+ (w3m-about-retrieve): New function.
+ (w3m-cid-retrieve): Ditto.
+ (w3m-retrieve): Call `w3m-about-retrieve' and `w3m-cid-retrieve'.
+ (w3m-rendering-region) [w3mmee]: No call `encode-coding-region'. Fix
+ coding-system spec error for Mule-2.3.
+ (w3m-rendering-region): Simplified.
+ (w3m-region) [w3mmee]: Encode this buffer as unibyte representation.
+ (w3m-about-history): No call `w3m-with-work-buffer'.
+ (w3m-about-db-history): Ditto.
+
+ * w3m-dtree.el (w3m-about-dtree): Ditto.
+
+ * w3m-weather.el (w3m-about-weather): Call `w3m-decode-buffer'.
+
+2001-05-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Popup a new frame if there is neither a window nor a
+ frame associated with w3m and `w3m-pop-up-frames' is non-nil; refer to
+ `w3m-pop-up-frame-parameters' when creating a new w3m frame.
+ (w3m-pop-up-frame-parameters): New user option which allows a kludge
+ that it can be either an alist or a plist.
+ (w3m-pop-up-frames): New user option.
+
+ * w3m-e21.el (w3m-setup-header-line): Replace "%" with "%%" in an url
+ string.
+
+2001-05-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-read-coding-system): Removed.
+ (w3m-process-environment): New variable.
+ (w3m-input-coding-system): Changed default value.
+ (w3m-output-coding-system) [w3mmee]: Changed default value.
+ (w3m-arrived-add-1): Changed argument spec.
+ (w3m-arrived-add): Ditto.
+ (w3m-arrived-coding-system): Removed.
+ (w3m-arrived-content-charset): New function.
+ (w3m-arrived-setup): Changed arrived file format to keep
+ content-charset instead of coding-system.
+ (w3m-arrived-shutdown): Ditto.
+ (w3m-exec-process): Refer `w3m-process-environment' to set environments
+ for sub-processes.
+ (w3m-decode-encoded-contents): Ditto.
+ (w3m-coding-system-to-charset): Removed.
+ (w3m-read-content-charset): New function.
+ (w3m-decode-buffer): Changed argument spec. Process this buffer if and
+ only if it's represented in unibyte.
+ (w3m-rendering-region): Reconstruced.
+ (w3m-exec): Changed argument spec and followed the change of
+ `w3m-decode-buffer'.
+ (w3m-goto-url): Changed argument spec and followed the change of
+ `w3m-exec'.
+ (w3m-redisplay-with-coding-system): Removed.
+ (w3m-redisplay-with-charset): New command to replace
+ `w3m-redisplay-with-coding-system'.
+ (w3m-region): No call `encode-coding-region'.
+ (w3m-about-history): Ditto.
+ (w3m-about-db-history): Ditto.
+
+ * w3m-antenna.el (w3m-about-antenna): No call `encode-coding-region'.
+
+ * w3m-dtree.el (w3m-about-dtree): Ditto.
+
+ * w3m-om.el (w3m-read-coding-system): Removed.
+ (coding-system-list): New function.
+
+2001-05-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-expand-file-name-as-url): If file is directory, expand to
+ use 'about://dtree'.
+ (w3m-local-content-type): If url is directory or 'about://dtree/",
+ return "text/html" type.
+ (w3m-goto-url): If URL is local and directory, change URL 'file://' to
+ 'about://dtree'.
+ (w3m-halfdump-command): New variable.
+ (w3m-halfdump-command-arguments): Change to defvar.
+ (w3m-halfdump-command-common-arguments): New constant, common arguments
+ for 'halfdump' execution of all w3m variants.
+ (w3m-rendering-region): Use 'w3m-halfdump-command' if setted. Change
+ call process arguments.
+ (w3m-lynx-like-map): Add w3m-gohome() keybind.
+ (w3m-info-like-map): Add w3m-dtree() and w3m-edit-this-url()
+ keybind. Use w3m-gohome() instead of lamda expression.
+ (w3m-mode): Modify doc-string.
+
+ * w3m-dtree.el (w3m-about-dtree): Modify message.
+
+2001-05-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-unoptimize-animated-gif): New function which is
+ separated from `w3m-create-image'; improve a way to check whether a
+ data should be unoptimized or not.
+ (w3m-create-image): Use it.
+
+2001-05-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-create-image): Attempt to extract the first frame of
+ an animated gif when the unoptimization is failed.
+
+2001-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-add-text-properties): Don't specify `end-open' nor
+ `front-nonsticky' that are the default.
+ (w3m-emacs-w3m-icon): Colorized.
+
+2001-05-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-cache-contents): Don't insert additional '\n' for binary
+ data.
+
+2001-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Don't make the coding-system `w3m-euc-japan' if it already
+ exists to make w3m.el reloadable in Emacs 20.
+
+2001-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about): Put an icon image as about://emacs-w3m.gif.
+ (w3m-retrieve): Make an exception of about://emacs-w3m.gif.
+ (w3m-attributes): Ditto.
+ (w3m-emacs-w3m-icon): New constant for about://emacs-w3m.gif.
+
+2001-05-22 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-region): Call w3m-render-region for the region from
+ `point-min' to `point-max' because buffer is already narrowed.
+
+2001-05-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Fix condition when
+ mew-mime-text/html() call, again. Avoid byte-compile warning when
+ compiling.
+
+2001-05-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Add support code of w3mmee. Reorganaized codes to handle
+ content types and coding systems which are specified by user.
+ (toplevel): Require 'pccl.
+ (w3m-type): New user option.
+ (w3m-mnc): Removed user option.
+ (w3m-linefeed-type): Removed variable.
+ (w3m-dump-head-source-option): Ditto.
+ (w3m-decode-all-to-this-charset): Ditto.
+ (w3m-halfdump-option): Ditto.
+ (w3m-halfdump-expand-options): Ditto.
+ (w3m-extended-characters-table): Ditto.
+ (w3m-command): Refer `w3m-type' to decide default value.
+ (w3m-command-arguments): Ditto.
+ (w3m-output-coding-system): Changed default value to `w3m-euc-japan'.
+ (w3m-profile-directory): Refer `w3m-command' to decide default value.
+ (w3m-default-save-directory): Ditto.
+ (w3m-dump-head-source-command-arguments): New constant.
+ (w3m-halfdump-command-arguments): Refer `w3m-type' to decide default
+ value.
+ (w3m-arrived-add-1): Add an argument `content-type'.
+ (w3m-arrived-add): Likewise and follow change of `w3m-arrived-add-1'.
+ (w3m-arrived-coding-system): Strict checking of return value.
+ (w3m-arrived-content-type): New function.
+ (w3m-arrived-setup): Follow change of `w3m-arrived-add'.
+ (w3m-arrived-shutdown): Ditto.
+ (w3m-exec-process): Set process environment to avoid unexpected
+ conversion in Windows.
+ (w3m-charset-to-coding-system): New function.
+ (w3m-decode-encoded-contents): Old name is `w3m-decode-encoded-buffer'.
+ Set process environment to avoid unexpected conversion in Windows.
+ (w3m-local-retrieve). Simplified.
+ (w3m-pretty-length): Removed.
+ (w3m-crlf-to-lf): Removed.
+ (w3m-w3m-dump-head-source): No call `w3m-crlf-to-lf'.
+ (w3m-w3m-dump-source): Ditto.
+ (w3m-w3m-retrieve) Removed optional argument `cs' and simplified.
+ (w3m-retrieve): Ditto.
+ (w3m-decode-extended-characters): Removed.
+ (w3m-euc-japan-decoder): New CCL program.
+ (w3m-euc-japan-encoder): Dummy CCL program.
+ (w3m-euc-japan): New coding system.
+ (w3m-rendering-region): New optional argument `charset' and support
+ codes of `w3mmee' are added. Handle new defintion style of
+ `w3m-halfdump-command-arguments'. Refer `w3m-euc-japan' to process
+ outputs of `w3m'.
+ (w3m-exec): Reconstructed. This accepts new optional argument
+ `content-type'.
+ (w3m-goto-url): Reconstructed to handle files which have unknown
+ cotent-types.
+ (w3m-redisplay-with-coding-system): Simplified.
+ (w3m-find-file): Simplified and optional argument `type' is removed.
+ (w3m-region): Encode output buffer into `w3m-input-coding-system'.
+ (w3m-about-history): Ditto.
+ (w3m-about-db-history): Ditto.
+
+ * w3m-antenna.el (w3m-about-antenna): Encode output buffer into
+ `w3m-input-coding-system'.
+
+ * w3m-dtree.el (w3m-about-dtree): Ditto.
+
+ * mime-w3m.el (mime-w3m-cid-retrieve): Changed spec of arguments.
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Ditto.
+
+2001-05-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images): Message "Showing...".
+
+ * w3m-xmas.el (w3m-create-image): Unoptimize animated GIFs using
+ gifsicle program.
+ (w3m-cache-unoptimized-gif-images-max-length): New variable.
+ (w3m-cache-unoptimized-gif-images): New variable.
+ (w3m-gifsicle-program): New variable.
+ (w3m-should-unoptimize-animated-gifs): New variable.
+
+2001-05-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify): Don't initialize the value of
+ `w3m-cache-underline-faces' here.
+ (w3m-toggle-inline-images): Run the following new hooks instead of to
+ hide/show underlines behind inline images here.
+ (w3m-cache-underline-faces): Variable moved to w3m-e21.el.
+ (w3m-remove-inline-images-after-hook): New hook.
+ (w3m-remove-inline-images-before-hook): New hook.
+ (w3m-show-inline-images-after-hook): New hook.
+ (w3m-show-inline-images-before-hook): New hook.
+
+ * w3m-e21.el: Use `w3m-remove-inline-images-after-hook',
+ `w3m-show-inline-images-after-hook',
+ `w3m-show-inline-images-before-hook' and `w3m-fontify-before-hook' to
+ fix the undesirable feature of Emacs 21 that to show an underline of a
+ text even if it has an image as a text property.
+ (w3m-cache-underline-faces): Variable moved from w3m.el.
+
+2001-05-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-cache-underline-faces): Modified docs that it is for
+ Emacs 21's exclusive use.
+
+2001-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-dtree-indent): Remove variable.
+ (w3m-dtree-fancy-display): Ditto.
+ (w3m-dtree-indent-strings): New variable.
+ (w3m-dtree-create-fancy): Remove function.
+ (w3m-dtree-create-sub): Rename function from w3m-dtree-create-fancy()
+ and tiny modified.
+ (w3m-about-dtree): Remove 'fancy style' method.
+
+2001-05-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * icons/db-history-up.xpm: Change color.
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Fix condition when
+ mew-mime-text/html() call.
+
+2001-05-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-find-file): Improved.
+ (w3m-default-content-type): New user option.
+ (w3m-url-completion): New function.
+ (w3m-input-url): Call `w3m-url-completion' to complete URLs.
+
+2001-05-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-find-file): New optional argument, `type' is added.
+
+2001-05-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-add-arrived-db): Improve the madness.
+
+ * w3m.el (w3m-about-history): Add small indentation to sub trees.
+
+2001-05-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history): Modify display format for no folding.
+
+2001-05-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): New implementation.
+ (w3m-about-history-indent-level): New variable.
+ (w3m-about-history-max-indentation): New variable.
+
+ * icons/history-up.xpm: Replaced a pixmap with a new pattern.
+
+2001-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-dtree-default-allfiles): Modify default value.
+ (w3m-dtree-fancy-display): New variable.
+ (w3m-dtree-create-fancy): New function.
+ (w3m-dtree-create-sub): Insert the indicator which directory or file,
+ if allfiles.
+ (w3m-about-dtree): Use fancy style function, if
+ 'w3m-dtree-fancy-display' is non-nil.
+
+2001-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m): Use existing frame or window.
+
+2001-05-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-dtree.el (w3m-dtree-create): Fix HTML bug.
+
+2001-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-cache-underline-faces): Added docs that it is currently
+ needed for only pretest versions of Emacs 21.
+ (w3m-fontify-anchors): Don't fontify the trailing white spaces of a
+ href.
+ * w3m-xmas.el (w3m-insert-image): Don't handle underline faces.
+ * w3m-e21.el (w3m-insert-image): Simplified.
+
+2001-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-setup-header-line, w3m-exec, w3m-decode-entities):
+ Replace `add-text-properties' with `w3m-add-text-properties'.
+ (w3m-fontify-images, w3m-fontify-anchors): Ditto.
+ (w3m-setup-header-line, w3m-cache-contents, w3m-refontify-anchor):
+ Replace `put-text-property' with `w3m-add-text-properties'.
+ (w3m-toggle-inline-images, w3m-fontify-anchors): Ditto.
+ (w3m-fontify-underline, w3m-fontify-bold): Ditto.
+ (w3m-add-text-properties): New macro used to put non-sticky text
+ properties.
+
+ * w3m-xmas.el (w3m-setup-header-line): Don't put non-sticky text
+ property here.
+
+2001-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-w3m): Typo fix.
+
+2001-05-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-bookmark.el (w3m-bookmark-default-section): Changed
+ initialization order.
+
+2001-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-dtree.el (w3m-dtree-create): Modify warning message.
+ (w3m-about-dtree): Set path to directory name.
+
+2001-05-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el, w3m-antenna.el, w3m-bookmark.el, w3m-dtree.el, w3m-search.el,
+ w3m-weather.el: Fixed document strings of functions.
+
+ * mew-w3m.el (mew-w3m): New customize group.
+ (mew-use-w3m-minor-mode): Use defcustom.
+ (mew-w3m-auto-insert-image): Use defcustom.
+
+2001-05-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-goto-url): Set 'default-directory' to
+ 'w3m-profile-directory', if 'url' is local but not exist that
+ directory.
+
+ * w3m-dtree.el (w3m-dtree-create): If 'path' is not a directory,
+ display warning message.
+
+2001-05-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify): Initialize the value of
+ `w3m-cache-underline-faces'.
+ (w3m-toggle-inline-images): Remove or restore the underlined faces.
+ (w3m-cache-underline-faces): New buffer-local variable used to cache
+ the detached underlined faces from a buffer.
+
+ * w3m-xmas.el (w3m-insert-image): Detach an underlined face in
+ `w3m-cache-underline-faces'.
+ * w3m-e21.el (w3m-insert-image): Ditto.
+
+2001-05-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-toggle-inline-images): Restore hidden faces in the text
+ property `w3m-hidden-face'.
+
+ * w3m-xmas.el (w3m-setup-header-line): Don't inherit existing text
+ properties in a header line.
+
+ * w3m-xmas.el (w3m-insert-image): Hide a face in the text property
+ `w3m-hidden-face' if it is underlined, instead of the removing.
+ * w3m-e21.el (w3m-insert-image): Ditto.
+
+2001-05-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (top-level): Fixed argument of autoload for `w3m-dtree', and
+ added autoload for `w3m-about-dtree'.
+
+ * w3m-dtree.el (w3m-dtree): Fixed doc-string.
+
+2001-05-15 "Takayuki Nakagawa" <tknakaga@kanagawa.hitachi.co.jp>
+
+ * w3m.el (w3m-goto-ftp-url): Use `file-directory-p' instead of file
+ name suffix to distinguish directories and files.
+ (w3m-time-parse-string (for buggy timezone.el)): Ignore errors occured
+ in `encode-time'.
+
+2001-05-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-dtree.el (top-level): Require `w3m' to suppress byte-compile
+ warnings.
+
+2001-05-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-view-this-url): Message if there is no link.
+ (w3m-cursor-anchor): Redefine as a macro for byte-optimization.
+ (w3m-action, w3m-image, w3m-anchor): Redefine as a macro using
+ `w3m-get-text-property-around'.
+ (w3m-get-text-property-around): New macro.
+
+2001-05-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-exec): Report a process exit status if an error has
+ occurred.
+ (w3m-download): Ditto.
+ (w3m-w3m-dump-source): Don't use `zerop' to check for a process exit
+ status.
+ (w3m-w3m-dump-head-source): Ditto.
+ (w3m-w3m-get-header): Ditto.
+ (w3m-exec-process): Made it to return t if succeeded otherwise nil, to
+ keep a process exit status in `w3m-process-exit-status'.
+ (w3m-process-exit-status): New variable.
+
+2001-05-15 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (TOP): Add autoload for w3m-dtree.
+ (w3m-url-to-file-name): If URL is started 'about://dtree', it convert
+ to local file. Change [A-z] to [A-Za-z].
+ (w3m-url-local-p): If URL is started 'about://dtree', it assume to
+ local file.
+ (w3m-prog-dtree): Delete variable.
+ (w3m-about-history-ignored-regexp): Delete constant.
+ (w3m-arrived-ignored-regexp): New constant.
+ (w3m-history-ignored-regexp): New constant.
+ (w3m-arrived-add): Use 'w3m-arrived-ignored-regexp' instead of
+ 'w3m-about-history-ignored-regexp'.
+ (w3m-arrived-p): Ditto.
+ (w3m-parse-attributes): Change [A-z] to [A-Za-z].
+ (w3m-fontify): Ditto.
+ (w3m-external-view): Remove 'about://dtree' handling.
+ (w3m-about-history): Use 'w3m-history-ignored-regexp' instead of
+ 'w3m-about-history-ignored-regexp'.
+ (w3m-about-db-history): Ditto.
+ (w3m-about-dtree): Move to 'w3m-dtree.el'.
+ (w3m-dtree): Ditto.
+
+ * w3m-dtree.el: New file.
+
+2001-05-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-cursor-anchor): New defsubst.
+ (w3m-fontify-anchors): Add 'w3m-cursor-anchor property for
+ w3m-goto-(next|previous)-anchor.
+ (w3m-goto-anchor-hist): New buffer local variable.
+ (w3m-goto-next-anchor): Use 'w3m-cursor-anchor property.
+ (w3m-goto-previous-anchor): Ditto.
+ (w3m-next-anchor): Don't stop divided anchor using
+ 'w3m-goto-anchor-hist'.
+ (w3m-previous-anchor): Ditto.
+
+ * w3m-form.el (w3m-fontify-forms): Add 'w3m-cursor-anchor property for
+ w3m-goto-(next|previous)-anchor.
+
+2001-05-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-copy): New implementation without recursive
+ funcall'ing using `w3m-history-tree'.
+ (w3m-history-tree): Allow the optional argument `newpos'.
+ (w3m-history-copy-1): Removed.
+
+ * w3m.el (w3m-gohome): New command.
+ (w3m-setup-menu): Use `w3m-menubar'.
+ (w3m-menubar): New constant.
+ (w3m-toolbar): Added "copy"; use `w3m-gohome'.
+ (w3m-toolbar-buttons): Added "copy".
+
+ * w3m-xmas.el (w3m-setup-menu): Moved menubar definition to w3m.el.
+
+ * icons/copy-up.xpm: New file.
+
+2001-05-11 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-last-modified): When specified URL is not
+ found, returns t.
+ (w3m-antenna-check-sites): When the checking site is not found, use old
+ record.
+ (w3m-about-antenna): Excess arguments are ignored.
+
+2001-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-insert-image): Remove `face' property from a text
+ behind an image.
+
+ * w3m-e21.el (w3m-remove-image): Use a regular plist in the arg of
+ `remove-text-properties'.
+ * w3m.el (w3m-toggle-inline-images): Ditto.
+
+2001-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-e21.el (w3m-insert-image): Remove `face' property from a text
+ behind an image.
+
+2001-05-10 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el:
+ (w3m-dump-head-source-option): New variable.
+ (w3m-decode-all-to-this-charset): Ditto.
+ (w3m-halfdump-option): Ditto.
+ (w3m-halfdump-expand-options): Ditto.
+ (w3m-edit-function): Ditto.
+ (w3m-prog-dtree): Ditto.
+ (w3m-halfdump-command-arguments): Remove "-halfdump".
+ (w3m-fontify): Display minibuffer messages.
+ (w3m-decode-buffer): Use w3m-decode-all-to-this-charset, when its
+ non-nil.
+ (w3m-local-retrieve): If file is directory, return 'nil'.
+ (w3m-w3m-dump-head-source): Use 'w3m-dump-head-source-option' instead
+ of "-dump_extra".
+ (w3m-rendering-region): Use 'w3m-halfdump-option',
+ 'w3m-halfdump-command-arguments' and 'w3m-halfdump-expand-options',
+ when call-process.
+ (w3m-exec): Add no-cache option for w3m-dtree when call
+ w3m-external-view().
+ (w3m-external-view): Add no-cache option. If url is local directory,
+ call w3m-dtree().
+ (w3m-print-this-url): Expand output message.
+ (w3m-edit-current-url): Use 'w3m-edit-function' instead of find-file().
+ (w3m-edit-this-url): New function.
+ (w3m-goto-next-anchor): Input form support.
+ (w3m-goto-previous-anchor): Ditto.
+ (keymap): Add w3m-edit-current-url() and w3m-edit-this-url().
+ (w3m-mode): Modify doc-string for new functions.
+ (w3m-view-header): Modify doc-string.
+ (w3m-history): Add doc-string.
+ (w3m-about-dtree): New function.
+ (w3m-dtree): Ditto.
+
+2001-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-flat): Don't funcall itself recursively.
+
+ * w3m.el (w3m-fontify-images): Only put text properties `w3m-image' and
+ `w3m-image-redundant' if there is a property `w3m-href-anchor'.
+
+2001-05-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-tree): New function.
+
+
+2001-05-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Release emacs-w3m-1.0 from emacs-w3m-1_0 branch.
+
+2001-05-08 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-setup-menu): Don't set up menu if it has already been
+ available.
+
+ * w3m.el (w3m-setup-menu): Locate W3M menu in the forefront of the
+ menubar.
+ * w3m-xmas.el (w3m-setup-menu): Ditto.
+
+2001-05-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mode): Modify doc-string for describe mode, again.
+
+2001-05-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-form.el (top-level): Modify string to 'iso-2022-7bit' for
+ set-auto-coding.
+ (w3m-form-make-get-string): Guard error in w3m-url-encode-string()
+ reported [emacs-w3m:00686].
+
+2001-05-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Run `set-buffer-multibyte' after
+ `erase-buffer' is done.
+
+2001-05-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-w3m-retrieve): Fixed problem when no-cache is non-nil and
+ w3m-content-type returns nil.
+
+2001-05-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-search.el (top-level): Removed magic string to decide coding
+ system.
+
+ * w3m-xmas.el (top-level): Ditto.
+
+ * w3m-e21.el (top-level): Ditto.
+
+2001-05-07 Masatake YAMATO <jet@gyve.org>
+
+ * w3m-xmas.el (w3m-setup-menu): Implemented.
+
+2001-05-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-attributes): Check validity of contents length, to
+ avoid the problem reported in [emacs-w3m:00682].
+
+2001-05-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-bookmark.el (w3m-bookmark-section-history): Revival.
+ (w3m-bookmark-title-history): Ditto.
+
+ * w3m.el (w3m-extended-characters-table): Add "\x90" entry.
+ (w3m-setup-menu): Move from w3m-e21.el.
+ (w3m-mode): Modify doc-string for describe mode.
+ (top-level): Add key-bind, w3m-antenna(), w3m-weather() and
+ w3m-search().
+ (w3m-about-history): Set w3m work buffer as multibyte.
+
+ * w3m-e21.el (w3m-setup-menu): Move to w3m.el.
+
+2001-05-03 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-mode): Call w3m-setup-menu.
+
+ * w3m-xmas.el (w3m-setup-menu): New stub.
+
+ * w3m-e21.el (w3m-setup-menu): New function.
+
+2001-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Replace ">" with "&gt;".
+
+2001-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): New implementation without recursive
+ funcall'ing.
+ (w3m-about-history-1): Removed.
+
+2001-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-ftp-url): Don't give a url string to the function
+ `file-name-nondirectory'.
+
+2001-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Enhance the last link.
+ (w3m-arrived-p): Return non-nil when url matches
+ `w3m-about-history-ignored-regexp'.
+ (w3m-arrived-add): Don't put url into an arrived-db when url matches
+ `w3m-about-history-ignored-regexp'.
+ (w3m-about-history-ignored-regexp): Renamed from
+ `w3m-about-history-except-regex'.
+
+ * w3m-hist.el (w3m-history-restore-position): Instruct
+ `w3m-history-plist-get' to work with buffer-local properties.
+ (w3m-history-store-position): Instruct `w3m-history-add-properties' to
+ work with buffer-local properties.
+ (w3m-history-remove-properties): Allow the optional arg `local'.
+ (w3m-history-add-properties): Ditto.
+ (w3m-history-plist-put): Ditto.
+ (w3m-history-plist-get): Ditto.
+ (w3m-history-copy): Remove buffer-local properties.
+ (w3m-history-flat): Made it to have buffer-local properties.
+
+2001-04-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Support Mew 1.95b120 or later.
+
+2001-04-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-quit): Clear the echo area just after prompting.
+ (w3m-save-list): Format a list by itself instead of the use of pp.
+
+2001-04-24 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-0.2.1-mnc.patch: See [emacs-w3m:00629].
+
+2001-04-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Use `w3m-history-store-position' instead of
+ `w3m-arrived-store-position'.
+ (w3m-lynx-like-map): Bind `w3m-history-restore-position' instead of
+ `w3m-view-previous-point' for the key `C-c C-b'; new key `C-c C-SPC' to
+ bind the command `w3m-history-store-position'.
+ (w3m-view-previous-point): Removed.
+ (w3m-view-next-page): Use `w3m-history-restore-position' instead of
+ `w3m-arrived-restore-position'.
+ (w3m-view-previous-page): Ditto.
+ (w3m-arrived-restore-position): Removed.
+ (w3m-arrived-store-position): Removed.
+
+ * w3m-hist.el (w3m-history-add-arrived-db): Don't specify the 2nd arg
+ in `w3m-history-push'; specify the 2nd in `w3m-history-backward'.
+ (w3m-history-restore-position): New command.
+ (w3m-history-store-position): New command.
+ (w3m-history-plist-put): Use `w3m-history-modify-properties'.
+ (w3m-history-plist-get): Don't specify the 3rd arg in
+ `w3m-history-assoc'.
+ (w3m-history-push): Allow the optional arg `replace-props'; use
+ `w3m-history-modify-properties'.
+ (w3m-history-assoc): Allow the optional arg `replace-props'; always
+ modify the properties of a history element; use
+ `w3m-history-modify-properties'.
+ (w3m-history-backward): Allow the optional arg `set-current'; don't
+ modify the position pointer of `w3m-history' normally; use
+ `w3m-history-save-position'.
+ (w3m-history-forward): Ditto.
+ (w3m-history-with-element): Don't specify the 3rd arg in
+ `w3m-history-assoc'.
+ (w3m-history-modify-properties): New macro.
+ (w3m-history-save-position): New macro.
+
+2001-04-23 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-xmas.el (w3m-setup-header-line): Check `major-mode' to decide
+ whether header line should be set up.
+
+2001-04-23 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-linefeed-type): Change default value.
+
+ * w3m-0.2.1-mnc.patch: Define setmode(fileno(stdout), O_BINARY) if
+ win32 or OS/2. Define lrand48() and srand48() used if they don't have.
+
+2001-04-23 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-about-db-history): Set w3m work buffer as multibyte.
+
+2001-04-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-info-like-map): Changed key of `w3m-reload-this-page'.
+
+2001-04-20 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m.el (w3m-expand-file-name-as-url): Use "file:///cygdrive/" instead
+ of "/cygdrive/" when `w3m-use-cygdrive' is non-nil.
+
+2001-04-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-add-arrived-db): New command.
+
+ * w3m.el (w3m-db-history): New command.
+ (w3m-about-history, w3m-about-history-1): Don't deactivate "about://*"
+ links.
+ (w3m-exec): Share a url string between the variable `w3m-current-url'
+ and the history structure.
+ (w3m-toolbar, w3m-toolbar-buttons): Added history and db-history.
+
+ * icons/db-history-up.xpm: New file.
+ * icons/history-up.xpm: New file.
+
+2001-04-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-source): Don't execute if can't load its source.
+ (w3m-view-header): Don't execute if can't load its header. Toggle
+ html/header if execute twice.
+
+2001-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Use `set-text-properties' to remove all text
+ props from url string.
+ (w3m-exec): Use `add-text-properties' instead of `set-text-properties'.
+ (w3m-w3m-dump-source, w3m-w3m-dump-head-source): Removed not-used bound
+ variable `w3m-w3m-retrieve-length'.
+ (w3m-cache-request-contents): Removed not-used bound variables `type'
+ and `charset'.
+ (w3m-entity-value): Removed not-used bound variable `sym'.
+ (w3m-arrived-add): Use `w3m-arrived-add-1'; don't funcall itself
+ recursively to get rid of redundancy; don't use `set-text-properties'
+ here.
+ (w3m-arrived-add-1): New macro.
+
+ * w3mhack.el (XEmacs): Byte-optimize `set-text-properties' to make the
+ program run a little bit faster.
+
+2001-04-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-use-cygdrive): Change default value.
+ (w3m-linefeed-type): New customize variable.
+ (w3m-executable-type): Remove variable.
+ (w3m-crlf-to-lf): Use 'w3m-linefeed-type' instead of
+ 'w3m-executable-type'.
+
+2001-04-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el: Byte-optimize `match-string-no-properties' not to use
+ `set-text-properties' under XEmacs.
+
+2001-04-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-setup-header-line): Check `major-mode' to decide whether
+ header line should be set up.
+
+ * mime-w3m.el (mime-w3m-use-header-line): Removed.
+ (mime-w3m-preview-text/html): Canceled last change.
+
+2001-04-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-mode-map): Initialize when source file is loaded.
+
+ * mime-w3m.el (mime-w3m-mode-map): Simplify.
+
+ * mew-w3m.el (TopLevel): Initialization code of `w3m-mode-map' is
+ removed.
+
+ * w3m.el, w3m-weather.el, w3m-filter.el, w3m-form.el: Change
+ coding-system.
+
+ * mime-w3m.el (mime-w3m-use-header-line): New user option.
+ (mime-w3m-preview-text/html): Refer `mime-w3m-use-header-line' to
+ control `w3m-use-header-line'.
+
+2001-04-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist: Made the history management system to keep properties of
+ each history element to be shared by all the w3m buffers.
+ (w3m-history-remove-properties): Share properties.
+ (w3m-history-add-properties): Ditto.
+ (w3m-history-plist-put): Ditto.
+ (w3m-history-copy, w3m-history-copy-1): Ditto.
+ (w3m-history-push): Ditto.
+ (w3m-history-assoc): Ditto.
+ (w3m-history-share-properties): New function.
+ (w3m-history-seek-properties): New function.
+
+ (w3m-history-rename-url): Allow the 4th arg `this-buffer'.
+ (w3m-history-with-element): Renamed from `w3m-history-with-elements';
+ bind only the variable `element' to have a history element of
+ `w3m-history-flat'.
+
+2001-04-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-setup-header-line): Don't execute the setup-header-line,
+ if w3m-current-url is 'nil'.
+
+ * w3m-xmas.el (w3m-setup-header-line): Ditto.
+
+2001-04-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-images): Use `match-string-no-properties' instead
+ of `buffer-substring-no-properties'.
+ (w3m-parse-attributes): Use `match-string-no-properties' instead of
+ `match-string' to remove text properties.
+
+ * w3m-xmas.el: Require `poe' for the function
+ `match-string-no-properties'.
+
+2001-04-17 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-setup-header-line): New function except for Emacs 21 nor
+ XEmacs.
+ (w3m-header-line-map): New variable except for Emacs 21 nor XEmacs.
+ (w3m-fontify-after-hook): Use it for emulating a header-line.
+ (w3m-header-line-location-content-face): New face except for Emacs 21.
+ (w3m-header-line-location-title-face): Ditto.
+ (w3m-use-header-line): Moved from w3m-e21.el.
+
+ * w3m-xmas.el (w3m-setup-header-line): New function.
+ (w3m-header-line-map): New variable.
+
+ * w3m-e21.el (w3m-use-header-line): Moved to w3m.el.
+
+2001-04-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * icons/parent-up.xpm: Reduced color depth.
+ * icons/parent-disabled.xpm: Renamed from parent-down.xpm.
+
+2001-04-16 Masatake YAMATO <masata-y@gyve.aist-nara.ac.jp>
+
+ * w3m.el (w3m-toolbar): Added w3m-toolbar-parent-icon.
+ (w3m-toolbar-buttons): Added "parent".
+ (w3m-parent-page-available-p): New function.
+
+ * icons/parent-up.xpm: New file.
+ * icons/parent-down.xpm: New file.
+
+2001-04-16 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-about-history): Set w3m work buffer as multibyte.
+
+2001-04-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history-1, w3m-about-history): Deactivate all
+ "about://*" links.
+
+2001-04-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history-1): New internal function.
+ (w3m-about-history): Use it.
+
+2001-04-15 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-e21.el (w3m-header-line-location-title-face): New face.
+ (w3m-header-line-location-content-face): Ditto.
+ (w3m-use-header-line): New user option.
+ (w3m-setup-header-line): New function.
+ (w3m-mode-hook): Add `w3m-setup-header-line'.
+
+2001-04-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Show a history tree (incompleted).
+ (w3m-exec): Put a title string into the history structure.
+
+2001-04-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history): Change the format on display.
+
+2001-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el (w3m-icon-directory): Define it as the constant nil to
+ avoid byte-compile warnings when compiling.
+ * w3m.el (w3m-icon-directory): Undo last change.
+
+2001-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-icon-directory): Hide the actual function name
+ `locate-data-directory' for old Emacsen to avoid byte-compile warnings.
+
+ * w3m-om.el (w3m-om-define-missing-widgets): New function.
+ (TopLevel): Use it for defining some missing widgets after the library
+ wid-edit is loaded.
+
+2001-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el (w3m-xmas-define-missing-widgets): New function.
+ (TopLevel): Use it for defining some missing widgets after the library
+ wid-edit is loaded.
+
+ * w3m.el (w3m-track-mouse): Added a description about balloon-help.
+ (w3m-make-balloon-help): New macro.
+ (w3m-fontify-anchors, w3m-fontify-images): Use it.
+
+2001-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-track-mouse): Default to t.
+ (w3m-make-help-echo): New macro.
+ (w3m-fontify-anchors, w3m-fontify-images): Use it.
+
+2001-04-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * mew-w3m.el (TopLevel): Set w3m-mode-map if not exec w3m-mode() yet.
+
+2001-04-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-fontify-images, w3m-fontify-anchors): Put a url string to
+ each anchor as a `help-echo' property when the value of
+ `w3m-track-mouse' is non-nil.
+ (w3m-track-mouse): New user option.
+
+2001-04-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-copy-buffer): Use `w3m-history-copy' to make copies of
+ `w3m-history' and `w3m-history-flat'.
+
+2001-04-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-mode-map): Refer `w3m-key-binding' to avoid the
+ problem reported in [emacs-w3m:00498].
+
+2001-04-10 Keisuke Nishida <kxn30@po.cwru.edu>
+
+ * w3m-search.el (w3m-search): Find default using thing-at-point.
+
+2001-04-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-about-history): Use `w3m-history-flat' instead of
+ `w3m-url-history'.
+ (w3m-view-source): Don't bind `w3m-url-yrotsih' nor `w3m-url-history'.
+ (w3m-redisplay-with-coding-system): Don't treat `w3m-url-history'.
+ (w3m-reload-this-page): Ditto.
+ (w3m-view-next-page): Use `w3m-history-forward' instead of
+ `w3m-url-yrotsih'.
+ (w3m-view-previous-page): Use `w3m-history-backward' instead of
+ `w3m-url-history'.
+ (w3m-exec): Use `w3m-history-push' instead of `w3m-url-yrotsih' or
+ `w3m-url-history'.
+ (w3m-toolbar): Use `w3m-history-next-link-available-p' and
+ `w3m-history-previous-link-available-p'.
+ (w3m-url-yrotsih, w3m-url-history): Removed.
+ (TopLevel): Require `w3m-hist'.
+
+2001-04-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-info-like-map): Use `(shift iso-lefttab)' instead of
+ `S-iso-lefttab'.
+ (w3m-lynx-like-map): Ditto.
+
+ * w3mhack.el (w3mhack-make-package): Add shimbun modules in
+ MANIFEST.w3m file.
+ (w3mhack-examine-modules): Look for the library "mime-def" instead of
+ "mime" to check whether FLIM has been installed or not.
+ * Makefile.in (install): Install shimbun modules as well.
+ (install-icons): Show subdirectory name.
+
+2001-04-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-key-binding): New user option.
+ (w3m-lynx-like-map, w3m-info-like-map): New keymaps.
+ (w3m): Refer w3m-key-binding, to decide whether keymap is used.
+
+2001-04-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-edit-current-url): New command.
+ (w3m-mode-map): `w3m-edit-current-url' is registered.
+ (w3m-save-this-url): Removed.
+ (w3m-decode-encoded-buffer): Use `w3m-which-command' in order to find
+ appropriate command in Windows.
+
+2001-04-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (default): Depends `Makefile'.
+ (Makefile): Removed `--recheck' option in order to re-create itself
+ when `Makefile.in' or `config.status' is updated.
+
+2001-04-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top): Define w3m-read-coding-system().
+ (w3m-content-type-alist): Change "fiber" to "fiber.exe".
+ (w3m-quit): Remove hook if no w3m exist.
+ (w3m-arrived-add): Add 'coding-system entry.
+ (w3m-arrived-coding-system): New function.
+ (w3m-arrived-setup): Handle 'coding-system entry.
+ (w3m-arrived-shutdown): Ditto.
+ (w3m-goto-url): Handle specified coding-system.
+ (w3m-redisplay-with-coding-system): Use w3m-read-coding-system. If no
+ coding-system specify, set 'reset.
+
+ * w3m-om.el (w3m-read-coding-system): New function.
+
+2001-04-04 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-w3m-retrieve): Add 'cs(coding-system)' option.
+ (w3m-retrieve): Ditto.
+ (w3m-exec): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-decode-buffer): Ditto. If 'cs' specify, decoding use it.
+ (w3m-mode-map): Add w3m-redisplay-with-coding-system() at "C".
+ (w3m-mode): Change doc string.
+ (w3m-redisplay-with-coding-system): New function.
+
+2001-04-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-attributes): When content type has trailing
+ semicolon, make it removed.
+
+ * w3mhack.el (load-path): Add `shimbun' sub-directory.
+
+2001-04-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * Makefile.in (clean): Remove shimbun modules.
+
+ * w3mhack.el (shimbun-module-directory): New constant.
+ (w3mhack-examine-modules): Add shimbun modules if mime is installed.
+
+ * w3m.el (w3m-decode-entities): New function.
+ (w3m-fontify): Use it.
+
+2001-04-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-print-this-url): New optional argument `add-kill-ring' is
+ added.
+
+2001-04-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-filter.el: New file.
+
+ * w3m-antenna.el (w3m-antenna-size): Refer decoded buffer as size.
+
+ * w3m.el (TopLevel): Add autoload code of `w3m-filter'.
+ (w3m-use-filter): New user option.
+ (w3m-retrieve): Call `w3m-filter' when decode.
+
+2001-04-03 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-force-redisplay): New variable, default is 't'.
+ (w3m-toggle-inline-images): If w3m-force-redisplay is nil, don't
+ redraw.
+ (w3m-goto-url): Ditto.
+ (w3m-region): Ditto.
+
+ * mew-w3m.el (mew-mime-text/html-w3m): Bind w3m-force-redisplay to
+ 'nil'.
+ (w3m-mew-support-cid): New variable.
+ (mew-w3m-cid-retrieve): Use mew-syntax-get-entry-by-cid(), Tnx, Kazu
+ Yamamoto <kazu@mew.org>.
+
+2001-04-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-process-message): Removed.
+ (w3m-exec-process): Clean up.
+ (w3m-w3m-dump-head-source): Removed code which refers
+ `w3m-process-message'.
+ (w3m-w3m-dump-source): Ditto.
+ (w3m-parse-attributes): Remove leading and trailing white space in
+ CDATA attribute values.
+
+2001-04-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-copy): Make a copy of `w3m-history-flat'
+ using `w3m-history-flat' instead of `w3m-history-copy-1'.
+
+2001-04-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (DISTS): Removed `Makefile'.
+
+2001-04-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-backward, w3m-history-forward): Simplified.
+
+2001-04-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-backward, w3m-history-forward): Allow the
+ optional argument `count'.
+ (w3m-history-backward-1, w3m-history-forward-1): New macros.
+
+2001-04-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-0.2.1-mnc.patch: Apply patch posted in [w3m-dev 01887].
+
+ * w3m.el (w3m-w3m-dump-head-source): Follow change in MNC patch.
+ (w3m-w3m-attributes): Ditto.
+
+2001-04-02 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-crlf-to-lf): New function.
+ (w3m-w3m-dump-head-source): Do crlf-to-lf when executable-type eq
+ 'cygwin.
+ (w3m-w3m-dump-source): All time do crlf-to-lf function when
+ executable-type eq 'cygwin.
+
+2001-04-02 Taiki SUGAWARA <taiki.s@cityfujisawa.ne.jp>
+
+ * w3m.el (w3m-exec-process): Guard the process from some errors.
+ (w3m-copy-buffer): Restore view point with new window to the point in
+ original window.
+
+2001-04-02 Hiroya Murata <hiroya@use-ebisu.co.jp>
+
+ * Makefile.in (Makefile): Depends on config.status instead of
+ configure.
+ (config.status): New rule.
+
+2001-04-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * aclocal.m4 (AC_PATH_ICONDIR): Quote "$(data-directory)" in help-
+ string.
+
+2001-04-02 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-html-string-regexp): Make no exception of back-quote.
+ (w3m-parse-attributes): Follow up above change.
+
+2001-03-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-home-page): Default value is changed.
+ (w3m-html-string-regexp): Support single quoted string.
+ (w3m-parse-attributes): Import from w3m-form.el.
+ (w3m-fontify-anchors): Fix bug reported in [emacs-w3m:00400].
+ (w3m-external-view): Fix.
+ (w3m-goto-url): Default argument is changed when it is interactively
+ called.
+ (w3m-browse-url): Fix.
+ (w3m-about): Update.
+ (w3m-about-history-except-regex): Add `about:'.
+
+ * w3m-form.el: (w3m-parse-attributes): Exported.
+
+ * mime-w3m.el (mime-w3m-save-background-color): Changed
+ `edebug-form-spec'.
+
+ * Makefile.in (dist): Improved.
+ (Makefile, configure): New rules.
+ (ECC, MODULES): Removed macros.
+
+2001-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-with-elements): New macro.
+ (w3m-history-rename-url): Use it.
+ (w3m-history-remove-properties): Use it.
+ (w3m-history-add-properties): Use it.
+ (w3m-history-plist-put): Use it.
+
+2001-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-rename-url): New function.
+ (w3m-history-remove-properties): New function.
+ (w3m-history-add-properties): New function.
+ (w3m-history-plist-put): New function.
+ (w3m-history-plist-get): New function.
+ (w3m-history-assoc): Return a history element of `w3m-history-flat'
+ instead of `w3m-history'.
+
+2001-03-30 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-w3m-attributes): Fixed spec of return value when response
+ code is greater than 500.
+
+2001-03-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Fix bugs in caching deflated contents.
+ (w3m-attributes): Fixed spec of return value when `about:' is
+ specified.
+ (w3m-cache-available-p): Removed.
+ (w3m-w3m-dump-head-source): Reconstructed.
+ (w3m-w3m-dump-source): New function.
+ (w3m-w3m-retrieve): Use `w3m-w3m-dump-head-source' or
+ `w3m-w3m-dump-source'.
+ (w3m-real-url): Fix side effect of macro expansion.
+
+ * w3m-0.2.1-mnc.patch: New file.
+
+2001-03-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (default): Replace with `fast'.
+ (install): Undo the last change.
+ (.el.elc, .SUFFIXES, install-anyway): Removed.
+ (fast-install-package, fast-install, fast): Removed.
+
+ * w3m-hist.el (w3m-hist): Provide as a feature.
+ (w3m-history-copy, w3m-history-copy-1): New functions.
+ (w3m-history-push): Handle the variable `w3m-history-flat' as well as
+ `w3m-history'.
+ (w3m-history-assoc): Ditto.
+ (w3m-history-flat function): Set the value of the variable
+ `w3m-history-flat'.
+ (w3m-history-flat variable): New buffer-local variable.
+ (The whole module): Replace the term ATTRIBUTES with PROPERTIES;
+ replace the symbol name of the variable `w3m-url-history' with
+ `w3m-history'.
+
+2001-03-29 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-real-url): Return original url when real url is nil.
+
+ * w3m-antenna.el (w3m-antenna-sites): Add 'time' type.
+ (w3m-antenna-alist): Modify comment.
+ (w3m-antenna-hns-last-modified): Don't use old 'Last-Modified:' format.
+ (w3m-antenna-last-modified): Use w3m-last-modified() when can not get
+ 'diary/di.cgi'.
+ (w3m-antenna-check-sites): Push current-time() if (nth 6 pre) is nil.
+
+2001-03-29 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Support deflated contents and redirected URLs.
+ (w3m-decoder-alist, w3m-mnc): New variable.
+ (w3m-encoding-alist): New constant.
+ (w3m-attributes, w3m-w3m-attributes, w3m-local-attributes): Spec of
+ return value is changed.
+ (w3m-content-charset, w3m-content-encoding, w3m-real-url): New macro.
+ (w3m-cache-available-p): New function.
+ (w3m-decode-encoded-buffer): Ditto.
+ (w3m-decode-buffer): Changed arguments spec. Call
+ `w3m-decode-encoded-buffer' to process encoded contents.
+ (w3m-w3m-dump-head-source): New function.
+ (w3m-w3m-retrieve): Call `w3m-w3m-dump-head-source' when `w3m-mnc' is
+ non-nil value. Follow change of `w3m-decode-buffer'.
+ (w3m-exec): Call `w3m-real-url' to process redirected URLs.
+ (w3m-sub-list): When N is nil, no elements in LIST should be deleted.
+ (w3m-save-list): Preserve file permission when file is overwritten.
+
+2001-03-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-compile): New function.
+
+ * Makefile.in (fast-install-package, fast-install, fast): New rules.
+ (install-package): Make it to be more talkative.
+ (install-anyway): New rule separated from `install'.
+ (install): Use `install-anyway'.
+
+ * w3m-hist.el (w3m-history-push): Rewrite for following the change of
+ `w3m-url-history'.
+ (w3m-history-assoc): Ditto.
+ (w3m-history-backward): Ditto.
+ (w3m-history-forward): Ditto.
+ (w3m-history-current): Ditto.
+ (w3m-history-current-1): New macro.
+ (w3m-history-next-link-available-p): New function.
+ (w3m-history-previous-link-available-p): New function.
+ (w3m-url-history): Make it to have the previous and the next position
+ pointers.
+
+2001-03-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-push): New function.
+
+2001-03-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-url-history): Define it here.
+ (w3m-history-assoc, w3m-history-flat, w3m-history-backward): New
+ functions.
+
+2001-03-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el (w3m-history-forward): New function.
+
+2001-03-24 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-goto-url): Put cursor at the top of minibuffer.
+
+2001-03-23 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-w3m-attributes): Don't check "OK" string in Status-Line.
+
+2001-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-time-parse-string the 2nd): Don't funcall
+ `parse-time-string' directly for avoiding compile warning.
+
+ * w3m-hist.el (w3m-history-current): New function.
+
+2001-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-hist.el: New file.
+
+2001-03-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-time-parse-string): Fix condition to detect timezone.el
+ includes bug.
+
+ * w3m-time.el: Removed.
+
+ * w3m.el (TopLevel): Require `timezone' instead of `w3m-time'.
+ (w3m-time-parse-string): Use `timezone-fix-time' and spec of return
+ value is changed.
+ (w3m-time-newer-p): Imported.
+
+ * w3m-antenna.el (w3m-antenna-hns-last-modified): Follow change of
+ `w3m-time-parse-string'.
+
+2001-03-23 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * README, README.ja: Update for w3m-0.2.1.
+
+ * Makefile.in (dist, tarball): Fix that some files are not included in
+ package.
+
+2001-03-22 Keisuke Nishida <kxn30@po.cwru.edu>
+
+ * w3m.el (w3m-goto-url): Insert the current url for input by default.
+
+2001-03-22 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-xmas.el (w3m-update-toolbar): New function.
+ (w3m-setup-toolbar): Added docstring.
+
+ * w3m.el (w3m-goto-url): Call `w3m-update-toolbar'.
+ (toplevel): Define `w3m-update-toolbar' if it is not bound as function.
+
+2001-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-w3m-attributes): Ignore errors while parsing a
+ time-string.
+
+2001-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Moved generic macros and defsubsts in front of functions.
+ (w3m-content-encoding, w3m-content-charset): Commented out.
+ * w3m-form.el (w3m-parse-attributes): Moved from w3m.el.
+
+2001-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Make `w3m-fontify-forms' and `w3m-form-parse-region' to be
+ always autoloaded; encolose the defining procedures for the unbound
+ functions with `eval-and-compile'.
+ (browse-url-interactive-arg): Bind it only at the compile-time as an
+ autoload'ed function.
+ * w3m-xmas.el: Provide `w3m-xmas' and then require `w3m'.
+ * w3m-om.el: Provide `w3m-om' and then require `w3m'.
+ * w3m-form.el: Require `w3m'.
+ * w3m-e21.el: Provide `w3m-e21' and then require `w3m'.
+
+2001-03-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el: All occurrence of `natsumikan' is replaced with
+ `natsumican'.
+
+2001-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (coding-system-category): Don't define it for the Emacs
+ variants.
+ * w3m-om.el (coding-system-category): Defalias to `get-code-mnemonic'.
+ * w3m-xmas.el (coding-system-category): Defalias to
+ `coding-system-type' if it is not bound.
+
+ * w3mhack.el (w3mhack-version): Don't require `w3m' in the top level,
+ do it here instead.
+
+2001-03-22 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-save-list): Use 'pp' if have pp(). Bind 'print-length'
+ and 'print-level' to nil.
+
+2001-03-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Structure of hash database of arrived urls is changed.
+ (w3m-arrived-setup): Follow change of DB structure.
+ (w3m-arrived-shutdown): Likewise.
+ (w3m-arrived-add): Likewise, and argument spec is changed.
+ (w3m-arrived-time): New function.
+ (w3m-arrived-seq, w3m-arrived-put-title, w3m-arrived-arrived-time,
+ w3m-arrived-put-arrived-time): Removed.
+ (w3m-goto-url): Follow change of `w3m-arrived-add'.
+
+2001-03-22 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-goto-url): Refresh the visibility of toolbar when XEmacs
+ is running.
+
+2001-03-22 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-to-file-name): Fix bug reported in [emacs-w3m:00305].
+ (w3m-goto-url): Set the value interpreted as a directory to
+ `default-directory'.
+
+2001-03-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-db-history): Use w3m-arrived-arrived-time().
+ (w3m-goto-url): Put arrived time to w3m-arrived-db.
+ (w3m-arrived-shutdown): Handling 'arrived-time in w3m-arrived-db.
+ (w3m-arrived-setup): Ditto.
+ (w3m-arrived-put-title): New function.
+ (w3m-arrived-arrived-time): Ditto.
+
+2001-03-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-shutdown): Check sites which are arrived on the
+ other emacs process.
+
+2001-03-21 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-input-url): 'nil' don't add candidates.
+
+2001-03-21 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-make-summary-function): Default value is
+ changed.
+ (w3m-antenna-make-summary-like-natsumikan): New function.
+
+ * w3m.el (w3m-about-db-history-sort-time): Removed.
+ (w3m-about-db-history): Use `w3m-time-newer-p' instead of
+ `w3m-about-db-history-sort-time'.
+
+2001-03-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-about-history-except-regex): New constant.
+ (w3m-about-db-history): New function.
+ (w3m-about-db-history-sort-time): Ditto.
+ (w3m-about-history): If 'titile' is '<no-title>', show 'URL' instead of
+ 'title'. Use w3m-about-history-except-regex.
+ (w3m-history): If exec with 'C-u', goto 'about://db-history/'.
+ (w3m-w3m-attributes): Adhoc implementation when server return 'HTTP/1.x
+ 500x'.
+
+2001-03-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Format of arrived URL database is changed in order to store
+ page's title.
+ (w3m-arrived-title, w3m-arrived-put-title): New function.
+ (w3m-arrived-setup, w3m-arrived-shutdown): Follow format change.
+ (w3m-about-history): Use page's title to make history contents.
+
+2001-03-19 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-url-to-file-name): Fix 'file:///c/xxxx' format in
+ Windows.
+ (w3m-expand-file-name-as-url): Use 'file:///c|/xxxx' format if
+ non-cygwin Windows.
+ (w3m-about-history): Uniq history. Insert exposition of html.
+
+2001-03-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-to-file-name): Fix (Cf. RFC-1808).
+ (w3m-expand-file-name-as-url): Ditto.
+ (w3m-url-local-p): New function.
+ (w3m-goto-url): Set `default-directory' when URL points a local file.
+ (w3m-find-file): Use `w3m-goto-url'.
+ (w3m-w32-browser-with-fiber): Use `w3m-url-to-file-name'.
+
+2001-03-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-make-package): Fixed entries of autoloads and
+ cus-load, and added ChangeLog in the file MANIFEST.w3m.
+
+ * aclocal.m4 (AC_CHECK_EMACS): Added the option `--with-xemacs'.
+
+2001-03-19 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-download): Bind `file-coding-system' to binary.
+ (w3m-content-type-alist): Fix.
+
+2001-03-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna): Optional argument, `no-cache' is added.
+
+2001-03-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-goto-url): Switch to buffer of w3m, certainty.
+ (w3m): Ditto.
+
+2001-03-17 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-halfdump-command-arguments): Rename from
+ 'w3m-command-arguments'.
+ (w3m-command-arguments): New customize variable.
+ (w3m-exec-process): Add w3m-command-arguments to args when w3m execute.
+ (w3m-rendering-region): Use w3m-halfdump-command-arguments when w3m
+ execute.
+ (w3m-fontify-anchors): Put w3m-name-anchor certainty.
+
+2001-03-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el: Changed antenna database format.
+ (w3m-antenna-site-key, w3m-antenna-site-title, w3m-antenna-site-class,
+ w3m-antenna-site-url, w3m-antenna-site-last-modified,
+ w3m-antenna-site-size, w3m-antenna-site-size-detected): New macros.
+ (w3m-antenna-setup): Follow change of database format.
+ (w3m-antenna-check-sites): New function.
+ (w3m-antenna-make-summary, w3m-antenna-sort-sites-by-time,
+ w3m-antenna-sort-sites-by-title): Use macros to refer database.
+ (w3m-about-antenna): Use w3m-antenna-check-sites.
+
+ * w3m.el (w3m-about-history): Don't print "about://antenna/".
+
+2001-03-17 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * icons/antenna-up.xpm: New file.
+
+ * w3m.el (w3m-toolbar-buttons): Added "antenna".
+ (w3m-toolbar): Ditto; Fixed behavior of `home'.
+
+2001-03-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el, w3m-antenna.el: Fix typo.
+
+2001-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-make-package): Remove autoloads and cus-load
+ files before generating.
+
+ * w3m.el (w3m): Added autoload cookie.
+ (w3m-icon-directory): Attempt to set the default value using the way of
+ Wanderlust.
+
+2001-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * README: Update for `install-package' and `install-icons'.
+ * README.ja: Ditto.
+
+ * w3mhack.el (w3mhack-make-package): New function.
+ (w3mhack-examine-modules): Ignore auto-save files.
+
+ * mkinstalldirs: New file.
+
+ * configure.in: Call `AC_PATH_PACKAGEDIR'.
+
+ * aclocal.m4 (AC_PATH_PACKAGEDIR): New function.
+ (AC_EXAMINE_PACKAGEDIR): New function.
+ (AC_CHECK_EMACS_FLAVOR): Merged into `AC_CHECK_EMACS'.
+
+ * Makefile.in (install-package): New rule.
+ (install-icons, install): Exec mkinstalldirs.
+ (SHELL, PACKAGEDIR): New variable.
+
+2001-03-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-goto-url): Force switch to '*w3m*' buffer.
+ (w3m-view-source): Don't add current-url to w3m-url-history|yrotsih.
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Change mime-part handling.
+
+2001-03-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-sort-function): Removed.
+ (w3m-antenna-sort-changed-sites-function): New variable.
+ (w3m-antenna-sort-unchanged-sites-function): Ditto.
+ (w3m-antenna-sort-sites-by-time): Refer time, when size modification
+ detected.
+ (w3m-about-antenna): Use new variables.
+
+2001-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-time.el (w3m-time-rules): Don't use backquote.
+ (w3m-time-zoneinfo): Ditto.
+ (w3m-time-parse-integer): Ditto.
+
+2001-03-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (TopLevel): Require `w3m-time'.
+ (w3m-w3m-attributes): Use `w3m-time-parse-string' instead of
+ `parse-time-string'.
+
+ * w3m-time.el: Import parse-time.el of T-gnus and rename it.
+
+ * w3m-antenna.el: Use `w3m-time-parse-string' instead of
+ `parse-time-string'.
+
+2001-03-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m-e21.el (w3m-create-image): Changed arguments spec, that
+ `accept-type-regexp' is removed.
+
+ * w3m-xmas.el (w3m-create-image): Ditto.
+
+2001-03-16 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Arrived URL database format is changed and code to get
+ headers and to retrieve contents is cleaned up.
+ (w3m-attributes, w3m-local-attributes): New function.
+ (w3m-w3m-attributes): Old name is `w3m-w3m-check-header'.
+ (w3m-content-type): Use `w3m-attributes'.
+ (w3m-content-charset, w3m-content-length, w3m-content-encoding,
+ w3m-last-modified): New macro.
+ (w3m-retrieve, w3m-local-retrieve): Changed arguments spec, that
+ `accept-type-regexp' is removed.
+ (w3m-w3m-retrieve): Likewise and call `w3m-w3m-attributes' instead of
+ `w3m-w3m-check-header'.
+ (w3m-exec): Follow change of arguments spec of `w3m-retrieve'.
+ (w3m-about-source, w3m-about-header): Changed arguments spec that
+ `accept-type-regexp' is removed and follow change of arguments spec of
+ w3m-retrieve.
+ (w3m-arrived-last-modified): New function.
+ (w3m-arrived-add): Support optional argument `time' and follow change
+ of database format.
+ (w3m-arrived-setup, w3m-arrived-shutdown, w3m-arrived-store-position,
+ w3m-arrived-restore-position): Follow change of database format.
+ (w3m-with-work-buffer, w3m-parse-attributes): Changed
+ `edebug-form-spec', see [emacs-w3m:00238].
+ (TopLevel): Add autoload codes for `w3m-antenna.el'.
+
+ * w3m-antenna.el: New file.
+
+ * mime-w3m.el (mime-w3m-cid-retrieve): Changed arguments spec, that
+ `accept-type-regexp' is removed.
+
+ * mew-w3m.el (mew-w3m-cid-retrieve): Ditto.
+
+2001-03-16 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-icons): New rule.
+ (ICONDIR): New variable.
+
+ * aclocal.m4 (AC_PATH_ICONDIR): New function.
+ * configure.in: Call it.
+
+2001-03-16 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * icons: New directory (Some toolbar icons are contained).
+
+2001-03-16 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-view-source): Render as html if already display source.
+
+2001-03-15 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-icon-directory): New variable.
+ (w3m-toolbar-buttons): New constant.
+ (w3m-toolbar): Ditto.
+ (w3m-setup-toolbar): Define as null function.
+ (w3m-mode): Call `w3m-setup-toolbar'.
+
+ * w3m-xmas.el (w3m-use-toolbar): New variable.
+ (w3m-xmas-make-toolbar-buttons): New function.
+ (w3m-setup-toolbar): Ditto.
+
+ * w3m-e21.el (w3m-use-toolbar): New variable.
+ (w3m-e21-toolbar-configurations): Ditto.
+ (w3m-e21-setup-toolbar): New function.
+ (w3m-e21-make-toolbar-buttons): Ditto.
+ (w3m-setup-toolbar): Ditto.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (XEmacs): Implemented the source level optimizer for `let'
+ or `let*' form to remove some obsolete variables.
+
+2001-03-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * README, README.ja: Update procedure of package installation.
+
+ * w3m.el (w3m-hook): Removed.
+ (w3m-goto-mailto-url): Old name is `w3m-mailto-url'.
+ (w3m-goto-ftp-url): Old name is `w3m-exec-ftp'.
+ (w3m-convert-ftp-url-for-emacsen): Old name is
+ `w3m-convert-ftp-to-emacsen'.
+ (w3m-exec): Removed code for ftp protocol.
+ (w3m-alive-p): Change spec of return value when w3m is alive.
+ (w3m-goto-url): Made this function safe when it is called at the buffer
+ whose major mode is not equal to w3m-mode.
+ (w3m): If it is interactively called when w3m is alive, it is simply
+ select the appropriate buffer in the current window without asking url.
+ (w3m-view-parent-page, w3m-browse-url, w3m-view-source, w3m-history):
+ Use `w3m-goto-url' instead of `w3m'.
+ (w3m-mode-map): Replace `w3m' with `w3m-goto-url'.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (MULE): Make `locate-library' run quietly; bind
+ defcustom'ed variables at compile-time; require `w3m' after
+ byte-optimizations are done.
+
+ * w3m.el (w3m-static-cond): New macro; use it for defining
+ `find-coding-system'.
+ (w3m-url-encode-string): Use `append' instead of `string-to-list' to
+ coerce a string to a list of chars.
+ (w3m-entity-regexp): Don't funcall `regexp-opt' directly for avoiding
+ compile warning.
+
+2001-03-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-exec-process): Add `delete-process' to clean up resources
+ of child process.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (default): Report errors if it has occurred while
+ examining modules.
+
+ * w3m.el: Add autoload for `w3m-remove-image' when compiling.
+ (w3m-charset-coding-system-alist): Use `coding-system-p' if the
+ function `find-coding-system' is not bound.
+
+ * w3mhack.el: Use `require' instead of `load' for loading "w3m" to
+ avoid undesirable newlines in stdout.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-xmas.el: Require `wid-edit' when the widget `coding-system' is
+ not available.
+
+ * mime-w3m.el: Add autoload for `font-set-face-background' since it is
+ not auto-autoload'ed in XEmacs.
+
+ * w3mhack.el: Require `bytecomp'; make XEmacs don't warn for unused
+ non-global variables.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Bind colon keywords only if it is not available.
+ (rfc2368-parse-mailto-url):
+ (w3m-form-parse-region):
+ (w3m-fontify-forms): Bind them only at the compile-time as autoload'ed
+ functions to avoid byte-compile warnings.
+
+ * w3mhack.el: Byte optimize `truncate-string' for replacing with
+ `truncate-string-to-width' if it is bound.
+
+ * mew-w3m.el (mew-w3m-minor-mode-setter): Defun it after defining some
+ variables.
+
+2001-03-15 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Makefile.in (default): Add `-k' option to continue byte-compile as
+ much as possible after an error.
+
+2001-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (default): Don't use `for' loop.
+ * w3mhack.el (w3mhack-examine-modules): Use space instead of newline
+ for the module names separator.
+
+2001-03-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Removed functions and variables of bookmark.
+ * w3m-bookmark.el: New file.
+ * Makefile.in: Clean up rules and removed GNU-make depended functions.
+ * w3mhack.el (TopLevel): Load w3m.el.
+ (w3mhack-version): New function.
+ * .cvsignore: Add files generated by autoconf.
+
+2001-03-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3mhack.el (w3mhack-examine-modules): Renamed from
+ `w3mhack-examine-additional-modules'.
+ * Makefile.in: Ditto.
+
+2001-03-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in, aclocal.m4, configure.in, install-sh, w3mhack.el: New
+ files.
+ * Makefile: Removed.
+
+2001-03-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Split file.
+
+ * w3m-form.el: New file.
+
+2001-03-14 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m-xmas.el (w3m-insert-image): Don't use current cursor point to
+ make a new extent.
+
+ * w3m.el (w3m-region): Call `sit-for' to redisplay before image
+ display.
+ (w3m-goto-url): Ditto.
+ (w3m-exec-process): Use `sleep-for' instead of `sit-for'.
+ (w3m-toggle-inline-images): Set cursor point before image insertion.
+ (w3m-goto-url): Set cursor point before redisplay.
+
+2001-03-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-read-passwd): Removed.
+ (w3m-exec-filter): Use `read-passwd' instead of `w3m-read-passwd'.
+
+ * w3m-om.el (read-passwd): Added.
+
+2001-03-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m-om.el: Rewrite to insert "-" into the name of eol-type variants
+ of each newly generated coding-system.
+
+2001-03-14 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Split files.
+ (w3m-coding-system): Changed customize type.
+ (w3m-input-coding-system): Ditto.
+ (w3m-output-coding-system): Ditto.
+ (w3m-bookmark-file-coding-system): Ditto.
+ (w3m-url-encode-string): Removed redundant code for Mule-2.
+
+ * w3m-e21.el: New file.
+
+ * w3m-xmas.el: New file.
+
+ * w3m-om.el: New file.
+
+ * w3m-search.el (w3m-search-default-coding-system): Changed customize
+ type.
+ (w3m-search-engine-alist): Ditto.
+
+ * w3m-weather.el: Fix comments.
+
+2001-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el: Use the copy of info-vector for newly generated coding-
+ systems; use `eval-when-compile' separately from "cl" for loading
+ "cl-macs".
+
+2001-03-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Split files.
+ * w3m-search.el: New file.
+ * w3m-weather.el: New file.
+
+2001-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-rendering-region): Make no exceptions of Mule 2 in
+ coding-systems.
+ (w3m-download): Ditto.
+ (w3m-local-retrieve): Ditto.
+ (w3m-exec-process): Ditto.
+ (w3m-arrived-file-coding-system): Unified the default value to
+ `euc-japan'.
+ (w3m-bookmark-file-coding-system): Ditto.
+ (w3m-default-url-coding-system): Ditto.
+ (w3m-output-coding-system): Ditto.
+ (w3m-coding-system): Ditto.
+ (w3m-input-coding-system): Unified the default value to `iso-2022-jp'.
+ (TopLevel): Generate some coding-systems by copying for Mule 2.
+ (TopLevel): Load "cl-macs" if the macro `dolist' has been defined
+ incorrectly.
+
+2001-03-13 Masatake YAMATO <jet@gyve.org>
+
+ * w3m.el (w3m-url-yrotsih): New variable.
+ (w3m-view-previous-page): Set w3m-url-yrotsih. Use while/cdr instead
+ of nthcdr.
+ (w3m-view-next-page): New function.
+ (w3m-mode-map): Bind w3m-view-next-page.
+ (w3m-mode): Added w3m-view-next-page and w3m-view-parent-page to the
+ function document.
+ (w3m-reload-this-page): Guard w3m-url-yrotsih from resetting.
+ (w3m-exec): Reset yrotsih.
+
+2001-03-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-content-type-alist): [UNIX] Change method for text/html
+ type.
+
+2001-03-13 Akihiro Arisawa <ari@mbf.sphere.ne.jp>,
+ TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Require `poem' when Mule 2.3 is running. Bind keywods
+ `:case-ignore' and `:integer' for Mule 2.3.
+ (coding-system-category): New alias when Mule 2.3 is running.
+ (w3m-arrived-file-coding-system): Fix typo.
+ (w3m-entity-alist): Fix for Mule 2.3.
+ (w3m-form-method, w3m-form-action, w3m-form-plist, w3m-form-put,
+ w3m-form-get): Convert to old style of macro definition.
+ (w3m-fontify): Removed code to decode w3m-specific characters.
+ (w3m-decode-extended-characters): New function.
+ (w3m-rendering-region): Use an unibyte temporary buffer and call
+ `w3m-decode-extended-characters'.
+
+2001-03-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-exec-process): Return process exit status.
+ (w3m-w3m-get-header): Check the return value of w3m-exec-process.
+ (w3m-w3m-check-header): Check the return value of w3m-w3m-get-header.
+
+2001-03-13 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-exec-process): Check exit status and cause an error if it
+ is not zero.
+
+2001-03-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-executable-type): Use (eq system-type 'windows-nt) for
+ determination of win32.
+ (w3m-content-type-alist): Ditto.
+
+2001-03-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-which-command): Support executable suffix, `.exe' for
+ win32.
+
+2001-03-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-content-type-alist): Add 'use fiber.exe' alist for
+ Windows.
+ (w3m-w32-browser-with-fiber): New funciton.
+
+2001-03-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-which-command): New function.
+ (w3m-external-view): When no viewing method is defined, call
+ `w3m-download' as alternative method. Added check which command exists
+ with `w3m-which-command'.
+
+2001-03-12 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-display-inline-image-status): Define as buffer local
+ variable.
+ (w3m-image-type): New function.
+ (w3m-image-type-available-p): Ditto.
+ (w3m-create-image): Check image type by `w3m-image-type-available-p'.
+ (w3m-exec): Accept all content-types in `w3m-retrieve'; Make an image
+ only page, if the image can be displayed inline; Call
+ `w3m-external-view' if the content-type of retrieved content is not
+ text nor image.
+
+2001-03-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-parent-page): Add a postfix '/' to parent-url.
+
+2001-03-12 Takaaki MORIYAMA <taka@airlab.cs.ritsumei.ac.jp>
+
+ * w3m.el (w3m-extended-charcters-table): Add '\x80'.
+
+2001-03-12 Masatake YAMATO <masata-y@is.aist-nara.ac.jp>
+
+ * w3m.el (w3m-view-parent-page): New command.
+ (w3m-mode-map): Add `w3m-view-parent-page'.
+
+2001-03-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el (mime-w3m-message-structure): Make variable buffer local
+ at top leve.
+
+2001-03-10 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-entity-alist): Eval at compile time.; Add character
+ entity references for ISO 8859-1 characters.
+
+2001-03-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-entity-regexp): New constant.
+ (w3m-fontify): Use `w3m-entity-regexp'.
+ (w3m-entity-value): Use defsubst, and fix typo.
+ (w3m-decode-anchor-string): New function.
+ (w3m-fontify-anchors): Decode `&amp;' exists in URL string.
+
+2001-03-09 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-create-image) [EMACS21,XEMACS]: Guard against error.
+
+ * mew-w3m.el (mew-w3m-auto-insert-image): New variable.
+ (mew-mime-text/html-w3m): Bind 'w3m-display-inline-image' with
+ 'mew-w3m-auto-insert-image'.
+ (mew-w3m-cid-retrieve): New function. Fix wrong guess.
+
+2001-03-09 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-mode-map): Add `w3m-close-window', `w3m-view-source',
+ `w3m-view-header', and `w3m-history'. Keybind of `w3m-quit' is
+ changed.
+ (w3m-close-window, w3m-about-source, w3m-view-source, w3m-about-header,
+ w3m-view-header, w3m-about-history, w3m-history): New functions.
+
+ * mime-w3m.el (mime-put-keymap-region): Removed.
+ (mime-w3m-save-background-color): Old name is
+ `mime-save-background-color'.
+ (mime-w3m-mode-map): Add workaround for `w3m-close-window',
+ `w3m-view-source', `w3m-view-header', and `w3m-history'.
+
+2001-03-09 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * w3m.el (w3m-cid-retrieve-function-alist): New variable.
+ (w3m-retrieve): Add support for URLs which has `cid:' prefix.
+
+ * mime-w3m.el: Always require `w3m'. Require `cl' when compiling. Set
+ `w3m-cid-retrieve-function-alist'.
+ (mime-w3m-message-structure): New variable.
+ (mime-w3m-preview-text/html): Set `mime-w3m-message-structure'.
+ (mime-w3m-cid-retrieve): New function.
+
+2001-03-09 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-toggle-inline-images): Eliminated needless local
+ variable.
+ (toplevel): Encloses old emacs judgement with eval-and-compile; Define
+ `find-coding-system' using `w3m-static-if'.
+
+2001-03-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: All w3m-backlog-* symbols are renamed into w3m-cache-*, and
+ coupling of retrieve module and cache module are cleand up.
+ (w3m-keep-cache-size): Old name is `w3m-keep-backlog'.
+ (w3m-cache-buffer, w3m-cache-articles, w3m-cache-hashtb,
+ w3m-cache-setup, w3m-cache-shutdown, w3m-cache-contents,
+ w3m-cache-request-contents): These symbols are renamed.
+ (w3m-cache-header, w3m-cache-request-header): New function.
+ (w3m-work-buffer-list): New variable.
+ (w3m-get-buffer-create): New function.
+ (w3m-with-work-buffer): New macro.
+ (w3m-kill-all-buffer): New function.
+ (w3m-create-image, w3m-local-retrieve): Use `w3m-with-work-buffer'
+ instead of `with-current-buffer'.
+ (w3m-arrived-setup): Set `w3m-input-url-history' when its value is nil.
+ (w3m-arrived-shutdown): More strict error check. This function is
+ added to `kill-emacs-hook'.
+ (w3m-w3m-get-header): New function.
+ (w3m-w3m-check-header): Use `w3m-w3m-get-header'.
+ (w3m-w3m-retrieve): Clean up code.
+ (w3m-download, w3m-exec): More strict error check.
+ (w3m-content-type): New optional argument `no-cache' is added.
+ (w3m-alive-p): New function.
+ (w3m-quit): Use `w3m-alive-p'.
+
+2001-03-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-local-retrieve): Bind 'auto conversion variables' to nil
+ when insert file with binary .
+
+2001-03-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-insert-image): Eliminated needless local variable.
+ (w3m-remove-image) [XEmacs]: Remove images at `end' too.
+ (w3m-fontify-images): Set `w3m-image-redundant' property if "img_alt"
+ string is upper case.
+ (w3m-toggle-inline-images): Fixed docstring; Insert and remove dummy
+ string if alt string has `w3m-image-redundant' property.
+
+2001-03-08 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-fontify): Allow '_' char for element name.
+
+2001-03-08 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-display-inline-image-status): New variable.
+ (w3m-image-type-alist): Define as constant.
+ (w3m-anchor): Moved position.
+ (w3m-image): Ditto.
+ (w3m-action): Ditto.
+ (w3m-create-image): Added argument `no-cache'.
+ (w3m-remove-image): New function.
+ (w3m-fontify-images): Don't display inline image here.
+ (w3m-toggle-inline-images): New function.
+ (w3m-mode-map): Bind 't' to `w3m-toggle-inline-images'.
+ (w3m-goto-url): Call `w3m-toggle-inline-images'; Set
+ `w3m-display-inline-image-status'.
+ (w3m-region): Ditto.
+
+2001-03-08 Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+
+ * mime-w3m.el (mime-w3m-preview-text/html): Use
+ `mime-entity-fetch-field' instead of `mime-w3m-get-xref'.
+ (mime-w3m-get-xref): Removed.
+
+2001-03-07 Keisuke Nishida <kxn30@po.cwru.edu>
+
+ * w3m.el (w3m-search-engine-alist): Added "rpmfind".
+ (w3m-fontify-anchors): Treat single quotes (') as quotation marks.
+
+2001-03-08 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Backlog module is separated from front-end functions and code
+ to access the list of arrived URLs is put in order.
+ (w3m-arrived-file): Renamed from `w3m-arrived-urls-file'.
+ (w3m-arrived-anchor-list): Removed variable.
+ (w3m-arrived-list-load, w3m-arrived-list-save, w3m-arrived-list-add,
+ w3m-save-position, w3m-restore-position): Removed functions.
+ (w3m-arrived-db-size): New constant.
+ (w3m-arrived-db, w3m-arrived-seq): New variables.
+ (w3m-arrived-p, w3m-arrived-add, w3m-arrived-setup,
+ w3m-arrived-shutdown, w3m-arrived-store-position,
+ w3m-arrived-restore-position): New functions.
+ (w3m-input-url): Follow changes.
+ (w3m-view-previous-page): Ditto.
+ (w3m-view-previous-point): Ditto.
+ (w3m-quit): Ditto.
+ (w3m-goto-url): Ditto.
+ (w3m-create-image): Clean up codes.
+
+2001-03-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-current-url-with-external-browser): Fix typo when
+ browse current URL.
+
+2001-03-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * w3m.el (w3m-create-image) [XEmacs]: Retrieve header to determine
+ image type when `w3m-local-content-type' failed.
+
+2001-03-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-arrived-file-coding-system): Default value is changed to
+ avoid unknown coding system error on XEmacs.
+ (w3m-input-url): Changed for old style `completing-read'.
+
+2001-03-07 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-download): Bind 'auto conversion variables' to nil.
+ (w3m-w3m-check-header): Fix search 'HTTP/1.[01] 200' method.
+ (inline-image-features): Patch from Yuuichi Teranishi san
+ <teranisi@gohome.org> at [emacs-w3m:00103].
+
+2001-03-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el: Renamed mime-w3m-preview-text/html from
+ w3m-mime-preview-text/html. Check of user setting is required.
+ (mime-w3m-mode-map): New variable.
+ (mime-w3m-get-xref): New function.
+ (mime-w3m-view-this-url): Ditto.
+ (mime-w3m-mouse-view-this-url): Ditto.
+ (mime-w3m-preview-text/html): Use `mime-w3m-mode-map' insted of
+ `w3m-mode-map'. Refer Xref: header to set `w3m-current-url'.
+ (mime-put-keymap-region): Define with `defmacro' instead of
+ `defmacro-maybe'.
+ (mime-save-background-color): Ditto.
+
+ * w3m.el (w3m-exec-filter): Improved code to process prompt string.
+
+2001-03-06 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-exec-filter): Delete Prompt string with process output
+ buffer.
+ (w3m-w3m-check-header): Check 'HTTP/1.[01] 200' for valid
+ 'content-length'.
+ (w3m-w3m-retrieve): Cygwin binary data support. Remove Prompt handling.
+
+2001-03-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (emacs-w3m-version): New constant.
+ (find-coding-system): Removed duplicated definition.
+ (w3m-backlog-remove-oldest): Simplify.
+ (w3m-search): Fix typo in function document.
+
+2001-03-05 Keisuke Nishida <kxn30@po.cwru.edu>
+
+ * w3m.el (w3m-anchor, w3m-image, w3m-action): Use defsubst.
+
+2001-03-05 Keisuke Nishida <kxn30@po.cwru.edu>
+
+ * w3m.el (and-let*): Removed
+ (w3m-save-this-url): Updated.
+
+2001-03-06 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-goto-previous-anchor): Fix mistake on merging w3-anchor
+ patch. Cursor should go to beginning of anchor previous.
+ (w3m-mode-map): Assign Shift-TAB key with w3m-previous-anchor.
+
+2001-03-06 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (TOP): No need to load cl-macs explicitly.
+ (w3m-charset-coding-system-alist): Do not use doloop in defcustom
+ because it is not expanded in compile time.
+
+2001-03-05 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: apply patch from Keisuke Nishida. URL is hold in text
+ property as already expanded. Some utility functions (w3m-anchor,
+ w3m-image, w3m-action) is defined and used.
+ (and-let*): New macro.
+ (w3m-fontify-anchors): Hold expanded url in text property.
+ (w3m-fontify-images): Likewise.
+ (w3m-expand-url): Save matching data. Match pattern bug fix (by
+ gotoh).
+ (w3m-anchor): New function.
+ (w3m-image): New function.
+ (w3m-action): New function. (added by gotoh)
+ (w3m-view-this-url): Use new functions to extract text prop.
+ (w3m-mouse-view-this-url): Likewise.
+ (w3m-download-this-url): Likewise.
+ (w3m-print-this-url): Likewise.
+ (w3m-save-this-url): Likewise.
+ (w3m-goto-next-anchor): Likewise, and do not expand url.
+ (w3m-external-view): Remove 1st arg CONTENT-TYPE.
+ (w3m-next-anchor): Use and-let* macro and do not expand url.
+ (w3m-goto-previous-anchor): Use utility functions.
+ (w3m-bookmark-add-this-url): Likewise and refine.
+ (w3m-url-encode-string): Do not escape ':' and '/'.
+
+2001-03-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-retrieve): Add support for URLs which has `about:'
+ prefix.
+ (w3m-content-type): Likewise.
+ (w3m-about, w3m-about-weather, w3m-weather, w3m-weather-remove-headers,
+ w3m-weather-remove-footers, w3m-weather-remove-weather-images,
+ w3m-weather-remove-washing-images, w3m-weather-remove-futon-images,
+ w3m-weather-remove-week-weather-images, w3m-weather-insert-title): New
+ function.
+ (w3m-weather-url-alist): New associative list of AREA vs. URL.
+ (w3m-weather-default-area): New customize variable.
+ (w3m-weather-default-area): Ditto.
+ (w3m-entity-value): When unknown entity is specified, return original
+ string instead of null string.
+
+2001-03-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-url-encode-string): New function.
+ (w3m-escape-query-string): Use `w3m-url-encode-string'.
+ (w3m-form-make-get-string): Ditto.
+ (w3m-message): Changed to support Emacs-19.
+ (w3m-parse-attributes): Ditto.
+ (w3m-fontify): Refer `mc-flag' when mule is used.
+
+2001-03-05 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-command-arguments): Make it as system constants user not
+ for user variable. User need not change this value. "-S" options is
+ removed because it doesn't work for non Text/Plain object.
+ (w3m-default-url-coding-system): New variable.
+ (w3m-search-engine-alist): Change format to hold encoding type for
+ query string. And add some engines.
+ (w3m-fill-column): Born again variable. Positive value is for fixed
+ column, negative value is for fitting frame width.
+ (w3m-mode): Add key description of "<" and ">" in doc-string.
+ (w3m-escape-query-string): Add 2nd argument for coding system.
+ (w3m-search): Adapt to new format of w3m-search-engine-alist.
+
+2001-03-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-sub-list): Guard error for XEmacs (N must count from
+ zero).
+
+2001-03-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-search): Simplify.
+ (w3m-do-search): Removed.
+
+2001-03-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Merge form branch to main trunk.
+
+2001-03-05 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-form-new): Changed w3m-form structure.
+ (w3m-form-p): Likewise.
+ (w3m-form-put): Likewise.
+ (w3m-form-get): Likewise.
+ (w3m-form-plist): New macro.
+ (w3m-form-symbol): Removed.
+ (w3m-url-encode): Ditto.
+ (w3m-form-make-get-string): Follow change of w3m-form and use
+ w3m-escape-query-string instead of w3m-url-encode.
+ (w3m-parse-attributes): New macro.
+ (w3m-form-parse-region): Use w3m-parse-attributes.
+ (w3m-fontify-forms): Use w3m-parse-attributes.
+
+2001-03-05 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-content-type-alist): Add some content-type.
+ (w3m-w3m-retrieve): Change bind variables method to 'let*'.
+
+2001-03-05 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-command-arguments): Add "-S" option for w3m.
+ (w3m-search-engine-alist): Add new spec for google with JA lang.
+ (w3m-current-url): Make variable buffer local at top leve.
+ (w3m-current-title): Likewise.
+ (w3m-url-history): Likewise.
+ (w3m-process-temp-file): Likewise.
+ (w3m-rendering-region): Do not make local variable for the reason
+ above.
+ (w3m-exec): Likewise.
+ (w3m-external-view): Likewise.
+ (w3m-goto-next-anchor): Bug fix.
+ (w3m-goto-previous-anchor): Bug fix.
+ (w3m-escape-query-string): Bug: Escape SPC char as "+" not "%20".
+
+2001-03-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-form-string-regexp): Add `eval-and-compile' to suprress
+ byte-compile error.
+ (w3m-form-p): Fix typo.
+ (w3m-mode-map): Swapped keybindings of w3m-scroll-left and
+ w3m-scroll-right to fit w3m's keybindings.
+
+2001-03-04 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Add Keisuke Nishida as author.
+ (TOP): Use thingatpt instead of ffap.
+ (w3m-fill-column): Obsoleted. Determine in dynamic.
+ (w3m-command-arguments): Specify as lambda
+ (w3m-command-arguments): Change initial value.
+ (w3m-search-engine-alist): Change spec more simple.
+ (w3m-input-url): Use thing-at-point.
+ (w3m-do-search): Adapt to new w3m-search-engine-alist spec.
+ (w3m-search): Change variable name and refine codes.
+
+ * w3m.el: (w3m-entity-value): Allow immediate entity (&#nnn).
+ (w3m-fontify): Likewise.
+
+2001-03-04 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-delete-duplicated-empty-lines): New variable.
+ (w3m-search-engine-alist): New variable.
+ (w3m-default-search-engine): New variable.
+ (w3m-horizontal-scroll-columns): New variable.
+ (w3m-fontify): Change regexp to allow non-double-quoted string for href
+ attribute value of anchor tag. Remove duplicated empty lines for
+ compact view.
+ (w3m-mode-map): Add keymap "<" and ">" to scroll horizontaly.
+ (w3m-mode): Truncate lines.
+ (w3m-scroll-left): New interactive function.
+ (w3m-scroll-right): New interactive function.
+ (w3m-escape-query-string): New function.
+ (w3m-do-search): New function.
+ (w3m-search): New interactive function for searching word with various
+ search engine.
+
+2001-03-04 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Start implementation of code to process <form> tag.
+ (w3m-form-face): New face.
+ (w3m-current-forms): New internal variable.
+ (w3m-form-string-regexp): New internal constant.
+ (w3m-form-new, w3m-form-p, w3m-form-symbol, w3m-form-method,
+ w3m-form-action, w3m-form-put, w3m-form-get, w3m-url-encode,
+ w3m-form-make-get-string, w3m-form-parse-region, w3m-fontify-forms,
+ w3m-form-replace, w3m-form-input, w3m-form-submit, w3m-form-real-reset,
+ w3m-form-reset, w3m-fontify-bold, w3m-fontify-underline,
+ w3m-fontify-images): New function.
+ (w3m-fontify): Use new functions.
+ (w3m-mode-map): Add scroll-right and scroll-left.
+ (w3m-mode): Set t to `truncate-line'.
+
+2001-03-04 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Patch from Keisuke Nishida <kxn30@po.cwru.edu>.
+ (w3m-print-this-url): Do not save URL, print only.
+ (w3m-save-this-url): New function. Print and save URL under cursor.
+ (w3m-goto-next-anchor): New function.
+ (w3m-next-anchor): Move to top anchor from bottom. Print URL after
+ move.
+ (w3m-goto-previous-anchor): New function.
+ (w3m-previous-anchor): Move to bottom anchor from top. Print URL after
+ move.
+
+2001-03-04 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Patch from Keisuke Nishida <kxn30@po.cwru.edu>.
+ (TOP): Require ffap.el.
+ (w3m-input-url): Prompt with default URL, and use URL under cursor as
+ default if not specified.
+ (w3m): Do not specify default url for w3m-input-url.
+
+2001-03-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-backlog-enter): Overwrite backlog data when specified URL
+ is duplicated.
+ (w3m-home-page): Changed official emacs-w3m page's address to
+ namazu.org.
+
+2001-03-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Renamed w3m-http-* to w3m-w3m-* in order to prepare name
+ space of symbols processing HTTP protocol directly, and fix for cookie.
+ (w3m-w3m-check-header): Renamed from `w3m-http-check-header'.
+ (w3m-w3m-retrieve): Renamed from `w3m-http-retrieve' and added code to
+ remove cookies.
+ (w3m-retrieve): Follow changes of fuction name.
+ (w3m-download): Likewise and changed argument spec.
+ (w3m-exec): Changed argument spec.
+ (w3m-goto-url): Changed reload scheme,
+ (w3m-fontify): Move point to the top of the buffer before delete <?xml
+ ... ?> tag.
+
+2001-03-02 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (TOP): Changed code to detect XEmacs and add to define
+ `find-coding-system'.
+ (w3m-backlog-setup): Changed caching data format.
+ (w3m-backlog-enter): Ditto and changed argument spec.
+ (w3m-backlog-request): Ditto and changed spec of return value.
+ (w3m-http-retrieve): Access backlog in this function and changed
+ argument spec.
+ (w3m-retrieve): Changed argument spec.
+ (w3m-exec): Clean up and chaned spec of return value.
+ (w3m-goto-url): Follow changes in `w3m-exec'.
+ (w3m-decode-buffer): Clean up.
+ (w3m-process-temp-file): New variable to suppress byte-compile warning.
+ (w3m-external-view): Use w3m-process-temp-file to suppress byte-compile
+ warning.
+ (w3m): Change `mode-line-buffer-identification'.
+
+2001-03-02 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-home-page): Initialize as URL.
+
+2001-03-02 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Correcting wrong use of cygwin type filename usage, using
+ dolist macro, adding handling codes html character entities, correct
+ bug of w3m-view-bookmark on win32 environment, fixing some small bugs,
+ etc.
+ (w3m-url-to-file-name): New function.
+ (w3m-expand-file-name-as-url): Renamed from w3m-expand-file-name.
+ (w3m-bookmark-file): Initialize as native filename format.
+ (w3m-arrived-urls-file): Likewise.
+ (w3m-charset-coding-system-alist): Use dolist macro.
+ (w3m-entity-alist): New constant.
+ (w3m-entity-db): New variable.
+ (w3m-entity-db-size): New variable.
+ (w3m-entity-db-setup): New function.
+ (w3m-entity-value): New function
+ (w3m-fontify): Refine html character entity decoding. Use dolist
+ macro. Some bug fix.
+ (w3m-exec-get-user): Simplify using dolist macro.
+ (w3m-bookmark-save): Likewise.
+ (w3m-local-content-type): Likewise.
+ (w3m-local-retrieve): Fix filename handling considering cygwin
+ convention by using w3m-local-file-name function.
+ (w3m-http-retrieve): Buf fix.
+ (w3m-rendering-region): Bug fix, use w3m-current-url.
+ (w3m-view-bookmark): Use w3m to do initialize on interactive call.
+ (w3m-find-file): Fix for renamed function.
+
+2001-03-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * Merge changes on `url' branch to main trunk.
+
+2001-03-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-home-page): Changed to official w3m.el page.
+ (w3m-anchor-face): Changed default face in dark backgraound.
+ (w3m-arrived-anchor-face): Ditto.
+ (w3m-download): Fix typo.
+ (w3m-content-type-alist): Accept .png file.
+ (w3m-external-view): Fix typo.
+ (w3m-view-image): Fix.
+
+2001-03-01 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * mew-w3m.el: New file to use w3m with Mew.
+
+2001-03-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * mime-w3m.el: New file to use w3m with SEMI.
+
+ * w3m.el (w3m-message): New function.
+ (w3m-verbose): New variable.
+ (w3m-process-message): Ditto.
+ (w3m-process-url): Removed.
+ (w3m-exec-process): Add code to show progress status.
+ (w3m-exec-filter): Fix prompt bug and clean up codes.
+ (w3m-retrieve): Changed arguments spec.
+ (w3m-local-retrieve): Ditto.
+ (w3m-http-retrieve): Ditto.
+ (w3m-pretty-length): New function.
+ (w3m-rendering-region): Add code to show progress status.
+
+2001-03-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-http-retrieve): Add adhoc fragment to avoid new-line
+ replacement.
+ (w3m-decode-buffer): Renamed from w3m-html-decode-buffer.
+
+2001-02-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-content-type-alist): Accept .htm as text/html.
+ (w3m-backlog-enter): Add code to memory w3m-current-title.
+ (w3m-backlog-request): Resume w3m-current-title from backlog data.
+ (w3m-html-decode-buffer): Change arguments spec.
+ (w3m-rendering-region): Removed code to set w3m-current-url.
+ (w3m-exec): Fix bug of proecessing text/plain files and changed data
+ format to preserve in backlog.
+
+2001-02-28 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Support XEmacs using APEL.
+ (w3m-fontify): Delete <?XML ... ?> tag for XHTML page.
+ (w3m-input-url): Do not use 7th arg of completing-read for XEmacs
+ support.
+ (w3m-bookmark-save): Check bookmark file is writable.
+
+2001-02-28 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-bookmark-add): Fix problem of adding bookmark first time.
+
+2001-02-28 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Reconstructed drastically and removed w3 depended codes.
+
+2001-02-28 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-executable-type): New variable.
+ (w3m-cygwin-path): New function.
+ (w3m-region): New function.
+
+2001-02-26 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-fontify): Add code to decode w3m-specific extended
+ charcters.
+ (w3m-extended-charcters-table): New constant.
+
+2001-02-08 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-async-exec): New customizable variable.
+ (w3m-exec-process): Use 'w3m-async-exec' instead of 'w3m-process-type'.
+
+2001-02-07 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Fixed small and thoughtless bugs...
+ (w3m-bookmark-file-modified-p): Bug fix.
+ (w3m-bookmark-save): Bug fix. Don't forget time stamp updating.
+ (w3m-bookmark-add): Bug fix. Function name miss-typing.
+
+2001-02-07 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el: Add bookmark operations. This feature is very ad-hoc.
+ Support loading w3m's bookmark file into internal bookmark data, adding
+ new entry interactively, and saving data as w3m's bookmark file format.
+ (w3m-bookmark-file-coding-system): New user varible.
+ (w3m-bookmark-data): New internal variable.
+ (w3m-bookmark-file-time-stamp): ditto.
+ (w3m-bookmark-section-history): ditto.
+ (w3m-bookmark-title-history): ditto.
+ (w3m-mode-map): Add bookmark operation functions to mode map.
+ (w3m-bookmark-file-modified-p): New function.
+ (w3m-bookmark-parse): ditto.
+ (w3m-bookmark-load): ditto.
+ (w3m-bookmark-save): ditto.
+ (w3m-bookmark-data-prepare): ditto.
+ (w3m-bookmark-add): ditto.
+ (w3m-bookmark-add-this-url): ditto.
+ (w3m-bookmark-add-current-url): ditto.
+
+2000-12-12 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-sub-list, w3m-load-list, w3m-save-list): New utility
+ function.
+ (w3m-arrived-list-load): Refine and move out common code into
+ w3m-load-list.
+ (w3m-arrived-list-save): Refine and move out common code into
+ w3m-save-list and w3m-sub-list. (Previous code had side effect of
+ nreverse).
+
+2000-12-10 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * makepatch.pl, Makefile, .cvsignore: New files.
+
+2000-10-26 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-this-url): Chang optinal argument 'arg'.
+ (w3m-next-anchor, w3m-previous-anchor): Bind 'pos'.
+ (w3m-fontify): Put mouse-face at anchor and image property.
+ (w3m-mouse-view-this-url): Handling 'w3m-image property.
+
+2000-10-20 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-process-type): Change default valule to 'start-process.
+ (w3m-process-user-counter): New buffer local variable.
+ (w3m-exec-get-user): New funciton, get user and passwd from
+ w3m-arrived-user-list.
+ (w3m-exec-filter): Use w3m-exec-get-user().
+
+2000-10-18 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-view-previous-point): New function.
+ (w3m-expand-url): If BASE is nil, it set "".
+ (w3m-download-this-url): w3m-refontify-anchor() exec when finished
+ download.
+
+2000-10-16 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-arrived-ct-file, w3m-arrived-file-cs,
+ w3m-always-html-url-regex): New variables.
+ (w3m-process-type): Change name from w3m-exec-process-type.
+ (w3m-refontify-anchor): New funcition.
+ (w3m-exec): Pre-check content-type.
+ (w3m-exec-w3m-ctcheck): New funcition, check context-type for URL.
+ (w3m-exec-w3m): New funcion, execute w3m.
+ (w3m-exec-ftp): New function, execute dired-other-window() or
+ copy-file(), if URL is 'ftp://'.
+ (w3m-convert-ftp-to-emacsen): Change 'ftp://' to '/user@host:/' from
+ elisp ML.
+ (w3m-download-this-url, w3m-save-image, w3-view-image): Use w3
+ features.
+
+2000-10-12 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (top-level): Add authors.
+ (w3m-expand-url): Check relative URL first.
+ (w3m-fontify): Add original text properties when replace 'escaped
+ character'.
+
+2000-10-11 Hideyuki SHIRAI <shirai@meadowy.org>
+
+ * w3m.el (w3m-mailto-url-function, w3m-use-cygdrive,
+ w3m-default-save-dir, w3m-arrived-list-file, w3m-arrived-list-keep,
+ w3m-arrived-anchor-face, w3m-exec-process-type,
+ w3m-process-connection-type, w3m-arrived-anchor-list): New user
+ custumize variables.
+ (w3m-mode): Change doc-string for key binding.
+ (w3m-arrived-list-add, w3m-arrived-list-load, w3m-arrived-list-save):
+ New functions for handling arrived anchor.
+ (w3m-fontify): Add arrived anchor face.
+ (w3m-exec-process, w3m-exec-filter, w3m-exec-sentinel): New functions
+ for asynchronous w3m execution.
+ (w3m-find-file, w3m-read-file-name, w3m-read-passwd): New miscellaneous
+ functions.
+ (w3m-expand-file-name): Support old cygwin.
+ (w3m-view-current-url-with-external-browser): If w3m-browser-command is
+ function, funcall it.
+ (w3m-mailto-url): If w3m-mailto-url-function is function, funcall it.
+ (w3m-mode-map): If running xemacs, use (button2) instead of (mouse-2).
+
+2000-09-21 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m): Cancel last change, use switch-to-buffer again.
+
+2000-09-20 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m): Do not switch buffer if w3m window already exists.
+
+2000-09-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Add declaration of dependency on APEL.
+ (w3m-quit): When other w3m buffers exist, don't destruct cache.
+ (w3m-browse-url): New function.
+
+2000-09-20 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-command-arguments): Remove option -m, that's not good for
+ bookmark / local file handling.
+
+2000-09-19 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-command-arguments): Add -m option explicitly.
+ (w3m-exec): Ad-hoc change to view .txt object. It's temporary
+ fix. Should we consider type? w3m option -dump_head may help us.
+ (w3m-exec): Get title and remove both format <title_alt> and <title>.
+ (w3m-view-this-url): Force reloading by prefix.
+ (w3m-view-current-url-with-external-browser): Works correctly.
+ (w3m-print-current-url): Push url to kill king to paste later.
+ (w3m-print-this-url): ditto.
+ (w3m-mailto-url): Use rfc2368.el instead of mailto.el.
+ (w3m-goto-url): Add 2nd argument RELOAD to withdraw data cached on
+ emacs.
+ (w3m-reload-this-page): Simplified by using new w3m-goto-url.
+ (w3m): Set mode-line-buffer-identification after changing major mode
+ because it overwrite that variable.
+
+2000-09-19 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el (w3m-fontify): Add code to handle irregular ordered elements
+ of anchor tags.
+ (w3m-mailto-url): Adopt for Emacs-19.
+ (w3m-input-url): Call `w3m-backlog-setup' to initialize
+ `w3m-backlog-hashtb'.
+
+2000-09-19 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m): Sorry, over paren.
+
+2000-09-18 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-exec): Get title correctly within -halfdump format of
+ w3m.
+ (w3m-mouse-view-this-url): New function to view page by clicking mouse
+ middle button.
+ (w3m-mode-map): Assign mouse middle button to view page.
+ (w3m): Change mode-line spec to show title of current page.
+
+2000-09-18 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Add authors.
+
+2000-09-18 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m-input-url): Enter url with completion. Candidates are
+ visited url kept in w3m-backlog-hashtb.
+ (w3m-backlog-setup): Change hash size as prime number and initialized
+ with value 0 for obarray.
+ (w3m-backlog-remove): Remove unused 2nd arg NUMBER and remove when
+ block to check NUMBER.
+ (w3m-exec): Show message "Loading..." while loading.
+ (w3m-save-position): New function to keep display position in Emacs
+ window into hash symbol, but I think this is not best way.
+ (w3m-restore-position): New function to restore display position.
+ (w3m-view-previous-page): Restore display position.
+ (w3m-expand-url): Canonicalize url, ex. "http://www.host.org" to
+ "http://www.host.org/". Change regexp to allow "mailto:" protocol.
+ Remove drive letter as side-effect using expand-file-name to expand url
+ for Win32 emacen.
+ (w3m-expand-file-name): New function to alternates expand-file-name
+ function with convert drive letter prefixed path to cygwin path.
+ i.e. c:/users/home to /cygdrive/c/users/home
+ (w3m-view-bookmark): Expand bookmark filename as cygwin path format to
+ pass to w3m.
+ (w3m-mode-map): Add new key binding 'B' to back to previous page. Add
+ new key binding 'R' to force reloading current page.
+ (w3m-mailto-url): New function to support mailto: protocol. It use
+ rfc2368.el if available.
+ (w3m-goto-url): Ad-hoc support mailto: protocol. We should consider
+ more...
+ (w3m-reload-this-page): New function to reload current page.
+
+2000-09-18 Shun-ichi GOTO <gotoh@taiyo.co.jp>
+
+ * w3m.el (w3m): Add 2nd arguemnt to use with browse url. This is patch
+ from Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp> in ELF-ML, Seq#
+ 875.
+ (w3m-fontify): Change regexp for <a ...> tag to allow newline in
+ between attributes. This is patch from Satoru Takabayashi
+ <satoru-t@is.aist-nara.ac.jp> in ELF-ML, Seq# 876.
+ (w3m-fontify): Allow un-ended tag for name attribute, is it w3m bug?).
+ This is Patch from Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp> in
+ ELF-ML, Seq# 876.
+
+2000-07-13 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Added handling of name anchors. Add comments.
+
+2000-07-12 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Improved to handle multi buffer. Fix broken cache and order
+ of fontify.
+
+2000-07-01 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: Handle &-sequence. Add history and cache.
+
+2000-06-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m.el: New file.
+
+
+Local Variables:
+coding: iso-2022-7bit
+fill-column: 79
+indent-tabs-mode: t
+End:
diff --git a/share/emacs/site-lisp/w3m/mew-w3m.el b/share/emacs/site-lisp/w3m/mew-w3m.el
new file mode 100644
index 00000000000..ed24004d188
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/mew-w3m.el
@@ -0,0 +1,474 @@
+;; mew-w3m.el --- View Text/Html content with w3m in Mew
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; Hideyuki SHIRAI <shirai@meadowy.org>
+;; Created: Wed Feb 28 03:31:00 2001
+;; Version: $Revision: 1.69 $
+;; Keywords: Mew, mail, w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This package is for viewing formatted (rendered) Text/Html content
+;; in Mew's message buffer.
+
+;;; Installation:
+
+;; (1) Simply load this file and add followings in your ~/.mew file.
+;;
+;; (require 'mew-w3m)
+;;
+;; (2) And you can use keymap of w3m-mode as mew-w3m-minor-mode.
+;; To activate this feaeture, add followings also:
+;;
+;; (setq mew-use-w3m-minor-mode t)
+;; (add-hook 'mew-message-hook 'mew-w3m-minor-mode-setter)
+;;
+;; (3) If you use mew-1.95b118 or later on which Emacs 21, 22 or XEmacs,
+;; can display the images in the Text/Html message.
+;; To activate this feaeture, add following in your ~/.mew file.
+;;
+;; (define-key mew-summary-mode-map "T" 'mew-w3m-view-inline-image)
+;;
+;; Press "T": Toggle the visibility of the images included its message only.
+;; Press "C-uT": Display the all images included its Text/Html part."
+;;
+;; (4) You can use emacs-w3m to fetch and/or browse
+;; `external-body with URL access'. To activate this feaeture,
+;; add followings also:
+;;
+;; (setq mew-ext-url-alist
+;; '(("^application/" "Fetch by emacs-w3m" mew-w3m-ext-url-fetch nil)
+;; (t "Browse by emacs-w3m" mew-w3m-ext-url-show nil)))
+;; or
+;; (setq mew-ext-url-alist
+;; '((t "Browse by emacs-w3m" mew-w3m-ext-url-show nil)))
+;;
+
+;;; Usage:
+
+;; There's nothing special. Browse messages in usual way.
+;; On viewing Text/Html file, rendered text is appeared in message
+;; buffer instead of usual "HTML" banner.
+;; C-c C-e operation is also allowed to view with external browser.
+;;
+;; If mew-use-w3m-minor-mode is t, key operations of w3m-mode is
+;; allowed (as minor-mode-map) and jump links in message buffer.
+;; NOTE: This feature is not complete. You may confuse.
+;;
+;;
+
+;;; Code:
+
+(require 'mew)
+(require 'w3m)
+(eval-when-compile (require 'cl))
+
+;;; initializer for mew
+(defgroup mew-w3m nil
+ "mew-w3m - Inline HTML rendering extension of Mew"
+ :group 'w3m)
+
+(defcustom mew-use-w3m-minor-mode nil
+ "*Use w3m minor mode in message buffer.
+Non-nil means that the minor mode whose keymap contains keys binded to
+some emacs-w3m commands are activated in message buffer, when viewing
+Text/Html contents."
+ :group 'mew-w3m
+ :type 'boolean)
+
+(defcustom mew-w3m-auto-insert-image nil
+ "*If non-nil, images are inserted automatically in Multipart/Related message.
+This variable is effective only in XEmacs, Emacs 21 and Emacs 22."
+ :group 'mew-w3m
+ :type 'boolean)
+
+(defcustom mew-w3m-cid-retrieve-hook nil
+ "*Hook run after cid retrieved"
+ :group 'mew-w3m
+ :type 'hook)
+
+(defcustom mew-w3m-region-cite-mark "&gt;&nbsp;"
+ "*Method of converting `blockquote'."
+ :group 'mew-w3m
+ :type '(choice (const :tag "Use Indent" nil)
+ (const :tag "Use Cite Mark \"> \"" "&gt;&nbsp;")
+ (string :tag "Use Other Mark")))
+
+(defconst mew-w3m-safe-url-regexp "\\`cid:")
+
+;; Avoid bytecompile error and warnings.
+(eval-when-compile
+ (defvar mew-use-text/html)
+ (unless (fboundp 'mew-current-get-fld)
+ (autoload 'mew-coding-system-p "mew")
+ (autoload 'mew-current-get-fld "mew")
+ (autoload 'mew-current-get-msg "mew")
+ (autoload 'mew-syntax-get-entry-by-cid "mew")
+ (defun mew-cache-hit (&rest args) ())))
+
+(defmacro mew-w3m-add-text-properties (props)
+ `(add-text-properties (point-min)
+ (min (1+ (point-min)) (point-max))
+ ,props))
+
+(defun mew-w3m-minor-mode-setter ()
+ "Check message buffer and activate w3m-minor-mode."
+ (w3m-minor-mode (or (and (get-text-property (point-min) 'w3m)
+ mew-use-w3m-minor-mode)
+ 0)))
+
+(defvar mew-w3m-use-safe-url-regexp t)
+
+(defun mew-w3m-view-inline-image (&optional allimage)
+ "Display the images of Text/Html part.
+\\<mew-summary-mode-map>
+'\\[mew-w3m-view-inline-image]' Toggle display the images included its message only.
+'\\[universal-argument]\\[mew-w3m-view-inline-image]' Display the all images included its Text/Html part."
+ (interactive "P")
+ (mew-summary-msg-or-part
+ (if allimage
+ (let ((mew-use-text/html t)
+ (mew-w3m-auto-insert-image t)
+ (mew-w3m-use-safe-url-regexp nil))
+ (mew-summary-display 'force))
+ (with-current-buffer (mew-buffer-message)
+ (let* ((image (get-text-property (point-min) 'w3m-images))
+ (w3m-display-inline-images image)
+ (w3m-safe-url-regexp (when mew-w3m-use-safe-url-regexp
+ mew-w3m-safe-url-regexp)))
+ (w3m-toggle-inline-images)
+ (mew-elet
+ (mew-w3m-add-text-properties `(w3m-images ,(not image)))
+ (set-buffer-modified-p nil)))))))
+
+(defun mew-w3m-region (start end &optional url charset)
+ "w3m-region with inserting the cite mark."
+ (if (null mew-w3m-region-cite-mark)
+ (w3m-region start end url charset)
+ (save-restriction
+ (narrow-to-region start end)
+ (let ((case-fold-search t)
+ pos lines tagbeg0 tagend0 tagbeg1 tagend1)
+ (goto-char (point-min))
+ (while (w3m-search-tag "blockquote")
+ (setq tagbeg0 (match-beginning 0))
+ (setq tagend0 (match-end 0))
+ (when (w3m-search-tag "/blockquote")
+ (setq tagbeg1 (match-beginning 0))
+ (setq tagend1 (match-end 0))
+ (setq lines (buffer-substring tagend0 tagbeg1))
+ (delete-region tagbeg0 tagend1)
+ (insert (with-temp-buffer
+ (insert lines)
+ (goto-char (point-min))
+ (if (and (w3m-search-tag "pre")
+ (setq tagbeg0 (match-beginning 0))
+ (setq tagend0 (match-end 0))
+ (w3m-search-tag "/pre")
+ (setq tagbeg1 (match-beginning 0))
+ (setq tagend1 (match-end 0)))
+ (progn
+ (delete-region tagbeg1 tagend1)
+ (delete-region tagbeg0 tagend0))
+ ;; delete <br>
+ (goto-char (point-min))
+ (while (w3m-search-tag "br")
+ (delete-region (match-beginning 0) (match-end 0))
+ (unless (looking-at "[\n\r]") (insert "\n"))))
+ (goto-char (point-max))
+ (skip-chars-backward " \t\n\f\r")
+ (delete-region (point) (point-max))
+ (goto-char (point-min))
+ (skip-chars-forward " \t\n\f\r")
+ (delete-region (point-min) (point))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (insert mew-w3m-region-cite-mark)
+ (forward-line 1))
+ (goto-char (point-min))
+ (insert "<pre>\n")
+ (goto-char (point-max))
+ (insert "\n</pre>\n")
+ (buffer-substring (point-min) (point-max)))))))
+ (w3m-region (point-min) (point-max) url charset))))
+
+;; processing Text/Html contents with w3m.
+(defun mew-mime-text/html-w3m (&rest args)
+ "View Text/Html contents with w3m rendering output."
+ (let ((w3m-display-inline-images mew-w3m-auto-insert-image)
+ (w3m-safe-url-regexp (when mew-w3m-use-safe-url-regexp
+ mew-w3m-safe-url-regexp))
+ w3m-force-redisplay ;; don't redraw
+ charset wcs xref
+ cache begin end params execute)
+ (if (= (length args) 2)
+ ;; Mew-2
+ (setq begin (nth 0 args) end (nth 1 args))
+ ;; Old Mew
+ (setq cache (nth 0 args))
+ (setq begin (nth 1 args))
+ (setq end (nth 2 args))
+ (setq params (nth 3 args))
+ (setq execute (nth 4 args)))
+ (if (and cache (or execute (<= end begin)))
+ ;; 'C-cC-e' + Old Mew
+ (apply 'mew-mime-text/html (list cache begin end params execute))
+ (save-excursion
+ ;; search Xref: Header in SHIMBUN article
+ (when cache (set-buffer cache))
+ (goto-char (point-min))
+ (when (re-search-forward mew-eoh nil t)
+ (let ((eoh (point))
+ (case-fold-search t))
+ (goto-char (point-min))
+ (when (and (re-search-forward "^X-Shimbun-Id: " eoh t)
+ (goto-char (point-min))
+ (re-search-forward "^Xref: \\(.+\\)\n" eoh t))
+ (setq xref (match-string 1))
+ (w3m-static-if (fboundp 'match-string-no-properties)
+ (setq xref (match-string-no-properties 1))
+ (setq xref (match-string 1))
+ (set-text-properties 0 (length xref) nil xref))))))
+ (mew-elet
+ (cond
+ ((and (null cache) (eq w3m-type 'w3m-m17n))
+ ;; Mew-2 + w3m-m17n.
+ ;; Coding-system and charset are decided by Mew.
+ (let ((w3m-input-coding-system w3m-input-coding-system)
+ (w3m-output-coding-system w3m-output-coding-system)
+ (w3m-halfdump-command-arguments w3m-halfdump-command-arguments))
+ (when (setq charset (mew-charset-guess-region begin end))
+ (setq wcs (mew-charset-to-cs charset)))
+ (when (and charset wcs (mew-coding-system-p wcs))
+ ;; guess correctly and not us-ascii
+ (setq w3m-input-coding-system wcs)
+ (setq w3m-output-coding-system wcs)
+ (setq w3m-halfdump-command-arguments
+ (list "-halfdump"
+ "-I" charset "-O" charset
+ "-o" "ext_halfdump=1"
+ "-o" "pre_conv=1"
+ "-o" "strict_iso2022=0")))
+ (mew-w3m-region begin end xref)))
+ ((null cache) ;; Mew-2 + w3m, w3mmee
+ (mew-w3m-region begin end xref (mew-charset-guess-region begin end)))
+ (t ;; Old Mew
+ (setq charset (or (mew-syntax-get-param params "charset")
+ (with-current-buffer cache
+ (mew-charset-guess-region begin end))))
+ (if charset
+ (setq wcs (mew-charset-to-cs charset))
+ (setq wcs mew-cs-text-for-write))
+ (mew-frwlet
+ mew-cs-dummy wcs
+ (mew-w3m-region (point)
+ (progn (insert-buffer-substring cache begin end)
+ (point))
+ xref))))
+ (mew-w3m-add-text-properties `(w3m t w3m-images ,mew-w3m-auto-insert-image))))))
+
+(defvar w3m-mew-support-cid (and (boundp 'mew-version-number)
+ (fboundp 'mew-syntax-get-entry-by-cid)))
+
+(defun mew-w3m-cid-retrieve (url &rest args)
+ (let ((output-buffer (current-buffer)))
+ (with-current-buffer w3m-current-buffer
+ (when (and w3m-mew-support-cid
+ (string-match "^cid:\\(.+\\)" url))
+ (setq url (match-string 1 url))
+ (let* ((fld (mew-current-get-fld (mew-frame-id)))
+ (msg (mew-current-get-msg (mew-frame-id)))
+ (cache (mew-cache-hit fld msg 'must-hit))
+ (syntax (mew-cache-decode-syntax cache))
+ cidstx beg end)
+ (if (string< "4.0.53" mew-version-number)
+ (setq cidstx (mew-syntax-get-entry-by-cid syntax (concat "<" url ">")))
+ (setq cidstx (mew-syntax-get-entry-by-cid syntax url)))
+ (when cidstx
+ (setq beg (mew-syntax-get-begin cidstx))
+ (setq end (mew-syntax-get-end cidstx))
+ (prog1
+ (with-current-buffer output-buffer
+ (set-buffer-multibyte t)
+ (insert-buffer-substring cache beg end)
+ (set-buffer-multibyte nil)
+ (downcase (car (mew-syntax-get-ct cidstx))))
+ (run-hooks 'mew-w3m-cid-retrieve-hook))))))))
+
+(when w3m-mew-support-cid
+ (push (cons 'mew-message-mode 'mew-w3m-cid-retrieve)
+ w3m-cid-retrieve-function-alist))
+
+(defun mew-w3m-ext-url-show (dummy url)
+ (pop-to-buffer (mew-buffer-message))
+ (w3m url))
+
+(defun mew-w3m-ext-url-fetch (dummy url)
+ (lexical-let ((url url)
+ (name (file-name-nondirectory url))
+ handler)
+ (w3m-process-do
+ (success (prog1
+ (w3m-download url nil nil handler)
+ (message "Download: %s..." name)))
+ (if success
+ (message "Download: %s...done" name)
+ (message "Download: %s...failed" name))
+ (sit-for 1))))
+
+(defun w3m-mail-compose-with-mew (source url charset content-type
+ to subject other-headers)
+ "Compose a mail using Mew."
+ (when (one-window-p)
+ (split-window))
+ (select-window (next-window))
+ (condition-case nil
+ (unless (and (boundp 'mew-init-p) mew-init-p
+ (progn
+ (mew-summary-jump-to-draft-buffer)
+ (and (eq major-mode 'mew-draft-mode)
+ (y-or-n-p "Attatch this draft? "))))
+ (mew-user-agent-compose to subject other-headers))
+ (quit
+ (if (y-or-n-p "Create new draft? ")
+ (mew-user-agent-compose to subject other-headers)
+ (delete-window)
+ (error "Abort mail composing"))))
+ (let* ((basename (file-name-nondirectory (w3m-url-strip-query url)))
+ (ct (downcase content-type))
+ (mew-attach-move-next-after-copy nil)
+ (i 1)
+ (pos -1)
+ (csorig (mew-charset-to-cs (symbol-name charset)))
+ last filename cs)
+ (unless (mew-attach-p)
+ (mew-draft-prepare-attachments))
+ ;; goto last attachment
+ (setq last (catch 'last
+ (while (not (= pos (point)))
+ (setq i (1+ i))
+ (mew-attach-goto-number 'here `(,i))
+ (when (mew-attach-line-lastp)
+ (throw 'last t)))))
+ (when (eq csorig mew-cs-unknown)
+ (setq csorig nil))
+ (if (or (not last) (not (mew-attach-not-line012-1)))
+ (message "Can not attach from emacs-w3m here!")
+ ;; Application/.*xml is not inline view with Mew.
+ (cond
+ ((string= "application/xhtml+xml" ct)
+ (setq ct "text/html"))
+ ((string-match "^application/.*xml$" ct)
+ (setq ct "text/xml")))
+ (setq filename (expand-file-name (cond
+ ((and (string-match "^[\t ]*$" basename)
+ (string= ct "text/html"))
+ "index.html")
+ ((and (string-match "^[\t ]*$" basename)
+ (string= ct "text/xml"))
+ "index.xml")
+ ((string-match "^[\t ]*$" basename)
+ "dummy")
+ (t
+ basename))
+ mew-temp-dir))
+ (with-temp-buffer
+ (cond
+ ((string= "text/html" ct)
+ (insert source)
+ (setq cs (w3m-static-if (fboundp 'mew-text/html-detect-cs)
+ (mew-text/html-detect-cs (point-min) (point-max))))
+ (when (or (eq cs mew-cs-unknown) (not cs))
+ (cond
+ (csorig
+ (setq cs csorig))
+ (t
+ (setq cs mew-cs-autoconv)))))
+ ((string= "text/xml" ct)
+ (insert source)
+ (setq cs (w3m-static-if (fboundp 'mew-text/html-detect-cs)
+ (mew-text/html-detect-cs (point-min) (point-max))))
+ (when (or (eq cs mew-cs-unknown) (not cs))
+ (cond
+ (csorig
+ (setq cs csorig))
+ ((mew-coding-system-p 'utf-8)
+ (setq cs 'utf-8))
+ (t
+ (setq cs mew-cs-autoconv)))))
+ ((string-match "^text/" ct)
+ (insert source)
+ (setq cs mew-cs-autoconv))
+ (t
+ (mew-set-buffer-multibyte nil)
+ (insert source)
+ (setq cs mew-cs-binary)))
+ (setq charset (cond
+ ((eq cs mew-cs-autoconv)
+ (mew-charset-guess-region (point-min) (point-max)))
+ ((eq cs mew-cs-binary)
+ nil)
+ (t
+ (mew-cs-to-charset cs))))
+ (mew-frwlet
+ mew-cs-text-for-read cs
+ (write-region (point-min) (point-max) filename nil 'nomsg)))
+ (when ct
+ (setq ct (mew-capitalize ct)))
+ (mew-attach-copy filename (file-name-nondirectory filename))
+ ;; content-type check & set
+ (let* ((nums (mew-syntax-nums))
+ (syntax (mew-syntax-get-entry mew-encode-syntax nums))
+ (file (mew-syntax-get-file syntax))
+ (ctl (mew-syntax-get-ct syntax))
+ (ct-orig (mew-syntax-get-value ctl 'cap))
+ cte)
+ (unless (string= ct ct-orig)
+ (setq ctl (list ct))
+ (mew-syntax-set-ct syntax ctl)
+ (setq cte (mew-ctdb-cte (mew-ctdb-by-ct ct)))
+ (mew-syntax-set-cte syntax cte)
+ (mew-syntax-set-cdp syntax (mew-syntax-cdp-format ct file))
+ (mew-encode-syntax-print mew-encode-syntax)))
+ ;; charset set
+ (let* ((nums (mew-syntax-nums))
+ (syntax (mew-syntax-get-entry mew-encode-syntax nums))
+ (file (mew-syntax-get-file syntax))
+ (ctl (mew-syntax-get-ct syntax))
+ (ct (mew-syntax-get-value ctl 'cap))
+ (params (mew-syntax-get-params ctl))
+ (ocharset "charset"))
+ (when (and (string-match "^Text" ct) charset)
+ (setq params (mew-delete ocharset params))
+ (setq ctl (cons ct (cons (list ocharset charset) params)))
+ (mew-syntax-set-ct syntax ctl))
+ (mew-syntax-set-cd syntax url)
+ (mew-encode-syntax-print mew-encode-syntax))
+ (message "Compose a mail using Mew with %s...done" url)
+ (when (and (file-exists-p filename) (file-writable-p filename))
+ (delete-file filename)))))
+
+;;;
+(provide 'mew-w3m)
+
+;; mew-w3m.el ends here
diff --git a/share/emacs/site-lisp/w3m/mime-w3m.el b/share/emacs/site-lisp/w3m/mime-w3m.el
new file mode 100644
index 00000000000..099d1211d80
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/mime-w3m.el
@@ -0,0 +1,227 @@
+;;; mime-w3m.el --- mime-view content filter for text
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+;; Keywords: HTML, MIME, multimedia, mail, news
+
+;; This file is *NOT* yet part of SEMI (Suite of Emacs MIME Interfaces).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Install:
+
+;; (1) Install SEMI.
+;; (2) Put this file to appropriate directory.
+;; (3) Write these following code to your ~/.emacs or ~/.gnus.
+;;
+;; (require 'mime-w3m)
+
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl)
+ ;; mime-parse.el should be loaded before mime.el so as not to make
+ ;; `mime-uri-parse-cid' an autoloaded function to which the byte
+ ;; compiler might issue a nonsense warning.
+ (require 'mime-parse)
+ (require 'mime)
+ (require 'w3m)
+ (defvar mime-preview-condition)
+ (defvar mime-setup-enable-inline-html)
+ (defvar mime-view-mode-default-map))
+
+(eval-and-compile
+ (when (featurep 'xemacs)
+ (require 'font)))
+
+(defcustom mime-w3m-display-inline-images 'default
+ "*Non-nil means that inline images are displayed.
+When this option is equal to `default',
+`w3m-default-display-inline-images' is refered instead of this option,
+to decide whether inline images are displayed."
+ :group 'w3m
+ :group 'mime-view
+ :type '(radio (const :format "%v " nil)
+ (sexp :format "non-nil "
+ :match
+ (lambda (widget value)
+ (and value (not (eq value 'default))))
+ :value-to-internal
+ (lambda (widget value)
+ (if (and value (not (equal value "default")))
+ (widget-sexp-value-to-internal widget value)
+ "t")))
+ (const default)))
+
+(defcustom mime-w3m-safe-url-regexp "\\`cid:"
+ "*Regexp that matches safe url names.
+Some HTML mails might have the trick of spammers using <img> tags. It
+is likely to be intended to verify whether you have read the mail.
+You can prevent your personal informations from leaking by setting
+this to the regexp which matches the safe url names. The value of the
+variable `w3m-safe-url-regexp' will be bound with this value. You may
+set this value to nil if you consider all the urls to be safe."
+ :group 'mime-w3m
+ :type '(choice (regexp :format "%t: %v\n" :size 0)
+ (const :tag "All URLs are safe" nil)))
+
+(defcustom mime-w3m-after-cursor-move-hook
+ '(w3m-print-this-url)
+ "*Hook run each time after the cursor moves in mime-w3m buffers.
+This hook is called by the `mime-w3m-check-current-position' function
+by way of `post-command-hook'."
+ :group 'mime-w3m
+ :type 'hook)
+
+(defcustom mime-w3m-setup-hook nil
+ "*Hook run at the end of function `mime-w3m-setup'."
+ :group 'mime-w3m
+ :type 'hook)
+
+(defvar mime-w3m-message-structure nil)
+(make-variable-buffer-local 'mime-w3m-message-structure)
+
+(defun mime-w3m-insinuate ()
+ "Insinuate `mime-w3m' module to SEMI."
+ (setq mime-setup-enable-inline-html nil)
+ (let (flag)
+ (when (boundp 'mime-preview-condition)
+ (labels ((overwrite (x)
+ (if (symbolp x)
+ (if (eq x 'mime-preview-text/html)
+ (setq flag 'mime-w3m-preview-text/html)
+ (when (eq x 'mime-w3m-preview-text/html)
+ (setq flag t))
+ x)
+ (if (consp x)
+ (cons (overwrite (car x)) (overwrite (cdr x)))
+ x))))
+ (setq mime-preview-condition
+ (overwrite mime-preview-condition))))
+ (unless flag
+ (eval-after-load "mime-view"
+ '(progn
+ (ctree-set-calist-strictly
+ 'mime-preview-condition
+ '((type . text)
+ (subtype . html)
+ (body . visible)
+ (body-presentation-method . mime-w3m-preview-text/html)))
+ (set-alist 'mime-view-type-subtype-score-alist
+ '(text . html) 3))))))
+
+(defun mime-w3m-setup ()
+ "Setup `mime-w3m' module."
+ (require 'w3m)
+ (when (eq mime-w3m-display-inline-images 'default)
+ (setq mime-w3m-display-inline-images w3m-default-display-inline-images))
+ (unless (assq 'mime-view-mode w3m-cid-retrieve-function-alist)
+ (push (cons 'mime-view-mode 'mime-w3m-cid-retrieve)
+ w3m-cid-retrieve-function-alist))
+ (run-hooks 'mime-w3m-setup-hook))
+
+(def-edebug-spec mime-w3m-save-background-color t)
+(defmacro mime-w3m-save-background-color (&rest body)
+ (if (featurep 'xemacs)
+ `(let ((color (color-name (face-background 'default))))
+ (prog1
+ (progn ,@body)
+ (font-set-face-background 'default color (current-buffer))))
+ (cons 'progn body)))
+
+;;;###autoload
+(defun mime-w3m-preview-text/html (entity situation)
+ (mime-w3m-setup)
+ (setq mime-w3m-message-structure (mime-find-root-entity entity))
+ (let ((p (point))
+ (xref
+ (or (mime-entity-fetch-field entity "xref")
+ (mime-entity-fetch-field mime-w3m-message-structure "xref"))))
+ (goto-char p)
+ (insert "\n")
+ (goto-char p)
+ (mime-w3m-save-background-color
+ (save-restriction
+ (narrow-to-region p p)
+ (mime-insert-text-content entity)
+ (run-hooks 'mime-text-decode-hook)
+ (condition-case err
+ (let ((w3m-safe-url-regexp mime-w3m-safe-url-regexp)
+ (w3m-display-inline-images mime-w3m-display-inline-images)
+ w3m-force-redisplay)
+ (w3m-region p (point-max)
+ (and (stringp xref)
+ (string-match "\\`http://" xref)
+ xref)
+ (mime-content-type-parameter
+ (mime-entity-content-type entity)
+ "charset"))
+ (add-text-properties p (point-max)
+ (list 'keymap w3m-minor-mode-map
+ 'text-rendered-by-mime-w3m t)))
+ (error (message "%s" err)))))))
+
+(let (current-load-list)
+ (defadvice mime-display-message
+ (after mime-w3m-add-local-hook activate compile)
+ "Advised by emacs-w3m.
+Set hooks run arround each command is executed."
+ (when (featurep 'w3m)
+ (w3m-add-local-hook 'pre-command-hook
+ 'w3m-store-current-position)
+ (w3m-add-local-hook 'post-command-hook
+ 'mime-w3m-check-current-position))))
+
+(defun mime-w3m-check-current-position ()
+ "Run `mime-w3m-after-cursor-move-hook' if the cursor has been moved."
+ (when (and (/= (point) (car w3m-current-position))
+ (ignore-errors
+ (or (get-text-property (point)
+ 'text-rendered-by-mime-w3m)
+ (get-text-property (car w3m-current-position)
+ 'text-rendered-by-mime-w3m))))
+ (run-hooks 'mime-w3m-after-cursor-move-hook)))
+
+(defun mime-w3m-cid-retrieve (url &rest args)
+ (let ((entity (mime-find-entity-from-content-id
+ (mime-uri-parse-cid url)
+ (with-current-buffer w3m-current-buffer
+ mime-w3m-message-structure))))
+ (when entity
+ ;; `mime-decode-string' should be performed in a unibyte buffer.
+ (w3m-insert-string (mime-entity-content entity))
+ (mime-entity-type/subtype entity))))
+
+(let (current-load-list)
+ (defadvice kill-new (before strip-keymap-properties-from-kill activate)
+ "Advised by emacs-w3m.
+Strip `keymap' or `local-map' properties from a killed string."
+ (if (text-property-any 0 (length (ad-get-arg 0))
+ 'text-rendered-by-mime-w3m t (ad-get-arg 0))
+ (remove-text-properties 0 (length (ad-get-arg 0))
+ '(keymap nil local-map nil)
+ (ad-get-arg 0)))))
+
+(mime-w3m-insinuate)
+
+(provide 'mime-w3m)
+
+;;; mime-w3m.el ends here
diff --git a/share/emacs/site-lisp/w3m/octet.el b/share/emacs/site-lisp/w3m/octet.el
new file mode 100644
index 00000000000..21b99656921
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/octet.el
@@ -0,0 +1,547 @@
+;;; octet.el --- An octet stream viewer.
+
+;; Copyright (C) 2000, 2002, 2003, 2004, 2005
+;; Yuuichi Teranishi <teranisi@gohome.org>
+
+;; Author: Yuuichi Teranishi <teranisi@gohome.org>
+;; Created: 2000/05/19
+;; Keywords: octet-stream, broken document
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; Display application/octet-stream inline on the emacs buffer.
+;;
+;; This program requires:
+;;
+;; emacs-w3m for HTML rendereing.
+;; (http://emacs-w3m.namazu.org/)
+;; Mule-UCS for UTF-8 decoding.
+;; (ftp://ftp.m17n.org/pub/mule/Mule-UCS/)
+;; wvHtml for MS Word document.
+;; (http://www.wvware.com/)
+;; xlHtml for MS Excel document.
+;; (http://chicago.sourceforge.net/xlhtml/)
+;; pptHtml for MS PowerPoint document.
+;; (http://chicago.sourceforge.net/xlhtml/)
+;; gunzip for decoding gzipped file.
+;; bunzip2 for decoding bzip2ed file.
+
+;; Put follwing line in your setting file:
+;;
+;; (require 'octet)
+;;
+;; To display octet data file, execute following command.
+;;
+;; M-x octet-find-file
+;;
+;; If you use SEMI, put following lines in your setting file:
+;;
+;; (require 'octet)
+;; (octet-mime-setup)
+;;
+;; Then you can toggle displaying application/octet-stream messages.
+
+;;; History:
+;;
+;; This file is created in 2000/05/19.
+;; All part was rewrote in 2002/01/28.
+;; Added to emacs-w3m repository in 2002/01/29.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'poe) ; for compatibility
+(require 'pces) ; as-binary-process
+(require 'mime) ; SEMI
+(require 'static)
+(require 'w3m-util); w3m-insert-string
+
+(defvar octet-temp-directory temporary-file-directory
+ "A directory to create temporal files.")
+
+(defvar octet-html-render-function 'octet-w3m-region
+ "A function for HTML rendering.")
+
+(defvar octet-suffix-type-alist
+ '(("xls" . msexcel)
+ ("ppt" . msppt)
+ ("doc" . msword)
+ ("gz" . gzip)
+ ("bz2" . bzip2)
+ ("html" . html)
+ ("jpg" . jpeg)
+ ("jpeg" . jpeg)
+ ("gif" . gif)
+ ("png" . png)
+ ("tif" . tiff)
+ ("tiff" . tiff)
+ ("txt" . text)
+ ("lzh" . lzh)
+ ("tar" . tar)
+ ("pdf" . pdf))
+ "Alist of suffix-to-octet-type.")
+
+(defvar octet-content-type-alist
+ '(("application/vnd\\.ms-excel" . msexcel)
+ ("application/vnd\\.ms-powerpoint" . msppt)
+ ("application/x-msexcel" . msexcel)
+ ("application/msword" . msword)
+ ("image/jpeg" . jpeg)
+ ("image/gif" . gif)
+ ("image/png" . png)
+ ("image/tiff" . tiff)
+ ("audio/midi" . ignore)
+ ("video/mpeg" . ignore)
+ ("text/html" . html-un)
+ ("application/x-tar" . tar)
+ ("application/pdf" . pdf))
+ "Alist of content-type-regexp-to-octet-type.")
+
+(defvar octet-magic-type-alist
+ '(("^\377\330\377[\340\356]..JFIF" image jpeg)
+ ("^\211PNG" image png)
+ ("^GIF8[79]" image gif)
+ ("^II\\*\000" image tiff)
+ ("^MM\000\\*" image tiff)
+ ("^MThd" audio midi)
+ ("^\000\000\001\263" video mpeg)
+ ("^<!doctype html" text html)
+ ("^<head" text html)
+ ("^<title" text html)
+ ("^<html" text html))
+ "*Alist of regexp about magic-number vs. corresponding content-types.
+Each element looks like (REGEXP TYPE SUBTYPE).
+REGEXP is a regular expression to match against the beginning of the
+content of entity.
+TYPE is symbol to indicate primary type of content-type.
+SUBTYPE is symbol to indicate subtype of content-type.")
+
+(defvar octet-type-filter-alist
+ `((msexcel octet-filter-call1 "xlhtml" ("-te") html-u8)
+ (msppt octet-filter-call1 "ppthtml" nil html-u8)
+ (msword octet-filter-call2-extra "wvHtml" nil html-u8)
+ (html octet-render-html nil nil nil)
+ (html-u8 octet-decode-u8-text nil nil html)
+ (html-un octet-decode-text nil nil html)
+ (gzip octet-filter-call1 "gunzip" ("-c") guess)
+ (bzip2 octet-filter-call1 "bunzip2" ("-c") guess)
+ (text octet-decode-text nil nil nil)
+ (ignore ignore nil nil nil)
+ (jpeg octet-decode-image nil jpeg nil)
+ (gif octet-decode-image nil gif nil)
+ (png octet-decode-image nil png nil)
+ (tiff octet-decode-image nil tiff nil)
+ (guess octet-filter-guess nil nil nil)
+ (lzh octet-filter-call1 "lha" ("-v") text)
+ (tar octet-tar-mode nil nil nil)
+ (pdf octet-filter-call2 "pdftotext" ("-q" "-eucjp" "-raw") text))
+ "Alist of type-to-filter-program.
+Each element should have the form like:
+\(TYPE FUNCTION FILTER_PROGRAM ARGUMENT NEW-TYPE\)
+nil in NEW-TYPE means filtering is completed.")
+
+(defvar octet-find-file-hook nil)
+
+(defvar octet-attachments nil)
+(make-variable-buffer-local 'octet-attachments)
+
+(defun octet-render-html (&rest args)
+ (funcall octet-html-render-function (point-min) (point-max))
+ 0)
+
+(defun octet-decode-text (&rest args)
+ (let ((string (buffer-string)))
+ (erase-buffer)
+ (set-buffer-multibyte t)
+ (insert (decode-coding-string string 'undecided)))
+ 0)
+
+;;; HTML rendering by w3m.el
+(defun w3m-about-octet-attachments (url &optional no-decode no-cache
+ &rest args)
+ (let (buffer attachments pair)
+ (set-buffer-multibyte nil)
+ (when (string-match "\\`about://octet-attachments/\\([^/]+\\)/" url)
+ (setq buffer (get-buffer (base64-decode-string (match-string 1 url)))
+ url (substring url (match-end 0))
+ attachments (with-current-buffer buffer
+ octet-attachments))
+ (when (and buffer attachments
+ (setq pair (assoc url attachments)))
+ (insert (cdr pair)))))
+ (car (funcall (symbol-function 'w3m-local-file-type) url)))
+
+(defun octet-w3m-region (beg end)
+ (let ((w3m-display-inline-images t)
+ (w3m-url-hierarchical-schemes '("about")))
+ (funcall (symbol-function 'w3m-region)
+ beg end (concat "about://octet-attachments/"
+ (base64-encode-string
+ (buffer-name (current-buffer))) "/"))
+ (setq octet-attachments nil))
+ 0)
+
+;; Decode image
+(static-cond
+ ((featurep 'xemacs)
+ (defun octet-decode-image (ignore &rest args)
+ (let (glyph)
+ (if (memq (car args) (image-instantiator-format-list))
+ (progn
+ (setq glyph (make-glyph (vector (car args) :data (buffer-string))))
+ (if glyph
+ (progn (erase-buffer)
+ (set-extent-end-glyph
+ (make-extent (point-min)(point-min))
+ glyph)
+ 0)
+ 1))
+ 1))))
+ (t
+ (defun octet-decode-image (ignore &rest args)
+ (let (image)
+ (if (image-type-available-p (car args))
+ (progn
+ (setq image (create-image (buffer-string) (car args) 'data))
+ (if image
+ (progn (erase-buffer)
+ (insert-image image) 0)
+ 1))
+ 1)))))
+
+(defun octet-decode-u8-text (&rest args)
+ (let ((string (buffer-string)))
+ (erase-buffer)
+ (set-buffer-multibyte t)
+ (insert (decode-coding-string string 'utf-8)))
+ 0)
+
+(defun octet-filter-call2 (filter &optional args)
+ "Call octed filter with two arguments (infile, outfile).
+Current buffer content is replaced.
+Returns 0 if succeed."
+ (let ((infile (file-name-nondirectory
+ (make-temp-file (expand-file-name "octet"
+ octet-temp-directory))))
+ (outfile (file-name-nondirectory
+ (make-temp-file (expand-file-name "octet"
+ octet-temp-directory))))
+ (last-dir default-directory)
+ result)
+ (cd octet-temp-directory)
+ (write-region-as-binary (point-min) (point-max) infile nil 'no-msg)
+ (unwind-protect
+ (progn
+ (as-binary-process
+ (setq result (apply 'call-process filter nil nil nil
+ (append args (list infile outfile)))))
+ (when (and (numberp result)
+ (zerop result))
+ (erase-buffer)
+ (insert-file-contents-as-binary outfile))
+ 0)
+ (if (file-exists-p infile) (delete-file infile))
+ (if (file-exists-p outfile) (delete-file outfile))
+ (cd last-dir))))
+
+(defun octet-filter-call2-extra (filter &optional args)
+ "Call octed filter with two arguments (infile, outfile).
+Current buffer content is replaced.
+Also, exta attachments are collected to `octet-attachments'.
+Returns 0 if succeed."
+ (let ((infile (file-name-nondirectory
+ (make-temp-file (expand-file-name "octet"
+ octet-temp-directory))))
+ (outfile (file-name-nondirectory
+ (make-temp-file (expand-file-name "octet"
+ octet-temp-directory))))
+ (last-dir default-directory)
+ result)
+ (cd octet-temp-directory)
+ (write-region-as-binary (point-min) (point-max) infile nil 'no-msg)
+ (unwind-protect
+ (progn
+ (as-binary-process
+ (setq result (apply 'call-process filter nil nil nil
+ (append args (list infile outfile)))))
+ (when (and (numberp result)
+ (zerop result))
+ (erase-buffer)
+ (insert-file-contents-as-binary outfile)
+ (dolist (attach (directory-files "." nil (concat
+ (regexp-quote outfile)
+ ".*\\..*")))
+ (setq octet-attachments
+ (cons (cons
+ attach
+ (with-temp-buffer
+ (insert-file-contents-as-binary attach)
+ (buffer-string)))
+ octet-attachments))
+ (if (file-exists-p attach) (delete-file attach))
+ ))
+ 0)
+ (if (file-exists-p infile) (delete-file infile))
+ (if (file-exists-p outfile) (delete-file outfile))
+ (cd last-dir))))
+
+(defun octet-filter-call1 (filter &optional args)
+ "Call external octed filter with two arguments (infile) and obtain stdout.
+Current buffer content is replaced.
+Returns 0 if succeed."
+ (let ((infile (file-name-nondirectory
+ (make-temp-file (expand-file-name "octet"
+ octet-temp-directory))))
+ (last-dir default-directory)
+ result)
+ (cd octet-temp-directory)
+ (write-region-as-binary (point-min) (point-max) infile nil 'no-msg)
+ (unwind-protect
+ (progn
+ (erase-buffer)
+ (as-binary-process
+ (setq result (apply 'call-process filter nil t nil
+ (append args (list infile)))))
+ (if (numberp result) result 1))
+ (if (file-exists-p infile) (delete-file infile))
+ (cd last-dir))))
+
+(defun octet-filter-guess (&rest args)
+ (let (buffer-file-name)
+ (octet-buffer)
+ 0))
+
+(defun octet-tar-mode (&rest args)
+ (funcall (symbol-function 'tar-mode))
+ 0)
+
+(defun octet-guess-type-from-name (name)
+ (when (string-match "\\.\\([a-z0-9]+\\)\\'" name)
+ (cdr (assoc (downcase (match-string 1 name))
+ octet-suffix-type-alist))))
+
+(defun octet-guess-type-from-content-type (content-type)
+ (let ((alist octet-content-type-alist)
+ type)
+ (while alist
+ (when (string-match (car (car alist)) content-type)
+ (setq type (cdr (car alist))
+ alist nil))
+ (setq alist (cdr alist)))
+ type))
+
+(defun octet-guess-type-from-magic ()
+ (let ((rest octet-magic-type-alist)
+ type subtype)
+ (goto-char (point-min))
+ (while (not (let ((cell (car rest)))
+ (if cell
+ (if (looking-at (car cell))
+ (setq type (nth 1 cell)
+ subtype (nth 2 cell)))
+ t)))
+ (setq rest (cdr rest)))
+ (if type
+ (octet-guess-type-from-content-type
+ (concat (symbol-name type) "/" (symbol-name subtype))))))
+
+(defun octet-filter-buffer (type)
+ "Call a filter function in `octet-type-filter-alist'.
+TYPE is the symbol of type.
+Returns NEW-TYPE."
+ (let ((elem (assq type octet-type-filter-alist)))
+ (if (zerop (apply (nth 1 elem) (list (nth 2 elem) (nth 3 elem))))
+ (nth 4 elem))))
+
+;;;###autoload
+(defun octet-buffer (&optional name content-type)
+ "View octet-stream content according to `octet-type-filter-alist'.
+Optional NAME is the filename.
+If optional CONTENT-TYPE is specified, it is used for type guess."
+ (interactive)
+ (let ((type (or (and content-type
+ (octet-guess-type-from-content-type
+ content-type))
+ (octet-guess-type-from-magic)
+ (and (or name buffer-file-name)
+ (octet-guess-type-from-name
+ (or name buffer-file-name)))
+ (intern (condition-case nil
+ (completing-read "Octet Type(text): "
+ (mapcar
+ (lambda (pair)
+ (list (symbol-name
+ (cdr pair))))
+ octet-suffix-type-alist)
+ nil 'require-match nil nil
+ "text")
+ (quit "text"))))))
+ (while (setq type (octet-filter-buffer type)))))
+
+(static-if (featurep 'xemacs)
+ (defun octet-insert-buffer (from)
+ "Insert after point the contents of BUFFER and the image."
+ (let (extent glyph)
+ (with-current-buffer from
+ (if (setq extent (extent-at (point-min) nil nil nil 'at))
+ (setq glyph (extent-end-glyph extent))))
+ (insert-buffer-substring from)
+ (if glyph
+ (set-extent-end-glyph (make-extent (point) (point))
+ glyph))))
+ (defalias 'octet-insert-buffer 'insert-buffer))
+
+;;;###autoload
+(defun octet-find-file (file)
+ "Find FILE with octet-stream decoding."
+ (interactive "fFilename: ")
+ (as-binary-input-file (find-file file))
+ (unwind-protect
+ (let (buffer-read-only)
+ (octet-buffer))
+ (goto-char (point-min))
+ (set-buffer-modified-p nil)
+ (auto-save-mode -1)
+ (setq buffer-read-only t
+ truncate-lines t)
+ (run-hooks 'octet-find-file-hook)))
+
+;;;
+;; Functions for SEMI.
+;;
+
+(defvar mime-preview-octet-hook nil)
+(defvar mime-view-octet-hook nil)
+
+;;;###autoload
+(defun mime-preview-octet (entity situation)
+ "A method for mime-view to preview octet message."
+ (goto-char (point-max))
+ (let ((p (point))
+ (name (mime-entity-filename entity))
+ from-buf to-buf)
+ (insert "\n")
+ (goto-char p)
+ (save-restriction
+ (narrow-to-region p p)
+ (setq to-buf (current-buffer))
+ (with-temp-buffer
+ (setq from-buf (current-buffer))
+ (w3m-insert-string (mime-entity-content entity))
+ (octet-buffer name (mime-entity-type/subtype entity))
+ (with-current-buffer to-buf
+ (octet-insert-buffer from-buf)
+ (run-hooks 'mime-preview-octet-hook))))))
+
+;;;###autoload
+(defun mime-view-octet (entity situation)
+ "A method for mime-view to display octet message."
+ (let (type subtype)
+ (let ((mdata (mime-entity-content entity))
+ (rest octet-magic-type-alist))
+ (while (not (let ((cell (car rest)))
+ (if cell
+ (if (string-match (car cell) mdata)
+ (setq type (nth 1 cell)
+ subtype (nth 2 cell)))
+ t)))
+ (setq rest (cdr rest)))
+ (if type
+ (progn
+ (setq situation (del-alist 'method (copy-alist situation)))
+ (funcall (symbol-function 'mime-play-entity)
+ entity
+ (put-alist 'type type
+ (put-alist 'subtype subtype
+ situation))
+ 'mime-view-octet))
+ (let ((buf (get-buffer-create
+ (format "%s-%s" (buffer-name) (mime-entity-number entity))))
+ (name (mime-entity-filename entity)))
+ (with-current-buffer buf
+ (set-buffer-multibyte nil)
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (w3m-insert-string mdata)
+ (octet-buffer name (mime-entity-type/subtype entity))
+ (setq buffer-read-only t
+ truncate-lines t)
+ (set-buffer-multibyte t)
+ (set-buffer-modified-p nil))
+ (let ((win (get-buffer-window (current-buffer))))
+ (or (eq (selected-window) win)
+ (select-window (or win (get-largest-window)))))
+ (view-buffer buf)
+ (run-hooks 'mime-view-octet-hook)
+ (goto-char (point-min)))))))
+
+;;;###autoload
+(defun octet-mime-setup ()
+ "Octet setting for MIME module."
+ (eval-after-load "mime-view"
+ '(progn
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . msword)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . excel)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . x-msexcel)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . vnd.ms-excel)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . vnd.ms-powerpoint)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-acting-condition
+ '((mode . "play")
+ (type . application)(subtype . octet-stream)
+ (method . mime-view-octet)))
+
+ (ctree-set-calist-strictly
+ 'mime-preview-condition
+ '((type . application)(subtype . t)
+ (encoding . t)
+ (body . invisible)
+ (body-presentation-method . mime-preview-octet)))
+ ;; another condition?
+ )))
+
+(provide 'octet)
+
+;;; octet.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-antenna.el b/share/emacs/site-lisp/w3m/w3m-antenna.el
new file mode 100644
index 00000000000..4373ba81bbc
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-antenna.el
@@ -0,0 +1,659 @@
+;;; w3m-antenna.el --- Utility to detect changes of WEB
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-antenna.el is the add-on utility of emacs-w3m to detect changes
+;; of WEB pages. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; How to install:
+
+;; Please put this file to appropriate directory, and if you want
+;; byte-compile it. And add following lisp expressions to your
+;; ~/.emacs.
+;;
+;; (autoload 'w3m-antenna "w3m-antenna" "Report changes of WEB sites." t)
+
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(require 'w3m-util)
+(require 'w3m-rss)
+(require 'w3m)
+
+(defgroup w3m-antenna nil
+ "w3m-antenna - Utility to detect changes of WEB."
+ :group 'w3m
+ :prefix "w3m-antenna-")
+
+(define-widget 'w3m-antenna-string 'string
+ "String widget with default value.
+When creating a new widget, its value is given by an expression specified
+with :value-from."
+ :tag "URL"
+ :value-from nil
+ :create 'w3m-antenna-string-create)
+
+(defun w3m-antenna-string-create (widget)
+ (if (string= "" (widget-get widget :value))
+ ;; No value is given.
+ (widget-put widget :value
+ (let* ((symbol (widget-get widget :value-from))
+ (value (eval symbol)))
+ (if value
+ (set symbol nil)
+ (setq value ""))
+ value)))
+ (widget-default-create widget))
+
+(eval-when-compile
+ ;; Compiler warning in Emacs 19.
+ (autoload 'widget-default-get "wid-edit"))
+
+(apply 'define-widget 'w3m-antenna-function 'function
+ "Bug-fixed version of the `function' widget.
+In Emacs 20.7 through 21.4 and XEmacs, it doesn't represent a value as
+a string internally, converts it into a string in the customization
+buffer, and provides the default value as `ignore'."
+ (if (and (fboundp 'widget-default-get)
+ (widget-default-get
+ '(function :value-to-external ignore :value foo)))
+ '(:value-create
+ (lambda (widget)
+ (widget-put widget :value
+ (widget-sexp-value-to-internal widget value))
+ (widget-field-value-create widget))
+ :value-to-internal
+ (lambda (widget value) value)
+ :value ignore)))
+
+(defvar w3m-antenna-alist nil
+ "A list of site information (internal variable). nil means that
+antenna database is not initialized. Each site information is a list
+that consists of:
+ 0. Format string of URL.
+ 1. Title.
+ 2. Class (Normal, HNS or TIME).
+ 3. Real URL.
+ 4. Last modification time.
+ 5. Size in bytes.
+ 6. Time when size modification is detected.
+")
+
+(defmacro w3m-antenna-site-key (site)
+ `(car ,site))
+(defmacro w3m-antenna-site-title (site)
+ `(nth 1 ,site))
+(defmacro w3m-antenna-site-class (site)
+ `(nth 2 ,site))
+(defmacro w3m-antenna-site-url (site)
+ `(nth 3 ,site))
+(defmacro w3m-antenna-site-last-modified (site)
+ `(nth 4 ,site))
+(defmacro w3m-antenna-site-size (site)
+ `(nth 5 ,site))
+(defmacro w3m-antenna-site-size-detected (site)
+ `(nth 6 ,site))
+
+(defcustom w3m-antenna-file
+ (expand-file-name ".antenna" w3m-profile-directory)
+ "File which has list of antenna URLs."
+ :group 'w3m-antenna
+ :type '(file :size 0))
+
+(defcustom w3m-antenna-refresh-interval nil
+ "Interval time to update (to refresh) the antenna page automatically.
+The value should be a positive integer in seconds, or nil which means
+not to update the page."
+ :group 'w3m-antenna
+ :type '(choice
+ (const :tag "Not reload." nil)
+ (integer :tag "Interval second.")))
+
+(defcustom w3m-antenna-sites
+ (unless noninteractive
+ (mapcar (lambda (site)
+ (list (w3m-antenna-site-key site)
+ (w3m-antenna-site-title site)
+ (w3m-antenna-site-class site)))
+ (w3m-load-list w3m-antenna-file)))
+ "List of WEB sites, watched by `w3m-antenna'."
+ :group 'w3m-antenna
+ :type `(repeat
+ (group
+ :indent 7
+ (w3m-antenna-string :format "URL: %v\n" :size 0
+ :value-from w3m-antenna-tmp-url)
+ (w3m-antenna-string :format "Title: %v\n" :size 0
+ :value-from w3m-antenna-tmp-title)
+ (choice
+ :tag "Procedure"
+ (const :tag "Check either its last modified time or its size" nil)
+ (const :tag "Check its last modified time only" time)
+ (const :tag "Check its current date provided by Hyper Nikki System"
+ hns)
+ (list :tag "Check RSS"
+ (function-item :format "" w3m-antenna-check-rss)
+ (string :format "URL: %v\n" :value ""))
+ (list :tag "Check the another changelog page"
+ (function-item :format "" w3m-antenna-check-another-page)
+ (string :format "URL: %v\n" :value ""))
+ (list :tag "Check the page linked by the anchor that matches"
+ (function-item :format "" w3m-antenna-check-anchor)
+ (regexp :value "")
+ (integer :value 0))
+ (cons :tag "Check with a user defined function"
+ (w3m-antenna-function
+ :match (lambda (widget value)
+ (and (functionp value)
+ (not (memq value
+ '(w3m-antenna-check-rss
+ w3m-antenna-check-another-page
+ w3m-antenna-check-anchor))))))
+ (repeat :tag "Arguments" sexp))))))
+
+(defcustom w3m-antenna-html-skelton
+ (eval-when-compile
+ (concat "<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">\n"
+ "<html>\n<head>\n<title>Antenna</title>\n%R</head>\n<body>\n"
+ "<h1>Antenna</h1>\n<p align=\"right\">Checked at %D.</p>\n"
+ "<h2>Updated</h2>\n<ul>\n%C</ul>\n"
+ "<h2>Visited</h2>\n<ul>\n%U</ul>\n"
+ "</body>\n</html>\n"))
+ "HTML skelton of antenna."
+ :group 'w3m-antenna
+ :type 'string)
+
+(defcustom w3m-antenna-make-summary-function
+ 'w3m-antenna-make-summary-like-natsumican
+ "Function to make summary of site information."
+ :group 'w3m-antenna
+ :type '(choice
+ :format "%{%t%}:\n %[Value Menu%] %v"
+ (function-item :tag "Simple style." w3m-antenna-make-summary)
+ (function-item :tag "Natsumican style."
+ w3m-antenna-make-summary-like-natsumican)
+ (function :format "User function: %v\n" :size 0)))
+
+(defcustom w3m-antenna-sort-changed-sites-function
+ 'w3m-antenna-sort-sites-by-time
+ "Function to sort list of changed sites."
+ :group 'w3m-antenna
+ :type '(choice
+ :format "%{%t%}:\n %[Value Menu%] %v"
+ (function-item :tag "Sort by last modification time."
+ w3m-antenna-sort-sites-by-time)
+ (function-item :tag "Sort by title." w3m-antenna-sort-sites-by-title)
+ (function-item :tag "Do nothing." identity)
+ (function :format "User function: %v\n" :size 0)))
+
+(defcustom w3m-antenna-sort-unchanged-sites-function
+ 'w3m-antenna-sort-sites-by-time
+ "Function to sort list of unchanged sites."
+ :group 'w3m-antenna
+ :type '(choice
+ :format "%{%t%}:\n %[Value Menu%] %v"
+ (function-item :tag "Sort by last modification time."
+ w3m-antenna-sort-sites-by-time)
+ (function-item :tag "Sort by title." w3m-antenna-sort-sites-by-title)
+ (function-item :tag "Do nothing." identity)
+ (function :format "User function: %v\n" :size 0)))
+
+(defun w3m-antenna-alist ()
+ (let ((alist (w3m-load-list w3m-antenna-file)))
+ (mapcar (lambda (site)
+ (let ((l (assoc (w3m-antenna-site-key site) alist)))
+ (if l
+ (progn
+ (setf (w3m-antenna-site-class l)
+ (w3m-antenna-site-class site))
+ l)
+ (append site (list nil nil nil nil)))))
+ w3m-antenna-sites)))
+
+(defun w3m-antenna-hns-last-modified (url handler)
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-retrieve (w3m-expand-url "di.cgi" url) nil t nil nil handler))
+ (when type
+ (or (let (start str)
+ ;; Process a line such as "Tue, 27 Mar 2001 12:43:16 GMT<br>".
+ (goto-char (point-min))
+ (and
+ (search-forward "\nLast-Modified: " nil t)
+ (setq start (match-end 0))
+ (search-forward "<br>" nil t)
+ (setq str (buffer-substring start (match-beginning 0)))
+ ;; Ignore format such as "2001, 27 03 GMT", which is used
+ ;; by old HNS.
+ (not (string-match
+ " *[0-9][0-9][0-9][0-9], +[0-9][0-9] +[0-9][0-9] +" str))
+ (w3m-time-parse-string str)))
+ (progn
+ ;; Process a line such as "newest day is 2001/03/15".
+ (goto-char (point-min))
+ (and
+ (re-search-forward "\
+^newest day is \\([0-9][0-9][0-9][0-9]\\)/\\([0-9][0-9]\\)/\\([0-9][0-9]\\)$"
+ nil t)
+ (encode-time 0 0 0
+ (string-to-number (match-string 3))
+ (string-to-number (match-string 2))
+ (string-to-number (match-string 1))
+ 32400)))))))
+
+(defun w3m-antenna-check-hns (site handler)
+ "Check the page served by HNS (Hyper Nikki System) asynchronously."
+ (lexical-let ((site site))
+ (w3m-process-do
+ (time
+ (w3m-antenna-hns-last-modified (w3m-antenna-site-key site) handler))
+ (if time
+ (w3m-antenna-site-update site (w3m-antenna-site-key site) time nil)
+ (w3m-antenna-check-page site handler)))))
+
+(defun w3m-antenna-check-rss (site handler url)
+ "Check RSS to detect change of SITE asynchronously.
+In order to use this function, `xml.el' is required."
+ (lexical-let ((url url)
+ (site site))
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-retrieve url nil t nil nil handler))
+ (let (link date dates)
+ (when type
+ (w3m-decode-buffer url)
+ (let* ((xml (ignore-errors
+ (xml-parse-region (point-min) (point-max))))
+ (dc-ns (w3m-rss-get-namespace-prefix
+ xml "http://purl.org/dc/elements/1.1/"))
+ (rss-ns (w3m-rss-get-namespace-prefix
+ xml "http://purl.org/rss/1.0/"))
+ (channel (car (w3m-rss-find-el
+ (intern (concat rss-ns "channel"))
+ xml)))
+ (items (w3m-rss-find-el
+ (intern (concat rss-ns "item"))
+ xml)))
+ (setq link (nth 2 (car (w3m-rss-find-el
+ (intern (concat rss-ns "link"))
+ channel))))
+ (setq dates (append
+ (w3m-rss-find-el
+ (intern (concat dc-ns "date"))
+ channel)
+ (w3m-rss-find-el
+ (intern (concat dc-ns "date"))
+ items)
+ (w3m-rss-find-el 'pubDate channel)
+ (w3m-rss-find-el 'pubDate items)))
+ (when dates
+ ;; Ignore future entries to display site announcements.
+ (let ((now (current-time)))
+ (let ((low (+ (nth 1 now) 3600))) ; 3600 = clock skew margin
+ (setq now
+ (if (>= low 65536)
+ (list (1+ (car now))
+ (- low 65536)
+ (nth 2 now))
+ (list (car now)
+ low
+ (nth 2 now)))))
+ (setq date '(0 0))
+ (dolist (tmp dates)
+ (setq tmp (w3m-rss-parse-date-string (nth 2 tmp)))
+ (and (w3m-time-newer-p tmp date)
+ (w3m-time-newer-p now tmp)
+ (setq date tmp)))))))
+ (if (and link date)
+ (w3m-antenna-site-update site link date nil)
+ (w3m-antenna-check-page site handler))))))
+
+(defun w3m-antenna-check-another-page (site handler url)
+ "Check the another page to detect change of SITE asynchronously.
+This function checks the another page specified by the URL before
+checking the SITE itself. This function is useful when the SITE's
+owner either maintains the page which describes the change of the
+SITE."
+ (lexical-let ((site site))
+ (w3m-process-do-with-temp-buffer
+ (time (w3m-last-modified url t handler))
+ (if time
+ (w3m-antenna-site-update site (w3m-antenna-site-key site) time nil)
+ (w3m-antenna-check-page site handler)))))
+
+(defun w3m-antenna-check-anchor (site handler regexp number)
+ "Check the page linked from SITE asynchronously.
+This function checks the page linked by an anchor that matches REGEXP
+from the page that is specified by SITE's key attribute."
+ (lexical-let ((site site)
+ (regexp regexp)
+ (number (or number 0)))
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-retrieve (w3m-antenna-site-key site)
+ nil nil nil nil handler))
+ (w3m-antenna-check-page site
+ handler
+ (when type
+ (w3m-decode-buffer (w3m-antenna-site-key site))
+ (goto-char (point-min))
+ (when (re-search-forward regexp nil t)
+ (w3m-expand-url
+ (match-string number)
+ (w3m-antenna-site-key site))))))))
+
+;; To avoid byte-compile warning.
+(eval-and-compile
+ (autoload 'w3m-filter "w3m-filter"))
+
+(defun w3m-antenna-check-page (site handler &optional url)
+ "Check SITE with the generic procedure.
+It consists of 3 steps:
+\(1\) Check the time when the SITE was last modified with HEAD request.
+\(2\) Check the size of the SITE with HEAD request.
+\(3\) Get the real content of the SITE, and check its size.
+"
+ (lexical-let ((site site)
+ (url (or url
+ (w3m-antenna-site-url site)
+ (w3m-antenna-site-key site))))
+ (w3m-process-do
+ (attr (w3m-attributes url t handler))
+ (when attr
+ (if (nth 4 attr) ; Use the value of Last-modified header.
+ (w3m-antenna-site-update site url (nth 4 attr) (nth 2 attr))
+ (unless (eq 'time (w3m-antenna-site-class site))
+ (if (nth 2 attr) ; Use the value of Content-Length header.
+ (w3m-antenna-site-update site url nil (nth 2 attr))
+ ;; Get the real content of the SITE, and calculate its size.
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-retrieve url nil t nil nil handler))
+ (when type
+ (w3m-decode-buffer url nil type)
+ (w3m-remove-comments)
+ (when w3m-use-filter
+ (w3m-filter url))
+ (w3m-antenna-site-update site url nil (buffer-size)))))))))))
+
+(defun w3m-antenna-site-update (site url time size)
+ "Update SITE's status information with specified TIME and SIZE."
+ ;; (w3m-antenna-site-size-detected site) keeps the time when SITE's
+ ;; size attribute is checked.
+ (setf (w3m-antenna-site-size-detected site)
+ (when size
+ (or (when (and url
+ (w3m-antenna-site-url site)
+ (string= url (w3m-antenna-site-url site))
+ (w3m-antenna-site-size site)
+ (= size (w3m-antenna-site-size site)))
+ (w3m-antenna-site-size-detected site))
+ (current-time))))
+ (setf (w3m-antenna-site-url site) url)
+ (setf (w3m-antenna-site-last-modified site) time)
+ (setf (w3m-antenna-site-size site) size)
+ site)
+
+(defun w3m-antenna-check-site (site handler)
+ "Check SITE asynchronously.
+If a class attribute of the SITE is a list that consists of a function
+to check SITE and its options, call it. When a class attribute of the
+SITE is equal to the symbol `hns', call `w3m-antenna-check-hns'.
+Otherwise, call `w3m-antenna-check-page'."
+ (if (and (listp (w3m-antenna-site-class site))
+ (functionp (car (w3m-antenna-site-class site))))
+ (apply (car (w3m-antenna-site-class site))
+ site handler (cdr (w3m-antenna-site-class site)))
+ (if (eq 'hns (w3m-antenna-site-class site))
+ (w3m-antenna-check-hns site handler)
+ (w3m-antenna-check-page site
+ handler
+ (format-time-string (w3m-antenna-site-key site)
+ (current-time))))))
+
+(defun w3m-antenna-mapcar (function sequence handler)
+ "Apply FUNCTION to each element of SEQUENCE asynchronously, and make
+a list of the results."
+ (let ((index -1)
+ (table (make-symbol "table"))
+ (buffer (make-symbol "buffer")))
+ (set table (make-vector (length sequence) nil))
+ (set buffer (current-buffer))
+ (dolist (element sequence)
+ (aset (symbol-value table)
+ (incf index)
+ (funcall function
+ element
+ (cons `(lambda (x)
+ (aset ,table ,index x)
+ (w3m-antenna-mapcar-after ,table ,buffer))
+ handler))))
+ (w3m-antenna-mapcar-after (symbol-value table) (symbol-value buffer))))
+
+(defun w3m-antenna-mapcar-after (result buffer)
+ "Handler function of `w3m-antenna-mapcar'.
+If all asynchronous processes have finished, return a list of the
+results for the further handler functions. Otherwise, return an
+asynchronous process that has not finished yet."
+ (or (catch 'found-proces
+ (let ((index -1))
+ (while (< (incf index) (length result))
+ (when (w3m-process-p (aref result index))
+ (throw 'found-proces (aref result index))))))
+ (progn
+ (set-buffer buffer)
+ (append result nil))))
+
+(defun w3m-antenna-check-all-sites (&optional handler)
+ "Check all sites specified in `w3m-antenna-sites'."
+ (unless w3m-antenna-alist
+ (setq w3m-antenna-alist (w3m-antenna-alist)))
+ (if (not handler)
+ (w3m-process-with-wait-handler
+ (w3m-antenna-check-all-sites handler))
+ (w3m-process-do
+ (result
+ (w3m-antenna-mapcar 'w3m-antenna-check-site
+ w3m-antenna-alist
+ handler))
+ (prog1 w3m-antenna-alist
+ (w3m-save-list w3m-antenna-file w3m-antenna-alist)
+ (setq w3m-antenna-alist nil)))))
+
+(defun w3m-antenna-make-summary (site)
+ (format "<li><a href=\"%s\">%s</a> %s"
+ (or (w3m-antenna-site-url site)
+ (w3m-antenna-site-key site))
+ (w3m-antenna-site-title site)
+ (cond
+ ((w3m-antenna-site-last-modified site)
+ (current-time-string (w3m-antenna-site-last-modified site)))
+ ((w3m-antenna-site-size site) "Size")
+ (t ""))))
+
+(defun w3m-antenna-make-summary-like-natsumican (site)
+ (let ((t1 (w3m-antenna-site-last-modified site))
+ (t2 (w3m-antenna-site-size-detected site)))
+ (format "<li>%20s&nbsp;&nbsp;(%s)&nbsp;&nbsp;<a href=\"%s\">%s</a>"
+ (if (or t1 t2)
+ (format-time-string "%Y/%m/%d %R" (or t1 t2))
+ "----/--/-- --:--")
+ (cond
+ (t1 "T")
+ (t2 "S")
+ (t "?"))
+ (or (w3m-antenna-site-url site)
+ (w3m-antenna-site-key site))
+ (w3m-antenna-site-title site))))
+
+(defun w3m-antenna-sort-sites-by-time (sites)
+ (sort sites
+ (lambda (a b)
+ (w3m-time-newer-p
+ (or (w3m-antenna-site-last-modified a)
+ (w3m-antenna-site-size-detected a))
+ (or (w3m-antenna-site-last-modified b)
+ (w3m-antenna-site-size-detected b))))))
+
+(defun w3m-antenna-sort-sites-by-title (sites)
+ (sort sites
+ (lambda (a b)
+ (string< (w3m-antenna-site-title a)
+ (w3m-antenna-site-title b)))))
+
+(defun w3m-antenna-make-contents (changed-sites unchanged-sites)
+ (insert w3m-antenna-html-skelton)
+ (goto-char (point-min))
+ (while (re-search-forward "%\\(.\\)" nil t)
+ (let ((c (char-after (match-beginning 1))))
+ (cond
+ ((memq c '(?C ?U))
+ (save-restriction
+ (narrow-to-region (match-beginning 0) (match-end 0))
+ (delete-region (point-min) (point-max))
+ (goto-char (point-min))
+ (dolist (site (if (eq c ?C)
+ changed-sites
+ unchanged-sites))
+ (insert (funcall w3m-antenna-make-summary-function site)
+ "\n"))
+ (goto-char (point-max))))
+ ((eq c '?D)
+ (goto-char (match-beginning 0))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (let ((time (nth 5 (file-attributes w3m-antenna-file))))
+ (if time
+ (current-time-string time)
+ "(unknown)"))))
+ ((eq c '?R)
+ (save-restriction
+ (narrow-to-region (match-beginning 0) (match-end 0))
+ (delete-region (point-min) (point-max))
+ (when (and w3m-antenna-refresh-interval
+ (integerp w3m-antenna-refresh-interval)
+ (< 0 w3m-antenna-refresh-interval))
+ (insert (format "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"%d\">\n"
+ w3m-antenna-refresh-interval)))))))))
+
+;;;###autoload
+(defun w3m-about-antenna (url &optional no-decode no-cache
+ post-data referer handler)
+ (w3m-process-do
+ (alist (if no-cache
+ (w3m-antenna-check-all-sites handler)
+ (or w3m-antenna-alist (w3m-antenna-alist))))
+ (let (changed unchanged)
+ (dolist (site alist)
+ (if (w3m-time-newer-p (or (w3m-antenna-site-last-modified site)
+ (w3m-antenna-site-size-detected site))
+ (or (w3m-arrived-last-modified
+ (w3m-antenna-site-url site))
+ (w3m-arrived-time
+ (w3m-antenna-site-url site))))
+ (progn
+ (w3m-cache-remove (w3m-antenna-site-url site))
+ (push site changed))
+ (push site unchanged)))
+ (w3m-antenna-make-contents
+ (funcall w3m-antenna-sort-changed-sites-function (nreverse changed))
+ (funcall w3m-antenna-sort-unchanged-sites-function (nreverse unchanged)))
+ "text/html")))
+
+;;;###autoload
+(defun w3m-antenna (&optional no-cache)
+ "Report changes of WEB sites, which is specified in `w3m-antenna-sites'."
+ (interactive "P")
+ (w3m-goto-url "about://antenna/" no-cache))
+
+(defvar w3m-antenna-tmp-url nil)
+(defvar w3m-antenna-tmp-title nil)
+
+(defun w3m-antenna-add-current-url (&optional arg)
+ "Add link of current page to antenna.
+With prefix, ask new url to add instead of current page."
+ (interactive "P")
+ (w3m-antenna-add (if arg (w3m-input-url) w3m-current-url)
+ (w3m-encode-specials-string w3m-current-title)))
+
+(defun w3m-antenna-add (url &optional title)
+ "Add URL to antenna.
+Optional argument TITLE is title of link."
+ (setq w3m-antenna-tmp-url url)
+ (setq w3m-antenna-tmp-title title)
+ (customize-variable 'w3m-antenna-sites)
+ ;; dirty...
+ (goto-char (point-max))
+ (re-search-backward "INS")
+ (widget-button-press (point))
+ (re-search-forward "State:\\|\\(\\[State\\]:\\)")
+ (backward-char (if (match-beginning 1) 3 2)))
+
+(defvar w3m-antenna-mode-map
+ (let ((map (make-sparse-keymap)))
+ (substitute-key-definition 'w3m-edit-current-url 'w3m-antenna-edit
+ map w3m-mode-map)
+ map)
+ "*Keymap for `w3m-antenna-mode'.")
+
+(defvar w3m-antenna-mode nil "Non-nil if w3m antenna mode is enabled.")
+(make-variable-buffer-local 'w3m-antenna-mode)
+(unless (assq 'w3m-antenna-mode minor-mode-alist)
+ (push (list 'w3m-antenna-mode " antenna") minor-mode-alist))
+(unless (assq 'w3m-antenna-mode minor-mode-map-alist)
+ (push (cons 'w3m-antenna-mode w3m-antenna-mode-map) minor-mode-map-alist))
+
+(defun w3m-antenna-mode (&optional arg)
+ "\\<w3m-antenna-mode-map>
+Minor mode to edit antenna.
+
+\\[w3m-antenna-edit] Customize `w3m-antenna-sites'.
+"
+ (interactive "P")
+ (when (setq w3m-antenna-mode
+ (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not w3m-antenna-mode)))
+ (run-hooks 'w3m-antenna-mode-hook)))
+
+(defun w3m-antenna-mode-setter (url)
+ "Activate `w3m-antenna-mode', when visiting page shows antenna."
+ (w3m-antenna-mode (if (string-match "\\`about://antenna/" url)
+ (progn
+ (setq default-directory
+ (file-name-directory w3m-antenna-file))
+ 1)
+ 0)))
+(add-hook 'w3m-display-functions 'w3m-antenna-mode-setter)
+
+(defun w3m-antenna-edit ()
+ "Start customize of `w3m-antenna-sites'."
+ (interactive)
+ (customize-variable 'w3m-antenna-sites))
+
+(provide 'w3m-antenna)
+
+;;; w3m-antenna.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-bookmark.el b/share/emacs/site-lisp/w3m/w3m-bookmark.el
new file mode 100644
index 00000000000..09863b08d08
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-bookmark.el
@@ -0,0 +1,588 @@
+;;; w3m-bookmark.el --- Functions to operate bookmark file of w3m
+
+;; Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-bookmark.el is the add-on program of emacs-w3m to operate
+;; bookmark file. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(require 'w3m-util)
+(require 'w3m)
+(require 'easymenu)
+
+(defcustom w3m-bookmark-file
+ (expand-file-name "bookmark.html" w3m-profile-directory)
+ "Bookmark file of w3m."
+ :group 'w3m
+ :type '(file :size 0))
+
+(defcustom w3m-bookmark-file-coding-system 'euc-japan
+ "Coding system for a created bookmark file.
+This option is used when a new bookmark file is created, or when an
+existing bookmark file includes ASCII characters only. If the coding
+system which is used to encode your using bookmark file is different
+from the value of this option, emacs-w3m does not change the encoding
+of your bookmark file."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-bookmark-default-section
+ nil
+ "Default section to add new entry."
+ :group 'w3m
+ :type '(radio (const :tag "Not specified" nil)
+ (string :format "Default section name: %v\n" :size 0)))
+
+(defcustom w3m-bookmark-mode-hook nil
+ "*Hook run at the end of function `w3m-bookmark-mode'."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-bookmark-menu-open-new-session nil
+ "If non-nil, \"Bookmark\" menu item open new session."
+ :group 'w3m
+ :type 'boolean)
+
+(eval-and-compile
+ (defconst w3m-bookmark-section-delimiter
+ "<!--End of section (do not delete this comment)-->\n"))
+
+(eval-and-compile
+ (defconst w3m-bookmark-section-format
+ (eval-when-compile
+ (concat "<h2>%s</h2>\n<ul>\n"
+ "<li><a href=\"%s\">%s</a>\n"
+ w3m-bookmark-section-delimiter
+ "</ul>\n"))))
+
+(defconst w3m-bookmark-initial-format
+ (eval-when-compile
+ (concat "<html><head><title>Bookmarks</title></head>\n"
+ "<body>\n<h1>Bookmarks</h1>\n"
+ w3m-bookmark-section-format
+ "</body>\n</html>\n")))
+
+(defvar w3m-bookmark-section-history nil)
+(defvar w3m-bookmark-title-history nil)
+
+(defvar w3m-bookmark-buffer-file-name nil
+ "Non-nil means that `w3m-bookmark-file' has been loaded to this buffer.")
+(make-variable-buffer-local 'w3m-bookmark-buffer-file-name)
+
+(defvar w3m-bookmark-mode-map
+ (let ((map (make-sparse-keymap))
+ (table '((kill-line . w3m-bookmark-kill-entry)
+ (undo . w3m-bookmark-undo))))
+ (dolist (pair table)
+ (substitute-key-definition (car pair) (cdr pair) map global-map))
+ (substitute-key-definition 'w3m-edit-current-url 'w3m-bookmark-edit
+ map w3m-mode-map)
+ map)
+ "*Keymap for `w3m-bookmark-mode'.")
+
+(defvar w3m-bookmark-mode nil "Non-nil if w3m bookmark mode is enabled.")
+(make-variable-buffer-local 'w3m-bookmark-mode)
+(unless (assq 'w3m-bookmark-mode minor-mode-alist)
+ (push (list 'w3m-bookmark-mode " bookmark") minor-mode-alist))
+(unless (assq 'w3m-bookmark-mode minor-mode-map-alist)
+ (push (cons 'w3m-bookmark-mode w3m-bookmark-mode-map) minor-mode-map-alist))
+
+(defun w3m-bookmark-mode (&optional arg)
+ "\\<w3m-bookmark-mode-map>
+Minor mode to edit bookmark.
+
+\\[w3m-bookmark-kill-entry] Kill the current entry of this bookmark.
+\\[w3m-bookmark-undo] Undo some previous changes on this bookmark.
+\\[w3m-bookmark-edit] Open `w3m-bookmark-file'.
+"
+ (interactive "P")
+ (when (setq w3m-bookmark-mode
+ (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not w3m-bookmark-mode)))
+ (run-hooks 'w3m-bookmark-mode-hook)))
+
+(defun w3m-bookmark-mode-setter (url)
+ "Activate `w3m-bookmark-mode', when visiting page shows bookmark."
+ (w3m-bookmark-mode (if (string-match "\\`about://bookmark/" url)
+ (progn
+ (setq default-directory
+ (file-name-directory w3m-bookmark-file))
+ 1)
+ 0)))
+(add-hook 'w3m-display-functions 'w3m-bookmark-mode-setter)
+
+(defun w3m-bookmark-file-modtime ()
+ "Return the modification time of the bookmark file `w3m-bookmark-file'.
+The value is a list of two time values `(HIGH LOW)' if the bookmark
+file exists, otherwise nil."
+ (nth 5 (file-attributes w3m-bookmark-file)))
+
+(defun w3m-bookmark-buffer (&optional no-verify-modtime)
+ "Return the buffer reading `w3m-bookmark-file' current."
+ (let ((buffer (get-file-buffer w3m-bookmark-file)))
+ (if buffer
+ ;; When a buffer visiting `w3m-bookmark-file' is found, return
+ ;; it instead of a working buffer. In this case, kill the
+ ;; working buffer which was generated in the past.
+ (progn (w3m-kill-buffer " *w3m bookmark*") buffer)
+ ;; Generate a working buffer.
+ (with-current-buffer (w3m-get-buffer-create " *w3m bookmark*")
+ (unless (and w3m-bookmark-buffer-file-name
+ (or no-verify-modtime
+ (equal (w3m-visited-file-modtime)
+ (w3m-bookmark-file-modtime))))
+ (when (file-readable-p w3m-bookmark-file)
+ (buffer-disable-undo)
+ (erase-buffer)
+ (let ((coding-system-for-read 'binary))
+ (insert-file-contents w3m-bookmark-file))
+ (w3m-decode-buffer
+ (w3m-expand-file-name-as-url w3m-bookmark-file))
+ (set-buffer-file-coding-system
+ (if (memq w3m-current-coding-system
+ '(undecided undecided-dos undecided-mac undecided-unix))
+ w3m-bookmark-file-coding-system
+ w3m-current-coding-system))
+ (set-buffer-modified-p nil))
+ (setq w3m-bookmark-buffer-file-name w3m-bookmark-file)
+ (set-visited-file-modtime (or (w3m-bookmark-file-modtime)
+ ;; No bookmark file.
+ (with-temp-buffer
+ ;; 0 in Emacs; (0 . 0) in XEmacs
+ (visited-file-modtime))))
+ (buffer-enable-undo))
+ (current-buffer)))))
+
+(defun w3m-bookmark-verify-modtime ()
+ (unless (equal (w3m-visited-file-modtime)
+ (w3m-bookmark-file-modtime))
+ (if (buffer-file-name)
+ (ask-user-about-supersession-threat w3m-bookmark-file)
+ (let ((modified (buffer-modified-p))
+ (name (buffer-name)))
+ (unwind-protect
+ (progn
+ (set-visited-file-name w3m-bookmark-file)
+ (ask-user-about-supersession-threat w3m-bookmark-file))
+ (set-visited-file-name nil)
+ (rename-buffer name)
+ (set-buffer-modified-p modified))))))
+
+(defun w3m-bookmark-sections ()
+ "Return collection of registered sections."
+ (let (sections)
+ (with-current-buffer (w3m-bookmark-buffer)
+ (goto-char (point-min))
+ (while (search-forward "<h2>" nil t)
+ (push (cons (buffer-substring-no-properties
+ (point)
+ (if (search-forward "</h2>" nil t)
+ (match-beginning 0)
+ (point-at-eol)))
+ nil)
+ sections)))
+ (nreverse sections)))
+
+(defun w3m-bookmark-save-buffer ()
+ "Save this current buffer to `w3m-bookmark-file'."
+ (cond
+ ((buffer-file-name)
+ (basic-save-buffer))
+ ((buffer-modified-p)
+ (let ((backup-info (find-backup-file-name w3m-bookmark-file))
+ (modes (when (file-exists-p w3m-bookmark-file)
+ (file-modes w3m-bookmark-file))))
+ (when (and modes ; means that `w3m-bookmark-file' exists.
+ make-backup-files
+ (funcall backup-enable-predicate w3m-bookmark-file))
+ (rename-file w3m-bookmark-file (car backup-info) t))
+ (write-region (point-min) (point-max) w3m-bookmark-file)
+ (when modes
+ (set-file-modes w3m-bookmark-file modes))
+ (set-visited-file-modtime (w3m-bookmark-file-modtime))
+ (set-buffer-modified-p nil)
+ (dolist (file (cdr backup-info))
+ (condition-case ()
+ (delete-file file)
+ (file-error nil)))))))
+
+(defun w3m-bookmark-safe-string (string format)
+ (labels ((filter (s c) (decode-coding-string (encode-coding-string s c) c)))
+ (if (let ((encoding (w3m-static-when (featurep 'mule)
+ buffer-file-coding-system)))
+ (or (string= string (filter string encoding))
+ (when w3m-use-mule-ucs
+ (string= (setq string
+ (filter string
+ (if w3m-accept-japanese-characters
+ 'w3m-euc-japan
+ 'w3m-iso-latin-1)))
+ (filter string encoding)))))
+ string
+ (error format string))))
+
+(defun w3m-bookmark-write-file (url title section)
+ "Make new bookmark with specified spec, and save it."
+ (with-current-buffer (w3m-bookmark-buffer)
+ (setq title (w3m-bookmark-safe-string
+ title
+ "Specified title includes unsafe character(s): %s")
+ section (w3m-bookmark-safe-string
+ section
+ "Specified section includes unsafe character(s): %s"))
+ (if (zerop (buffer-size))
+ ;; New bookmark file.
+ (progn
+ (insert (format w3m-bookmark-initial-format section url title))
+ (set-buffer-file-coding-system w3m-bookmark-file-coding-system))
+ (goto-char (point-min))
+ (if (search-forward (format "<h2>%s</h2>" section) nil t)
+ (progn
+ (unless (search-forward w3m-bookmark-section-delimiter nil t)
+ (error "Can't find section delimiter: %s" section))
+ (goto-char (match-beginning 0))
+ (insert (format "<li><a href=\"%s\">%s</a>\n" url title)))
+ ;; New section.
+ (unless (search-forward "</body>\n" nil t)
+ (error "%s" "Can't find terminator of bookmark"))
+ (goto-char (match-beginning 0))
+ (insert (format w3m-bookmark-section-format
+ section url title))))
+ (w3m-bookmark-save-buffer)))
+
+(defun w3m-bookmark-add (url &optional title)
+ "Add URL to bookmark.
+Optional argument TITLE is title of link."
+ (let ((section (completing-read
+ (if w3m-bookmark-default-section
+ (format "Section (default %s): "
+ w3m-bookmark-default-section)
+ "Section: ")
+ (w3m-bookmark-sections) nil nil nil
+ 'w3m-bookmark-section-history)))
+ (and (string= section "")
+ (setq section w3m-bookmark-default-section))
+ (when (or (not section)
+ (string-match section "^ *$"))
+ (error "%s" "You must specify section name"))
+ (setq title (read-string "Title: " title 'w3m-bookmark-title-history))
+ (when (or (not title)
+ (string-match title "^ *$"))
+ (error "%s" "You must specify title"))
+ (w3m-bookmark-write-file url
+ (w3m-encode-specials-string title)
+ (w3m-encode-specials-string section))))
+
+;;;###autoload
+(defun w3m-bookmark-add-this-url ()
+ "Add link under cursor to bookmark."
+ (interactive)
+ (if (null (w3m-anchor))
+ (message "No anchor") ; nothing to do
+ (let ((url (w3m-anchor))
+ (title (buffer-substring-no-properties
+ (previous-single-property-change (1+ (point))
+ 'w3m-href-anchor)
+ (next-single-property-change (point) 'w3m-href-anchor))))
+ (w3m-bookmark-add url title))
+ (message "Added")))
+
+;;;###autoload
+(defun w3m-bookmark-add-current-url (&optional arg)
+ "Add a url of the current page to the bookmark.
+With prefix, ask for a new url instead of the present one."
+ (interactive "P")
+ (w3m-bookmark-add (if arg (w3m-input-url) w3m-current-url)
+ w3m-current-title)
+ (message "Added"))
+
+;;;###autoload
+(defun w3m-bookmark-add-all-urls ()
+ "Add urls of all pages being visited to the bookmark."
+ (interactive)
+ (let ((buffers (w3m-list-buffers)))
+ (if (and w3m-use-tab
+ (>= (length buffers) 2))
+ (while buffers
+ (switch-to-buffer (pop buffers))
+ (condition-case nil
+ (w3m-bookmark-add-current-url)
+ (quit)))
+ (message
+ "Use the `%s' command instead"
+ (key-description (car (where-is-internal 'w3m-bookmark-add-current-url
+ w3m-mode-map)))))))
+
+;;;###autoload
+(defun w3m-bookmark-add-current-url-group ()
+ "Add link of the group of current urls to the bookmark."
+ (interactive)
+ (w3m-bookmark-add
+ (concat "group:"
+ (mapconcat
+ 'w3m-url-encode-string
+ (mapcar (lambda (buffer)
+ (with-current-buffer buffer w3m-current-url))
+ (w3m-list-buffers))
+ "&")))
+ (message "Added as URL group"))
+
+;;;###autoload
+(defun w3m-bookmark-view (&optional reload)
+ "Display the bookmark."
+ (interactive "P")
+ (if (file-exists-p w3m-bookmark-file)
+ (w3m-goto-url "about://bookmark/" reload)
+ (message "No bookmark file is available")))
+
+;;;###autoload
+(defun w3m-bookmark-view-new-session (&optional reload)
+ "Display the bookmark on a new session."
+ (interactive "P")
+ (if (not (eq major-mode 'w3m-mode))
+ (message "This command can be used in w3m mode only")
+ (if (file-exists-p w3m-bookmark-file)
+ (w3m-view-this-url-1 "about://bookmark/" reload 'new-session)
+ (message "No bookmark file is available"))))
+
+;;;###autoload
+(defun w3m-about-bookmark (&rest args)
+ (insert-buffer-substring (w3m-bookmark-buffer))
+ (let ((ident) (i 0) (j 0))
+ (goto-char (point-min))
+ (while (search-forward (setq ident (format "w3mbk%d." i)) nil t)
+ (incf i))
+ (setq i 0)
+ (goto-char (point-min))
+ (while (re-search-forward "\n<\\(?:h2\\|\\(li\\)\\)>" nil t)
+ (forward-char -1)
+ (insert (if (match-beginning 1)
+ (format " id=\"%s%d.%d\"" ident i (incf j))
+ (format " id=\"%s%d\"" ident (incf i))))))
+ "text/html")
+
+(defun w3m-bookmark-current-number ()
+ "Return the ordinal number of the current bookmark entry."
+ (let ((x (car (get-text-property (point-at-eol) 'w3m-name-anchor))))
+ (and x
+ (string-match "\\`w3mbk[0-9]+\\.[0-9]+\\.\\([0-9]+\\)\\'" x)
+ (string-to-number (match-string 1 x)))))
+
+(defun w3m-bookmark-kill-entry (num)
+ "Kill the bookmark entry of the current line.
+With prefix argument, kill that many entries from point."
+ (interactive "p")
+ (let ((entries (w3m-bookmark-current-number)))
+ (when entries
+ (setq entries (list entries))
+ (while (> (decf num) 0)
+ (push (1+ (car entries)) entries))
+ (condition-case nil
+ (w3m-bookmark-kill-entries entries)
+ (file-supersession nil))
+ (w3m-bookmark-view t))))
+
+(defun w3m-bookmark-kill-entries (entries)
+ (with-current-buffer (w3m-bookmark-buffer t)
+ (w3m-bookmark-verify-modtime)
+ (goto-char (point-min))
+ (let ((i 0))
+ (while (search-forward "\n<li>" nil t)
+ (when (memq (incf i) entries)
+ (let ((beg (point-at-bol))
+ (end (progn
+ (search-forward w3m-bookmark-section-delimiter)
+ (match-beginning 0))))
+ (delete-region (goto-char beg)
+ (if (search-forward "\n<li>" end t)
+ (point-at-bol)
+ end))
+ (goto-char (1- beg))))))
+ (w3m-bookmark-save-buffer)))
+
+(defun w3m-bookmark-undo (&optional arg)
+ "Undo some previous changes on bookmark."
+ (interactive "p")
+ (condition-case nil
+ (with-current-buffer (w3m-bookmark-buffer t)
+ (w3m-bookmark-verify-modtime)
+ (undo arg)
+ (w3m-bookmark-save-buffer))
+ (file-supersession nil))
+ (w3m-bookmark-view t))
+
+(defun w3m-bookmark-edit ()
+ "Edit the bookmark file."
+ (interactive)
+ (w3m-edit-url (w3m-expand-file-name-as-url w3m-bookmark-file)))
+
+;; Bookmark menu
+(defvar w3m-bookmark-menu-items
+ (let ((etsu (when w3m-use-japanese-menu
+ (decode-coding-string "\e$B1\\\e(B" 'iso-2022-jp)))) ;; $B1\(B
+ `(([,(w3m-make-menu-item (concat "$B%V%C%/%^!<%/$N(B" etsu "$BMw(B") "View Bookmark")
+ w3m-bookmark-view t]
+ [,(w3m-make-menu-item (concat "$B?7%;%C%7%g%s$G%V%C%/%^!<%/$N(B" etsu "$BMw(B")
+ "View Bookmark in a New Session")
+ w3m-bookmark-view-new-session t]
+ [,(w3m-make-menu-item "$B%V%C%/%^!<%/$NJT=8(B" "Edit Bookmark")
+ w3m-bookmark-edit t]
+ "----"
+ [,(w3m-make-menu-item "$B$3$N%Z!<%8$r%V%C%/%^!<%/(B" "Add Current URL to Bookmark")
+ w3m-bookmark-add-current-url t]
+ [,(w3m-make-menu-item "$B$9$Y$F$N(B URL $B$r%V%C%/%^!<%/(B" "Add These URLs to Bookmark")
+ w3m-bookmark-add-current-url-group t]
+ [,(w3m-make-menu-item "$B$3$N(B URL $B$r%V%C%/%^!<%/(B" "Add This URL to Bookmark")
+ w3m-bookmark-add-this-url (w3m-anchor)])
+ .
+ ([,(w3m-make-menu-item "$B$3$N%(%s%H%j$r>C5n(B" "Kill Current Entry")
+ w3m-bookmark-kill-entry
+ (text-property-not-all (point-at-bol) (point-at-eol)
+ 'w3m-href-anchor nil)]
+ [,(w3m-make-menu-item "$B$b$H$KLa$9(B" "Undo")
+ w3m-bookmark-undo t]
+ [,(w3m-make-menu-item "$B%V%C%/%^!<%/$NJT=8(B" "Edit Bookmark")
+ w3m-bookmark-edit t])))
+ "*List of the bookmark menu items.
+The car is used if `w3m-bookmark-mode' is nil, otherwise the cdr is used.")
+
+;;;###autoload
+(defun w3m-setup-bookmark-menu ()
+ "Setup w3m bookmark items in menubar."
+ (w3m-static-if (featurep 'xemacs)
+ (unless (car (find-menu-item current-menubar '("Bookmark")))
+ (easy-menu-define w3m-bookmark-menu w3m-mode-map
+ "" '("Bookmark" ["(empty)" ignore nil]))
+ (easy-menu-add w3m-bookmark-menu)
+ (add-hook 'activate-menubar-hook 'w3m-bookmark-menubar-update))
+ (unless (lookup-key w3m-mode-map [menu-bar Bookmark])
+ (easy-menu-define w3m-bookmark-menu w3m-mode-map "" '("Bookmark"))
+ (easy-menu-add w3m-bookmark-menu)
+ (add-hook 'menu-bar-update-hook 'w3m-bookmark-menubar-update))))
+
+(defun w3m-bookmark-menubar-update ()
+ "Update w3m bookmark menubar."
+ (when (and (eq major-mode 'w3m-mode)
+ (w3m-static-if (featurep 'xemacs)
+ (frame-property (selected-frame) 'menubar-visible-p)
+ menu-bar-mode))
+ (let ((items (if w3m-bookmark-mode
+ (cdr w3m-bookmark-menu-items)
+ (car w3m-bookmark-menu-items)))
+ (pages (w3m-bookmark-make-menu-items)))
+ (easy-menu-define w3m-bookmark-menu w3m-mode-map
+ "The menu kepmap for the emacs-w3m bookmark."
+ (cons "Bookmark" (if pages
+ (append items '("----") pages)
+ items)))
+ (w3m-static-when (featurep 'xemacs)
+ (when (setq items (car (find-menu-item current-menubar '("Bookmark"))))
+ (setcdr items (cdr w3m-bookmark-menu))
+ (set-buffer-menubar current-menubar))))))
+
+(defun w3m-bookmark-iterator ()
+ "Iteration bookmark groups/entries.
+Format as (list (\"Group name\" . (\"Entry URL\" . \"Entry name\")* )* )."
+ (let ((entries nil))
+ (with-current-buffer (w3m-bookmark-buffer)
+ (goto-char (point-min))
+ (let (group entry beg end)
+ (while (re-search-forward "<h2>\\([^<]+\\)</h2>" nil t)
+ (setq group (match-string-no-properties 1))
+ (setq beg (match-beginning 0))
+ (setq end (re-search-forward "</ul>" nil t))
+ (save-excursion
+ (let (urls)
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<a href=\"\\([^\"]+\\)\">\\([^<]+\\)</a>"
+ nil t)
+ (push (cons (match-string-no-properties 1)
+ (match-string-no-properties 2))
+ urls))
+ (setq entry (cons group (nreverse urls)))
+ (push entry entries)
+ (widen)))
+ (goto-char (match-end 0))))
+ (nreverse entries))))
+
+(defun w3m-bookmark-menu-open-item (url)
+ "Open URL at current/new buffer"
+ (if w3m-bookmark-menu-open-new-session
+ (w3m-goto-url-new-session url)
+ (w3m-goto-url url)))
+
+(defvar w3m-bookmark-menu-items-pre nil)
+(defvar w3m-bookmark-menu-items-time nil)
+
+(defvar w3m-bookmark-make-item-xmas
+ (and (equal "Japanese" w3m-language) (featurep 'xemacs)))
+
+(defun w3m-bookmark-make-item (item)
+ (if w3m-bookmark-make-item-xmas
+ (concat item "%_ ")
+ item))
+
+(defun w3m-bookmark-make-menu-items (&optional nomenu)
+ "Create w3m bookmark menu items."
+ (when (not nomenu)
+ (if (and w3m-bookmark-menu-items-pre
+ w3m-bookmark-menu-items-time
+ (equal w3m-bookmark-menu-items-time
+ (w3m-bookmark-file-modtime)))
+ w3m-bookmark-menu-items-pre
+ (setq w3m-bookmark-menu-items-time (w3m-bookmark-file-modtime))
+ (let ((entries (when (file-exists-p w3m-bookmark-file)
+ (w3m-bookmark-iterator))))
+ (setq w3m-bookmark-menu-items-pre
+ (and entries
+ (mapcar
+ (lambda (entry)
+ (let ((group (car entry))
+ (items (cdr entry)))
+ (cons (w3m-bookmark-make-item group)
+ (and items
+ (mapcar
+ (lambda (item)
+ (vector
+ (w3m-bookmark-make-item (cdr item))
+ `(w3m-bookmark-menu-open-item
+ ,(car item))))
+ items)))))
+ entries)))))))
+
+(provide 'w3m-bookmark)
+
+;;; w3m-bookmark.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-bug.el b/share/emacs/site-lisp/w3m/w3m-bug.el
new file mode 100644
index 00000000000..a5d790b6cee
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-bug.el
@@ -0,0 +1,192 @@
+;;; w3m-bug.el --- command to report emacs-w3m bugs -*- coding: euc-japan -*-
+
+;; Copyright (C) 2002, 2003, 2005, 2007, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; `M-x report-emacs-w3m-bug' starts an email note to the emacs-w3m
+;; developers describing a problem.
+
+;;; Code:
+
+(defvar report-emacs-w3m-bug-address "emacs-w3m@namazu.org"
+ "*Address of mailing list for emacs-w3m bugs.")
+
+(defvar report-emacs-w3m-bug-no-explanations nil
+ "*If non-nil, suppress the explanations given for the sake of novice users.")
+
+(defconst report-emacs-w3m-bug-system-informations
+ (eval
+ '`(emacs-w3m-version
+ emacs-version
+ ,@(if (or (boundp 'mule-version)
+ (functionp 'mule-version))
+ '(mule-version))
+ ,@(cond ((featurep 'xemacs)
+ '((featurep 'mule)
+ (featurep 'file-coding)))
+ ((or (boundp 'Meadow-version)
+ (functionp 'Meadow-version))
+ '(Meadow-version)))
+ system-type
+ (featurep 'gtk)
+ w3m-version
+ w3m-type
+ w3m-compile-options
+ w3m-language
+ w3m-command-arguments
+ w3m-command-arguments-alist
+ w3m-command-environment
+ w3m-input-coding-system
+ w3m-output-coding-system
+ w3m-use-mule-ucs))
+ "List of the system informations. Users should NEVER modify the value."
+ ;; For the developers:
+ ;; It is possible that it would be a security hole. To prevent those
+ ;; rogue attacks, this constant should be reloaded for each time to
+ ;; send a bug report. Each element can be the symbol of a variable,
+ ;; a Lisp function with no argument or any Lisp form to be evaluated.
+ )
+
+(eval-when-compile
+ (require 'cl))
+
+(defun report-emacs-w3m-bug (topic &optional buffer)
+ "Report a bug in emacs-w3m.
+Prompts for bug subject. Leaves you in a mail buffer."
+ (interactive
+ (let* ((buffer (current-buffer))
+ (buffers (cons buffer (delq buffer (buffer-list))))
+ (inhibit-point-motion-hooks t)
+ keymap)
+ (save-current-buffer
+ (while buffers
+ (setq buffer (car buffers)
+ buffers (cdr buffers))
+ (set-buffer buffer)
+ (save-restriction
+ (widen)
+ (if (or (eq major-mode 'w3m-mode)
+ (and (keymapp (setq keymap
+ (or (get-text-property
+ (max (1- (point-max)) (point-min))
+ 'keymap)
+ (get-text-property
+ (max (1- (point-max)) (point-min))
+ 'local-map)))))
+ (where-is-internal 'w3m-print-current-url keymap))
+ (setq buffers nil)
+ (setq buffer nil)))))
+ (list (read-string "Bug Subject: ") buffer)))
+ (let (after-load-alist)
+ ;; See the comment for `report-emacs-w3m-bug-system-informations'.
+ (load "w3m-bug"))
+ (compose-mail report-emacs-w3m-bug-address topic nil 'new)
+ (goto-char (point-min))
+ (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
+ (forward-line 1)
+ (unless buffer
+ (insert
+ (if (and (boundp 'w3m-language)
+ (equal (symbol-value 'w3m-language) "Japanese"))
+ "¤â¤·²Äǽ¤Ê¤é emacs-w3m ¤òµ¯Æ°¤·¤Æ¤«¤é¤ä¤êľ¤·¤Æ¤¯¤À¤µ¤¤¡£\n"
+ "It is if possible, please redo after starting emacs-w3m.\n")
+ "\
+================================================================\n"))
+ (unless report-emacs-w3m-bug-no-explanations
+ ;; Insert warnings for the novice users.
+ (if (and (boundp 'w3m-language)
+ (equal (symbol-value 'w3m-language) "Japanese"))
+ (progn
+ (insert "¤³¤Î¥Ð¥°¥ê¥Ý¡¼¥È¤Ï emacs-w3m ³«È¯¥Á¡¼¥à¤ËÁ÷¤é¤ì¤Þ¤¹¡£\n")
+ (put-text-property (point)
+ (progn
+ (insert "\
+¤¢¤Ê¤¿¤Î¥í¡¼¥«¥ë¥µ¥¤¥È¤Î´ÉÍý¼Ô°¸¤Æ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó!!")
+ (point))
+ 'face 'underline)
+ (insert "\n\n¤Ç¤­¤ë¤À¤±´Ê·é¤Ë½Ò¤Ù¤Æ¤¯¤À¤µ¤¤:
+\t- ²¿¤¬µ¯¤­¤Þ¤·¤¿¤«?
+\t- ËÜÅö¤Ï¤É¤¦¤Ê¤ë¤Ù¤­¤À¤Ã¤¿¤È»×¤¤¤Þ¤¹¤«?
+\t- ¤½¤Î¤È¤­²¿¤ò¤·¤Þ¤·¤¿¤«? (Àµ³Î¤Ë)
+
+¤â¤· Lisp ¤Î¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤¬¤¢¤ì¤ÐźÉÕ¤·¤Æ¤¯¤À¤µ¤¤¡£\n"))
+ (insert "\
+This bug report will be sent to the emacs-w3m development team,\n")
+ (put-text-property (point)
+ (progn
+ (insert " not to your local site managers!!")
+ (point))
+ 'face 'italic)
+ (insert "\nPlease write in ")
+ (put-text-property (point) (progn
+ (insert "simple")
+ (point))
+ 'face 'italic)
+ (insert " English, because the emacs-w3m developers
+aren't good at English reading. ;-)
+
+Please describe as succinctly as possible:
+\t- What happened.
+\t- What you thought should have happened.
+\t- Precisely what you were doing at the time.
+
+Please also include any Lisp back-traces that you may have.\n"))
+ (insert "\
+================================================================\n"))
+ (insert "Dear Bug Team!\n\n")
+ (let ((user-point (point))
+ (print-escape-newlines t)
+ (print-quoted t)
+ infos print-length print-level)
+ (insert "\n
+================================================================
+
+System Info to help track down your bug:
+---------------------------------------\n")
+ (with-current-buffer (or buffer (current-buffer))
+ (dolist (info report-emacs-w3m-bug-system-informations)
+ (push (prin1-to-string info) infos)
+ (push "\n => " infos)
+ (push (cond ((functionp info)
+ (prin1-to-string (condition-case code
+ (funcall info)
+ (error
+ code))))
+ ((symbolp info)
+ (prin1-to-string (condition-case code
+ (symbol-value info)
+ (error
+ code))))
+ ((consp info)
+ (prin1-to-string (condition-case code
+ (eval info)
+ (error
+ code)))))
+ infos)
+ (push "\n" infos)))
+ (apply 'insert (nreverse infos))
+ (goto-char user-point)))
+
+;;; w3m-bug.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-ccl.el b/share/emacs/site-lisp/w3m/w3m-ccl.el
new file mode 100644
index 00000000000..e8bea09c0ec
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-ccl.el
@@ -0,0 +1,202 @@
+;;; w3m-ccl.el --- CCL programs to process Unicode and internal characters.
+
+;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file contains CCL programs to process Unicode and internal
+;; characters of w3m. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;;; MEMO:
+
+;; It is possible to support multi scripts without Mule-UCS. For more
+;; detail, see [emacs-w3m:01950]
+
+;;; Code:
+
+(eval-and-compile
+ (cond
+ ((featurep 'xemacs)
+ (require 'pccl))
+ (t
+ (require 'ccl))))
+
+;;; CCL programs:
+
+(eval-when-compile
+ (when (and (not (fboundp 'charset-id))
+ (fboundp 'charset-id-internal))
+ (defmacro charset-id (charset)
+ "Return charset identification number of CHARSET."
+ `(charset-id-internal ,charset))))
+
+(eval-and-compile
+ (defconst w3m-internal-characters-alist
+ '((?\x90 . ? ) ; ANSP (use for empty anchor)
+ (?\x91 . ? ) ; IMSP (blank around image)
+ (?\xa0 . ? )) ; NBSP (non breakble space)
+ "Alist of internal characters v.s. ASCII characters.")
+
+ (defun w3m-ccl-write-repeat (charset &optional r0 r1)
+ (unless r0
+ (setq r0 'r0))
+ (unless r1
+ (setq r1 (if (eq r0 'r1) 'r0 'r1)))
+ (let ((unibyte (memq charset '(latin-iso8859-1 katakana-jisx0201))))
+ (if (fboundp 'ccl-compile-write-multibyte-character)
+ `((,r1 &= ?\x7f)
+ ,@(unless unibyte
+ `((,r1 |= ((,r0 & ?\x7f) << 7))))
+ (,r0 = ,(charset-id charset))
+ (write-multibyte-character ,r0 ,r1)
+ (repeat))
+ `((write ,(charset-id charset))
+ ,@(unless unibyte
+ `((write ,r0)))
+ (write-repeat ,r1)))))
+
+ (defconst w3m-ccl-write-euc-japan-character
+ (when (fboundp 'ccl-compile-read-multibyte-character)
+ `((read-multibyte-character r1 r0)
+ (if (r1 == ,(charset-id 'ascii))
+ ;; (1) ASCII characters
+ (write-repeat r0))
+ (if (r1 == ,(charset-id 'latin-jisx0201))
+ ;; (2) Latin Part of Japanese JISX0201.1976
+ ;; Convert to ASCII
+ (write-repeat r0))
+ (r2 = (r1 == ,(charset-id 'japanese-jisx0208-1978)))
+ (if ((r1 == ,(charset-id 'japanese-jisx0208)) | r2)
+ ;; (3) Characters of Japanese JISX0208.
+ ((r1 = ((r0 & 127) | 128))
+ (r0 = ((r0 >> 7) | 128))
+ (write r0)
+ (write-repeat r1)))
+ (if (r1 == ,(charset-id 'katakana-jisx0201))
+ ;; (4) Katakana Part of Japanese JISX0201.1976
+ ((r0 |= 128)
+ (write ?\x8e)
+ (write-repeat r0)))))
+ "CCL program to write characters represented in `euc-japan'.")
+
+ (defconst w3m-ccl-write-iso-latin-1-character
+ (when (fboundp 'ccl-compile-read-multibyte-character)
+ `((read-multibyte-character r1 r0)
+ (if (r1 == ,(charset-id 'ascii))
+ ;; (1) ASCII characters
+ (write-repeat r0))
+ (if (r1 == ,(charset-id 'latin-jisx0201))
+ ;; (2) Latin Part of Japanese JISX0201.1976
+ ;; Convert to ASCII
+ (write-repeat r0))
+ (if (r1 == ,(charset-id 'latin-iso8859-1))
+ ;; (3) Latin-1 characters
+ ((r0 |= ?\x80)
+ (write-repeat r0)))))
+ "CCL program to write characters represented in `iso-latin-1'.")
+
+ (defconst w3m-ccl-generate-ncr
+ `((r1 = 0)
+ (r2 = 0)
+ (loop
+ (r1 = (r1 << 4))
+ (r1 |= (r0 & 15))
+ (r0 = (r0 >> 4))
+ (if (r0 == 0)
+ (break)
+ ((r2 += 1)
+ (repeat))))
+ (write "&#x")
+ (loop
+ (branch (r1 & 15)
+ ,@(mapcar
+ (lambda (i)
+ (list 'write (string-to-char (format "%x" i))))
+ '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
+ (r1 = (r1 >> 4))
+ (if (r2 == 0)
+ ((write ?\;)
+ (break))
+ ((r2 -= 1)
+ (repeat))))
+ (repeat))
+ "CCL program to generate a string which represents a UCS codepoint
+in NCR (Numeric Character References)."))
+
+(define-ccl-program w3m-euc-japan-decoder
+ `(2
+ (loop
+ (read r0)
+ ;; Process normal EUC characters.
+ (if (r0 < ?\x80)
+ (write-repeat r0))
+ (if (r0 > ?\xa0)
+ ((read r1)
+ ,@(w3m-ccl-write-repeat 'japanese-jisx0208)))
+ (if (r0 == ?\x8e)
+ ((read r1)
+ ,@(w3m-ccl-write-repeat 'katakana-jisx0201)))
+ (if (r0 == ?\x8f)
+ ((read r0)
+ (read r1)
+ ,@(w3m-ccl-write-repeat 'japanese-jisx0212)))
+ ;; Process internal characters used in w3m.
+ ,@(mapcar (lambda (pair)
+ `(if (r0 == ,(car pair))
+ (write-repeat ,(cdr pair))))
+ w3m-internal-characters-alist)
+ (write-repeat r0))))
+
+(unless (get 'w3m-euc-japan-encoder 'ccl-program-idx)
+ (define-ccl-program w3m-euc-japan-encoder
+ `(1 (loop (read r0) (write-repeat r0)))))
+
+(define-ccl-program w3m-iso-latin-1-decoder
+ `(2
+ (loop
+ (read r0)
+ ;; Process ASCII characters.
+ (if (r0 < ?\x80)
+ (write-repeat r0))
+ ;; Process Latin-1 characters.
+ (if (r0 > ?\xa0)
+ (,@(w3m-ccl-write-repeat 'latin-iso8859-1 'r1)))
+ ;; Process internal characters used in w3m.
+ ,@(mapcar (lambda (pair)
+ `(if (r0 == ,(car pair))
+ (write-repeat ,(cdr pair))))
+ w3m-internal-characters-alist)
+ (write-repeat r0))))
+
+(unless (get 'w3m-iso-latin-1-encoder 'ccl-program-idx)
+ (define-ccl-program w3m-iso-latin-1-encoder
+ `(1 (loop (read r0) (write-repeat r0)))))
+
+
+(provide 'w3m-ccl)
+
+;;; w3m-ccl.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-cookie.el b/share/emacs/site-lisp/w3m/w3m-cookie.el
new file mode 100644
index 00000000000..f79ff5cf71a
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-cookie.el
@@ -0,0 +1,578 @@
+;;; w3m-cookie.el --- Functions for cookie processing
+
+;; Copyright (C) 2002, 2003, 2005, 2006, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Teranishi Yuuichi <teranisi@gohome.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file contains the functions for cookies. For more detail
+;; about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;; Reference for version 0 cookie:
+;; http://www.netscape.com/newsref/std/cookie_spec.html
+;; Reference for version 1 cookie:
+;; http://www.ietf.org/rfc/rfc2965.txt
+;;
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+(require 'w3m)
+
+(defvar w3m-cookies nil
+ "A list of cookie elements.
+Currently only browser local cookies are stored.")
+
+(defconst w3m-cookie-two-dot-domains-regexp
+ (concat "\\.\\(?:"
+ (mapconcat 'identity (list "com" "edu" "net" "org" "gov" "mil" "int")
+ "\\|")
+ "\\)$")
+ "A regular expression of top-level domains that only require two matching
+'.'s in the domain name in order to set a cookie.")
+
+(defcustom w3m-cookie-accept-domains nil
+ "A list of trusted domain name string."
+ :group 'w3m
+ :type '(repeat (string :format "Domain name: %v\n" :size 0)))
+
+(defcustom w3m-cookie-reject-domains nil
+ "A list of untrusted domain name string."
+ :group 'w3m
+ :type '(repeat (string :format "Domain name: %v\n" :size 0)))
+
+(defcustom w3m-cookie-accept-bad-cookies nil
+ "If nil, don't accept bad cookies.
+If t, accept bad cookies.
+If ask, ask user whether accept bad cookies or not."
+ :group 'w3m
+ :type '(radio
+ (const :tag "Don't accept bad cookies" nil)
+ (const :tag "Ask accepting bad cookies" ask)
+ (const :tag "Always accept bad cookies" t)))
+
+(defcustom w3m-cookie-save-cookies t
+ "*Non-nil means save cookies when emacs-w3m cookie system shutdown."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-cookie-file
+ (expand-file-name ".cookie" w3m-profile-directory)
+ "File in which cookies are kept."
+ :group 'w3m
+ :type '(file :size 0))
+
+;;; Cookie accessor.
+(defmacro w3m-cookie-url (cookie)
+ `(aref ,cookie 0))
+(defmacro w3m-cookie-domain (cookie)
+ `(aref ,cookie 1))
+(defmacro w3m-cookie-secure (cookie)
+ `(aref ,cookie 2))
+(defmacro w3m-cookie-name (cookie)
+ `(aref ,cookie 3))
+(defmacro w3m-cookie-value (cookie)
+ `(aref ,cookie 4))
+(defmacro w3m-cookie-path (cookie)
+ `(aref ,cookie 5))
+(defmacro w3m-cookie-version (cookie)
+ `(aref ,cookie 6))
+(defmacro w3m-cookie-expires (cookie)
+ `(aref ,cookie 7))
+(defmacro w3m-cookie-ignore (cookie)
+ `(aref ,cookie 8))
+
+(defun w3m-cookie-create (&rest args)
+ (let ((cookie (make-vector 9 nil)))
+ (setf (w3m-cookie-url cookie) (plist-get args :url))
+ (setf (w3m-cookie-domain cookie) (plist-get args :domain))
+ (setf (w3m-cookie-secure cookie) (plist-get args :secure))
+ (setf (w3m-cookie-name cookie) (plist-get args :name))
+ (setf (w3m-cookie-value cookie) (plist-get args :value))
+ (setf (w3m-cookie-path cookie) (plist-get args :path))
+ (setf (w3m-cookie-version cookie) (or (plist-get args :version) 0))
+ (setf (w3m-cookie-expires cookie) (plist-get args :expires))
+ (setf (w3m-cookie-ignore cookie) (plist-get args :ignore))
+ cookie))
+
+(defun w3m-cookie-store (cookie)
+ "Store COOKIE."
+ (let (ignored)
+ (catch 'found
+ (dolist (c w3m-cookies)
+ (when (and (string= (w3m-cookie-domain c)
+ (w3m-cookie-domain cookie))
+ (string= (w3m-cookie-path c)
+ (w3m-cookie-path cookie))
+ (string= (w3m-cookie-name c)
+ (w3m-cookie-name cookie)))
+ (if (w3m-cookie-ignore c)
+ (setq ignored t)
+ (setq w3m-cookies (delq c w3m-cookies)))
+ (throw 'found t))))
+ (unless ignored
+ (push cookie w3m-cookies))))
+
+(defun w3m-cookie-remove (domain path name)
+ "Remove COOKIE if stored."
+ (dolist (c w3m-cookies)
+ (when (and (string= (w3m-cookie-domain c)
+ domain)
+ (string= (w3m-cookie-path c)
+ path)
+ (string= (w3m-cookie-name c)
+ name))
+ (setq w3m-cookies (delq c w3m-cookies)))))
+
+(defun w3m-cookie-retrieve (host path &optional secure)
+ "Retrieve cookies for DOMAIN and PATH."
+ (let ((case-fold-search t)
+ expires cookies)
+ (dolist (c w3m-cookies)
+ (if (and (w3m-cookie-expires c)
+ (w3m-time-newer-p (current-time)
+ (w3m-time-parse-string
+ (w3m-cookie-expires c))))
+ (push c expires)
+ (when (and (not (w3m-cookie-ignore c))
+ (or
+ ;; A special case that domain name is ".hostname".
+ (string= (concat "." host) (w3m-cookie-domain c))
+ (string-match (concat
+ (regexp-quote (w3m-cookie-domain c)) "$")
+ host))
+ (string-match (concat
+ "^" (regexp-quote (w3m-cookie-path c)))
+ path))
+ (if (w3m-cookie-secure c)
+ (if secure
+ (push c cookies))
+ (push c cookies)))))
+ ;; Delete expired cookies.
+ (dolist (expire expires)
+ (setq w3m-cookies (delq expire w3m-cookies)))
+ cookies))
+
+;; HTTP URL parser.
+(defun w3m-parse-http-url (url)
+ "Parse an absolute HTTP URL."
+ (let (secure split)
+ (w3m-string-match-url-components url)
+ (when (and (match-beginning 4)
+ (or (equal (match-string 2 url) "http")
+ (setq secure (equal (match-string 2 url) "https"))))
+ (setq split (save-match-data
+ (split-string (match-string 4 url) ":")))
+ (vector secure
+ (nth 0 split)
+ (string-to-number (or (nth 1 split) "80"))
+ (if (eq (length (match-string 5 url)) 0)
+ "/"
+ (match-string 5 url))))))
+
+(defsubst w3m-http-url-secure (http-url)
+ "Secure flag of the HTTP-URL."
+ (aref http-url 0))
+
+(defsubst w3m-http-url-host (http-url)
+ "Host name of the HTTP-URL."
+ (aref http-url 1))
+
+(defsubst w3m-http-url-port (http-url)
+ "Port number of the HTTP-URL."
+ (aref http-url 2))
+
+(defsubst w3m-http-url-path (http-url)
+ "Path of the HTTP-URL."
+ (aref http-url 3))
+
+;;; Cookie parser.
+(defvar w3m-cookie-parse-args-syntax-table
+ (copy-syntax-table emacs-lisp-mode-syntax-table)
+ "A syntax table for parsing sgml attributes.")
+
+(modify-syntax-entry ?' "\"" w3m-cookie-parse-args-syntax-table)
+(modify-syntax-entry ?` "\"" w3m-cookie-parse-args-syntax-table)
+(modify-syntax-entry ?{ "(" w3m-cookie-parse-args-syntax-table)
+(modify-syntax-entry ?} ")" w3m-cookie-parse-args-syntax-table)
+
+(defun w3m-cookie-parse-args (str &optional nodowncase)
+ (let (name value results name-pos val-pos)
+ (with-current-buffer (get-buffer-create " *w3m-cookie-parse-temp*")
+ (erase-buffer)
+ (set-syntax-table w3m-cookie-parse-args-syntax-table)
+ (insert str)
+ (goto-char (point-min))
+ (while (not (eobp))
+ (skip-chars-forward "; \n\t")
+ (setq name-pos (point))
+ (skip-chars-forward "^ \n\t=;")
+ (unless nodowncase
+ (downcase-region name-pos (point)))
+ (setq name (buffer-substring name-pos (point)))
+ (skip-chars-forward " \t\n")
+ (if (/= (or (char-after (point)) 0) ?=) ; There is no value
+ (setq value nil)
+ (skip-chars-forward " \t\n=")
+ (setq val-pos (point)
+ value
+ (cond
+ ((or (= (or (char-after val-pos) 0) ?\")
+ (= (or (char-after val-pos) 0) ?'))
+ (buffer-substring (1+ val-pos)
+ (condition-case ()
+ (prog2
+ (forward-sexp 1)
+ (1- (point))
+ (skip-chars-forward "\""))
+ (error
+ (skip-chars-forward "^ \t\n")
+ (point)))))
+ (t
+ (buffer-substring val-pos
+ (progn
+ (skip-chars-forward "^;")
+ (skip-chars-backward " \t")
+ (point)))))))
+ (push (cons name value) results)
+ (skip-chars-forward "; \n\t"))
+ results)))
+
+(defun w3m-cookie-trusted-host-p (host)
+ "Returns non-nil when the HOST is specified as trusted by user."
+ (let ((accept w3m-cookie-accept-domains)
+ (reject w3m-cookie-reject-domains)
+ (trusted t)
+ regexp tlen rlen)
+ (while accept
+ (cond
+ ((string= (car accept) ".")
+ (setq regexp ".*"))
+ ((string= (car accept) ".local")
+ (setq regexp "^[^\\.]+$"))
+ ((eq (string-to-char (car accept)) ?.)
+ (setq regexp (concat (regexp-quote (car accept)) "$")))
+ (t (setq regexp (concat "^" (regexp-quote (car accept)) "$"))))
+ (when (string-match regexp host)
+ (setq tlen (length (car accept))
+ accept nil))
+ (pop accept))
+ (while reject
+ (cond
+ ((string= (car reject) ".")
+ (setq regexp ".*"))
+ ((string= (car reject) ".local")
+ (setq regexp "^[^\\.]+$"))
+ ((eq (string-to-char (car reject)) ?.)
+ (setq regexp (concat (regexp-quote (car reject)) "$")))
+ (t (setq regexp (concat "^" (regexp-quote (car reject)) "$"))))
+ (when (string-match (concat regexp "$") host)
+ (setq rlen (length (car reject))
+ reject nil))
+ (pop reject))
+ (if tlen
+ (if rlen
+ (if (<= tlen rlen)
+ (setq trusted nil)))
+ (if rlen
+ (setq trusted nil)))
+ trusted))
+
+;;; Version 0 cookie.
+(defun w3m-cookie-1-acceptable-p (host domain)
+ (let ((numdots 0)
+ (last nil)
+ (case-fold-search t)
+ (mindots 3))
+ (while (setq last (string-match "\\." domain last))
+ (setq numdots (1+ numdots)
+ last (1+ last)))
+ (if (string-match w3m-cookie-two-dot-domains-regexp domain)
+ (setq mindots 2))
+ (cond
+ ((string= host domain) ; Apparently netscape lets you do this
+ t)
+ ;; A special case that domain name is ".hostname".
+ ((string= (concat "." host) domain)
+ t)
+ ((>= numdots mindots) ; We have enough dots in domain name
+ ;; Need to check and make sure the host is actually _in_ the
+ ;; domain it wants to set a cookie for though.
+ (string-match (concat (regexp-quote domain) "$") host))
+ (t
+ nil))))
+
+(defun w3m-cookie-1-set (url &rest args)
+ ;; Set-Cookie:, version 0 cookie.
+ (let ((http-url (w3m-parse-http-url url))
+ (case-fold-search t)
+ secure domain expires path rest)
+ (when http-url
+ (setq secure (and (w3m-assoc-ignore-case "secure" args) t)
+ domain (or (cdr-safe (w3m-assoc-ignore-case "domain" args))
+ (w3m-http-url-host http-url))
+ expires (cdr-safe (w3m-assoc-ignore-case "expires" args))
+ path (or (cdr-safe (w3m-assoc-ignore-case "path" args))
+ (file-name-directory
+ (w3m-http-url-path http-url))))
+ (while args
+ (if (not (member (downcase (car (car args)))
+ '("secure" "domain" "expires" "path")))
+ (setq rest (cons (car args) rest)))
+ (setq args (cdr args)))
+ (cond
+ ((not (w3m-cookie-trusted-host-p (w3m-http-url-host http-url)))
+ ;; The site was explicity marked as untrusted by the user
+ nil)
+ ((or (w3m-cookie-1-acceptable-p (w3m-http-url-host http-url) domain)
+ (eq w3m-cookie-accept-bad-cookies t)
+ (and (eq w3m-cookie-accept-bad-cookies 'ask)
+ (y-or-n-p (format "Accept bad cookie from %s for %s? "
+ (w3m-http-url-host http-url) domain))))
+ ;; Cookie is accepted by the user, and passes our security checks
+ (dolist (elem rest)
+ ;; If a CGI script wishes to delete a cookie, it can do so by
+ ;; returning a cookie with the same name, and an expires time
+ ;; which is in the past.
+ (when (and expires
+ (w3m-time-newer-p (current-time)
+ (w3m-time-parse-string expires)))
+ (w3m-cookie-remove domain path (car elem)))
+ (w3m-cookie-store
+ (w3m-cookie-create :url url
+ :domain domain
+ :name (car elem)
+ :value (cdr elem)
+ :path path
+ :expires expires
+ :secure secure))))
+ (t
+ (message "%s tried to set a cookie for domain %s - rejected."
+ (w3m-http-url-host http-url) domain))))))
+
+;;; Version 1 cookie.
+(defun w3m-cookie-2-acceptable-p (http-url domain)
+ ;; A user agent rejects (SHALL NOT store its information) if the Version
+ ;; attribute is missing. Moreover, a user agent rejects (SHALL NOT
+ ;; store its information) if any of the following is true of the
+ ;; attributes explicitly present in the Set-Cookie2 response header:
+
+ ;; * The value for the Path attribute is not a prefix of the
+ ;; request-URI.
+
+ ;; * The value for the Domain attribute contains no embedded dots,
+ ;; and the value is not .local.
+
+ ;; * The effective host name that derives from the request-host does
+ ;; not domain-match the Domain attribute.
+
+ ;; * The request-host is a HDN (not IP address) and has the form HD,
+ ;; where D is the value of the Domain attribute, and H is a string
+ ;; that contains one or more dots.
+
+ ;; * The Port attribute has a "port-list", and the request-port was
+ ;; not in the list.
+ )
+
+(defun w3m-cookie-2-set (url &rest args)
+ ;; Set-Cookie2:, version 1 cookie.
+ ;; Not implemented yet.
+ )
+
+
+;;; Save & Load
+(defvar w3m-cookie-init nil)
+
+(defun w3m-cookie-clear ()
+ "Clear cookie list."
+ (setq w3m-cookies nil))
+
+(defun w3m-cookie-save (&optional domain)
+ "Save cookies.
+When DOMAIN is non-nil, only save cookies whose domains match it."
+ (interactive)
+ (let (cookies)
+ (dolist (cookie w3m-cookies)
+ (when (and (or (not domain)
+ (string= (w3m-cookie-domain cookie) domain))
+ (w3m-cookie-expires cookie)
+ (w3m-time-newer-p (w3m-time-parse-string
+ (w3m-cookie-expires cookie))
+ (current-time)))
+ (push cookie cookies)))
+ (w3m-save-list w3m-cookie-file cookies)))
+
+(defun w3m-cookie-save-current-site-cookies ()
+ "Save cookies for the current site."
+ (interactive)
+ (when (and w3m-current-url
+ (not (w3m-url-local-p w3m-current-url)))
+ (w3m-string-match-url-components w3m-current-url)
+ (w3m-cookie-save (match-string 4 w3m-current-url))))
+
+(defun w3m-cookie-load ()
+ "Load cookies."
+ (when (null w3m-cookies)
+ (setq w3m-cookies
+ (w3m-load-list w3m-cookie-file))))
+
+(defun w3m-cookie-setup ()
+ "Setup cookies. Returns immediataly if already initialized."
+ (interactive)
+ (unless w3m-cookie-init
+ (w3m-cookie-load)
+ (setq w3m-cookie-init t)))
+
+;;;###autoload
+(defun w3m-cookie-shutdown ()
+ "Save cookies, and reset cookies' data."
+ (interactive)
+ (when w3m-cookie-save-cookies
+ (w3m-cookie-save))
+ (setq w3m-cookie-init nil)
+ (w3m-cookie-clear)
+ (if (get-buffer " *w3m-cookie-parse-temp*")
+ (kill-buffer (get-buffer " *w3m-cookie-parse-temp*"))))
+
+;;;###autoload
+(defun w3m-cookie-set (url beg end)
+ "Register cookies which correspond to URL.
+BEG and END should be an HTTP response header region on current buffer."
+ (w3m-cookie-setup)
+ (when (and url beg end)
+ (save-excursion
+ (let ((case-fold-search t)
+ (version 0)
+ data)
+ (goto-char beg)
+ (while (re-search-forward
+ "^\\(?:Set-Cookie\\(2\\)?:\\) *\\(.*\\(?:\n[ \t].*\\)*\\)\n"
+ end t)
+ (setq data (match-string 2))
+ (if (match-beginning 1)
+ (setq version 1))
+ (apply
+ (case version
+ (0 'w3m-cookie-1-set)
+ (1 'w3m-cookie-2-set))
+ url (w3m-cookie-parse-args data 'nodowncase)))))))
+
+;;;###autoload
+(defun w3m-cookie-get (url)
+ "Get a cookie field string which corresponds to the URL."
+ (w3m-cookie-setup)
+ (let* ((http-url (w3m-parse-http-url url))
+ (cookies (and http-url
+ (w3m-cookie-retrieve (w3m-http-url-host http-url)
+ (w3m-http-url-path http-url)
+ (w3m-http-url-secure http-url)))))
+ ;; When sending cookies to a server, all cookies with a more specific path
+ ;; mapping should be sent before cookies with less specific path mappings.
+ (setq cookies (sort cookies
+ (lambda (x y)
+ (< (length (w3m-cookie-path x))
+ (length (w3m-cookie-path y))))))
+ (when cookies
+ (mapconcat (lambda (cookie)
+ (concat (w3m-cookie-name cookie)
+ "=" (w3m-cookie-value cookie)))
+ cookies
+ "; "))))
+
+;;;###autoload
+(defun w3m-cookie (&optional no-cache)
+ "Display cookies and enable you to manage them."
+ (interactive "P")
+ (w3m-goto-url "about://cookie/" no-cache))
+
+;;;###autoload
+(defun w3m-about-cookie (url &optional no-decode no-cache post-data &rest args)
+ "Make the html contents to display and to enable you to manage cookies."
+ (unless w3m-use-cookies (error "You must enable emacs-w3m to use cookies."))
+ (w3m-cookie-setup)
+ (let ((pos 0))
+ (when post-data
+ (dolist (pair (split-string post-data "&"))
+ (setq pair (split-string pair "="))
+ (setf (w3m-cookie-ignore
+ (nth (string-to-number (car pair)) w3m-cookies))
+ (eq (string-to-number (cadr pair)) 0))))
+ (insert
+ (concat
+ "\
+<html><head><title>Cookies</title></head>
+<body><center><b>Cookies</b></center>
+<p><form method=\"post\" action=\"about://cookie/\">
+<ol>"))
+ (dolist (cookie w3m-cookies)
+ (insert
+ (concat
+ "<li><h1><a href=\""
+ (w3m-cookie-url cookie)
+ "\">"
+ (w3m-cookie-url cookie)
+ "</a></h1>"
+ "<table cellpadding=0>"
+ "<tr><td width=\"80\"><b>Cookie:</b></td><td>"
+ (w3m-cookie-name cookie) "=" (w3m-cookie-value cookie)
+ "</td></tr>"
+ (when (w3m-cookie-expires cookie)
+ (concat
+ "<tr><td width=\"80\"><b>Expires:</b></td><td>"
+ (w3m-cookie-expires cookie)
+ "</td></tr>"))
+ "<tr><td width=\"80\"><b>Version:</b></td><td>"
+ (number-to-string (w3m-cookie-version cookie))
+ "</td></tr>"
+ (when (w3m-cookie-domain cookie)
+ (concat
+ "<tr><td width=\"80\"><b>Domain:</b></td><td>"
+ (w3m-cookie-domain cookie)
+ "</td></tr>"))
+ (when (w3m-cookie-path cookie)
+ (concat
+ "<tr><td width=\"80\"><b>Path:</b></td><td>"
+ (w3m-cookie-path cookie)
+ "</td></tr>"))
+ "<tr><td width=\"80\"><b>Secure:</b></td><td>"
+ (if (w3m-cookie-secure cookie) "Yes" "No")
+ "</td></tr><tr><td>"
+ "<tr><td width=\"80\"><b>Use:</b></td><td>"
+ (format "<input type=radio name=\"%d\" value=1%s>Yes"
+ pos (if (w3m-cookie-ignore cookie) "" " checked"))
+ "&nbsp;&nbsp;"
+ (format "<input type=radio name=\"%d\" value=0%s>No"
+ pos (if (w3m-cookie-ignore cookie) " checked" ""))
+ "</td></tr><tr><td><input type=submit value=\"OK\"></table><p>"))
+ (setq pos (1+ pos)))
+ (insert "</ol></form></body></html>")
+ "text/html"))
+
+(provide 'w3m-cookie)
+
+;;; w3m-cookie.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-dtree.el b/share/emacs/site-lisp/w3m/w3m-dtree.el
new file mode 100644
index 00000000000..5bfe5355e68
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-dtree.el
@@ -0,0 +1,239 @@
+;;; w3m-dtree.el --- The add-on program to display local directory tree.
+
+;; Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: Hideyuki SHIRAI <shirai@meadowy.org>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia, directory, tree
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-dtree.el is the add-on program of emacs-w3m to display local
+;; directory tree. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; Code:
+(require 'w3m)
+
+(defcustom w3m-dtree-default-allfiles nil
+ "*If non-nil, set 'allfiles' to default."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-dtree-directory-depth 8
+ "*Interger of a depth of the viewing directory."
+ :group 'w3m
+ :type '(choice
+ (const :tag "No limit" nil)
+ (integer :format "%t: %v\n" :size 0 :tag "depth" 10)))
+
+(defcustom w3m-dtree-indent-strings ["|-" "+-" "| " " "]
+ "*Vector of strings to be used for indentation with w3m-dtree.
+
+If use default value or choice 'ASCII', display like this,
+/home/shirai/work/emacs-w3m/
+ |-CVS/
+ |-icons/
+ | +-CVS/
+ +-shimbun/
+ +-CVS/
+
+If you care for another style, set manually and try it :-).
+"
+ :group 'w3m
+ :type '(radio
+ (const :format "ASCII: " ["|-" "+-" "| " " "])
+ (vector
+ :convert-widget w3m-widget-type-convert-widget
+ (let ((defaults (if (equal w3m-language "Japanese")
+ (vconcat
+ (mapcar
+ (lambda (s)
+ (decode-coding-string s 'iso-2022-7bit))
+ '("\e$B('\e(B" "\e$B(&\e(B"
+ "\e$B(\"\e(B" "\e$B!!\e(B")))
+ ["|-" "+-" "| " " "])))
+ `(:format "Others:\n%v" :indent 4
+ (string :format "%{|-%} %v\n"
+ :sample-face widget-field-face :size 0
+ :value ,(aref defaults 0))
+ (string :format "%{+-%} %v\n"
+ :sample-face widget-field-face :size 0
+ :value ,(aref defaults 1))
+ (string :format "%{| %} %v\n"
+ :sample-face widget-field-face :size 0
+ :value ,(aref defaults 2))
+ (string :format "%{ %} %v"
+ :sample-face widget-field-face :size 0
+ :value ,(aref defaults 3)))))))
+
+(defcustom w3m-dtree-stop-strings ["|=" "+="]
+ "*Vector of strings to be used for indentation when a depth of directory
+over the 'w3m-dtree-directory-depth'."
+ :group 'w3m
+ :type '(radio
+ (const :format "ASCII: " ["|=" "+="])
+ (const :format "ASCII Bold: " ["<b>|-</b>" "<b>+-</b>"])
+ (vector
+ :convert-widget w3m-widget-type-convert-widget
+ (let ((defaults (if (equal w3m-language "Japanese")
+ (vconcat
+ (mapcar
+ (lambda (s)
+ (decode-coding-string s 'iso-2022-7bit))
+ '("\e$B(<\e(B" "\e$B(1\e(B")))
+ ["|=" "+="])))
+ `(:format "Others:\n%v" :indent 4
+ (string :format "|= %{|=%} %v\n"
+ :sample-face bold :size 0
+ :value ,(aref defaults 0))
+ (string :format "+= %{+=%} %v\n"
+ :sample-face bold :size 0
+ :value ,(aref defaults 1)))))))
+
+(defun w3m-dtree-expand-file-name (path)
+ (if (string-match "^\\(.\\):\\(.*\\)" path)
+ (if w3m-use-cygdrive
+ (concat "/cygdrive/"
+ (match-string 1 path) (match-string 2 path))
+ (concat "/" (match-string 1 path) "|" (match-string 2 path)))
+ path))
+
+(defun w3m-dtree-directory-name (path)
+ (when (and w3m-treat-drive-letter
+ (string-match
+ "^/\\(?:\\([A-Za-z]\\)[|:]?\\|cygdrive/\\([A-Za-z]\\)\\)/"
+ path))
+ (setq path (concat
+ (or (match-string 1 path)
+ (match-string 2 path))
+ ":/"
+ (substring path (match-end 0)))))
+ path)
+
+(defmacro w3m-dtree-has-child (path)
+ `(let ((w32-get-true-file-link-count t)) ;; true link count for Meadow
+ (and (nth 1 (file-attributes ,path))
+ (/= (nth 1 (file-attributes ,path)) 2))))
+
+(defun w3m-dtree-create-sub (path allfiles dirprefix fileprefix indent depth)
+ (let* ((files (directory-files path t))
+ (limit (and (integerp w3m-dtree-directory-depth)
+ (>= depth w3m-dtree-directory-depth)))
+ (indent-sub1 (if limit
+ (aref w3m-dtree-stop-strings 0)
+ (aref w3m-dtree-indent-strings 0)))
+ (indent-sub2 (aref w3m-dtree-indent-strings 2))
+ file fullpath tmp)
+ (setq files (delete (concat (file-name-as-directory path) ".")
+ (delete (concat (file-name-as-directory path) "..")
+ files)))
+ (unless allfiles
+ (setq tmp files)
+ (while (setq file (car tmp))
+ (unless (file-directory-p file)
+ (setq files (delete file files)))
+ (setq tmp (cdr tmp))))
+ (while (setq fullpath (car files))
+ (when (= (length files) 1)
+ (if limit
+ (setq indent-sub1 (aref w3m-dtree-stop-strings 1))
+ (setq indent-sub1 (aref w3m-dtree-indent-strings 1)))
+ (setq indent-sub2 (aref w3m-dtree-indent-strings 3)))
+ (setq file (file-name-nondirectory fullpath))
+ (cond
+ ((or (not allfiles) (file-directory-p fullpath))
+ (insert (format "%s%s%s<A HREF=\"%s%s\">%s</A>\n"
+ indent indent-sub1
+ (if allfiles "<B>[d]</B>" "")
+ dirprefix
+ (w3m-dtree-expand-file-name (file-name-as-directory fullpath))
+ (concat file "/")))
+ (when (and (null limit)
+ (or allfiles (w3m-dtree-has-child fullpath)))
+ (w3m-dtree-create-sub fullpath allfiles dirprefix fileprefix
+ (concat indent indent-sub2) (1+ depth))))
+ ((and allfiles (file-exists-p fullpath))
+ (insert (format "%s%s%s<A HREF=\"%s%s\">%s</A>\n"
+ indent indent-sub1
+ (if allfiles "(f)" "")
+ fileprefix (w3m-dtree-expand-file-name fullpath)
+ file))))
+ (setq files (cdr files)))))
+
+(defun w3m-dtree-create (path allfiles dirprefix fileprefix)
+ (let ((charset (or (car (rassq w3m-file-name-coding-system
+ w3m-charset-coding-system-alist))
+ w3m-file-name-coding-system)))
+ (insert "<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">\n"
+ "<html>\n<head>\n"
+ "<meta http-equiv=\"CONTENT-TYPE\" "
+ "content=\"text/html; charset="
+ (symbol-name charset)
+ "\">\n"
+ "<title>"
+ path
+ "</title>\n</head>\n<body>\n<pre>\n")
+ (insert (format "<A HREF=\"%s%s\">%s</A>%s\n"
+ dirprefix (w3m-dtree-expand-file-name path) path
+ (if allfiles " (allfiles)" "")))
+ (if (file-directory-p path)
+ (w3m-dtree-create-sub path allfiles dirprefix fileprefix " " 0)
+ (insert (format "\n<h3>Warning: Directory not found.</h3>\n")))
+ (insert "</pre>\n</body>\n</html>\n")))
+
+;;;###autoload
+(defun w3m-about-dtree (url &optional nodecode allfiles &rest args)
+ (let ((prelen (length "about://dtree"))
+ (dirprefix "about://dtree")
+ (fileprefix "file://")
+ path)
+ (if (string-match "\\?allfiles=\\(?:\\(true\\)\\|false\\)$" url)
+ (progn
+ (setq path (substring url prelen (match-beginning 0)))
+ (if (match-beginning 1) (setq allfiles t)))
+ (if w3m-dtree-default-allfiles
+ (setq allfiles (not allfiles)))
+ (setq path (substring url prelen)))
+ ;; counter drive letter
+ (setq path (file-name-as-directory (w3m-dtree-directory-name path)))
+ (setq default-directory path)
+ (w3m-message "Dtree (%s)..." path)
+ (w3m-dtree-create path allfiles dirprefix fileprefix)
+ (w3m-message "Dtree...done")
+ "text/html"))
+
+;;;###autoload
+(defun w3m-dtree (allfiles path)
+ "Display directory tree on local file system.
+If called with 'prefix argument', display all directorys and files."
+ (interactive "P\nDDtree directory: ")
+ (if w3m-dtree-default-allfiles
+ (setq allfiles (not allfiles)))
+ (w3m-goto-url (format "about://dtree%s%s"
+ (w3m-dtree-expand-file-name
+ (file-name-as-directory
+ (expand-file-name path)))
+ (if allfiles "?allfiles=true" ""))))
+
+(provide 'w3m-dtree)
+;;; w3m-dtree.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-ems.el b/share/emacs/site-lisp/w3m/w3m-ems.el
new file mode 100644
index 00000000000..40af163676e
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-ems.el
@@ -0,0 +1,1410 @@
+;;; w3m-ems.el --- GNU Emacs stuff for emacs-w3m
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Yuuichi Teranishi <teranisi@gohome.org>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; This file contains GNU Emacs stuff that emacs-w3m uses. For more
+;; detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+;;
+;; We can use w3m-static- switches to make the byte code differ between
+;; Emacs 2[12] and 23, if anything, it is impossible to share the byte
+;; code with those versions of Emacsen.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+(require 'w3m-proc)
+(require 'w3m-image)
+(require 'w3m-favicon)
+(require 'w3m-ccl)
+(require 'wid-edit)
+
+;; Functions and variables which should be defined in the other module
+;; at run-time.
+(eval-when-compile
+ (defvar w3m-add-tab-number)
+ (defvar w3m-coding-system)
+ (defvar w3m-current-process)
+ (defvar w3m-current-title)
+ (defvar w3m-current-url)
+ (defvar w3m-default-coding-system)
+ (defvar w3m-display-inline-images)
+ (defvar w3m-favicon-image)
+ (defvar w3m-form-input-textarea-coding-system)
+ (defvar w3m-form-use-fancy-faces)
+ (defvar w3m-icon-directory)
+ (defvar w3m-image-default-background)
+ (defvar w3m-mode-map)
+ (defvar w3m-modeline-process-status-on)
+ (defvar w3m-new-session-in-background)
+ (defvar w3m-process-queue)
+ (defvar w3m-show-graphic-icons-in-header-line)
+ (defvar w3m-show-graphic-icons-in-mode-line)
+ (defvar w3m-toolbar)
+ (defvar w3m-toolbar-buttons)
+ (defvar w3m-use-favicon)
+ (defvar w3m-use-header-line)
+ (defvar w3m-use-header-line-title)
+ (defvar w3m-use-tab)
+ ;; `w3m-tab-move-right' calls the inline function `w3m-buffer-set-number'
+ ;; which uses it.
+ (defvar w3m-use-title-buffer-name)
+ (defvar w3m-work-buffer-list)
+ (defvar w3m-work-buffer-name)
+ (autoload 'w3m-copy-buffer "w3m")
+ (autoload 'w3m-delete-buffer "w3m")
+ (autoload 'w3m-image-type "w3m")
+ (autoload 'w3m-retrieve "w3m")
+ (autoload 'w3m-select-buffer-update "w3m"))
+
+(eval-and-compile
+ (unless (fboundp 'frame-current-scroll-bars)
+ (defalias 'frame-current-scroll-bars 'ignore))
+ (unless (fboundp 'window-fringes)
+ (defalias 'window-fringes 'ignore))
+ (unless (fboundp 'unencodable-char-position)
+ (defalias 'unencodable-char-position 'ignore)))
+
+;;; Coding system and charset.
+
+(defsubst w3m-find-coding-system (obj)
+ "Return OBJ if it is a coding-system."
+ (if (coding-system-p obj) obj))
+
+(defun w3m-detect-coding-region (start end &optional priority-list)
+ "Detect coding system of the text in the region between START and END.
+Return the first possible coding system.
+
+PRIORITY-LIST is a list of coding systems ordered by priority."
+ (let (category categories)
+ (dolist (codesys priority-list)
+ (setq category (coding-system-category codesys))
+ (unless (or (null category) (assq category categories))
+ (push (cons category codesys) categories)))
+ (car (detect-coding-with-priority start end (nreverse categories)))))
+
+(defun w3m-mule-unicode-p ()
+ "Check the existence as charsets of mule-unicode."
+ (and (charsetp 'mule-unicode-0100-24ff)
+ (charsetp 'mule-unicode-2500-33ff)
+ (charsetp 'mule-unicode-e000-ffff)))
+
+(defalias 'w3m-make-ccl-coding-system
+ (if (fboundp 'define-coding-system)
+ (eval-when-compile
+ (funcall (if (and (fboundp 'define-coding-system)
+ (featurep 'bytecomp))
+ 'byte-compile
+ 'identity)
+ '(lambda (coding-system mnemonic docstring decoder encoder) "\
+Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER.
+CODING-SYSTEM, DECODER and ENCODER must be symbols.
+This function is an interface to `define-coding-system'."
+ (define-coding-system coding-system docstring
+ :mnemonic mnemonic :coding-type 'ccl
+ :ccl-decoder decoder :ccl-encoder encoder))))
+ (eval-when-compile
+ (funcall (if (featurep 'bytecomp)
+ (lambda (form)
+ (let ((byte-compile-warnings
+ (if (eq (get 'make-coding-system 'byte-compile)
+ 'byte-compile-obsolete)
+ (delq 'obsolete
+ (copy-sequence
+ (cond ((consp byte-compile-warnings)
+ byte-compile-warnings)
+ (byte-compile-warnings
+ byte-compile-warning-types)
+ (t nil))))
+ byte-compile-warnings)))
+ (byte-compile form)))
+ 'identity)
+ '(lambda (coding-system mnemonic docstring decoder encoder) "\
+Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER.
+CODING-SYSTEM, DECODER and ENCODER must be symbols.
+This function is an interface to `make-coding-system'."
+ (make-coding-system coding-system 4 mnemonic docstring
+ (cons decoder encoder)))))))
+
+;; For Emacsen of which the `mule-version' is 5.x, redefine the ccl
+;; programs that been defined in w3m-ccl.el.
+(w3m-static-when (string-match "\\`5\\." mule-version)
+ (let ((source
+ ;; CCL program to convert multibyte char to ucs with emacs-unicode.
+ `((if (r1 == ,(charset-id 'latin-iso8859-1))
+ ((r1 = (r0 + 128)))
+ (if (r1 == ,(charset-id 'mule-unicode-0100-24ff))
+ ((r1 = ((((r0 & #x3f80) >> 7) - 32) * 96))
+ (r0 &= #x7f)
+ (r1 += (r0 + 224))) ; 224 == -32 + #x0100
+ (if (r1 == ,(charset-id 'mule-unicode-2500-33ff))
+ ((r1 = ((((r0 & #x3f80) >> 7) - 32) * 96))
+ (r0 &= #x7f)
+ (r1 += (r0 + 9440))) ; 9440 == -32 + #x2500
+ (if (r1 == ,(charset-id 'mule-unicode-e000-ffff))
+ ((r1 = ((((r0 & #x3f80) >> 7) - 32) * 96))
+ (r0 &= #x7f)
+ (r1 += (r0 + 57312))) ; 57312 == -32 + #xe000
+ ,(if (fboundp 'ccl-compile-lookup-character)
+ '((lookup-character utf-subst-table-for-encode r1 r0)
+ (if (r7 == 0) ; lookup failed
+ (r1 = #xfffd)))
+ '((r1 = #xfffd)))))))
+ (if (r1 == #xfffd)
+ (write-repeat ?~) ; unknown character.
+ (r0 = r1)))))
+ (if (get 'utf-translation-table-for-encode 'translation-table-id)
+ ;; Emacs 21.3 and later.
+ (progn
+ (eval
+ `(define-ccl-program w3m-euc-japan-encoder
+ '(4
+ (loop
+ ,@w3m-ccl-write-euc-japan-character
+ (translate-character utf-translation-table-for-encode r1 r0)
+ ,@source
+ ,@w3m-ccl-generate-ncr))))
+ (eval
+ `(define-ccl-program w3m-iso-latin-1-encoder
+ '(4
+ (loop
+ ,@w3m-ccl-write-iso-latin-1-character
+ (translate-character utf-translation-table-for-encode r1 r0)
+ ,@source
+ ,@w3m-ccl-generate-ncr)))))
+ ;; Emacs 21.2 and earlier.
+ (eval
+ `(define-ccl-program w3m-euc-japan-encoder
+ '(4
+ (loop
+ ,@w3m-ccl-write-euc-japan-character
+ ,@source
+ ,@w3m-ccl-generate-ncr))))
+ (eval
+ `(define-ccl-program w3m-iso-latin-1-encoder
+ '(4
+ (loop
+ ,@w3m-ccl-write-iso-latin-1-character
+ ,@source
+ ,@w3m-ccl-generate-ncr)))))))
+
+;; This might be redefined by w3m-ucs.el.
+(defun w3m-ucs-to-char (codepoint)
+ (or (decode-char 'ucs codepoint) ?~))
+
+(defun w3m-add-local-hook (hook function &optional append)
+ "Add to the buffer-local value of HOOK the function FUNCTION."
+ (add-hook hook function append t))
+
+(defun w3m-remove-local-hook (hook function)
+ "Remove to the buffer-local value of HOOK the function FUNCTION."
+ (remove-hook hook function t))
+
+;; Function which returns non-nil when the current display device can
+;; show images inline.
+(defalias 'w3m-display-graphic-p 'display-images-p)
+
+(defun w3m-display-inline-images-p ()
+ "Returns non-nil when images can be displayed under the present
+circumstances."
+ (and w3m-display-inline-images (display-images-p)))
+
+(defun w3m-create-image (url &optional no-cache referer size handler)
+ "Retrieve data from URL and create an image object.
+If optional argument NO-CACHE is non-nil, cache is not used.
+If second optional argument REFERER is non-nil, it is used as Referer: field.
+If third optional argument SIZE is non-nil, its car element is used as width
+and its cdr element is used as height."
+ (if (not handler)
+ (w3m-process-with-wait-handler
+ (w3m-create-image url no-cache referer size handler))
+ (lexical-let ((set-size size)
+ (url url)
+ image size)
+ (w3m-process-do-with-temp-buffer
+ (type (progn
+ (set-buffer-multibyte nil)
+ (w3m-retrieve url nil no-cache nil referer handler)))
+ (goto-char (point-min))
+ (when (w3m-image-type-available-p
+ (setq type
+ (or (and (let (case-fold-search)
+ (looking-at
+ "\\(GIF8\\)\\|\\(\377\330\\)\\|\211PNG\r\n"))
+ (cond ((match-beginning 1) 'gif)
+ ((match-beginning 2) 'jpeg)
+ (t 'png)))
+ (w3m-image-type type))))
+ (setq image (create-image (buffer-string) type t
+ :ascent 'center
+ :background w3m-image-default-background))
+ (if (and w3m-resize-images set-size)
+ (progn
+ (set-buffer-multibyte t)
+ (setq size (image-size image 'pixels))
+ (if (and (null (car set-size)) (cdr set-size))
+ (setcar set-size
+ (/ (* (car size) (cdr set-size)) (cdr size))))
+ (if (and (null (cdr set-size)) (car set-size))
+ (setcdr set-size
+ (/ (* (cdr size) (car set-size)) (car size))))
+ (if (or (not (eq (car size)
+ (car set-size))) ; width is different
+ (not (eq (cdr size)
+ (cdr set-size)))) ; height is different
+ (lexical-let ((image image))
+ (w3m-process-do
+ (resized (w3m-resize-image
+ (plist-get (cdr image) :data)
+ (car set-size)(cdr set-size)
+ handler))
+ (if resized (plist-put (cdr image) :data resized))
+ image))
+ image))
+ image))))))
+
+(defun w3m-create-resized-image (url rate &optional referer size handler)
+ "Resize an cached image object.
+URL is the image file's url.
+RATE is resize percentage.
+If REFERER is non-nil, it is used as Referer: field.
+If SIZE is non-nil, its car element is used as width
+and its cdr element is used as height."
+ (if (not handler)
+ (w3m-process-with-wait-handler
+ (w3m-create-image url nil referer size handler))
+ (lexical-let ((url url)
+ (rate rate)
+ image)
+ (w3m-process-do-with-temp-buffer
+ (type (progn
+ (set-buffer-multibyte nil)
+ (w3m-retrieve url nil nil nil referer handler)))
+ (when (w3m-image-type-available-p (setq type (w3m-image-type type)))
+ (setq image (create-image (buffer-string) type t :ascent 'center))
+ (progn
+ (set-buffer-multibyte t)
+ (w3m-process-do
+ (resized (w3m-resize-image-by-rate
+ (plist-get (cdr image) :data)
+ rate
+ handler))
+ (if resized (plist-put (cdr image) :data resized))
+ image)))))))
+
+(defun w3m-insert-image (beg end image &rest args)
+ "Display image on the current buffer.
+Buffer string between BEG and END are replaced with IMAGE."
+ (let ((faces (get-text-property beg 'face))
+ (idx 0)
+ orig len face)
+ (add-text-properties beg end (list 'display image
+ 'intangible image
+ 'invisible nil))
+ ;; Hide underlines behind inline images.
+ ;; Gerd Moellmann <gerd@gnu.org>, the maintainer of Emacs 21, wrote in
+ ;; the article <86heyi7vks.fsf@gerd.segv.de> in the list emacs-pretest-
+ ;; bug@gnu.org on 18 May 2001 that to show an underline of a text even
+ ;; if it has an image as a text property is the feature of Emacs 21.
+ ;; However, that behavior is not welcome to the w3m buffers, so we do
+ ;; to fix it with the following stuffs.
+ (when faces
+ (unless (listp faces)
+ (setq faces (list faces)))
+ (setq orig (copy-sequence faces)
+ len (length orig))
+ (while (< idx len)
+ (when (face-underline-p (setq face (nth idx orig)))
+ (setq faces (delq face faces)))
+ (setq idx (1+ idx)))
+ (when (< (length faces) len)
+ (put-text-property beg end 'face faces)
+ (put-text-property beg end 'w3m-faces-with-underline orig)))))
+
+(defun w3m-remove-image (beg end)
+ "Remove an image which is inserted between BEG and END."
+ (remove-text-properties beg end '(display nil intangible nil))
+ (let ((underline (get-text-property beg 'w3m-faces-with-underline)))
+ (when underline
+ (add-text-properties
+ beg end (list 'face underline 'w3m-faces-with-underline nil)))))
+
+(defun w3m-image-type-available-p (image-type)
+ "Return non-nil if an image with IMAGE-TYPE can be displayed inline."
+ (and (display-images-p)
+ (image-type-available-p image-type)))
+
+;;; Form buttons
+(defface w3m-form-button
+ '((((type x w32 mac ns) (class color))
+ :background "lightgrey" :foreground "black"
+ :box (:line-width 2 :style released-button))
+ (((class color) (background light)) (:foreground "cyan" :underline t))
+ (((class color) (background dark)) (:foreground "red" :underline t))
+ (t (:underline t)))
+ "*Face to fontify buttons in forms."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-form-button-face 'face-alias 'w3m-form-button)
+
+(defface w3m-form-button-mouse
+ '((((type x w32 mac ns) (class color))
+ :background "DarkSeaGreen1" :foreground "black"
+ :box (:line-width 2 :style released-button))
+ (((class color) (background light)) (:foreground "cyan" :underline t))
+ (((class color) (background dark)) (:foreground "red" :underline t))
+ (t (:underline t)))
+ "*Face to fontify focused buttons in forms."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-form-button-mouse-face 'face-alias 'w3m-form-button-mouse)
+
+(defface w3m-form-button-pressed
+ '((((type x w32 mac ns) (class color))
+ :background "lightgrey" :foreground "black"
+ :box (:line-width 2 :style pressed-button))
+ (((class color) (background light)) (:foreground "cyan" :underline t))
+ (((class color) (background dark)) (:foreground "red" :underline t))
+ (t (:underline t)))
+ "*Face to fontify pressed buttons in forms."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-form-button-pressed-face 'face-alias 'w3m-form-button-pressed)
+
+(defvar w3m-form-button-keymap
+ (let ((map (copy-keymap widget-keymap)))
+ (substitute-key-definition 'widget-forward nil map)
+ (substitute-key-definition 'widget-backward nil map)
+ map))
+
+(define-widget 'w3m-form-button 'push-button
+ "Widget for w3m form button."
+ :keymap w3m-form-button-keymap
+ :action (function (lambda (widget &optional e)
+ (eval (widget-get widget :w3m-form-action)))))
+
+(defun w3m-form-make-button (start end properties)
+ "Make button on the region from START to END."
+ (if w3m-form-use-fancy-faces
+ (progn
+ (unless (memq (face-attribute 'w3m-form-button :box)
+ '(nil unspecified))
+ (and (eq ?\[ (char-after start))
+ (eq ?\] (char-before end))
+ (save-excursion
+ (goto-char start)
+ (delete-char 1)
+ (insert " ")
+ (goto-char end)
+ (delete-char -1)
+ (insert " ")
+ (setq start (1+ start)
+ end (1- end)))))
+ (let ((w (widget-convert-button
+ 'w3m-form-button start end
+ :w3m-form-action (plist-get properties 'w3m-action))))
+ (overlay-put (widget-get w :button-overlay) 'evaporate t))
+ (add-text-properties start end properties))
+ (w3m-add-text-properties start end (append '(face w3m-form) properties))))
+
+(defun w3m-setup-widget-faces ()
+ (make-local-variable 'widget-button-face)
+ (make-local-variable 'widget-mouse-face)
+ (make-local-variable 'widget-button-pressed-face)
+ (setq widget-button-face 'w3m-form-button)
+ (setq widget-mouse-face 'w3m-form-button-mouse)
+ (setq widget-button-pressed-face 'w3m-form-button-pressed))
+
+;;; Menu bar
+(defun w3m-menu-on-forefront (arg &optional curbuf)
+ "Place emacs-w3m menus on the forfront of the menu bar if ARG is non-nil.
+If CURBUF is given, this function works only in the current buffer,
+otherwise works in all the emacs-w3m buffers."
+ (if curbuf
+ (if arg
+ (let ((items (mapcar 'car (cdr (lookup-key global-map [menu-bar])))))
+ (when items
+ (set (make-local-variable 'menu-bar-final-items) items)))
+ (kill-local-variable 'menu-bar-final-items))
+ (save-current-buffer
+ (dolist (buffer (w3m-list-buffers t))
+ (set-buffer buffer)
+ (w3m-menu-on-forefront arg t)))))
+
+;;; Toolbar
+(defcustom w3m-use-toolbar
+ (and (featurep 'tool-bar)
+ ;; Emacs 22 and greater return t for `(featurep 'tool-bar)'
+ ;; even if being launched with the -nw option.
+ (display-images-p)
+ (or (featurep 'gtk)
+ (image-type-available-p 'xpm)))
+ "Non-nil activates toolbar of w3m."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-toolbar-icon-preferred-image-types
+ (if (featurep 'gtk)
+ '(png)
+ '(xpm))
+ "List of image types that you prefer to use for the tool bar icons.
+By default, `png' is most preferred for Emacs built with GTK and `xpm'
+is for others."
+ :group 'w3m
+ :type '(repeat (symbol :tag "Image type"))
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (when (and (not noninteractive) (boundp 'w3m-toolbar-buttons))
+ (w3m-update-toolbars)))))
+
+(defcustom w3m-toolbar-use-single-image-per-icon nil
+ "Non-nil means use single image (named possibly *-up) per icon.
+If it is nil, subsidiaries, e.g., *-down and *-disabled, if any, are
+used together."
+ :group 'w3m
+ :type 'boolean
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (when (and (not noninteractive) (boundp 'w3m-toolbar-buttons))
+ (w3m-update-toolbars)))))
+
+(defcustom w3m-toolbar-configurations
+ `((tool-bar-button-margin . global)
+ ,@(unless (featurep 'gtk)
+ '((tool-bar-button-relief . global))))
+ "Alist of the variables and the values controls the tool bar appearance.
+The value `global' means to use the global value of the variable.
+
+If you're annoyed with changing of the frame height of Emacs built for
+GTK because of the difference of the sizes between the emacs-w3m tool
+bar icons and the ones that Emacs natively uses, try customizing this
+variable or both the value of this variable and the global value of
+`tool-bar-button-margin'. For examples:
+
+;; The case where the emacs-w3m icons are smaller than the others.
+\(setq w3m-toolbar-configurations '((tool-bar-button-margin . 5)))
+
+;; The case where the emacs-w3m icons are bigger than the others.
+\(setq w3m-toolbar-configurations '((tool-bar-button-margin . 0))
+ tool-bar-button-margin 7)"
+ :group 'w3m
+ :type '(repeat (cons :format "%v"
+ (symbol :tag "Variable")
+ (radio :format "%v"
+ (const :format "%v " global)
+ (sexp :tag "Local Value"))))
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (when (and (not noninteractive) (featurep 'w3m))
+ (w3m-toolbar-set-configurations)))))
+
+(defun w3m-toolbar-define-keys (keymap defs)
+ ;; Invalidate the default bindings.
+ (let ((keys (cdr (key-binding [tool-bar] t)))
+ item)
+ (while (setq item (pop keys))
+ (when (setq item (car-safe item))
+ (define-key keymap (vector 'tool-bar item) 'undefined))))
+ (let ((n (length defs))
+ def)
+ (while (>= n 0)
+ (setq n (1- n)
+ def (nth n defs))
+ (define-key keymap (vector 'tool-bar (aref def 1))
+ (list 'menu-item (aref def 3) (aref def 1)
+ :enable (aref def 2)
+ :image (symbol-value (aref def 0)))))))
+
+(defun w3m-find-image (name &optional directory)
+ "Find image file for NAME and return cons of file name and type.
+This function searches only in DIRECTORY, that defaults to the value of
+`w3m-icon-directory', for an image file of which the base name is NAME.
+Files of types that Emacs does not support are ignored."
+ (unless directory
+ (setq directory w3m-icon-directory))
+ (when (and directory
+ (file-directory-p directory)
+ (display-images-p))
+ (let* ((case-fold-search nil)
+ (files (directory-files directory t
+ (concat "\\`" (regexp-quote name) "\\.")))
+ (types (append w3m-toolbar-icon-preferred-image-types image-types))
+ file type rest)
+ (while files
+ (when (string-match "\\.\\([^.]+\\)\\'" (setq file (pop files)))
+ (setq type (intern (downcase (match-string 1 file))))
+ (setq type (or (cdr (assq type '((tif . tiff)
+ (jpg . jpeg)
+ (ps . postscript)
+ (pgm . pbm)
+ (ppm . pbm))))
+ type))
+ (push (cons file (memq type types)) rest)))
+ (setq rest (car (sort rest (lambda (a b) (> (length a) (length b))))))
+ (when (cdr rest)
+ (cons (car rest) (cadr rest))))))
+
+(defun w3m-toolbar-make-buttons (buttons &optional force)
+ (let ((xpm-props '(:color-symbols (("backgroundToolBarColor" . "None"))))
+ button icon down disabled up)
+ (while buttons
+ (setq button (pop buttons)
+ icon (intern (concat "w3m-toolbar-" button "-icon")))
+ (when (or force (not (boundp icon)))
+ (setq down (w3m-find-image (concat button "-down"))
+ disabled (w3m-find-image (concat button "-disabled")))
+ (if (setq up (or (w3m-find-image (concat button "-up"))
+ (prog1
+ (or down disabled (w3m-find-image button))
+ (setq down nil
+ disabled nil))))
+ (progn
+ (setq up (apply 'create-image (car up) (cdr up) nil
+ :ascent 'center
+ (when (eq (cdr up) 'xpm)
+ xpm-props)))
+ (if (or w3m-toolbar-use-single-image-per-icon
+ (not (or down disabled)))
+ (set icon up)
+ (when down
+ (setq down (apply 'create-image (car down) (cdr down) nil
+ :ascent 'center
+ (when (eq (cdr up) 'xpm)
+ xpm-props))))
+ (when disabled
+ (setq disabled (apply 'create-image
+ (car disabled) (cdr disabled) nil
+ :ascent 'center
+ (when (eq (cdr disabled) 'xpm)
+ xpm-props))))
+ (set icon (vector down up disabled disabled))))
+ (error "Icon file %s-up.* not found" button))))))
+
+(defun w3m-toolbar-set-configurations (&optional curbuf)
+ "Set values of variables according to `w3m-toolbar-configurations'.
+If CURBUF is given, this function works only in the current buffer,
+otherwise works in all the emacs-w3m buffers."
+ (if curbuf
+ (dolist (config w3m-toolbar-configurations)
+ (if (eq (cdr config) 'global)
+ (kill-local-variable (car config))
+ (set (make-local-variable (car config)) (cdr config))))
+ (let ((cur (selected-frame))
+ buffer buffers)
+ (walk-windows
+ (lambda (window)
+ (setq buffer (window-buffer window))
+ (unless (memq buffer buffers)
+ (set-buffer buffer)
+ (when (eq major-mode 'w3m-mode)
+ (push buffer buffers)
+ (select-frame (window-frame window))
+ ;;(set-buffer buffer)
+ (w3m-toolbar-set-configurations t))))
+ 'ignore 'visible)
+ (select-frame-set-input-focus cur)
+ (save-current-buffer
+ (dolist (buffer (w3m-list-buffers t))
+ (unless (memq buffer buffers)
+ (set-buffer buffer)
+ (w3m-toolbar-set-configurations t))))
+ (select-frame-set-input-focus cur))))
+
+(defun w3m-setup-toolbar ()
+ (when (and w3m-use-toolbar
+ (w3m-find-image "antenna-up"))
+ (w3m-toolbar-make-buttons w3m-toolbar-buttons)
+ (w3m-toolbar-set-configurations t)
+ (w3m-toolbar-define-keys w3m-mode-map w3m-toolbar)))
+
+(defalias 'w3m-update-toolbar 'ignore)
+
+(defun w3m-update-toolbars ()
+ (when (and w3m-use-toolbar
+ (w3m-find-image "antenna-up"))
+ (w3m-toolbar-make-buttons w3m-toolbar-buttons t)
+ (w3m-toolbar-set-configurations)
+ (w3m-toolbar-define-keys w3m-mode-map w3m-toolbar)))
+
+;;; Header line & Tabs
+(defcustom w3m-tab-width 16
+ "w3m tab width."
+ :group 'w3m
+ :set (lambda (symbol value)
+ (custom-set-default symbol
+ (if (and (numberp value) (> value 0))
+ value
+ 16)))
+ :type '(integer :size 0))
+
+(defface w3m-tab-unselected
+ '((((type x w32 mac ns) (class color))
+ :background "Gray70" :foreground "Gray20"
+ :box (:line-width -1 :style released-button))
+ (((class color))
+ (:background "blue" :foreground "black")))
+ "*Face to fontify unselected tabs."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-unselected-face 'face-alias 'w3m-tab-unselected)
+
+(defface w3m-tab-unselected-retrieving
+ '((((type x w32 mac ns) (class color))
+ :background "Gray70" :foreground "OrangeRed"
+ :box (:line-width -1 :style released-button))
+ (((class color))
+ (:background "blue" :foreground "OrangeRed")))
+ "*Face to fontify unselected tabs which are retrieving their pages."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-unselected-retrieving-face
+ 'face-alias 'w3m-tab-unselected-retrieving)
+
+(defface w3m-tab-unselected-unseen
+ '((((type x w32 mac ns) (class color))
+ :background "Gray70" :foreground "Gray20"
+ :box (:line-width -1 :style released-button))
+ (((class color))
+ (:background "blue" :foreground "gray60")))
+ "*Face to fontify unselected and unseen tabs."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-unselected-unseen-face 'face-alias 'w3m-tab-unselected-unseen)
+
+(defface w3m-tab-selected
+ '((((type x w32 mac ns) (class color))
+ :background "Gray90" :foreground "black"
+ :box (:line-width -1 :style released-button))
+ (((class color))
+ (:background "cyan" :foreground "black"))
+ (t (:underline t)))
+ "*Face to fontify selected tab."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-selected-face 'face-alias 'w3m-tab-selected)
+
+(defface w3m-tab-selected-retrieving
+ '((((type x w32 mac ns) (class color))
+ :background "Gray90" :foreground "red"
+ :box (:line-width -1 :style released-button))
+ (((class color))
+ (:background "cyan" :foreground "red"))
+ (t (:underline t)))
+ "*Face to fontify selected tab which is retrieving its page."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-selected-retrieving-face
+ 'face-alias 'w3m-tab-selected-retrieving)
+
+(defface w3m-tab-background
+ '((((type x w32 mac ns) (class color))
+ :background "LightSteelBlue" :foreground "black")
+ (((class color))
+ (:background "white" :foreground "black")))
+ "*Face to fontify background of tab line."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-background-face 'face-alias 'w3m-tab-background)
+
+(defface w3m-tab-selected-background
+ '((((type x w32 mac ns) (class color))
+ :background "LightSteelBlue" :foreground "black")
+ (((class color))
+ (:background "white" :foreground "black")))
+ "*Face to fontify selected background tab."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-selected-background-face
+ 'face-alias 'w3m-tab-selected-background)
+
+(defface w3m-tab-mouse
+ '((((type x w32 mac ns) (class color))
+ :background "Gray75" :foreground "white"
+ :box (:line-width -1 :style released-button)))
+ "*Face used to highlight tabs under the mouse."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-tab-mouse-face 'face-alias 'w3m-tab-mouse)
+
+(defvar w3m-modeline-spinner-map nil
+ "Keymap used on the spinner in the mode-line.")
+
+(defvar w3m-spinner-map-help-echo "mouse-2 kills the current process"
+ "String used for the :help-echo property on the spinner.")
+
+(defun w3m-setup-header-line ()
+ (setq header-line-format
+ (cond (w3m-use-tab
+ '(:eval (w3m-tab-line)))
+ (w3m-use-header-line
+ (list
+ (if w3m-use-header-line-title
+ (list
+ (propertize
+ "Title: "
+ 'face (list 'w3m-header-line-location-title))
+ `(:eval
+ (propertize
+ (replace-regexp-in-string "%" "%%" (w3m-current-title))
+ 'face (list 'w3m-header-line-location-content)
+ 'mouse-face '(highlight :foreground
+ ,(face-foreground 'default))
+ 'local-map (let ((map (make-sparse-keymap)))
+ (define-key map [header-line mouse-2]
+ 'w3m-goto-url)
+ map)
+ 'help-echo "mouse-2 prompts to input URL"))
+ ", ")
+ "")
+ (propertize
+ "Location: "
+ 'face (list 'w3m-header-line-location-title))
+ `(:eval
+ (propertize
+ (if (stringp w3m-current-url)
+ (replace-regexp-in-string "%" "%%" w3m-current-url)
+ "")
+ 'face (list 'w3m-header-line-location-content)
+ 'mouse-face '(highlight :foreground
+ ,(face-foreground 'default))
+ 'local-map (let ((map (make-sparse-keymap)))
+ (define-key map [header-line mouse-2]
+ 'w3m-goto-url)
+ map)
+ 'help-echo "mouse-2 prompts to input URL")))))))
+
+(eval-when-compile
+ ;; Shut up the byte-compiler for old Emacsen.
+ (unless (fboundp 'force-window-update)
+ (defalias 'force-window-update 'ignore)))
+
+(eval-and-compile
+ (defalias 'w3m-force-window-update
+ (if (and (fboundp 'force-window-update)
+ (not (eq (symbol-function 'force-window-update) 'ignore)))
+ (lambda (&optional window) "\
+Force redisplay of WINDOW which defaults to the selected window."
+ (force-window-update (or window (selected-window))))
+ (lambda (&optional ignore) "\
+Wobble the selected window to force redisplay of the header-line."
+ (save-window-excursion
+ (split-window-vertically))))))
+
+(defun w3m-tab-drag-mouse-function (event buffer)
+ (let ((window (posn-window (event-end event)))
+ mpos)
+ (when (framep window) ; dropped at outside of the frame.
+ (setq window nil
+ mpos (mouse-position))
+ (and (framep (car mpos))
+ (car (cdr mpos))
+ (cdr (cdr mpos))
+ (setq window (window-at (car (cdr mpos))
+ (cdr (cdr mpos))
+ (car mpos))))
+ (unless window
+ (when (one-window-p 'nomini)
+ (split-window))
+ (setq window (next-window))))
+ (unless (eq (window-buffer window) buffer)
+ (select-window window)
+ (switch-to-buffer buffer)
+ (w3m-force-window-update window))))
+
+(defun w3m-tab-click-mouse-function (event buffer)
+ (let ((window (posn-window (event-start event))))
+ (select-window window)
+ (switch-to-buffer buffer)
+ (w3m-force-window-update window)))
+
+(defun w3m-tab-double-click-mouse1-function (event buffer)
+ (let ((window (posn-window (event-start event))))
+ (when (eq major-mode 'w3m-mode)
+ (if w3m-new-session-in-background
+ (save-window-excursion
+ (w3m-copy-buffer))
+ (w3m-copy-buffer)))
+ (w3m-force-window-update window)))
+
+(defun w3m-tab-double-click-mouse2-function (event buffer)
+ (let ((window (posn-window (event-start event))))
+ (when (eq major-mode 'w3m-mode)
+ (w3m-delete-buffer))
+ (w3m-force-window-update window)))
+
+(defvar w3m-tab-line-format nil
+ "Internal variable used to keep contents to be shown in the header-line.
+This is a buffer-local variable.")
+(make-variable-buffer-local 'w3m-tab-line-format)
+
+(defvar w3m-tab-timer nil
+ "Internal variable used to say time has not gone by after the tab-line
+was updated last time. It is used to control the `w3m-tab-line'
+function running too frequently, set by the function itself and
+cleared by a timer.")
+(make-variable-buffer-local 'w3m-tab-timer)
+
+(defcustom w3m-tab-track-mouse t
+ "Say whether to make the mouse track the selected tab.
+It controls the behavior of the commands `w3m-tab-previous-buffer',
+`w3m-tab-next-buffer', `w3m-tab-move-right', and `w3m-tab-move-left'
+invoked by the mouse.
+
+You may want to set this to nil if you use a proportional font for the
+tab faces. See also `w3m-tab-mouse-position-adjuster'."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-tab-mouse-position-adjuster '(0.5 . -4)
+ "Values used to adjust the mouse position on tabs.
+It is used when the command `w3m-tab-previous-buffer',
+`w3m-tab-next-buffer', `w3m-tab-move-right', or `w3m-tab-move-left' is
+invoked by the mouse. The value consists of the cons of a floating
+point number M and an integer N that are applied to calculating of the
+mouse position, which is given in pixel units, as follows:
+
+ (TAB_WIDTH + M) * ORDER + N
+
+Where TAB_WIDTH is the pixel width of a tab and ORDER is the order
+number in tabs. The result is rounded towards zero.
+
+Note that the calculation will always fail if you use a proportional
+font for the tab faces. See also `w3m-tab-track-mouse'."
+ :group 'w3m
+ :type '(cons (number :tag "M") (integer :tag "N")))
+
+(defun w3m-tab-mouse-track-selected-tab (event order
+ &optional buffers decelerate)
+ "Make the mouse track the selected tab.
+EVENT is a command event. ORDER is the order number in tabs.
+The optional BUFFERS is a list of emacs-w3m buffers, DECELERATE if it
+is non-nil means not to respond to too fast operation of mouse wheel."
+ (when (and w3m-use-tab window-system w3m-tab-track-mouse
+ (consp event) (symbolp (car event)))
+ (let ((e (get (car event) 'event-symbol-elements))
+ (len (* (car w3m-tab-mouse-position-adjuster) order))
+ (fcw (frame-char-width))
+ posn tab start end disp next)
+ (when (and (consp e) (symbolp (car e))
+ (or (memq (car e) '(mouse-4 mouse-5 wheel-up wheel-down))
+ (string-match "\\`mouse-" (symbol-name (car e)))))
+ ;; Ignore values gotten by the mouse pointing to other frames.
+ ;; It might happen if the frame in question gets out of focus
+ ;; by a certain desktop tool such as unclutter.
+ (let ((frame (selected-frame)))
+ (while (not (cadr (setq posn (mouse-pixel-position))))
+ (select-frame-set-input-focus frame)))
+ ;; Update the header line.
+ (setq w3m-tab-timer nil)
+ (sit-for 0)
+ (setq tab w3m-tab-line-format)
+ (with-temp-buffer
+ (insert tab)
+ (setq start (point-min)
+ end (point))
+ (while (and (> order 0)
+ (setq start (text-property-any start end
+ 'tab-separator t))
+ (setq start (text-property-not-all start end
+ 'tab-separator t)))
+ (setq order (1- order)))
+ (setq end (1- start)
+ start (point-min)
+ next start
+ disp (get-text-property start 'display))
+ (while (and (< next end)
+ (setq next (next-single-property-change
+ start 'display nil end)))
+ (setq len (+ (cond
+ ((eq (car disp) 'image)
+ (or (car w3m-favicon-size) (frame-char-height)))
+ ((eq (car disp) 'space)
+ (* (or (plist-get (cdr disp) :width) 1) fcw))
+ (t
+ (* (string-width (buffer-substring start next))
+ fcw)))
+ len)
+ start next
+ disp (get-text-property start 'display))))
+ (set-mouse-pixel-position
+ (car posn)
+ (truncate (+ len (cdr w3m-tab-mouse-position-adjuster)))
+ (cddr posn))
+ (when decelerate
+ (sleep-for 0.1))
+ (discard-input)))))
+
+(defun w3m-tab-next-buffer (&optional n event)
+ "Turn N pages of emacs-w3m buffers ahead."
+ (interactive (list (prefix-numeric-value current-prefix-arg)
+ last-command-event))
+ (unless n (setq n 1))
+ (when (and (/= n 0) (eq major-mode 'w3m-mode))
+ (let ((buffers (w3m-list-buffers)))
+ (switch-to-buffer
+ (nth (mod (+ n (w3m-buffer-number (current-buffer)) -1)
+ (length buffers))
+ buffers))
+ (run-hooks 'w3m-select-buffer-hook)
+ (w3m-select-buffer-update)
+ (w3m-tab-mouse-track-selected-tab
+ event (w3m-buffer-number (current-buffer)) buffers))))
+
+(defun w3m-tab-previous-buffer (&optional n event)
+ "Turn N pages of emacs-w3m buffers behind."
+ (interactive (list (prefix-numeric-value current-prefix-arg)
+ last-command-event))
+ (w3m-tab-next-buffer (- n) event))
+
+(defun w3m-tab-move-right (&optional n event)
+ "Move this tab N times to the right (to the left if N is negative)."
+ (interactive (list (prefix-numeric-value current-prefix-arg)
+ last-command-event))
+ (unless n (setq n 1))
+ (when (and (/= n 0) (eq major-mode 'w3m-mode))
+ (let* ((buffers (if (> n 0)
+ (w3m-list-buffers)
+ (setq n (- n))
+ (nreverse (w3m-list-buffers))))
+ (dest (or (nth n (memq (current-buffer) buffers))
+ (car (last buffers))))
+ (next (w3m-buffer-number dest))
+ (cur (w3m-buffer-number (current-buffer)))
+ e posn start)
+ (rename-buffer "*w3m*<0>")
+ (w3m-buffer-set-number dest cur)
+ (w3m-buffer-set-number (current-buffer) next)
+ (w3m-select-buffer-update)
+ (w3m-tab-mouse-track-selected-tab event next buffers t))))
+
+(defun w3m-tab-move-left (&optional n event)
+ "Move this tab N times to the left (to the right if N is negative)."
+ (interactive (list (prefix-numeric-value current-prefix-arg)
+ last-command-event))
+ (w3m-tab-move-right (- n) event))
+
+(defvar w3m-tab-map nil)
+(make-variable-buffer-local 'w3m-tab-map)
+
+(defvar w3m-tab-spinner-map nil)
+(make-variable-buffer-local 'w3m-tab-spinner-map)
+
+(defun w3m-tab-make-keymap ()
+ (unless w3m-tab-map
+ (setq w3m-tab-map (make-sparse-keymap))
+ (let* ((cur (current-buffer))
+ (f1 (lambda (fn) `(lambda (e) (interactive "e") (,fn e ,cur))))
+ (f2 (lambda (fn) `(lambda (e)
+ (interactive "e")
+ (select-window (posn-window (event-start e)))
+ (switch-to-buffer ,cur)
+ (setq this-command ',fn)
+ (,fn 1 e))))
+ (drag-action (funcall f1 'w3m-tab-drag-mouse-function))
+ (single-action (funcall f1 'w3m-tab-click-mouse-function))
+ (double-action1 (funcall f1 'w3m-tab-double-click-mouse1-function))
+ (double-action2 (funcall f1 'w3m-tab-double-click-mouse2-function))
+ (menu-action (funcall f1 'w3m-tab-button-menu))
+ (menu-action2 (funcall f1 'w3m-tab-button-menu2))
+ (next-buffer-action (funcall f2 'w3m-tab-next-buffer))
+ (previous-buffer-action (funcall f2 'w3m-tab-previous-buffer))
+ (move-left-action (funcall f2 'w3m-tab-move-left))
+ (move-right-action (funcall f2 'w3m-tab-move-right)))
+ (define-key w3m-tab-map [header-line down-mouse-1] 'ignore)
+ (define-key w3m-tab-map [header-line down-mouse-2] 'ignore)
+ (define-key w3m-tab-map [header-line mouse-1] single-action)
+ (define-key w3m-tab-map [header-line mouse-2] single-action)
+ (define-key w3m-tab-map [header-line drag-mouse-1] drag-action)
+ (define-key w3m-tab-map [header-line drag-mouse-2] drag-action)
+ (define-key w3m-tab-map [header-line double-mouse-1] double-action1)
+ (define-key w3m-tab-map [header-line double-mouse-2] double-action2)
+ (define-key w3m-tab-map [header-line mouse-3] menu-action)
+ (define-key w3m-tab-map [header-line wheel-up] previous-buffer-action)
+ (define-key w3m-tab-map [header-line wheel-down] next-buffer-action)
+ (define-key w3m-tab-map [header-line mouse-4] previous-buffer-action)
+ (define-key w3m-tab-map [header-line mouse-5] next-buffer-action)
+ (define-key w3m-tab-map [header-line C-wheel-up] move-left-action)
+ (define-key w3m-tab-map [header-line C-wheel-down] move-right-action)
+ (define-key w3m-tab-map [header-line C-mouse-4] move-left-action)
+ (define-key w3m-tab-map [header-line C-mouse-5] move-right-action)
+ (define-key w3m-mode-map [header-line double-mouse-1]
+ 'w3m-goto-new-session-url)
+ (define-key w3m-mode-map [header-line mouse-3] menu-action2)
+ ;; The following bindings in `w3m-mode-map', not `w3m-tab-map',
+ ;; are required for some platforms, in which mouse wheel events
+ ;; sometimes pass by `w3m-tab-map' for the unresolved reason and
+ ;; see `w3m-mode-map', or else the `undefined' errors will arise.
+ (define-key w3m-mode-map [header-line mouse-4] 'w3m-tab-previous-buffer)
+ (define-key w3m-mode-map [header-line mouse-5] 'w3m-tab-next-buffer)
+ (define-key w3m-mode-map [header-line wheel-up] 'w3m-tab-previous-buffer)
+ (define-key w3m-mode-map [header-line wheel-down] 'w3m-tab-next-buffer)
+ (define-key w3m-mode-map [header-line C-wheel-up] 'w3m-tab-move-left)
+ (define-key w3m-mode-map [header-line C-wheel-down] 'w3m-tab-move-right)
+ (define-key w3m-mode-map [header-line C-mouse-4] 'w3m-tab-move-left)
+ (define-key w3m-mode-map [header-line C-mouse-5] 'w3m-tab-move-right))
+ (unless w3m-tab-spinner-map
+ (setq w3m-tab-spinner-map (make-sparse-keymap))
+ (define-key w3m-tab-spinner-map [header-line mouse-2]
+ `(lambda (e)
+ (interactive "e")
+ (save-current-buffer
+ ;; Why the `(w3m-process-stop BUFFER)' doesn't work?
+ (set-buffer ,(current-buffer))
+ (call-interactively 'w3m-process-stop)))))))
+
+(defvar w3m-tab-half-space
+ (propertize " " 'display '(space :width 0.5))
+ "The space of half width.")
+
+(defvar w3m-tab-separator-map nil)
+
+(unless w3m-tab-separator-map
+ (let ((map (make-sparse-keymap)))
+ (setq w3m-tab-separator-map map)
+ (define-key map [header-line wheel-up] 'w3m-tab-previous-buffer)
+ (define-key map [header-line wheel-down] 'w3m-tab-next-buffer)
+ (define-key map [header-line mouse-4] 'w3m-tab-previous-buffer)
+ (define-key map [header-line mouse-5] 'w3m-tab-next-buffer)
+ (define-key map [header-line C-wheel-up] 'w3m-tab-move-left)
+ (define-key map [header-line C-wheel-down] 'w3m-tab-move-right)
+ (define-key map [header-line C-mouse-4] 'w3m-tab-move-left)
+ (define-key map [header-line C-mouse-5] 'w3m-tab-move-right)))
+
+(defvar w3m-tab-separator
+ (propertize " "
+ 'face (list 'w3m-tab-background)
+ 'mouse-face 'w3m-tab-selected-background
+ 'display '(space :width 0.5)
+ 'tab-separator t
+ 'local-map w3m-tab-separator-map)
+ "String used to separate tabs.")
+
+(defun w3m-tab-line ()
+ (or (and w3m-tab-timer w3m-tab-line-format)
+ (let* ((current (current-buffer))
+ (buffers (w3m-list-buffers))
+ (breadth 1)
+ (number 0)
+ (fringes (window-fringes))
+ (width (+ (window-width)
+ (/ (float (+ (or (car fringes) 0)
+ (or (nth 1 fringes) 0)))
+ (frame-char-width))
+ ;; Assume that the vertical scroll-bar has
+ ;; the width of two space characters.
+ (if (car (frame-current-scroll-bars)) 2 0)))
+ (nbuf (length buffers))
+ (graphic (and window-system
+ w3m-show-graphic-icons-in-header-line))
+ (margin (if window-system
+ (+ (if graphic 3.0 0.5)
+ ;; Right and left shadows.
+ (/ 2.0 (frame-char-width)))
+ 1))
+ (spinner (when w3m-process-queue
+ (w3m-make-spinner-image)))
+ buffer title data datum process unseen favicon keymap face icon
+ line)
+ (setq w3m-tab-timer t)
+ (run-at-time 0.1 nil
+ (lambda (buffer)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (setq w3m-tab-timer nil)
+ (when (and (eq (selected-window)
+ (get-buffer-window buffer))
+ w3m-process-queue)
+ (inline (w3m-force-window-update))))))
+ current)
+ (save-current-buffer
+ (while buffers
+ (set-buffer (setq buffer (pop buffers)))
+ (setq number (1+ number))
+ (setq title (if w3m-add-tab-number
+ (format "%d.%s" number (w3m-current-title))
+ (w3m-current-title)))
+ (setq breadth
+ (max breadth
+ ;; There may be a wide character in the beginning of
+ ;; the title.
+ (if (> (length title) 0)
+ (char-width (aref title 0))
+ 0)))
+ (push (list (eq current buffer)
+ w3m-current-process
+ (w3m-unseen-buffer-p buffer)
+ title
+ (when w3m-use-favicon w3m-favicon-image)
+ w3m-tab-map)
+ data)))
+ (setq width (if (> (* nbuf (+ margin w3m-tab-width)) width)
+ (max (truncate (- (/ width nbuf) margin)) breadth)
+ w3m-tab-width))
+ (while data
+ (setq datum (pop data)
+ current (car datum)
+ process (nth 1 datum)
+ unseen (nth 2 datum)
+ title (nth 3 datum)
+ favicon (nth 4 datum)
+ keymap (nth 5 datum)
+ face (list
+ (if process
+ (if current
+ 'w3m-tab-selected-retrieving
+ 'w3m-tab-unselected-retrieving)
+ (if current
+ 'w3m-tab-selected
+ (if unseen
+ 'w3m-tab-unselected-unseen
+ 'w3m-tab-unselected))))
+ icon (when graphic
+ (cond
+ (process
+ (when spinner
+ (propertize
+ " "
+ 'display spinner
+ 'face face
+ 'local-map w3m-tab-spinner-map
+ 'help-echo w3m-spinner-map-help-echo)))
+ (favicon
+ (propertize
+ " "
+ 'display favicon
+ 'face face
+ 'local-map keymap
+ 'help-echo title))))
+ breadth (cond (icon width)
+ (graphic (+ 2 width))
+ (t width)))
+ (push
+ (list
+ icon
+ (propertize
+ (concat
+ (when graphic w3m-tab-half-space)
+ (replace-regexp-in-string
+ "%" "%%"
+ (if (and (> (string-width title) breadth)
+ (> breadth 6))
+ (truncate-string-to-width
+ (concat (truncate-string-to-width title (- breadth 3))
+ "...")
+ breadth nil ?.)
+ (truncate-string-to-width title breadth nil ?\ ))))
+ 'face face
+ 'mouse-face 'w3m-tab-mouse
+ 'local-map keymap
+ 'help-echo title)
+ w3m-tab-separator)
+ line))
+ (setq w3m-tab-line-format
+ (concat (apply 'concat (apply 'nconc line))
+ (propertize (make-string (window-width) ?\ )
+ 'face (list 'w3m-tab-background)
+ 'mouse-face 'w3m-tab-selected-background
+ 'local-map w3m-tab-separator-map))))))
+
+(add-hook 'w3m-mode-setup-functions 'w3m-tab-make-keymap)
+(add-hook 'w3m-mode-setup-functions 'w3m-setup-header-line)
+(add-hook 'w3m-mode-setup-functions 'w3m-setup-widget-faces)
+(add-hook 'w3m-select-buffer-hook 'w3m-force-window-update)
+
+;; Graphic icons.
+(defcustom w3m-space-before-modeline-icon ""
+ "String of space character(s) to be put in front of the mode-line icon.
+It may be better to use one or more spaces if you are using oblique or
+italic font in the modeline."
+ :group 'w3m
+ :type 'string)
+
+(defvar w3m-spinner-image-file nil
+ "Image file used to show a spinner in the header-line.")
+
+(defvar w3m-spinner-image-frames 3
+ "Number of frames which the spinner image contains.")
+
+(defvar w3m-spinner-image-index 0
+ "Counter used to rotate spinner images. This is a buffer-local variable.")
+(make-variable-buffer-local 'w3m-spinner-image-index)
+
+;; Images to be displayed in the modeline.
+(defvar w3m-modeline-process-status-on-icon nil)
+(defvar w3m-modeline-image-status-on-icon nil)
+(defvar w3m-modeline-status-off-icon nil)
+(defvar w3m-modeline-ssl-image-status-on-icon nil)
+(defvar w3m-modeline-ssl-status-off-icon nil)
+
+(defun w3m-initialize-graphic-icons (&optional force)
+ "Make icon images which will be displayed in the mode-line."
+ (interactive "P")
+ (when (or (image-type-available-p 'xpm)
+ (image-type-available-p 'png))
+ ;; Prefer xpm icons rather than png icons since Emacs doesn't display
+ ;; background colors of icon images other than xpm images transparently
+ ;; in the mode line.
+ (let* ((w3m-toolbar-icon-preferred-image-types
+ (if (image-type-available-p 'xpm)
+ '(xpm)
+ '(png)))
+ (defs `((w3m-modeline-status-off-icon
+ ,(w3m-find-image "state-00")
+ w3m-modeline-status-off)
+ (w3m-modeline-image-status-on-icon
+ ,(w3m-find-image "state-01")
+ w3m-modeline-image-status-on)
+ (w3m-modeline-ssl-status-off-icon
+ ,(w3m-find-image "state-10")
+ w3m-modeline-ssl-status-off)
+ (w3m-modeline-ssl-image-status-on-icon
+ ,(w3m-find-image "state-11")
+ w3m-modeline-ssl-image-status-on)))
+ def icon file type status keymap)
+ (while defs
+ (setq def (car defs)
+ defs (cdr defs)
+ icon (car def)
+ file (car (nth 1 def))
+ type (cdr (nth 1 def))
+ status (nth 2 def))
+ (if (and w3m-show-graphic-icons-in-mode-line file)
+ (progn
+ (when (or force (not (symbol-value icon)))
+ (unless keymap
+ (setq keymap
+ (make-mode-line-mouse-map 'mouse-2
+ 'w3m-reload-this-page)))
+ (set icon (propertize
+ " "
+ 'display (create-image file type nil
+ :ascent 'center)
+ 'local-map keymap
+ 'mouse-face 'mode-line-highlight
+ 'help-echo "mouse-2 reloads this page"))
+ (put icon 'risky-local-variable t)
+ (put status 'risky-local-variable t))
+ (when (stringp (symbol-value status))
+ ;; Save the original status strings as properties.
+ (put status 'string (symbol-value status)))
+ (set status (list "" 'w3m-space-before-modeline-icon icon)))
+ ;; Don't use graphic icons.
+ (when (get status 'string)
+ (set status (get status 'string)))))))
+ (let (file)
+ ;; Spinner
+ (when (and (or force (not w3m-spinner-image-file))
+ (image-type-available-p 'gif)
+ w3m-icon-directory
+ (file-directory-p w3m-icon-directory)
+ (file-exists-p
+ (setq file (expand-file-name "spinner.gif"
+ w3m-icon-directory))))
+ (setq w3m-spinner-image-file file)
+ (define-key (setq w3m-modeline-spinner-map (make-sparse-keymap))
+ [mode-line mouse-2]
+ 'w3m-process-stop)
+ (put 'w3m-modeline-process-status-on 'risky-local-variable t)
+ (put 'w3m-modeline-process-status-on-icon 'risky-local-variable t))
+ (if (and window-system
+ w3m-show-graphic-icons-in-mode-line
+ w3m-spinner-image-file)
+ (progn
+ (when (stringp w3m-modeline-process-status-on)
+ ;; Save the original status strings as properties.
+ (put 'w3m-modeline-process-status-on 'string
+ w3m-modeline-process-status-on))
+ (setq w3m-modeline-process-status-on
+ '(""
+ w3m-space-before-modeline-icon
+ w3m-modeline-process-status-on-icon)))
+ (when (get 'w3m-modeline-process-status-on 'string)
+ (setq w3m-modeline-process-status-on
+ (get 'w3m-modeline-process-status-on 'string))))))
+
+(defun w3m-make-spinner-image ()
+ "Make an image used to show a spinner.
+It should be called periodically in order to spin the spinner."
+ (when w3m-spinner-image-file
+ (unless (< (incf w3m-spinner-image-index) w3m-spinner-image-frames)
+ (setq w3m-spinner-image-index 0))
+ (let ((image (create-image w3m-spinner-image-file 'gif nil
+ :ascent 'center :mask 'heuristic
+ :index w3m-spinner-image-index)))
+ (setq w3m-modeline-process-status-on-icon
+ (propertize " "
+ 'display image
+ 'local-map w3m-modeline-spinner-map
+ 'help-echo w3m-spinner-map-help-echo))
+ image)))
+
+(defun w3m-decode-coding-string-with-priority (str coding)
+ "Decode the string STR which is encoded in CODING.
+If CODING is a list, look for the coding system using it as a priority
+list."
+ (setq str (string-make-unibyte str))
+ (when (listp coding)
+ (setq coding
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert str)
+ (w3m-detect-coding-region (point-min) (point-max) coding))))
+ (decode-coding-string str
+ (or coding
+ w3m-default-coding-system
+ w3m-coding-system
+ 'iso-2022-7bit)))
+
+(defun w3m-form-coding-system-accept-region-p (&optional from to coding-system)
+ "Check whether `coding-system' can encode specified region."
+ (let ((from (or from (point-min)))
+ (to (or to (point-max)))
+ (coding-system (or coding-system
+ w3m-form-input-textarea-coding-system)))
+ (if (fboundp 'unencodable-char-position)
+ (let ((pos (unencodable-char-position from to coding-system)))
+ (or (not pos)
+ (y-or-n-p (format "\"%c\" would not be accepted. Continue? "
+ (char-after pos)))))
+ (let ((select-safe-coding-system-accept-default-p nil))
+ (or (eq (select-safe-coding-system from to coding-system)
+ coding-system)
+ (y-or-n-p
+ "This text may cause coding-system problem. Continue? "))))))
+
+(provide 'w3m-ems)
+
+;;; w3m-ems.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-favicon.el b/share/emacs/site-lisp/w3m/w3m-favicon.el
new file mode 100644
index 00000000000..8784703182c
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-favicon.el
@@ -0,0 +1,367 @@
+;;; w3m-favicon.el --- utilities for handling favicon in emacs-w3m
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Yuuichi Teranishi <teranisi@gohome.org>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+;;(require 'w3m-util)
+;;(require 'w3m-proc)
+(require 'w3m-image)
+
+(eval-when-compile
+ (defvar w3m-current-buffer)
+ (defvar w3m-current-url)
+ (defvar w3m-favicon-image)
+ (defvar w3m-icon-data)
+ (defvar w3m-modeline-favicon)
+ (defvar w3m-profile-directory)
+ (defvar w3m-use-favicon)
+ (defvar w3m-work-buffer-name)
+ (defvar w3m-work-buffer-list)
+ (autoload 'w3m-expand-url "w3m")
+ (autoload 'w3m-load-list "w3m")
+ (autoload 'w3m-message "w3m")
+ (autoload 'w3m-retrieve "w3m")
+ (autoload 'w3m-save-list "w3m")
+ (autoload 'w3m-url-readable-string "w3m"))
+
+(defcustom w3m-favicon-size nil
+ "Size of favicon. The value should be `(WIDTH . HEIGHT)' or nil.
+Where WIDTH and HEIGHT are positive integers; both or any of them can
+be omitted."
+ :group 'w3m
+ :type '(radio (const :tag "Not specified" nil)
+ (cons :format "%v"
+ (integer :format "Width: %v " :size 0 :value 16)
+ (integer :format "Height: %v " :size 0 :value 16))))
+
+(defconst w3m-favicon-name "favicon.ico"
+ "The favicon name.")
+
+(add-hook 'w3m-display-functions 'w3m-favicon-setup)
+
+(defcustom w3m-favicon-use-cache-file nil
+ "*If non-nil, use favicon cache file."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-favicon-cache-file nil
+ "Filename of saving favicon cache.
+It defaults to the file named \".favicon\" under the directory specified
+by the `w3m-profile-directory' variable."
+ :group 'w3m
+ :type '(radio (const :format "Not specified\n")
+ (file :format "%t: %v\n" :size 0)))
+
+(defcustom w3m-favicon-cache-expire-wait (* 30 24 60 60)
+ "*The cache will be expired after specified seconds passed since retrieval.
+If this variable is nil, never expired."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-favicon-type
+ (let ((types '(png gif pbm xpm bmp))
+ type)
+ (catch 'det
+ (while types
+ (setq type (car types)
+ types (cdr types))
+ (if (if (featurep 'xemacs)
+ (featurep type)
+ (image-type-available-p type))
+ (throw 'det type)))))
+ "*Image type of display favicon."
+ :group 'w3m
+ :type (cons 'radio
+ (let ((types (if (or
+ (featurep 'xemacs)
+ (not (fboundp 'image-types)))
+ (delq nil
+ (mapcar (lambda (type)
+ (if (featurep type) type))
+ '(gif jpeg png tiff xpm)))
+ (delq 'postscript (copy-sequence image-types)))))
+ (nconc (mapcar (lambda (x)
+ `(const :format "%v " ,x))
+ (butlast types))
+ `((const ,(car (last types))))))))
+
+(defcustom w3m-space-before-favicon " "
+ "String of space char(s) to be put in front of favicon in the mode-line.
+It may be better to use two or more spaces if you are using oblique or
+italic font in the modeline."
+ :group 'w3m
+ :type 'string)
+
+(defcustom w3m-favicon-convert-args nil
+ "List of additional arguments passed to ImageMagick's convert program.
+Args that are always passed to convert in addition to this value are:
+
+\(\"-geometry\" \"WIDTHxHEIGHT\" \"fromTYPE:temp-file\" \"toTYPE:-\")
+
+Args might also contain (\"-transparent\" \"COLOR\") in the beginning.
+Note that this value is effective only with Emacs 22 and greater."
+ :group 'w3m
+ :type `(repeat (group :inline t
+ :match-inline
+ (lambda (widget vals)
+ (if (and (eq (aref (car vals) 0) ?-)
+ (cdr vals)
+ (not (eq (aref (nth 1 vals) 0) ?-)))
+ (cons (list (car vals) (nth 1 vals))
+ (nthcdr 2 vals))
+ (cons (list (car vals)) (cdr vals))))
+ (string :format "Arg: %v " :value "-" :size 0)
+ (checklist :inline t
+ (string :format "Value: %v\n" :size 0)))))
+
+(defcustom w3m-favicon-default-background nil
+ "Color name used as transparent color of favicon image.
+Nil means to use the background color of the Emacs frame. The null
+string \"\" is special, that will be replaced with the background color
+of the header line or the mode line on which the favicon is displayed.
+Note that this value is effective only with Emacs 22 and greater."
+ :group 'w3m
+ :type '(radio (string :format "Color: %v\n" :size 0
+ :match (lambda (widget value)
+ (and (stringp value) (> (length value) 0))))
+ (const :tag "Use the background color of the Emacs frame" nil)
+ (const :tag "Null string" "")))
+
+(defvar w3m-favicon-type-alist '((pbm . ppm))
+ "A list of a difference type of image between Emacs and ImageMagick.
+ 0. Type of Emacs
+ 1. Type of ImageMagick")
+
+(defvar w3m-favicon-cache-data nil
+ "A list of favicon cache (internal variable).
+Each information is a list whose elements are:
+
+ 0. URL
+ 1. (RAW_DATA . TYPE)
+ 2. DATE when the RAW_DATA was retrieved
+ 3. IMAGE
+
+Where IMAGE highly depends on the Emacs version and is not saved in
+the cache file.")
+
+(w3m-static-if (featurep 'xemacs)
+ (set 'w3m-modeline-favicon
+ '("" w3m-space-before-favicon w3m-favicon-image))
+ (put 'w3m-modeline-favicon 'risky-local-variable t))
+(make-variable-buffer-local 'w3m-modeline-favicon)
+(make-variable-buffer-local 'w3m-favicon-image)
+
+(defmacro w3m-favicon-cache-p (url)
+ "Say whether the favicon data for URL has been chached."
+ `(assoc ,url w3m-favicon-cache-data))
+
+(defmacro w3m-favicon-cache-favicon (url)
+ "Pull out the favicon image corresponding to URL from the cache."
+ `(nth 3 (assoc ,url w3m-favicon-cache-data)))
+
+(defmacro w3m-favicon-cache-retrieved (url)
+ "Return the time when the favicon data for URL was retrieved."
+ `(nth 2 (assoc ,url w3m-favicon-cache-data)))
+
+(defmacro w3m-favicon-set-image (image)
+ "Set IMAGE to `w3m-favicon-image' and `w3m-modeline-favicon'."
+ (if (featurep 'xemacs)
+ `(set 'w3m-favicon-image ,image)
+ `(when (setq w3m-favicon-image ,image)
+ (set 'w3m-modeline-favicon
+ (list ""
+ 'w3m-space-before-favicon
+ (propertize " " 'display w3m-favicon-image)
+ (propertize " " 'display '(space :width 0.5)))))))
+
+(defun w3m-favicon-setup (url)
+ "Set up the favicon data in the current buffer. The buffer-local
+variable `w3m-favicon-image' will be set to non-nil value when the
+favicon is ready."
+ (w3m-favicon-set-image nil)
+ (when (and w3m-use-favicon
+ w3m-current-url
+ (w3m-static-if (featurep 'xemacs)
+ (and (device-on-window-system-p)
+ (featurep w3m-favicon-type))
+ (and (display-images-p)
+ (image-type-available-p w3m-favicon-type))))
+ (let (icon)
+ (cond
+ ((and (string-match "\\`about://\\([^/]+\\)/" url)
+ (setq icon (intern-soft (concat "w3m-about-" (match-string 1 url)
+ "-favicon"))))
+ (with-current-buffer w3m-current-buffer
+ (w3m-favicon-set-image
+ (w3m-favicon-convert
+ (base64-decode-string (symbol-value icon)) 'ico))))
+ ((or (string-match "\\`https?://" url)
+ (and (string-match "\\`about://\\(?:header\\|source\\)/https?://"
+ url)
+ (setq url (substring url 15))))
+ (if w3m-icon-data
+ (w3m-favicon-retrieve (car w3m-icon-data) (cdr w3m-icon-data)
+ w3m-current-buffer)
+ (w3m-favicon-retrieve (w3m-expand-url (concat "/" w3m-favicon-name)
+ url)
+ 'ico w3m-current-buffer)))))))
+
+(defun w3m-favicon-convert (data type)
+ "Convert the favicon DATA in TYPE to the favicon image and return it."
+ (when (or (not (eq type 'ico))
+ ;; Since most of favicons are the `ico' types, we make sure
+ ;; of the magic-numbers only as for them.
+ (string-equal "\x00\x00\x01\x00" (substring data 0 4)))
+ (let ((height (or (cdr w3m-favicon-size)
+ (w3m-static-if (featurep 'xemacs)
+ (face-height 'default)
+ (frame-char-height))))
+ (new (w3m-static-unless (featurep 'xemacs)
+ (>= emacs-major-version 22)))
+ bg args img)
+ ;; Examine the transparent color of the image.
+ (when (and w3m-imagick-identify-program
+ (equal w3m-favicon-default-background ""))
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert data)
+ (let ((coding-system-for-read 'raw-text)
+ (coding-system-for-write 'binary))
+ (condition-case nil
+ (call-process-region (point-min) (point-max)
+ w3m-imagick-identify-program
+ t t nil "-verbose" (format "%s:-" type))
+ (error)))
+ (goto-char (point-min))
+ (setq case-fold-search t)
+ (while (and (not bg)
+ (re-search-forward "^ *Transparent +color: *\
+\\([^\n ]+\\(?: +[^\n ]+\\)*\\)" nil t))
+ (when (string-match "\\`none\\'" (setq bg (match-string 1)))
+ (setq bg nil)))))
+ (setq args (list "-geometry"
+ (format "%dx%d"
+ (or (car w3m-favicon-size) height) height)))
+ (w3m-static-unless (featurep 'xemacs)
+ (when new
+ ;; "-transparent" should precede the other arguments.
+ (setq args (nconc (when bg (list "-transparent" bg))
+ args
+ w3m-favicon-convert-args))))
+ (setq img (apply
+ #'w3m-imagick-convert-data
+ data (symbol-name type)
+ (symbol-name (or (cdr (assq w3m-favicon-type
+ w3m-favicon-type-alist))
+ w3m-favicon-type))
+ args))
+ (when img
+ (w3m-static-if (featurep 'xemacs)
+ (make-glyph
+ (make-image-instance (vector w3m-favicon-type :data img)))
+ (if new
+ (create-image img w3m-favicon-type t
+ :ascent 'center
+ :background w3m-favicon-default-background)
+ (create-image img w3m-favicon-type t :ascent 'center)))))))
+
+(defun w3m-favicon-retrieve (url type target)
+ "Retrieve favicon from URL and convert it to image as TYPE in TARGET.
+TYPE is a symbol like `ico' and TARGET is a buffer where the image is
+stored in the `w3m-favicon-image' buffer-local variable."
+ (if (and (w3m-favicon-cache-p url)
+ (or (null w3m-favicon-cache-expire-wait)
+ (< (- (w3m-float-time)
+ (w3m-float-time (w3m-favicon-cache-retrieved url)))
+ w3m-favicon-cache-expire-wait)))
+ (with-current-buffer target
+ (w3m-favicon-set-image (w3m-favicon-cache-favicon url)))
+ (lexical-let ((url url)
+ (type type)
+ (target target)
+ (silent w3m-message-silent))
+ (w3m-process-with-null-handler
+ (w3m-process-do-with-temp-buffer
+ (ok (w3m-retrieve url 'raw nil nil nil handler))
+ (let ((w3m-message-silent silent)
+ idata image)
+ (if (and ok
+ ;; Some broken servers provides empty contents.
+ (>= (buffer-size) 4))
+ (setq idata (buffer-string)
+ image (w3m-favicon-convert idata type))
+ (w3m-message "Reading %s...done (no favicon)"
+ (w3m-url-readable-string url)))
+ (with-current-buffer target
+ (w3m-favicon-set-image image)
+ (push (list url idata (current-time) w3m-favicon-image)
+ w3m-favicon-cache-data)))))))
+ ;; Emacs frame needs to be redisplayed to make favicon come out.
+ (w3m-force-window-update-later target 1))
+
+(defun w3m-favicon-save-cache-file ()
+ "Save the cached favicon data into the local file."
+ (when w3m-favicon-use-cache-file
+ (w3m-save-list (or w3m-favicon-cache-file
+ (expand-file-name ".favicon" w3m-profile-directory))
+ (delq nil (mapcar (lambda (elem)
+ (when (= (length elem) 4)
+ (butlast elem)))
+ w3m-favicon-cache-data))
+ 'binary)))
+
+(defun w3m-favicon-load-cache-file ()
+ "Load the cached favicon data from the local file."
+ (when (and w3m-favicon-use-cache-file
+ (null w3m-favicon-cache-data))
+ (let ((cache (w3m-load-list
+ (or w3m-favicon-cache-file
+ (expand-file-name ".favicon" w3m-profile-directory))
+ 'binary))
+ elem data image)
+ (while cache
+ (setq elem (car cache)
+ cache (cdr cache)
+ data (cadr elem))
+ (when (stringp data)
+ (setcar (cdr elem) (setq data (cons data 'ico))))
+ (when (setq image (condition-case nil
+ (w3m-favicon-convert (car data) (cdr data))
+ (error nil)))
+ (push (nconc elem (list image)) w3m-favicon-cache-data))))))
+
+(add-hook 'w3m-arrived-setup-functions 'w3m-favicon-load-cache-file)
+(add-hook 'w3m-arrived-shutdown-functions 'w3m-favicon-save-cache-file)
+
+(provide 'w3m-favicon)
+
+;;; w3m-favicon.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-fb.el b/share/emacs/site-lisp/w3m/w3m-fb.el
new file mode 100644
index 00000000000..810bb212914
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-fb.el
@@ -0,0 +1,208 @@
+;;; w3m-fb.el --- frame-local buffers support for Emacs-w3m
+
+;;; Copyright (C) 2005, 2006 Matthew P. Hodges
+
+;; Author: Matthew P. Hodges <MPHodges@member.fsf.org>
+;; Version: $Id: w3m-fb.el,v 1.4 2006/09/20 09:26:42 yamaoka Exp $
+
+;; w3m-fb.el is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published
+;; by the Free Software Foundation; either version 2, or (at your
+;; option) any later version.
+
+;; w3m-fb.el is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;;; Commentary:
+;;
+;; With this mode switched on, W3M buffers are associated with the
+;; frame on which they were created. Only tabs for the current
+;; frame's W3M buffers are shown (with non-nil w3m-use-tab); other
+;; affected commands are w3m-next-buffer w3m-previous-buffer,
+;; w3m-select-buffer and w3m-quit.
+;;
+;; Switch the mode on programmatically with:
+;;
+;; (w3m-fb-mode 1)
+;;
+;; or toggle interactively with M-x w3m-fb-mode RET.
+
+;;; Code:
+
+(defconst w3m-fb-version "1.0.0"
+ "Version number of this package.")
+
+(eval-when-compile
+ (autoload 'w3m-delete-buffer "w3m" nil t)
+ (autoload 'w3m-list-buffers "w3m-util")
+ (autoload 'w3m-next-buffer "w3m" nil t)
+ (defvar w3m-pop-up-frames))
+
+(eval-and-compile
+ (defalias 'w3m-fb-frame-parameter
+ (cond
+ ((fboundp 'frame-parameter)
+ 'frame-parameter)
+ ((fboundp 'frame-property)
+ 'frame-property)
+ (t
+ (error "No frame parameter/property function")))))
+
+(defvar w3m-fb-delete-frame-functions
+ (cond
+ ((boundp 'delete-frame-functions)
+ 'delete-frame-functions)
+ ((boundp 'delete-frame-hook)
+ 'delete-frame-hook)
+ (t
+ (error "No delete-frame hook/functions variable found")))
+ "Symbol associated with `delete-frame' hooks.")
+
+(defvar w3m-fb-list-buffers-frame nil
+ "Frame to list buffers for in `w3m-list-buffers'.
+Bind this if the buffers associated with a frame other than the
+selected frame are required.")
+
+;; Customizable variables
+
+(defgroup w3m-fb nil
+ "Frame local buffers for Emacs-w3m."
+ :group 'w3m)
+
+(defcustom w3m-fb-delete-frame-kill-buffers t
+ "If non-nil, kill W3M buffers after deleting frames."
+ :group 'w3m-fb
+ :type 'boolean
+ :set (lambda (sym val)
+ (set sym val)
+ (when (boundp 'w3m-fb-mode)
+ (if w3m-fb-mode
+ (add-hook w3m-fb-delete-frame-functions
+ 'w3m-fb-delete-frame-buffers)
+ (remove-hook w3m-fb-delete-frame-functions
+ 'w3m-fb-delete-frame-buffers)))))
+
+;; Internal variables
+
+(defvar w3m-fb-buffer-list nil
+ "List of w3m buffers associated with the selected frame.")
+
+(defvar w3m-fb-inhibit-buffer-selection nil
+ "Non-nil to inhibit selecting a suitable w3m buffer.")
+
+;; Internal functions
+
+(defun w3m-fb-delete-frame-buffers (&optional frame)
+ "Delete W3M buffers associated with frame FRAME."
+ (let* ((w3m-fb-list-buffers-frame frame)
+ (buffers (w3m-list-buffers))
+ ;; Now bind w3m-fb-mode to nil so that w3m-delete-buffer
+ ;; doesn't call w3m-quit when there are w3m buffers belonging
+ ;; to other frames.
+ (w3m-fb-mode nil)
+ (w3m-fb-inhibit-buffer-selection t))
+ (save-window-excursion
+ (dolist (b buffers)
+ (with-current-buffer b
+ (w3m-delete-buffer))))))
+
+;; Could use set-frame-parameter here, but it isn't portable
+(defun w3m-fb-set-frame-parameter (frame parameter value)
+ "Set for frame FRAME parameter PARAMETER to VALUE."
+ (modify-frame-parameters frame (list (cons parameter value))))
+
+(defun w3m-fb-add ()
+ "Add current buffer to `w3m-fb-buffer-list'."
+ (let ((val (w3m-fb-frame-parameter nil 'w3m-fb-buffer-list)))
+ (w3m-fb-set-frame-parameter
+ nil 'w3m-fb-buffer-list (nconc val (list (current-buffer))))))
+
+(defun w3m-fb-remove ()
+ "Remove current buffer from `w3m-fb-buffer-list'.
+Applies to all frames."
+ (when (eq major-mode 'w3m-mode)
+ (let (val)
+ (dolist (f (frame-list))
+ (setq val (w3m-fb-frame-parameter f 'w3m-fb-buffer-list))
+ (w3m-fb-set-frame-parameter
+ f 'w3m-fb-buffer-list (delq (current-buffer) val))))))
+
+(defun w3m-fb-associate ()
+ "Associate all `w3m-mode' buffers with a frame."
+ (let (buffers done rest)
+ ;; Buffers displayed in windows
+ (dolist (f (frame-list))
+ (setq buffers nil)
+ (dolist (w (window-list f nil (frame-selected-window f)))
+ (when (with-current-buffer (window-buffer w)
+ (eq major-mode 'w3m-mode))
+ (setq buffers (nconc buffers (list (window-buffer w))))
+ (setq done (nconc done (list (window-buffer w))))))
+ (w3m-fb-set-frame-parameter
+ f 'w3m-fb-buffer-list buffers))
+ ;; Buffers not displayed in windows; add to selected frame
+ (let ((w3m-fb-mode nil))
+ (setq rest (w3m-list-buffers)))
+ (dolist (b done)
+ (setq rest (delq b rest)))
+ (when rest
+ (w3m-fb-set-frame-parameter
+ nil 'w3m-fb-buffer-list
+ (nconc (w3m-fb-frame-parameter nil 'w3m-fb-buffer-list) rest)))))
+
+(defun w3m-fb-dissociate ()
+ "Disassociate `w3m-mode' buffers from frames."
+ (dolist (f (frame-list))
+ (w3m-fb-set-frame-parameter f 'w3m-fb-buffer-list nil)))
+
+(defun w3m-fb-select-buffer ()
+ "Select an appropriate W3M buffer to display."
+ ;; If there are w3m buffers belonging to this frame, ensure one is
+ ;; selected; if not make sure that we're not displaying a w3m
+ ;; buffer
+ (cond
+ ;; Select w3m buffer belonging to frame, if one is available
+ ((w3m-list-buffers)
+ (unless (memq (current-buffer) (w3m-list-buffers))
+ (w3m-next-buffer -1)))
+ (t
+ ;; If no w3m buffers belong to frame, don't display any w3m buffer
+ (while (eq major-mode 'w3m-mode)
+;; (assert (eq (current-buffer)
+;; (window-buffer (selected-window))))
+ (bury-buffer)))))
+
+;; Minor mode setup
+
+;;;###autoload
+(define-minor-mode w3m-fb-mode
+ "Toggle W3M Frame Buffer mode.
+This allows frame-local lists of buffers (tabs)."
+ :init-value nil
+ :group 'w3m-fb
+ :global t
+ (if (and w3m-fb-mode
+ (if w3m-pop-up-frames
+ (prog1
+ (setq w3m-fb-mode nil)
+ (message "\
+W3M Frame Buffer mode not activated (non-nil w3m-pop-up-frames)")
+ (sit-for 2))
+ t))
+ (progn
+ (add-hook 'w3m-mode-hook 'w3m-fb-add)
+ (add-hook 'kill-buffer-hook 'w3m-fb-remove)
+ (when w3m-fb-delete-frame-kill-buffers
+ (add-hook w3m-fb-delete-frame-functions
+ 'w3m-fb-delete-frame-buffers))
+ (w3m-fb-associate))
+ (remove-hook 'w3m-mode-hook 'w3m-fb-add)
+ (remove-hook 'kill-buffer-hook 'w3m-fb-remove)
+ (remove-hook w3m-fb-delete-frame-functions 'w3m-fb-delete-frame-buffers)
+ (w3m-fb-dissociate)))
+
+(provide 'w3m-fb)
+
+;;; w3m-fb.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-filter.el b/share/emacs/site-lisp/w3m/w3m-filter.el
new file mode 100644
index 00000000000..8feb1439e21
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-filter.el
@@ -0,0 +1,367 @@
+;;; w3m-filter.el --- filtering utility of advertisements on WEB sites -*- coding: euc-japan -*-
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-filter.el is the add-on utility to filter advertisements on WEB
+;; sites.
+
+
+;;; Code:
+
+(provide 'w3m-filter)
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m)
+
+(defcustom w3m-filter-rules
+ `(("\\`http://www\\.geocities\\.co\\.jp/"
+ w3m-filter-delete-regions
+ "<DIV ALIGN=CENTER>\n<!--*/GeoGuide/*-->" "<!--*/GeoGuide/*-->\n</DIV>")
+ ("\\`http://[a-z]+\\.hp\\.infoseek\\.co\\.jp/"
+ w3m-filter-delete-regions
+ "<!-- start AD -->" "<!-- end AD -->")
+ ("\\`http://linux\\.ascii24\\.com/linux/"
+ w3m-filter-delete-regions
+ "<!-- DAC CHANNEL AD START -->" "<!-- DAC CHANNEL AD END -->")
+ ("\\`http://\\(www\\|images\\|news\\|maps\\|groups\\)\\.google\\."
+ w3m-filter-google)
+ ("\\`https?://\\(?:www\\.\\)?amazon\\.\
+\\(?:com\\|co\\.\\(?:jp\\|uk\\)\\|fr\\|de\\)/"
+ w3m-filter-amazon)
+ ("\\`https?://mixi\\.jp" w3m-filter-mixi)
+ ("\\`http://eow\\.alc\\.co\\.jp/[^/]+/UTF-8" w3m-filter-alc)
+ ("\\`http://www\\.asahi\\.com/" w3m-filter-asahi-shimbun)
+ ("\\`http://imepita\\.jp/[0-9]+/[0-9]+" w3m-filter-imepita)
+ ("\\`http://allatanys\\.jp/" w3m-filter-allatanys)
+ ("\\`http://.*\\.wikipedia\\.org/" w3m-filter-wikipedia)
+ ("" w3m-filter-iframe))
+ "Rules to filter advertisements on WEB sites."
+ :group 'w3m
+ :type '(repeat
+ (cons :format "%v" :indent 4
+ (regexp :format "Regexp: %v\n" :size 0)
+ (choice
+ :tag "Filtering Rule"
+ (list :tag "Delete regions surrounded with these patterns"
+ (function-item :format "" w3m-filter-delete-region)
+ (regexp :tag "Start")
+ (regexp :tag "End"))
+ (list :tag "Filter with a user defined function"
+ function
+ (repeat :tag "Arguments" sexp))))))
+
+(defcustom w3m-filter-google-use-utf8
+ (or (featurep 'un-define) (fboundp 'utf-translate-cjk-mode)
+ (and (not (equal "Japanese" w3m-language))
+ (w3m-find-coding-system 'utf-8)))
+ "*Use the converting rule to UTF-8 on the site of Google."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-filter-google-use-ruled-line t
+ "*Use the ruled line on the site of Google."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-filter-google-separator "<hr>"
+ "Field separator for Google's search results ."
+ :group 'w3m
+ :type 'string)
+
+(defcustom w3m-filter-amazon-regxp
+ (concat
+ "\\`\\(https?://\\(?:www\\.\\)?amazon\\."
+ "\\(?:com\\|co\\.\\(?:jp\\|uk\\)\\|fr\\|de\\)"
+ ;; "Joyo.com"
+ "\\)/"
+ "\\(?:"
+ "\\(?:exec/obidos\\|o\\)/ASIN"
+ "\\|"
+ "gp/product"
+ "\\|"
+ "\\(?:[^/]+/\\)?dp"
+ "\\)"
+ "/\\([0-9]+\\)")
+ "*Regexp to extract ASIN number for Amazon."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-filter-amazon-short-url-bottom nil
+ "*Amazon short URLs insert bottom position."
+ :group 'w3m
+ :type 'boolean)
+
+;;;###autoload
+(defun w3m-filter (url)
+ "Apply filtering rule of URL against a content in this buffer."
+ (save-match-data
+ (dolist (elem w3m-filter-rules)
+ (when (string-match (car elem) url)
+ (apply (cadr elem) url (cddr elem))))))
+
+(defun w3m-filter-delete-regions (url start end)
+ "Delete regions surrounded with a START pattern and an END pattern."
+ (goto-char (point-min))
+ (let (p (i 0))
+ (while (and (search-forward start nil t)
+ (setq p (match-beginning 0))
+ (search-forward end nil t))
+ (delete-region p (match-end 0))
+ (incf i))
+ (> i 0)))
+
+(defun w3m-filter-replace-regexp (url regexp to-string)
+ "Replace all occurrences of REGEXP with TO-STRING."
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (replace-match to-string nil nil)))
+
+;; Filter functions:
+(defun w3m-filter-asahi-shimbun (url)
+ "Convert entity reference of UCS."
+ (when w3m-use-mule-ucs
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ end ucs)
+ (while (re-search-forward "alt=\"\\([^\"]+\\)" nil t)
+ (goto-char (match-beginning 1))
+ (setq end (set-marker (make-marker) (match-end 1)))
+ (while (re-search-forward "&#\\([0-9]+\\);" (max end (point)) t)
+ (setq ucs (string-to-number (match-string 1)))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert-char (w3m-ucs-to-char ucs) 1))))))
+
+(defun w3m-filter-google (url)
+ "Insert separator within items."
+ (goto-char (point-min))
+ (let ((endm (make-marker))
+ (case-fold-search t)
+ pos beg end)
+ (when (and w3m-filter-google-use-utf8
+ (re-search-forward "\
+<a class=. href=\"http://\\(www\\|images\\|news\\|maps\\|groups\\)\\.google\\."
+ nil t)
+ (setq pos (match-beginning 0))
+ (search-backward "<table" nil t)
+ (setq beg (match-beginning 0))
+ (search-forward "</table" nil t)
+ (set-marker endm (match-end 0))
+ (< pos (marker-position endm)))
+ (goto-char beg)
+ (while (re-search-forward "[?&][io]e=\\([^&]+\\)&" endm t)
+ (replace-match "UTF-8" nil nil nil 1))
+ (setq end (marker-position endm)))
+ (when (string-match "\\`http://www\\.google\\.[^/]+/search\\?" url)
+ (goto-char (point-max))
+ (when (and w3m-filter-google-use-ruled-line
+ (search-backward "<div class=" end t)
+ (search-forward "</div>" nil t))
+ (insert w3m-filter-google-separator))
+ (if w3m-filter-google-use-ruled-line
+ (while (search-backward "<div class=" end t)
+ (insert w3m-filter-google-separator))
+ (while (search-backward "<div class=" end t)
+ (insert "<p>"))))))
+
+(defun w3m-filter-amazon (url)
+ "Insert Amazon short URIs."
+ (when (string-match w3m-filter-amazon-regxp url)
+ (let* ((base (match-string 1 url))
+ (asin (match-string 2 url))
+ (shorturls `(,(concat base "/dp/" asin "/")
+ ,(concat base "/o/ASIN/" asin "/")
+ ,(concat base "/gp/product/" asin "/")))
+ (case-fold-search t)
+ shorturl)
+ (goto-char (point-min))
+ (setq url (file-name-as-directory url))
+ (when (or (and (not w3m-filter-amazon-short-url-bottom)
+ (search-forward "<body" nil t)
+ (search-forward ">" nil t))
+ (and w3m-filter-amazon-short-url-bottom
+ (search-forward "</body>" nil t)
+ (goto-char (match-beginning 0))))
+ (insert "\n")
+ (while (setq shorturl (car shorturls))
+ (setq shorturls (cdr shorturls))
+ (unless (string= url shorturl)
+ (insert (format "Amazon Short URL: <a href=\"%s\">%s</a><br>\n"
+ shorturl shorturl))))
+ (insert "\n")))))
+
+(defun w3m-filter-mixi (url)
+ "Direct jump to the external diary."
+ (goto-char (point-min))
+ (let (newurl)
+ (while (re-search-forward "<a href=\"?view_diary\\.pl\\?url=\\([^>]+\\)>"
+ nil t)
+ (setq newurl (match-string 1))
+ (when newurl
+ (delete-region (match-beginning 0) (match-end 0))
+ (when (string-match "&owner_id=[0-9]+\"?\\'" newurl)
+ (setq newurl (substring newurl 0 (match-beginning 0))))
+ (insert (format "<a href=\"%s\">"
+ (w3m-url-readable-string newurl)))))))
+
+(defun w3m-filter-alc (url)
+ (let ((baseurl "http://eow.alc.co.jp/%s/UTF-8/")
+ curl cword beg tmp1)
+ (when (string-match "\\`http://eow\\.alc\\.co\\.jp/\\([^/]+\\)/UTF-8/" url)
+ (setq curl (match-string 0 url))
+ (setq cword (match-string 1 url))
+ (setq cword (car (split-string (w3m-url-decode-string cword 'utf-8)
+ " ")))
+ (goto-char (point-min))
+ (while (search-forward "¥Ç¡¼¥¿¤ÎžºÜ¤Ï¶Ø¤¸¤é¤ì¤Æ¤¤¤Þ¤¹" nil t)
+ (delete-region (line-beginning-position) (line-end-position))
+ (insert "<br>"))
+ (goto-char (point-min))
+ (when (search-forward "<body" nil t)
+ (forward-line 1)
+ (insert "<h1>±Ñ¼­Ï¯ on the WEB<h1>\n")
+ (setq beg (point))
+ (when (search-forward "<!-- ¢§¸¡º÷ʸ»úÎó -->" nil t)
+ (forward-line 1)
+ (delete-region beg (point)))
+ (when (search-forward "<!-- ¢§¥ï¡¼¥É¥ê¥ó¥¯ ÍúÎò -->" nil t)
+ (forward-line 1)
+ (setq beg (point))
+ (when (search-forward "</body>" nil t)
+ (delete-region beg (match-beginning 0))))
+ (insert "<br>¡ö¥Ç¡¼¥¿¤ÎžºÜ¤Ï¶Ø¤¸¤é¤ì¤Æ¤¤¤Þ¤¹¡£")
+ ;; next/previous page
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<a href='javascript:goPage(\"\\([0-9]+\\)\")'>"
+ nil t)
+ (setq tmp1 (match-string 1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (format "<a href=\"%s?pg=%s\">" curl tmp1)))
+ ;; wordlink
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<span class=\"wordlink\">\\([^<]+\\)</span>"
+ nil t)
+ (setq tmp1 (match-string 1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (format "<a href=\"%s\">%s</a>" (format baseurl tmp1) tmp1)))
+ ;; goGradable/goFairWord
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<a href='javascript:\\(goGradable\\|goFairWord\\)(\"\\([^\"]+\\)\")'>"
+ nil t)
+ (setq tmp1 (match-string 2))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (format "<a href=\"%s\">" (format baseurl tmp1))))
+ ;; remove spacer
+ (goto-char (point-min))
+ (while (search-forward "img/spacer.gif" nil t)
+ (delete-region (line-beginning-position) (line-end-position)))
+ (goto-char (point-min))
+ ;; remove ¥ï¡¼¥É¥ê¥ó¥¯
+ (when (search-forward "alt=\"¥ï¡¼¥É¥ê¥ó¥¯\"" nil t)
+ (delete-region (line-beginning-position) (line-end-position)))
+ ;; Á´Ê¸¤òɽ¼¨¤¹¤ë¤Ï̵Íý
+ (goto-char (point-min))
+ (while (re-search-forward
+ (concat "<br */> *¢Í<strong>"
+ "<a href='javascript:goFullText(\"[^\"]+\", \"[^\"]+\")'>"
+ "Á´Ê¸¤òɽ¼¨¤¹¤ë</a>")
+ nil t)
+ (delete-region (match-beginning 0) (match-end 0)))
+ ;; Java Document write... ;_;
+ ;; (while (re-search-forward
+ ;; "<a href='javascript:goFullText(\"\\([^\"]+\\)\", \"\\([^\"]+\\)\")'>"
+ ;; nil t)
+ ;; (setq tmp1 (match-string 1))
+ ;; (setq tmp2 (match-string 2))
+ ;; (delete-region (match-beginning 0) (match-end 0))
+ ;; ;; &dk=JE, &dk=EJ
+ ;; (insert (format "<a href=\"%s?ref=ex&exp=%s&dn=%s&dk=%s\">"
+ ;; curl tmp1 tmp2
+ ;; (if (string-match "\\Cj" cword) "JE" "EJ"))))
+ ))))
+
+(defun w3m-filter-imepita (url)
+ "JavaScript emulation."
+ (goto-char (point-min))
+ (let (tmp)
+ (when (re-search-forward
+ (concat "<script><!--\ndocument.write('\\([^\n]*\\)');\r\n//--></script>\n"
+ "<noscript>.*</noscript>")
+ nil t)
+ (setq tmp (match-string 1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert tmp))))
+
+(defun w3m-filter-iframe (url)
+ (goto-char (point-min))
+ (while (re-search-forward "<iframe [^>]*src=\"\\([^\"]*\\)\"[^>]*>" nil t)
+ (insert (concat "[iframe:<a href=\"" (match-string 1) "\">" (match-string 1) "</a>]"))))
+
+(defun w3m-filter-allatanys (url)
+ "JavaScript emulation."
+ (goto-char (point-min))
+ (let (aturl atexpurl)
+ (if (re-search-forward
+ (concat "<body[ \t\r\f\n]+onload=\"window\\.top\\.location\\.replace('"
+ w3m-html-string-regexp
+ "');\">")
+ nil t)
+ (progn
+ (setq aturl (match-string 1))
+ (setq atexpurl (w3m-expand-url aturl url))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert "<body>\n"
+ "<hr>"
+ "Body has a <b>url=window.top.location.replace()</b><br><br>\n"
+ (format "Goto: <a href=%s>%s</a>\n" aturl atexpurl)
+ "<hr>")
+ (goto-char (point-min))
+ (insert (format "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=%s\">\n"
+ aturl)))
+ (while (re-search-forward (concat "<a[ \t\r\l\n]+href=\"javascript:[^(]+('"
+ "\\([^']+\\)')\">")
+ nil t)
+ (setq aturl (match-string 1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (format "<a href=\"%s\">" aturl))))))
+
+(defun w3m-filter-wikipedia (url)
+ "Make anchor reference to work."
+ (goto-char (point-min))
+ (let (matched-text refid)
+ (while (re-search-forward
+ "<\\(?:sup\\|cite\\) id=\"\\([^\"]*\\)\"" nil t)
+ (setq matched-text (match-string 0)
+ refid (match-string 1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (format "<a name=\"%s\"></a>%s" refid matched-text)))))
+
+;;; w3m-filter.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-form.el b/share/emacs/site-lisp/w3m/w3m-form.el
new file mode 100644
index 00000000000..d75857d568e
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-form.el
@@ -0,0 +1,1896 @@
+;;; w3m-form.el --- Stuffs to handle <form> tag
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Yuuichi Teranishi <teranisi@gohome.org>,
+;; Hideyuki SHIRAI <shirai@meadowy.org>,
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; Akihiro Arisawa <ari@mbf.sphere.ne.jp>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; This file contains the stuffs to handle <form> tag on emacs-w3m.
+;; For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+(require 'w3m)
+
+(eval-when-compile
+ (defvar w3m-current-forms))
+
+(defcustom w3m-form-use-fancy-faces t
+ "*Use fancy faces to fontify <form> tags."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-form-treat-textarea-size t
+ "*Non-nil means to process textarea size (treat textarea rows)."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-form-use-textarea-backup t
+ "*Non-nil means save and restore text that you wrote last in the textarea.
+Files to save text are stored in the directory specified by the
+`w3m-form-textarea-directory' variable."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-form-textarea-file-expire-date 3
+ "*Date to expire of the file for textarea's backup."
+ :group 'w3m
+ :type '(choice (integer :tag "Expire date")
+ (const :tag "Remove when emacs-w3m exit" t)
+ (const :tag "No expire" nil)))
+
+(defcustom w3m-form-textarea-file-coding-system
+ (cond ((or (featurep 'un-define)
+ (fboundp 'utf-translate-cjk-mode))
+ 'utf-8)
+ ((equal "Japanese" w3m-language)
+ 'iso-2022-7bit-ss2)
+ ((w3m-find-coding-system 'utf-8)
+ 'utf-8)
+ (t
+ 'iso-2022-7bit-ss2))
+ "Coding system for textarea's backup file."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-form-textarea-directory
+ (expand-file-name ".textarea" w3m-profile-directory)
+ "*Name of the directory to save the file of textarea input."
+ :group 'w3m
+ :type '(directory :size 0))
+
+(defcustom w3m-form-textarea-edit-mode 'text-mode
+ "*Major mode to edit textarea."
+ :group 'w3m
+ :type '(choice
+ (function :tag "Major mode")
+ (repeat :tag "Rules to select major modes for the current page"
+ (cons (choice (regexp :tag "Regexp matches the current page")
+ (function :tag "Predicate checks the current page")
+ (sexp :tag "Expression checks the current page"))
+ (function :tag "Major mode")))))
+
+(defface w3m-form
+ '((((class color) (background light)) (:foreground "cyan" :underline t))
+ (((class color) (background dark)) (:foreground "red" :underline t))
+ (t (:underline t)))
+ "*Face to fontify forms."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-form-face 'face-alias 'w3m-form)
+
+;;; Local variables
+(defvar w3m-form-input-textarea-buffer nil)
+(defvar w3m-form-input-textarea-form nil)
+(defvar w3m-form-input-textarea-hseq nil)
+(defvar w3m-form-input-textarea-point nil)
+(defvar w3m-form-input-textarea-wincfg nil)
+(defvar w3m-form-input-textarea-file nil)
+(defvar w3m-form-input-textarea-coding-system nil)
+(defvar w3m-form-use-textarea-backup-p nil)
+(make-variable-buffer-local 'w3m-form-input-textarea-buffer)
+(make-variable-buffer-local 'w3m-form-input-textarea-form)
+(make-variable-buffer-local 'w3m-form-input-textarea-hseq)
+(make-variable-buffer-local 'w3m-form-input-textarea-point)
+(make-variable-buffer-local 'w3m-form-input-textarea-wincfg)
+(make-variable-buffer-local 'w3m-form-input-textarea-file)
+(make-variable-buffer-local 'w3m-form-input-textarea-coding-system)
+(make-variable-buffer-local 'w3m-form-use-textarea-backup-p)
+
+(defvar w3m-form-textarea-files nil)
+(make-variable-buffer-local 'w3m-form-textarea-files)
+
+(defvar w3m-form-textarea-post-files nil)
+(make-variable-buffer-local 'w3m-form-textarea-post-files)
+
+(defvar w3m-form-input-textarea-mode nil
+ "Non-nil if w3m textarea minor mode is enabled.")
+(make-variable-buffer-local 'w3m-form-input-textarea-mode)
+
+(defvar w3m-form-input-select-buffer nil)
+(defvar w3m-form-input-select-form nil)
+(defvar w3m-form-input-select-name nil)
+(defvar w3m-form-input-select-id nil)
+(defvar w3m-form-input-select-point nil)
+(defvar w3m-form-input-select-candidates nil)
+(defvar w3m-form-input-select-wincfg nil)
+(defvar w3m-form-input-select-urlid nil)
+(make-variable-buffer-local 'w3m-form-input-select-buffer)
+(make-variable-buffer-local 'w3m-form-input-select-form)
+(make-variable-buffer-local 'w3m-form-input-select-name)
+(make-variable-buffer-local 'w3m-form-input-select-id)
+(make-variable-buffer-local 'w3m-form-input-select-point)
+(make-variable-buffer-local 'w3m-form-input-select-candidates)
+(make-variable-buffer-local 'w3m-form-input-select-wincfg)
+(make-variable-buffer-local 'w3m-form-input-select-urlid)
+
+(defvar w3m-form-input-map-buffer nil)
+(defvar w3m-form-input-map-wincfg nil)
+(defvar w3m-form-input-map-point nil)
+(defvar w3m-form-input-map-urlname nil)
+(make-variable-buffer-local 'w3m-form-input-map-buffer)
+(make-variable-buffer-local 'w3m-form-input-map-wincfg)
+(make-variable-buffer-local 'w3m-form-input-map-point)
+(make-variable-buffer-local 'w3m-form-input-map-urlname)
+
+(defvar w3m-form-new-session nil
+ "Specify non-nil value to create a new session after sending form.
+It is useful to bind this variable with `let', but do not set it globally.")
+
+(defvar w3m-form-download nil
+ "Specify non-nil value to download contents after sending form.
+It is useful to bind this variable with `let', but do not set it globally.")
+
+;;; w3m-form structure:
+
+(defun w3m-form-normalize-action (action url)
+ "Normalize the ACTION using URL as a current URL."
+ ;; "!CURRENT_URL!" is magic string of w3m.
+ (if (and action (not (string= action "!CURRENT_URL!")))
+ (w3m-expand-url action url)
+ (when url
+ (w3m-string-match-url-components url)
+ (substring url 0 (or (match-beginning 6)
+ (match-beginning 8))))))
+
+(defun w3m-form-new (method action &optional baseurl charlst enctype)
+ "Return new form object."
+ (vector 'w3m-form-object
+ (if (stringp method)
+ (intern method)
+ method)
+ action
+ charlst
+ (or enctype 'application/x-www-form-urlencoded)
+ nil))
+
+(defun w3m-form-p (obj)
+ "Return t if OBJ is a form object."
+ (and (vectorp obj)
+ (symbolp (aref 0 obj))
+ (eq (aref 0 obj) 'w3m-form-object)))
+
+(defun w3m-form-set-method (form method)
+ (aset form 1 (if (stringp method)
+ (intern method)
+ method)))
+(defsetf w3m-form-method w3m-form-set-method)
+
+(defmacro w3m-form-method (form)
+ `(aref ,form 1))
+(defmacro w3m-form-action (form)
+ `(aref ,form 2))
+(defmacro w3m-form-charlst (form)
+ `(aref ,form 3))
+(defmacro w3m-form-enctype (form)
+ `(aref ,form 4))
+(defmacro w3m-form-plist (form)
+ `(aref ,form 5))
+(defun w3m-form-put-property (form name property value)
+ (aset form 5
+ (plist-put (w3m-form-plist form)
+ (setq name (if (stringp name) (intern name) name))
+ (plist-put (plist-get (w3m-form-plist form) name)
+ property value)))
+ value)
+(defmacro w3m-form-get-property (form name property)
+ `(plist-get (plist-get (w3m-form-plist ,form)
+ (if (stringp ,name)
+ (intern ,name)
+ ,name))
+ ,property))
+(defmacro w3m-form-put (form id name value)
+ `(w3m-form-put-property ,form ,id :value (cons ,name ,value)))
+(defmacro w3m-form-get (form id)
+ `(cdr (w3m-form-get-property ,form ,id :value)))
+(defun w3m-form-get-by-name (form name)
+ (let ((plist (w3m-form-plist form))
+ pair value)
+ (while plist
+ (setq pair (plist-get (cadr plist) :value))
+ (when (and pair
+ (string= (car pair) name))
+ (setq value (cdr pair)
+ plist nil))
+ (setq plist (cddr plist)))
+ value))
+(defun w3m-form-put-by-name (form id name value)
+ (let ((plist (w3m-form-plist form))
+ pair found)
+ (while plist
+ (setq pair (plist-get (cadr plist) :value))
+ (when (and pair
+ (string= (car pair) name))
+ (setcar plist id)
+ (setcdr pair value)
+ (setq found t
+ plist nil))
+ (setq plist (cddr plist)))
+ (unless found
+ (w3m-form-put form id name value))))
+
+(defun w3m-form-goto-next-field ()
+ "Move to next form field and return the point.
+If no field in forward, return nil without moving."
+ (let* ((id (get-text-property (point) 'w3m-form-field-id))
+ (beg (if id
+ (next-single-property-change (point) 'w3m-form-field-id)
+ (point)))
+ (next (next-single-property-change beg 'w3m-form-field-id)))
+ (if next
+ (goto-char next)
+ nil)))
+
+(defun w3m-form-get-coding-system (coding)
+ (or (catch 'det
+ (while coding
+ (if (w3m-charset-to-coding-system (car coding))
+ (throw 'det (w3m-charset-to-coding-system (car coding)))
+ (setq coding (cdr coding)))))
+ w3m-current-coding-system
+ (w3m-charset-to-coding-system
+ (w3m-content-charset w3m-current-url))
+ w3m-default-coding-system))
+
+(defun w3m-form-make-form-data (form)
+ (let ((plist (w3m-form-plist form))
+ (coding (w3m-form-charlst form))
+ buf bufs)
+ (setq coding (w3m-form-get-coding-system coding))
+ (while plist
+ (let* ((number (car plist))
+ (pair (plist-get (cadr plist) :value))
+ (name (car pair))
+ (value (cdr pair)))
+ (cond
+ ((and (consp value)
+ (eq (car value) 'file))
+ (setq bufs (cons (cons number (cons name value)) bufs)))
+ ((and (consp value)
+ (consp (cdr value))
+ (consp (cadr value))) ; select.
+ (setq bufs (cons (cons number (cons name (car value))) bufs)))
+ ((consp value) ; checkbox
+ (setq bufs (append (mapcar (lambda (x) (cons number (cons name x))) value)
+ bufs)))
+ (value
+ (setq bufs (cons (cons number (cons name value)) bufs))))
+ (setq plist (cddr plist))))
+ (when bufs
+ (setq bufs (sort bufs (lambda (x y) (< (car x) (car y)))))
+ (if (eq (w3m-form-enctype form) 'multipart/form-data)
+ (let ((boundary (apply 'format "--_%d_%d_%d" (current-time)))
+ file type)
+ ;; (setq buf (nreverse buf))
+ (cons
+ (concat "multipart/form-data; boundary=" boundary)
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (while (setq buf (cdr (car bufs)))
+ (if (and (consp (cdr buf))
+ (eq (car (cdr buf)) 'file))
+ (progn
+ (setq file (expand-file-name (cdr (cdr buf))))
+ (if (string= (setq type (w3m-local-content-type file))
+ "unknown")
+ (setq type "application/octet-stream"))
+ (insert "--" boundary "\r\n"
+ "Content-Disposition: form-data; name=\""
+ (car buf)
+ "\"; filename=\"" file "\"\r\n"
+ "Content-Type: " type "\r\n"
+ "Content-Transfer-Encoding: binary\r\n\r\n")
+ (when (file-exists-p file)
+ (insert-file-contents-literally file)
+ (goto-char (point-max)))
+ (insert "\r\n"))
+ (insert "--" boundary "\r\n"
+ "Content-Disposition: form-data; name=\""
+ (car buf)
+ "\"\r\n\r\n"
+ (encode-coding-string (cdr buf) coding)
+ "\r\n"))
+ (setq bufs (cdr bufs)))
+ (insert "--" boundary "--\r\n")
+ (buffer-string))))
+ (mapconcat (lambda (elem)
+ (setq elem (cdr elem))
+ (format "%s=%s"
+ (w3m-url-encode-string (car elem) coding t)
+ (w3m-url-encode-string (if (stringp (cdr elem))
+ (cdr elem)
+ "")
+ coding
+ t)))
+ bufs "&")))))
+
+(defun w3m-form-resume (forms)
+ "Resume content of all forms in the current buffer using FORMS."
+ (when forms
+ (if (eq (car forms) t)
+ (setq forms (cdr forms)))
+ (save-excursion
+ (goto-char (point-min))
+ (let (textareas)
+ (while (w3m-form-goto-next-field)
+ (let ((fid (get-text-property (point) 'w3m-form-field-id)))
+ (when (and fid
+ (string-match "\
+fid=\\([^/]+\\)/type=\\([^/]+\\)/name=\\([^/]*\\)/id=\\(.*\\)$"
+ fid))
+ (let ((form (nth (string-to-number (match-string 1 fid))
+ forms))
+ (cform (nth (string-to-number (match-string 1 fid))
+ w3m-current-forms))
+ (type (match-string 2 fid))
+ (name (match-string 3 fid))
+ (id (string-to-number (match-string 4 fid))))
+ (when form
+ (cond
+ ((or (string= type "submit")
+ (string= type "image"))
+ ;; Remove status to support forms containing multiple
+ ;; submit buttons.
+ (w3m-form-put cform id name nil))
+ ((or (string= type "reset")
+ (string= type "hidden")
+ ;; Do nothing.
+ ))
+ ((string= type "password")
+ (w3m-form-replace (w3m-form-get form id)
+ 'invisible)
+ (unless (eq form cform)
+ (w3m-form-put cform id name (w3m-form-get form id))))
+ ((string= type "radio")
+ (let ((value (w3m-form-get-by-name form name)))
+ (when value
+ (w3m-form-replace
+ (if (string= value (nth 4 (w3m-action (point))))
+ "*" " ")))
+ (unless (eq form cform)
+ (w3m-form-put-by-name cform id name value))))
+ ((string= type "checkbox")
+ (let ((value (w3m-form-get form id)))
+ (when value
+ (w3m-form-replace
+ (if (member (nth 4 (w3m-action (point))) value)
+ "*" " ")))
+ (unless (eq form cform)
+ (w3m-form-put cform id name value))))
+ ((string= type "select")
+ (let ((selects (w3m-form-get form id)))
+ (when (and (consp selects) (car selects))
+ (w3m-form-replace (cdr (assoc (car selects)
+ (cdr selects)))))
+ (unless (eq form cform)
+ (w3m-form-put cform id name selects))))
+ ((string= type "textarea")
+ (let ((hseq (nth 2 (w3m-action (point))))
+ (value (w3m-form-get form id)))
+ (when (> hseq 0)
+ (setq textareas (cons (cons hseq value) textareas)))
+ (unless (eq form cform)
+ (w3m-form-put cform id name value))))
+ ((string= type "file")
+ (let ((value (w3m-form-get form id)))
+ (when (and value
+ (consp value))
+ (w3m-form-replace (cdr value)))
+ (unless (eq form cform)
+ (w3m-form-put cform id name value))))
+ (t
+ (let ((value (w3m-form-get form id)))
+ (when (stringp value)
+ (w3m-form-replace value))
+ (unless (eq form cform)
+ (w3m-form-put cform id name value))))))))))
+ (unless w3m-form-treat-textarea-size
+ (dolist (textarea textareas)
+ (when (cdr textarea)
+ (w3m-form-textarea-replace (car textarea) (cdr textarea)))))))))
+
+;;;###autoload
+(defun w3m-fontify-forms ()
+ "Process half-dumped data and fontify forms in this buffer."
+ ;; If `w3m-current-forms' is resumed from history, reuse it.
+ (w3m-form-parse-and-fontify
+ (when (eq t (car w3m-current-forms))
+ (setq w3m-current-forms (cdr w3m-current-forms)))))
+
+(eval-and-compile
+ (unless (fboundp 'w3m-form-make-button)
+ (defun w3m-form-make-button (start end properties)
+ "Make button on the region from START to END with PROPERTIES."
+ (w3m-add-text-properties start end
+ (append '(face w3m-form) properties)))))
+
+;;; w3mmee
+;;
+(eval-and-compile
+ (defalias 'w3m-char-to-int (if (fboundp 'char-to-int)
+ 'char-to-int
+ 'identity))
+ (defalias 'w3m-string-to-char-list (if (fboundp 'string-to-list)
+ 'string-to-list
+ (lambda (str)
+ (mapcar 'identity str))))
+ (defalias 'w3m-int-to-char (if (fboundp 'int-to-char)
+ 'int-to-char
+ 'identity)))
+
+(defmacro w3m-form-mee-attr-unquote (x)
+ "Unquote form attribute of w3mmee."
+ '(let (attr)
+ (when (eq (car x) ?T)
+ (setq x (cdr x))
+ (while (and x (not (eq (w3m-char-to-int (car x)) 0)))
+ (setq attr (concat attr (char-to-string (car x))))
+ (setq x (cdr x))))
+ attr))
+
+(defun w3m-form-mee-new (x)
+ "Decode form information of w3mmee."
+ (setq x (w3m-string-to-char-list
+ (w3m-url-decode-string x w3m-current-coding-system)))
+ (let (method enctype action charset target name)
+ (setq method (case (/ (w3m-char-to-int (car x)) 16)
+ (0 "get")
+ (1 "post")
+ (2 "internal")
+ (3 "head"))
+ enctype (case (% (w3m-char-to-int (car x)) 16)
+ (0 'application/x-www-form-urlencoded)
+ (1 'multipart/form-data)))
+ (setq x (cdr x))
+ (setq action (w3m-form-normalize-action (w3m-form-mee-attr-unquote x)
+ w3m-current-url))
+ (setq x (cdr x))
+ (if (member "lang=many" w3m-compile-options)
+ (setq charset (w3m-form-mee-attr-unquote x))
+ (setq charset (case (car x)
+ (?e "euc-jp")
+ (?s "shift-jis")
+ (?n "iso-2022-7bit"))))
+ (setq x (cdr x))
+ (setq target (w3m-form-mee-attr-unquote x)) ; not used.
+ (setq x (cdr x))
+ (setq name (w3m-form-mee-attr-unquote x)) ; not used.
+ (w3m-form-new method action nil (and charset (list charset)) enctype)))
+
+(defun w3m-form-mee-select-value (value)
+ "Decode select form information of w3mmee."
+ (let ((clist (w3m-string-to-char-list
+ (w3m-url-decode-string value w3m-current-coding-system)))
+ label val s selected candidates)
+ (while clist
+ (setq s (eq (car clist) (w3m-int-to-char 1))
+ label nil
+ val nil)
+ (setq clist (cdr clist))
+ (while (not (eq (car clist) (w3m-int-to-char 0)))
+ (setq label (concat label (char-to-string (car clist))))
+ (setq clist (cdr clist)))
+ (if label
+ (setq label (decode-coding-string label w3m-output-coding-system)))
+ (setq clist (cdr clist))
+ (while (not (eq (car clist) (w3m-int-to-char 0)))
+ (setq val (concat val (char-to-string (car clist))))
+ (setq clist (cdr clist)))
+ (if val
+ (setq val (decode-coding-string val w3m-output-coding-system)))
+ (if s (setq selected val))
+ (push (cons val label) candidates)
+ (setq clist (cdr clist)))
+ (cons selected (nreverse candidates))))
+
+(defun w3m-fontify-textareas ()
+ "Process and fontify textareas in this buffer."
+ (when w3m-form-treat-textarea-size
+ (save-excursion
+ (goto-char (point-min))
+ (let (form fid start end type name rows start-column end-column
+ hseq abs-hseq buffer-read-only text id filename readonly)
+ (while (w3m-form-goto-next-field)
+ (setq fid (get-text-property (point) 'w3m-form-field-id))
+ (setq filename (get-text-property (point) 'w3m-form-file-name))
+ (when
+ (and
+ fid
+ (string-match
+ "fid=\\([^/]+\\)/type=\\([^/]+\\)/name=\\([^/]*\\)/id=\\(.*\\)$"
+ fid))
+ (setq form (nth (string-to-number (match-string 1 fid))
+ w3m-current-forms)
+ type (match-string 2 fid)
+ name (match-string 3 fid)
+ id (string-to-number (match-string 4 fid)))
+ (when (string= type "textarea")
+ (setq rows (get-text-property (point) 'w3m-textarea-rows)
+ hseq (get-text-property (point) 'w3m-form-hseq)
+ readonly (get-text-property (point) 'w3m-form-readonly)
+ abs-hseq (w3m-anchor-sequence))
+ (setq start-column (- (current-column) 1))
+ (goto-char (next-single-property-change (point)
+ 'w3m-form-hseq))
+ (setq end-column (current-column))
+ (save-excursion
+ (dotimes (i (- rows 1))
+ (forward-line -1)
+ (save-excursion
+ (move-to-column start-column)
+ (delete-char 1)
+ (insert "[")
+ (setq start (point))
+ (move-to-column end-column)
+ (delete-char 1)
+ (setq end (point))
+ (insert "]"))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%s/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-textarea ,form ,hseq)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-form-hseq ,hseq
+ w3m-anchor-sequence ,abs-hseq
+ w3m-form-id ,id
+ w3m-form-name ,name
+ w3m-form-file-name ,filename
+ w3m-form-readonly ,readonly)))
+ (when (setq text (w3m-form-get form id))
+ (w3m-form-textarea-replace hseq text))))))))))
+
+(defun w3m-form-parse-and-fontify (&optional reuse-forms)
+ "Parse forms of the half-dumped data in this buffer and fontify them.
+Result form structure is saved to the local variable `w3m-current-forms'.
+If optional REUSE-FORMS is non-nil, reuse it as `w3m-current-form'."
+ (let ((case-fold-search t)
+ (id 0)
+ tag start end internal-start textareas selects forms maps mapval
+ form filename)
+ (setq w3m-form-textarea-files nil)
+ (setq w3m-form-use-textarea-backup-p nil)
+ (goto-char (point-min))
+ (while (if (eq w3m-type 'w3mmee)
+ (w3m-search-tag "_f" "map" "img_alt" "input_alt"
+ "/input_alt")
+ (w3m-search-tag "form_int" "map" "img_alt" "input_alt"
+ "/input_alt"))
+ (setq tag (downcase (match-string 1)))
+ (goto-char (match-end 1))
+ (setq start (match-end 0))
+ (cond
+ ((string= tag (if (eq w3m-type 'w3mmee) "_f" "form_int"))
+ (if (eq w3m-type 'w3mmee)
+ (w3m-parse-attributes (_x)
+ (setq forms (nconc forms (list (w3m-form-mee-new _x)))))
+ (w3m-parse-attributes (action (method :case-ignore)
+ (fid :integer)
+ (accept-charset :case-ignore)
+ (enctype :case-ignore)
+ (charset :case-ignore))
+ (when action
+ (setq action (w3m-url-transfer-encode-string
+ (w3m-decode-anchor-string action)
+ (if charset
+ (w3m-charset-to-coding-system charset)
+ w3m-current-coding-system))))
+ (if (setq form (cdr (assq fid forms)))
+ (progn
+ (setf (w3m-form-method form) (or method "get"))
+ (setf (w3m-form-action form)
+ (w3m-form-normalize-action action w3m-current-url))
+ (setf (w3m-form-charlst form)
+ (if accept-charset
+ (setq accept-charset
+ (split-string accept-charset ","))))
+ (setf (w3m-form-enctype form)
+ (if enctype
+ (intern enctype)
+ 'application/x-www-form-urlencoded)))
+ (setq form (w3m-form-new
+ (or method "get")
+ (w3m-form-normalize-action action w3m-current-url)
+ nil
+ (if accept-charset
+ (setq accept-charset
+ (split-string accept-charset ",")))
+ (if enctype
+ (intern enctype)
+ 'application/x-www-form-urlencoded)))
+ (setq forms (cons (cons fid form) forms))))))
+ ((string= tag "map")
+ (let (candidates)
+ (w3m-parse-attributes (name)
+ (while (and (w3m-search-tag "area" "/map")
+ (not (char-equal
+ (char-after (match-beginning 1))
+ ?/)))
+ (goto-char (match-end 1))
+ (w3m-parse-attributes (href alt)
+ (when href
+ (setq candidates (cons (cons href (or alt href))
+ candidates)))))
+ (unless maps (setq maps (w3m-form-new "map" ".")))
+ (when candidates
+ (w3m-form-put maps
+ (incf id)
+ name
+ (nreverse candidates))))))
+ ((string= tag "img_alt")
+ (w3m-parse-attributes (usemap)
+ (w3m-search-tag "/img_alt")
+ (when (or usemap mapval)
+ (unless maps (setq maps (w3m-form-new "map" ".")))
+ (unless usemap (setq usemap mapval))
+ (when mapval (setq mapval nil))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start (match-beginning 0)
+ `(w3m-action (w3m-form-input-map ,maps ,usemap))))))
+ ((string= tag "/input_alt")
+ (replace-match ""))
+ ((string= tag "input_alt")
+ (w3m-parse-attributes ((fid :integer)
+ (type :case-ignore)
+ (width :integer)
+ (maxlength :integer)
+ (hseq :integer)
+ (selectnumber :integer) ; select
+ (textareanumber :integer) ; textarea
+ (size :integer) ; textarea
+ (rows :integer) ; textarea
+ (top_mergin :integer) ; textarea
+ (checked :bool) ; checkbox, radio
+ (readonly :bool)
+ no_effect ; map
+ name value)
+ (incf id)
+ (when value
+ (setq value (w3m-decode-entities-string value)))
+ (save-excursion
+ (search-forward "</input_alt>")
+ (setq end (match-beginning 0)))
+ (let ((abs-hseq (or (and (null hseq) 0) (abs hseq))))
+ (setq w3m-max-anchor-sequence
+ (max abs-hseq w3m-max-anchor-sequence))
+ (if (eq w3m-type 'w3mmee)
+ (setq form (nth fid forms))
+ (setq form (cdr (assq fid forms))))
+ (unless form
+ (setq forms (cons (cons fid (setq form
+ (w3m-form-new nil nil)))
+ forms)))
+ (cond
+ ((and (string= type "hidden")
+ (string= name "link"))
+ (setq mapval value))
+ ((or (string= type "submit")
+ (string= type "image"))
+ (unless (string= no_effect "true")
+ (w3m-form-make-button
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-submit ,form ,id ,name ,value
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq))))
+ ((string= type "reset")
+ (w3m-form-make-button
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-reset ,form)
+ w3m-anchor-sequence ,abs-hseq)))
+ ((string= type "textarea")
+ (if (eq w3m-type 'w3mmee)
+ (w3m-form-put form id
+ name
+ (decode-coding-string
+ (w3m-url-decode-string value
+ w3m-current-coding-system)
+ w3m-output-coding-system))
+ (setq textareas (cons (list textareanumber form id name readonly)
+ textareas)))
+ (when w3m-current-url
+ (setq filename (expand-file-name
+ (w3m-form-input-textarea-filename
+ w3m-current-url
+ (format "fid=%d/type=%s/name=%s/id=%d"
+ fid type name id))
+ w3m-form-textarea-directory))
+ (setq w3m-form-textarea-files
+ (cons filename w3m-form-textarea-files)))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-textarea ,form ,hseq)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-textarea-rows ,rows
+ w3m-form-hseq ,hseq
+ w3m-anchor-sequence ,abs-hseq
+ w3m-form-id ,id
+ w3m-form-name ,name
+ w3m-form-file-name ,filename
+ w3m-form-readonly ,readonly)))
+ ((string= type "select")
+ (when (if (eq w3m-type 'w3mmee)
+ (when value
+ (w3m-form-put form id name
+ (w3m-form-mee-select-value value))
+ t)
+ (setq selects (cons (list selectnumber form id name)
+ selects)))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-select ,form ,id ,name)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq))))
+ ((string= type "password")
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-password ,form ,id ,name)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq
+ w3m-form-readonly ,readonly)))
+ ((string= type "checkbox")
+ (let ((cvalue (w3m-form-get form id)))
+ (w3m-form-put form id name
+ (if checked
+ (cons value cvalue)
+ cvalue)))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-checkbox ,form ,id ,name ,value)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq)))
+ ((string= type "radio")
+ ;; Radio button input, one name has one value
+ (if checked
+ (w3m-form-put-by-name form id name value))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-radio ,form ,id ,name ,value)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get-by-name ,form ,name)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq)))
+ ((string= type "file")
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input-file ,form ,id ,name ,value)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq)))
+ (t
+ (w3m-form-put form
+ id
+ name
+ (or value (w3m-form-get form id)))
+ (w3m-add-face-property start end 'w3m-form)
+ (add-text-properties
+ start end
+ `(w3m-form-field-id
+ ,(format "fid=%d/type=%s/name=%s/id=%d" fid type name id)
+ w3m-action (w3m-form-input ,form ,id ,name ,type
+ ,width ,maxlength ,value)
+ w3m-submit (w3m-form-submit ,form ,id ,name
+ (w3m-form-get ,form ,id)
+ w3m-form-new-session
+ w3m-form-download)
+ w3m-anchor-sequence ,abs-hseq
+ w3m-form-readonly ,readonly)))))))))
+ ;; Process <internal> tag.
+ (when (search-forward "<internal>" nil t)
+ (setq internal-start (match-beginning 0))
+ (while (and (null reuse-forms)
+ (re-search-forward "<\\([a-z]+\\)_int" nil t))
+ (incf id)
+ (cond
+ ((string= (match-string 1) "select")
+ (w3m-parse-attributes ((selectnumber :integer))
+ (let ((selectinfo (cdr (assq selectnumber selects)))
+ current candidates)
+ (when selectinfo
+ ;; Parse FORM SELECT fields until </SELECT> (or </FORM>)
+ (while (and (w3m-search-tag "option_int" "/select_int")
+ (not (char-equal (char-after (match-beginning 1))
+ ?/)))
+ ;; <option_int> is found
+ (goto-char (match-end 1))
+ (w3m-parse-attributes ((value :decode-entity)
+ (label :decode-entity)
+ (selected :bool))
+ (push (cons value label) candidates)
+ (if selected (setq current value))
+ (skip-chars-forward ">\n")))
+ (setq candidates (nreverse candidates))
+ (w3m-form-put (nth 0 selectinfo)
+ (nth 1 selectinfo)
+ (nth 2 selectinfo)
+ (cons (or current ; current value
+ (caar candidates))
+ candidates))))))
+ ((string= (match-string 1) "textarea")
+ (w3m-parse-attributes ((textareanumber :integer))
+ (forward-char 1) ; skip newline character.
+ (let ((textareainfo (cdr (assq textareanumber textareas)))
+ (buffer (current-buffer))
+ end text)
+ (when textareainfo
+ (setq start (point))
+ (skip-chars-forward "^<")
+ (setq text (buffer-substring-no-properties start (point)))
+ (w3m-form-put
+ (nth 0 textareainfo) (nth 1 textareainfo) (nth 2 textareainfo)
+ (with-temp-buffer
+ (insert text)
+ (w3m-decode-entities)
+ (goto-char (point-min))
+ (while (search-forward "\r\n" nil t) (replace-match "\n"))
+ (buffer-string)))))))))
+ (when (search-forward "</internal>" nil t)
+ (delete-region internal-start (match-end 0))))
+ (setq w3m-current-forms (if (eq w3m-type 'w3mmee)
+ forms
+ (mapcar 'cdr
+ (sort forms (lambda (x y)
+ (< (car x)(car y)))))))
+ (w3m-form-resume (or reuse-forms w3m-current-forms))))
+
+(defun w3m-form-replace (string &optional invisible)
+ (let* ((start (text-property-any (point-min) (point-max)
+ 'w3m-action (w3m-action (point))))
+ (width (string-width
+ (buffer-substring
+ start
+ (next-single-property-change start 'w3m-action))))
+ (prop (text-properties-at start))
+ (p (point))
+ (buffer-read-only))
+ (goto-char start)
+ (insert (setq string
+ (if invisible
+ (make-string (length string) ?.)
+ (mapconcat 'identity
+ (split-string
+ (w3m-truncate-string (or string "")
+ width) "\n")
+ "")))
+ (make-string (max (- width (string-width string)) 0) ?\ ))
+ (delete-region (point)
+ (next-single-property-change (point) 'w3m-action))
+ (add-text-properties start (point) prop)
+ (set-buffer-modified-p nil)
+ (prog1 (point)
+ (goto-char p))))
+
+(defun w3m-form-input (form id name type width maxlength value)
+ (let ((fvalue (w3m-form-get form id)))
+ (if (get-text-property (point) 'w3m-form-readonly)
+ (message "READONLY %s: %s" (upcase type) fvalue)
+ (save-excursion
+ (let ((input (save-excursion
+ (read-from-minibuffer (concat (upcase type) ": ") fvalue)))
+ (coding (w3m-form-get-coding-system (w3m-form-charlst form))))
+ (when (with-temp-buffer
+ (insert input)
+ (w3m-form-coding-system-accept-region-p nil nil coding))
+ (w3m-form-put form id name input)
+ (w3m-form-replace input)))))))
+
+(defun w3m-form-input-password (form id name)
+ (if (get-text-property (point) 'w3m-form-readonly)
+ (message "This input box is read-only.")
+ (let* ((fvalue (w3m-form-get form id))
+ (input (save-excursion
+ (read-passwd (concat "PASSWORD"
+ (if fvalue
+ " (default is no change)")
+ ": ")
+ nil
+ fvalue))))
+ (w3m-form-put form id name input)
+ (w3m-form-replace input 'invisible))))
+
+(defun w3m-form-input-checkbox (form id name value)
+ (let ((fvalue (w3m-form-get form id)))
+ (if (member value fvalue) ; already checked
+ (progn
+ (w3m-form-put form id name (delete value fvalue))
+ (w3m-form-replace " "))
+ (w3m-form-put form id name (cons value fvalue))
+ (w3m-form-replace "*"))))
+
+(defun w3m-form-field-parse (fid)
+ (when (and fid
+ (string-match
+ "fid=\\([^/]+\\)/type=\\([^/]+\\)/name=\\([^/]*\\)/id=\\(.*\\)$"
+ fid))
+ (list (match-string 1 fid)
+ (match-string 2 fid)
+ (match-string 3 fid)
+ (match-string 4 fid))))
+
+(defun w3m-form-input-radio (form id name value)
+ (save-excursion
+ (let ((fid (w3m-form-field-parse
+ (get-text-property (point) 'w3m-form-field-id)))
+ cur-fid)
+ (when fid
+ ;; Uncheck all RADIO input having same NAME
+ (goto-char 1)
+ (while (w3m-form-goto-next-field)
+ (setq cur-fid (w3m-form-field-parse
+ (get-text-property (point)
+ 'w3m-form-field-id)))
+ (when (and (string= (nth 0 fid) (nth 0 cur-fid))
+ (string= (nth 1 fid) (nth 1 cur-fid))
+ (string= (nth 2 fid) (nth 2 cur-fid)))
+ (w3m-form-put-by-name
+ form (string-to-number (nth 3 fid)) (nth 2 fid) nil)
+ (w3m-form-replace " ")))))) ; erase check
+ ;; Then set this field as checked.
+ (w3m-form-put-by-name form id name value)
+ (w3m-form-replace "*"))
+
+(defun w3m-form-input-file (form id name value)
+ (let ((input (save-excursion
+ (read-file-name "File name: "
+ (or (cdr (w3m-form-get form id))
+ "~/")))))
+ (w3m-form-put form id name (cons 'file input))
+ (w3m-form-replace input)))
+
+;;; TEXTAREA
+
+(defcustom w3m-form-input-textarea-buffer-lines 10
+ "*Buffer lines for form textarea buffer."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-form-input-textarea-mode-hook nil
+ "*A hook called after w3m-form-input-textarea-mode."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-form-input-textarea-set-hook nil
+ "*A Hook called before w3m-form-input-textarea-set."
+ :group 'w3m
+ :type 'hook)
+
+(defun w3m-form-text-chop (text)
+ "Return a list of substrings of TEXT which are separated by newline
+character."
+ (when text
+ (let ((start 0) parts)
+ (while (string-match "\n" text start)
+ (setq parts (cons (substring text start (match-beginning 0)) parts)
+ start (match-end 0)))
+ (nreverse (cons (substring text start) parts)))))
+
+(defun w3m-form-search-textarea (hseq direction)
+ (let ((point (point))
+ (next-single-property-change-function
+ (if (eq direction 'forward)
+ 'next-single-property-change
+ 'previous-single-property-change))
+ found)
+ (if (get-text-property point 'w3m-form-hseq)
+ (setq point (funcall next-single-property-change-function point
+ 'w3m-form-hseq)))
+ (when point
+ (while (and (not found)
+ (setq point (funcall next-single-property-change-function
+ point 'w3m-form-hseq)))
+ (when (eq (get-text-property point 'w3m-form-hseq) hseq)
+ (setq found t)))
+ (if point (goto-char point)))))
+
+(defun w3m-form-textarea-replace (hseq string)
+ (let ((chopped (w3m-form-text-chop string))
+ (p (point)))
+ (goto-char (point-min))
+ (while (w3m-form-search-textarea hseq 'forward)
+ (w3m-form-replace (or (car chopped) ""))
+ (setq chopped (cdr chopped)))
+ (goto-char p)))
+
+(defun w3m-form-textarea-info ()
+ "Return a list of (ID NAME LINE READONLY) for current text area."
+ (let ((s (get-text-property (point) 'w3m-form-hseq))
+ (lines 1))
+ (save-excursion
+ (while (w3m-form-search-textarea s 'backward)
+ (incf lines))
+ (list (get-text-property (point) 'w3m-form-id)
+ (get-text-property (point) 'w3m-form-name)
+ lines
+ (get-text-property (point) 'w3m-form-readonly)))))
+
+(defvar w3m-form-input-textarea-map nil)
+(unless w3m-form-input-textarea-map
+ (setq w3m-form-input-textarea-map (make-sparse-keymap))
+ (define-key w3m-form-input-textarea-map "\C-c\C-c"
+ 'w3m-form-input-textarea-set)
+ (define-key w3m-form-input-textarea-map "\C-c\C-q"
+ 'w3m-form-input-textarea-exit)
+ (define-key w3m-form-input-textarea-map "\C-c\C-k"
+ 'w3m-form-input-textarea-exit)
+ (define-key w3m-form-input-textarea-map "\C-x\C-s"
+ 'w3m-form-input-textarea-save))
+
+(defun w3m-form-input-textarea-filename (url id)
+ (condition-case nil
+ (concat (md5 (concat url id) nil nil w3m-current-coding-system) ".txt")
+ (error
+ (let ((file "")
+ ;; Interdit chars of Windows
+ (replace (regexp-opt '("\\" "/" ":" "*" "?" "\"" "<" ">" "|")))
+ (max-file-path 254))
+ (while (string-match replace url)
+ (setq file (concat file (substring url 0 (match-beginning 0)) "_"))
+ (setq url (substring url (match-end 0))))
+ (setq file (concat file url "-"))
+ (while (string-match replace id)
+ (setq file (concat file (substring id 0 (match-beginning 0)) "_"))
+ (setq id (substring id (match-end 0))))
+ (if (< (- max-file-path 4) (length file))
+ (setq file (substring file 0 (- max-file-path 4 (length id)))))
+ (setq file (concat file id ".txt"))
+ (convert-standard-filename file)))))
+
+(defun w3m-form-input-textarea-save (&optional buffer file no-check)
+ "Save textarea buffer."
+ (interactive)
+ (setq buffer (or buffer (current-buffer)))
+ (setq file (or file w3m-form-input-textarea-file))
+ (with-current-buffer buffer
+ (if (/= (buffer-size) 0)
+ (when (and
+ (or w3m-form-use-textarea-backup-p
+ (and (eq this-command 'w3m-form-input-textarea-save)
+ (y-or-n-p "Really save this buffer? ")))
+ (or no-check
+ (w3m-form-coding-system-accept-region-p)))
+ (let ((buffer-file-coding-system
+ w3m-form-textarea-file-coding-system)
+ (coding-system-for-write
+ w3m-form-textarea-file-coding-system))
+ (write-region (point-min) (point-max) file nil 'nomsg)))
+ (when w3m-form-use-textarea-backup-p
+ (when (file-exists-p file)
+ (delete-file file))
+ (when (file-exists-p (make-backup-file-name file))
+ (delete-file (make-backup-file-name file)))
+ (set-buffer-modified-p nil)))))
+
+(defun w3m-form-input-textarea-set ()
+ "Save and exit from w3m form textarea mode."
+ (interactive)
+ (run-hooks 'w3m-form-input-textarea-set-hook)
+ (let ((input (buffer-string))
+ (buffer (current-buffer))
+ (hseq w3m-form-input-textarea-hseq)
+ (form w3m-form-input-textarea-form)
+ (point w3m-form-input-textarea-point)
+ (w3mbuffer w3m-form-input-textarea-buffer)
+ (wincfg w3m-form-input-textarea-wincfg)
+ (file w3m-form-input-textarea-file)
+ info)
+ (when (w3m-form-coding-system-accept-region-p)
+ (w3m-form-input-textarea-save buffer file t)
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (if (not (buffer-live-p w3mbuffer))
+ (and (eq this-command 'w3m-form-input-textarea-set)
+ (message "No current w3m buffer"))
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when (and form point)
+ (goto-char point)
+ (setq info (w3m-form-textarea-info))
+ (w3m-form-put form (nth 0 info) (nth 1 info) input)
+ (w3m-form-textarea-replace hseq input))))))
+
+(defun w3m-form-input-textarea-exit ()
+ "Exit from w3m form textarea mode."
+ (interactive)
+ (let ((buffer (current-buffer))
+ (point w3m-form-input-textarea-point)
+ (w3mbuffer w3m-form-input-textarea-buffer)
+ (wincfg w3m-form-input-textarea-wincfg)
+ (file w3m-form-input-textarea-file))
+ (w3m-form-input-textarea-save buffer file)
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (if (not (buffer-live-p w3mbuffer))
+ (and (eq this-command 'w3m-form-input-textarea-exit)
+ (message "No current w3m buffer"))
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when point (goto-char point)))))
+
+(unless (assq 'w3m-form-input-textarea-mode minor-mode-alist)
+ (push (list 'w3m-form-input-textarea-mode " w3m form textarea")
+ minor-mode-alist))
+(unless (assq 'w3m-form-input-textarea-mode minor-mode-map-alist)
+ (push (cons 'w3m-form-input-textarea-mode w3m-form-input-textarea-map)
+ minor-mode-map-alist))
+
+(defun w3m-form-input-textarea-mode (&optional arg)
+ "\\<w3m-form-input-textarea-map>
+Minor mode to edit form textareas of w3m.
+
+\\[w3m-form-input-textarea-set]\
+ Set the value and exit from this textarea.
+\\[w3m-form-input-textarea-exit]\
+ Exit from this textarea without setting the value.
+\\[w3m-form-input-textarea-save]\
+ Save editing data in this textarea.
+"
+ (interactive "P")
+ (when (setq w3m-form-input-textarea-mode
+ (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not w3m-form-input-textarea-mode)))
+ (run-hooks 'w3m-form-input-textarea-mode-hook)))
+
+(defun w3m-form-input-textarea-mode-setup (caller-buffer)
+ (funcall (if (functionp w3m-form-textarea-edit-mode)
+ w3m-form-textarea-edit-mode
+ (or (when (buffer-live-p caller-buffer)
+ (with-current-buffer caller-buffer
+ (save-match-data
+ (catch 'found-mode
+ (dolist (elem w3m-form-textarea-edit-mode)
+ (when (if (stringp (car elem))
+ (string-match (car elem)
+ w3m-current-url)
+ (if (functionp (car elem))
+ (funcall (car elem))
+ (eval (car elem))))
+ (throw 'found-mode (cdr elem))))))))
+ 'text-mode)))
+ (w3m-form-input-textarea-mode 1)
+ (message "%s"
+ (substitute-command-keys "Type \
+`\\<w3m-form-input-textarea-map>\\[w3m-form-input-textarea-set]' to exit \
+textarea, or type \
+`\\<w3m-form-input-textarea-map>\\[w3m-form-input-textarea-exit]' to quit \
+textarea")))
+
+(eval-and-compile
+ (defalias 'w3m-same-window-p
+ (if (featurep 'xemacs)
+ (lambda (buffer-name)
+ "Return non-nil if a buffer named BUFFER-NAME would be shown in the \"same\" window.
+This function returns non-nil if `display-buffer' or
+`pop-to-buffer' would show a buffer named BUFFER-NAME in the
+selected rather than \(as usual\) some other window. See
+`same-window-buffer-names' and `same-window-regexps'."
+ (cond
+ ((not (stringp buffer-name)))
+ ;; The elements of `same-window-buffer-names' can be buffer
+ ;; names or cons cells whose cars are buffer names.
+ ((and (boundp 'same-window-buffer-names)
+ (member buffer-name same-window-buffer-names)))
+ ((and (boundp 'same-window-buffer-names)
+ (assoc buffer-name same-window-buffer-names)))
+ ((and (boundp 'same-window-regexps)
+ (save-match-data
+ (catch 'found
+ (dolist (regexp same-window-regexps)
+ ;; The elements of `same-window-regexps' can be regexps
+ ;; or cons cells whose cars are regexps.
+ (when (or (and (stringp regexp)
+ (string-match regexp buffer-name))
+ (and (consp regexp) (stringp (car regexp))
+ (string-match (car regexp) buffer-name)))
+ (throw 'found t)))))))))
+ 'same-window-p)))
+
+(defun w3m-form-input-textarea (form hseq)
+ (let* ((info (w3m-form-textarea-info))
+ (value (w3m-form-get form (car info)))
+ (cur-win (selected-window))
+ (wincfg (current-window-configuration))
+ (w3mbuffer (current-buffer))
+ (point (point))
+ (size (- (window-height cur-win)
+ (1+ (max window-min-height
+ w3m-form-input-textarea-buffer-lines))))
+ (file (get-text-property (point) 'w3m-form-file-name))
+ (coding (w3m-form-get-coding-system (w3m-form-charlst form)))
+ (readonly (nth 3 info))
+ (backup-p (and (not readonly)
+ (w3m-form-use-textarea-backup-p)))
+ buffer)
+ (setq w3m-form-use-textarea-backup-p backup-p)
+ (when backup-p
+ (add-hook 'kill-emacs-hook 'w3m-form-textarea-file-cleanup)
+ (let ((dir (file-chase-links
+ (expand-file-name w3m-form-textarea-directory))))
+ (unless (and (file-exists-p dir) (file-directory-p dir))
+ (make-directory dir))))
+ (setq buffer
+ (catch 'detect-buffer
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when (and w3m-form-input-textarea-mode
+ (eq w3m-form-input-textarea-buffer w3mbuffer)
+ (string= w3m-form-input-textarea-file file))
+ (throw 'detect-buffer (cons t buffer)))))
+ (generate-new-buffer "*w3m form textarea*")))
+ (unless (consp buffer)
+ (when (and backup-p (file-exists-p file) (file-readable-p file))
+ (with-temp-buffer
+ (let ((buffer-file-coding-system w3m-form-textarea-file-coding-system)
+ (coding-system-for-read w3m-form-textarea-file-coding-system))
+ (insert-file-contents file))
+ (let ((before (buffer-string)))
+ (when (unless (w3m-form-textarea-same-check value before)
+ (save-window-excursion
+ (set-window-buffer (selected-window) (current-buffer))
+ (goto-char (abs (w3m-compare-strings
+ before 0 (length before)
+ value 0 (length value))))
+ (condition-case nil
+ (y-or-n-p
+ "The saved text for this form exists. Use it? ")
+ (quit
+ (kill-buffer buffer)
+ (error "Abort textarea editing")))))
+ (setq value before)))))
+ (with-current-buffer buffer
+ (insert value)
+ (set-buffer-modified-p nil)
+ (when readonly (setq buffer-read-only t))
+ (goto-char (point-min))
+ (forward-line (1- (nth 2 info)))
+ (w3m-form-input-textarea-mode-setup w3mbuffer)
+ (setq w3m-form-input-textarea-form form
+ w3m-form-input-textarea-hseq hseq
+ w3m-form-input-textarea-buffer w3mbuffer
+ w3m-form-input-textarea-point point
+ w3m-form-input-textarea-wincfg wincfg
+ w3m-form-input-textarea-file file
+ w3m-form-input-textarea-coding-system coding
+ w3m-form-use-textarea-backup-p backup-p)))
+ (if (and (consp buffer)
+ (get-buffer-window (cdr buffer)))
+ ;; same frame only
+ (select-window (get-buffer-window (cdr buffer)))
+ ;; Use the whole current window for the textarea when a user added
+ ;; the buffer name "*w3m form textarea*" to `same-window-buffer-names'
+ ;; (that is available only in Emacs).
+ ;; cf. http://article.gmane.org/gmane.emacs.w3m/7797
+ (unless (w3m-same-window-p (buffer-name (if (consp buffer)
+ (cdr buffer)
+ buffer)))
+ (condition-case nil
+ (split-window cur-win (if (> size 0) size window-min-height))
+ (error
+ (delete-other-windows)
+ (split-window cur-win (- (window-height cur-win)
+ w3m-form-input-textarea-buffer-lines))))
+ (select-window (next-window)))
+ (let ((pop-up-windows nil))
+ (switch-to-buffer (if (consp buffer) (cdr buffer) buffer))))))
+
+(defun w3m-form-use-textarea-backup-p ()
+ (and w3m-form-use-textarea-backup
+ (let ((cbuf (current-buffer))
+ (curl w3m-current-url))
+ (catch 'loop
+ (save-current-buffer
+ (dolist (buf (w3m-list-buffers))
+ (when (eq buf cbuf)
+ (throw 'loop t))
+ (set-buffer buf)
+ (when (string= w3m-current-url curl)
+ (throw 'loop nil)))
+ t)))))
+
+(defun w3m-form-textarea-same-check (str1 str2)
+ "Compare STR1 and STR2 without tailed whitespace."
+ (when (string-match "[ \t\n\r]+$" str1)
+ (setq str1 (substring str1 0 (match-beginning 0))))
+ (when (string-match "[ \t\n\r]+$" str2)
+ (setq str2 (substring str2 0 (match-beginning 0))))
+ (string= str1 str2))
+
+(defun w3m-form-textarea-file-cleanup ()
+ "Remove all textarea files."
+ (remove-hook 'kill-emacs-hook 'w3m-form-textarea-file-cleanup)
+ (let ((dir (file-chase-links
+ (expand-file-name w3m-form-textarea-directory)))
+ (checktime t)
+ files file time)
+ (when (and w3m-form-textarea-file-expire-date
+ (file-directory-p dir))
+ (when (integerp w3m-form-textarea-file-expire-date)
+ (setq checktime (decode-time (current-time)))
+ (setq checktime (encode-time (nth 0 checktime) ;; seconds
+ (nth 1 checktime) ;; minutes
+ (nth 2 checktime) ;; hour
+ (- (nth 3 checktime) ;; day
+ w3m-form-textarea-file-expire-date)
+ (nth 4 checktime) ;; month
+ (nth 5 checktime) ;; year
+ (nth 6 checktime) ;; dow
+ (nth 7 checktime) ;; dst
+ (nth 8 checktime)))) ;; zone
+ (setq files (directory-files dir 'full "[^.]" 'nosort))
+ (while (setq file (car files))
+ (setq files (cdr files))
+ (when (file-writable-p file)
+ (if (eq checktime t)
+ (delete-file file)
+ (setq time (nth 5 (file-attributes file)))
+ (when (w3m-time-newer-p checktime time)
+ (delete-file file))))))))
+
+(defun w3m-form-textarea-files-remove ()
+ "Remove used files of textarea."
+ (let (file)
+ (while (setq file (car w3m-form-textarea-post-files))
+ (setq w3m-form-textarea-post-files (cdr w3m-form-textarea-post-files))
+ (when (and (member file w3m-form-textarea-files)
+ (file-exists-p file)
+ (file-writable-p file))
+ (delete-file file)
+ (setq file (make-backup-file-name file))
+ (when (and (file-exists-p file)
+ (file-writable-p file))
+ (delete-file file))))))
+
+(defun w3m-form-set-number (w3mbuf newname)
+ "Change parent w3m buffer in form buffers"
+ (save-current-buffer
+ (let ((newbuff (get-buffer newname)))
+ (when newbuff
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (cond
+ ((and w3m-form-input-textarea-mode
+ (eq w3m-form-input-textarea-buffer w3mbuf))
+ (setq w3m-form-input-textarea-buffer newbuff))
+ ((and (eq major-mode 'w3m-form-input-select-mode)
+ (eq w3m-form-input-select-buffer w3mbuf))
+ (setq w3m-form-input-select-buffer newbuff))
+ ((and (eq major-mode 'w3m-form-input-map-mode)
+ (eq w3m-form-input-map-buffer w3mbuf))
+ (setq w3m-form-input-map-buffer newbuff))))))))
+
+(defun w3m-form-kill-buffer (w3mbuf)
+ "Kill form buffers"
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (cond
+ ((and w3m-form-input-textarea-mode
+ (eq w3m-form-input-textarea-buffer w3mbuf))
+ (w3m-form-input-textarea-exit))
+ ((and (eq major-mode 'w3m-form-input-select-mode)
+ (eq w3m-form-input-select-buffer w3mbuf))
+ (w3m-form-input-select-exit))
+ ((and (eq major-mode 'w3m-form-input-map-mode)
+ (eq w3m-form-input-map-buffer w3mbuf))
+ (w3m-form-input-map-exit))))))
+
+;;; SELECT
+
+(defcustom w3m-form-input-select-buffer-lines 10
+ "*Buffer lines for form select buffer."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-form-input-select-mode-hook nil
+ "*A hook called after w3m-form-input-select-mode."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-form-input-select-set-hook nil
+ "*A Hook called before w3m-form-input-select-set."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-form-mouse-face 'highlight
+ "*Mouse face to highlight selected value."
+ :group 'w3m
+ :type 'face)
+
+(defvar w3m-form-input-select-keymap nil)
+(unless w3m-form-input-select-keymap
+ (setq w3m-form-input-select-keymap (make-sparse-keymap))
+ (define-key w3m-form-input-select-keymap "\C-c\C-c"
+ 'w3m-form-input-select-set)
+ (define-key w3m-form-input-select-keymap "\r"
+ 'w3m-form-input-select-set)
+ (define-key w3m-form-input-select-keymap "\C-m"
+ 'w3m-form-input-select-set)
+ (define-key w3m-form-input-select-keymap "\C-c\C-q"
+ 'w3m-form-input-select-exit)
+ (define-key w3m-form-input-select-keymap "\C-c\C-k"
+ 'w3m-form-input-select-exit)
+ (define-key w3m-form-input-select-keymap "q"
+ 'w3m-form-input-select-exit)
+ (define-key w3m-form-input-select-keymap "\C-g"
+ 'w3m-form-input-select-exit)
+ (define-key w3m-form-input-select-keymap "h" 'backward-char)
+ (define-key w3m-form-input-select-keymap "j" 'next-line)
+ (define-key w3m-form-input-select-keymap "k" 'previous-line)
+ (define-key w3m-form-input-select-keymap "l" 'forward-char)
+ (if (featurep 'xemacs)
+ (define-key w3m-form-input-select-keymap [(button2)]
+ 'w3m-form-input-select-set-mouse)
+ (define-key w3m-form-input-select-keymap [mouse-2]
+ 'w3m-form-input-select-set-mouse)))
+
+(defun w3m-form-input-select-set-mouse (event)
+ "Save and exit from w3m form select mode with mouse."
+ (interactive "e")
+ (mouse-set-point event)
+ (w3m-form-input-select-set))
+
+(defun w3m-form-input-select-set ()
+ "Save and exit from w3m form select mode."
+ (interactive)
+ (run-hooks 'w3m-form-input-select-set-hook)
+ (let* ((cur (get-text-property (point)
+ 'w3m-form-select-value))
+ (buffer (current-buffer))
+ (name w3m-form-input-select-name)
+ (id w3m-form-input-select-id)
+ (form w3m-form-input-select-form)
+ (point w3m-form-input-select-point)
+ (w3mbuffer w3m-form-input-select-buffer)
+ (wincfg w3m-form-input-select-wincfg)
+ input)
+ (setcar w3m-form-input-select-candidates cur)
+ (setq input w3m-form-input-select-candidates)
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (when (buffer-live-p w3mbuffer)
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when (and form point)
+ (goto-char point)
+ (w3m-form-put form id name input)
+ (w3m-form-replace (cdr (assoc cur (cdr input))))))))
+
+(defun w3m-form-input-select-exit ()
+ "Exit from w3m form select mode."
+ (interactive)
+ (let* ((buffer (current-buffer))
+ (point w3m-form-input-select-point)
+ (w3mbuffer w3m-form-input-select-buffer)
+ (wincfg w3m-form-input-select-wincfg))
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (when (buffer-live-p w3mbuffer)
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when point (goto-char point)))))
+
+(defun w3m-form-input-select-mode ()
+ "\\<w3m-form-input-select-keymap>
+ Major mode for w3m form select.
+
+\\[w3m-form-input-select-set]\
+ Save and exit from w3m form select mode.
+\\[w3m-form-input-select-exit]\
+ Exit from w3m form select mode.
+\\[w3m-form-input-select-set-mouse]\
+ Save and exit from w3m form select mode with mouse.
+"
+ (setq mode-name "w3m form select"
+ major-mode 'w3m-form-input-select-mode)
+ (setq buffer-read-only t)
+ (use-local-map w3m-form-input-select-keymap)
+ (w3m-run-mode-hooks 'w3m-form-input-select-mode-hook))
+
+(defun w3m-form-input-select (form id name)
+ (let* ((value (w3m-form-get form id))
+ (cur-win (selected-window))
+ (wincfg (current-window-configuration))
+ (urlid (format "%s:%s:%d" w3m-current-url name id))
+ (w3mbuffer (current-buffer))
+ (point (point))
+ (size (min
+ (- (window-height cur-win)
+ window-min-height 1)
+ (- (window-height cur-win)
+ (max window-min-height
+ (1+ w3m-form-input-select-buffer-lines)))))
+ buffer cur pos)
+ (setq buffer
+ (catch 'detect-buffer
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when (and w3m-form-input-select-buffer
+ (eq w3m-form-input-select-buffer w3mbuffer)
+ (string= w3m-form-input-select-urlid urlid))
+ (throw 'detect-buffer (cons t buffer)))))
+ (generate-new-buffer "*w3m form select*")))
+ (unless (consp buffer)
+ (with-current-buffer buffer
+ (setq w3m-form-input-select-form form)
+ (setq w3m-form-input-select-name name)
+ (setq w3m-form-input-select-id id)
+ (setq w3m-form-input-select-buffer w3mbuffer)
+ (setq w3m-form-input-select-point point)
+ (setq w3m-form-input-select-candidates value)
+ (setq w3m-form-input-select-wincfg wincfg)
+ (setq w3m-form-input-select-urlid urlid)
+ (when value
+ (setq cur (car value))
+ (setq value (cdr value))
+ (dolist (candidate value)
+ (setq pos (point))
+ (insert (if (zerop (length (cdr candidate)))
+ " " ; "" -> " "
+ (cdr candidate)))
+ (add-text-properties pos (point)
+ (list 'w3m-form-select-value (car candidate)
+ 'mouse-face w3m-form-mouse-face))
+ (insert "\n")))
+ (goto-char (point-min))
+ (while (and (not (eobp))
+ (not (equal cur
+ (get-text-property (point)
+ 'w3m-form-select-value))))
+ (goto-char (next-single-property-change (point)
+ 'w3m-form-select-value)))
+ (set-buffer-modified-p nil)
+ (beginning-of-line)
+ (w3m-form-input-select-mode)))
+ (if (and (consp buffer)
+ (get-buffer-window (cdr buffer)))
+ ;; same frame only
+ (select-window (get-buffer-window (cdr buffer)))
+ (condition-case nil
+ (split-window cur-win (if (> size 0) size window-min-height))
+ (error
+ (delete-other-windows)
+ (split-window cur-win (- (window-height cur-win)
+ w3m-form-input-select-buffer-lines))))
+ (select-window (next-window))
+ (let ((pop-up-windows nil))
+ (switch-to-buffer (if (consp buffer) (cdr buffer) buffer))))))
+
+;;; MAP
+
+(defcustom w3m-form-input-map-buffer-lines 10
+ "*Buffer lines for form select map buffer."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-form-input-map-mode-hook nil
+ "*A hook called after w3m-form-input-map-mode."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-form-input-map-set-hook nil
+ "*A Hook called before w3m-form-input-map-set."
+ :group 'w3m
+ :type 'hook)
+
+(defvar w3m-form-input-map-keymap nil)
+(unless w3m-form-input-map-keymap
+ (setq w3m-form-input-map-keymap (make-sparse-keymap))
+ (define-key w3m-form-input-map-keymap "\C-c\C-c"
+ 'w3m-form-input-map-set)
+ (define-key w3m-form-input-map-keymap "\r"
+ 'w3m-form-input-map-set)
+ (define-key w3m-form-input-map-keymap "\C-m"
+ 'w3m-form-input-map-set)
+ (define-key w3m-form-input-map-keymap "\C-c\C-q"
+ 'w3m-form-input-map-exit)
+ (define-key w3m-form-input-map-keymap "\C-c\C-k"
+ 'w3m-form-input-map-exit)
+ (define-key w3m-form-input-map-keymap "q"
+ 'w3m-form-input-map-exit)
+ (define-key w3m-form-input-map-keymap "\C-g"
+ 'w3m-form-input-map-exit)
+ (define-key w3m-form-input-map-keymap "h" 'backward-char)
+ (define-key w3m-form-input-map-keymap "j" 'next-line)
+ (define-key w3m-form-input-map-keymap "k" 'previous-line)
+ (define-key w3m-form-input-map-keymap "l" 'forward-char)
+ (if (featurep 'xemacs)
+ (define-key w3m-form-input-map-keymap [(button2)]
+ 'w3m-form-input-map-set-mouse)
+ (define-key w3m-form-input-map-keymap [mouse-2]
+ 'w3m-form-input-map-set-mouse)))
+
+(defun w3m-form-input-map-set-mouse (event)
+ "Save and exit from w3m form select map mode with mouse."
+ (interactive "e")
+ (mouse-set-point event)
+ (w3m-form-input-map-set))
+
+(defun w3m-form-input-map-set ()
+ "Save and exit from w3m form select map mode."
+ (interactive)
+ (run-hooks 'w3m-form-input-map-set-hook)
+ (let* ((map (get-text-property (point) 'w3m-form-map-value))
+ (buffer (current-buffer))
+ (w3mbuffer w3m-form-input-map-buffer)
+ (wincfg w3m-form-input-map-wincfg)
+ (point w3m-form-input-map-point))
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (when (buffer-live-p w3mbuffer)
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when point (goto-char point))
+ (w3m-goto-url (w3m-expand-url map)))))
+
+(defun w3m-form-input-map-exit ()
+ "Exit from w3m form select map mode."
+ (interactive)
+ (let* ((buffer (current-buffer))
+ (w3mbuffer w3m-form-input-map-buffer)
+ (wincfg w3m-form-input-map-wincfg)
+ (point w3m-form-input-map-point))
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (when (buffer-live-p w3mbuffer)
+ (pop-to-buffer w3mbuffer)
+ (set-window-configuration wincfg)
+ (when point (goto-char point)))))
+
+(defun w3m-form-input-map-mode ()
+ "\\<w3m-form-input-map-keymap>
+ Major mode for w3m map select.
+
+\\[w3m-form-input-map-set]\
+ Save and exit from w3m form select map mode.
+\\[w3m-form-input-map-exit]\
+ Exit from w3m form select map mode.
+\\[w3m-form-input-map-set-mouse]\
+ Save and exit from w3m form select map mode with mouse.
+"
+ (setq mode-name "w3m map select"
+ major-mode 'w3m-form-input-map-mode)
+ (setq buffer-read-only t)
+ (use-local-map w3m-form-input-map-keymap)
+ (w3m-run-mode-hooks 'w3m-form-input-map-mode-hook))
+
+(defun w3m-form-input-map (form name)
+ (let* ((value (w3m-form-get-by-name form name))
+ (urlname (format "%s:%s" w3m-current-url name))
+ (cur-win (selected-window))
+ (wincfg (current-window-configuration))
+ (w3mbuffer (current-buffer))
+ (point (point))
+ (size (min
+ (- (window-height cur-win)
+ window-min-height 1)
+ (- (window-height cur-win)
+ (max window-min-height
+ (1+ w3m-form-input-map-buffer-lines)))))
+ buffer pos)
+ (setq buffer
+ (catch 'detect-buffer
+ (save-current-buffer
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when (and w3m-form-input-map-buffer
+ (eq w3m-form-input-map-buffer w3mbuffer)
+ (string= w3m-form-input-map-urlname urlname))
+ (throw 'detect-buffer (cons t buffer)))))
+ (generate-new-buffer "*w3m map select*")))
+ (unless (consp buffer)
+ (with-current-buffer buffer
+ (setq w3m-form-input-map-buffer w3mbuffer)
+ (setq w3m-form-input-map-wincfg wincfg)
+ (setq w3m-form-input-map-point point)
+ (setq w3m-form-input-map-urlname urlname)
+ (when value
+ (dolist (candidate value)
+ (setq pos (point))
+ (insert (if (zerop (length (cdr candidate)))
+ (car candidate)
+ (cdr candidate)))
+ (add-text-properties pos (point)
+ (list 'w3m-form-map-value (car candidate)
+ 'mouse-face w3m-form-mouse-face))
+ (insert "\n")))
+ (goto-char (point-min))
+ (set-buffer-modified-p nil)
+ (beginning-of-line)
+ (w3m-form-input-map-mode)))
+ (if (and (consp buffer)
+ (get-buffer-window (cdr buffer)))
+ ;; same frame only
+ (select-window (get-buffer-window (cdr buffer)))
+ (condition-case nil
+ (split-window cur-win (if (> size 0) size window-min-height))
+ (error
+ (delete-other-windows)
+ (split-window cur-win (- (window-height cur-win)
+ w3m-form-input-map-buffer-lines))))
+ (select-window (next-window))
+ (let ((pop-up-windows nil))
+ (switch-to-buffer (if (consp buffer) (cdr buffer) buffer))))))
+
+;;;
+(defun w3m-form-submit-get-textarea-files (form)
+ (when w3m-form-use-textarea-backup-p
+ (let ((plist (w3m-form-plist form))
+ pos id file files)
+ (while plist
+ (setq id (car plist))
+ (setq plist (cddr plist))
+ (setq pos (text-property-any (point-min) (point-max) 'w3m-form-id id))
+ (when (and pos
+ (setq file (get-text-property pos 'w3m-form-file-name)))
+ (setq files (cons file files))))
+ files)))
+
+(defun w3m-form-submit (form &optional id name value new-session download)
+ (if (w3m-anchor (point))
+ ;; cf SA17565
+ (w3m-goto-url (w3m-anchor (point)))
+ (when (and id name
+ (> (length name) 0))
+ (w3m-form-put form id name value))
+ (let* ((orig-url w3m-current-url)
+ (url (or (w3m-form-action form)
+ (if (string-match "\\?" w3m-current-url)
+ (substring w3m-current-url 0 (match-beginning 0))
+ w3m-current-url))))
+ (setq w3m-form-textarea-post-files
+ (w3m-form-submit-get-textarea-files form))
+ (cond ((and (not (string= url orig-url))
+ (string-match "^https://" orig-url)
+ (string-match "^http://" url)
+ (not (y-or-n-p (format "Send POST data to '%s'?" url))))
+ (ding))
+ ((or (eq 'post (w3m-form-method form))
+ ;; While some sites, e.g., emacswiki.org, specify the
+ ;; `get' method for the enctype `multipart/form-data',
+ ;; we use the `post' method according to the proposal
+ ;; of RFC2070.
+ (eq 'multipart/form-data (w3m-form-enctype form)))
+ (if download
+ (funcall 'w3m-download
+ url nil nil nil
+ (w3m-form-make-form-data form))
+ (funcall (if new-session
+ 'w3m-goto-url-new-session
+ 'w3m-goto-url)
+ url 'reload nil
+ (w3m-form-make-form-data form)
+ w3m-current-url)))
+ ((eq 'get (w3m-form-method form))
+ (funcall (if download
+ 'w3m-download
+ (if new-session
+ 'w3m-goto-url-new-session
+ 'w3m-goto-url))
+ (concat (w3m-url-strip-query url)
+ "?" (w3m-form-make-form-data form))))
+ (t
+ (w3m-message "This form's method has not been supported: %s"
+ (let (print-level print-length)
+ (prin1-to-string (w3m-form-method form)))))))))
+
+(defun w3m-form-real-reset (form sexp)
+ (and (eq 'w3m-form-input (car sexp))
+ (eq form (nth 1 sexp))
+ (w3m-form-put form (nth 2 sexp) (nth 3 sexp) (nth 7 sexp))
+ (w3m-form-replace (nth 7 sexp))))
+
+(defun w3m-form-reset (form)
+ (save-excursion
+ (let (pos prop)
+ (when (setq prop (w3m-action (goto-char (point-min))))
+ (goto-char (or (w3m-form-real-reset form prop)
+ (next-single-property-change pos 'w3m-action))))
+ (while (setq pos (next-single-property-change (point) 'w3m-action))
+ (goto-char pos)
+ (goto-char (or (w3m-form-real-reset form (w3m-action pos))
+ (next-single-property-change pos 'w3m-action)))))))
+
+
+(provide 'w3m-form)
+
+;;; w3m-form.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-hist.el b/share/emacs/site-lisp/w3m/w3m-hist.el
new file mode 100644
index 00000000000..84c3ab5cd89
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-hist.el
@@ -0,0 +1,732 @@
+;;; w3m-hist.el --- the history management system for emacs-w3m
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Emacs-w3m keeps history in the buffer-local variables `w3m-history'
+;; and `w3m-history-flat'. Each variable contains a list of all the
+;; links you have visited. The behavior tracing history backward or
+;; forward is controlled by the `w3m-history-reuse-history-elements'
+;; variable. See the documentations for those variables for details.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(defcustom w3m-history-reuse-history-elements nil
+ "Non-nil means reuse the history element when re-visiting the page.
+Otherwise, a new history element will be created even if there are
+elements for the same url in the history.
+
+Emacs-w3m used to operate as the case in which it is non-nil, however
+it sometimes brought about users' dissatisfaction. For example, if a
+user visited the pages A -> B -> C -> B in order, performing BACK on
+the second B would let a user visit A. The reason why a user was
+taken to A rather than C is that the `w3m-history' variable only had
+the list `(A B C)' as a history and B was the current position at that
+time.
+
+The default value for this variable is nil which allows the
+`w3m-history' variable to have the list `(A B C B)'. Where contents
+of two B's are the identical Lisp objects. So, too much wasting the
+Lisp resources will be avoided.
+
+See the documentation for the variables `w3m-history' and
+`w3m-history-flat' for more information."
+ :group 'w3m
+ :type '(boolean :format "%{%t%}: %[%v%]" :on "On" :off "Off"))
+
+(defcustom w3m-history-minimize-in-new-session nil
+ "Non-nil means minimize copied history so that there's only current page.
+This variable is effective when creating of the new session by copying
+\(i.e., `w3m-copy-buffer')."
+ :group 'w3m
+ :type '(boolean :format "%{%t%}: %[%v%]" :on "On" :off "Off"))
+
+(defvar w3m-history nil
+ "A tree-structured complex list of all the links which you have visited.
+This is a buffer-local variable. For example, it will grow as follows:
+
+\[Branch-1.0.0.0]: +--> U1.0.0.0.0 --> U1.0.0.0.1
+ |
+ [Branch-1.0]: +--> U1.0.0 --> U1.0.1 --> U1.0.2
+ |
+ [Trunk]: U0 --> U1 --> U2 --> U3 --> U4 --> U5 --> U6
+ |
+ [Branch-2.0]: +--> U2.0.0 --> U2.0.1
+ |
+ [Branch-2.1]: +--> U2.1.0 --> U2.1.1 --> U2.1.2
+ |
+\[Branch-2.1.1.0]: +--> U2.1.1.0.0
+
+In this case, the U1.0.0.0.0 history element represents the first link
+of the first branch which is sprouted from the U1.0.0 history element.
+
+The trunk or each branch is a simple list which will contain some
+history elements. History elements in the trunk or each branch will
+be arranged in increasing order (the newest history element will be
+the last element of the list). Each history element represents a link
+which consists of the following records:
+
+ (URL PROPERTIES BRANCH BRANCH ...)
+
+Where URL is a string of an address of a link. PROPERTIES is a plist
+which is able to contain any kind of data to supplement the URL as
+follows:
+
+ (KEYWORD VALUE KEYWORD VALUE ...)
+
+A note for programmers: PROPERTIES should always be a non-nil value in
+order to make it easy to share the value in every history element in
+every emacs-w3m buffer.
+
+The remaining BRANCHes are branches of the history element. Branches
+will also be arranged in increasing order (the newest one will be the
+rightmost element). Each BRANCH will also be a tree-structured
+complex list. Therefore, the history structure will grow up
+infinitely.
+
+In order to save the Lisp resources, URL strings and PROPERTIES in the
+`w3m-history' variables are shared in every emacs-w3m buffer (it means
+each element in two `w3m-history' variables can be compared by `eq'
+rather than `equal'). If there is necessity to make buffer-local
+properties, in other words, to make properties of which values differ
+in every emacs-w3m buffer, use the `w3m-history-flat' variable instead.
+
+There are special rules on the emacs-w3m history management system.
+As you perhaps foresaw, the operation BACK on U2.0.0 brings you to U2,
+and one more BACK brings you to U1. Well, where do you think we
+should go next when the operation FORWARD is performed on U1? The
+rule is to go to the newest link you have ever visited. So, that
+operation should take you to U1.0.0.
+
+Another rule is that the new U4 link should sprout from U1.0.1 if
+`w3m-history-reuse-history-elements' is nil when you visit the U4 link
+directly from U1.0.1. In contrast, you should be taken to the
+existing U4 link instead of sprouting the new branch from U1.0.1 if
+`w3m-history-reuse-history-elements' is non-nil.
+
+In addition, the first element of `w3m-history' is special. It is a
+list containing pointers which point to three history elements as
+shown below:
+
+ (PREV CURRENT NEXT)
+
+PREV points to the previous history element, CURRENT points to the
+current one and NEXT points to the next one. Each of them is a list
+which contains an odd number of integers. For example, `(0)' does
+point to U0 and `(2 1 0)' does point to U2.1.0. Finally, the value of
+the `w3m-history' variable will be constructed as follows:
+
+\(((1) (2) (2 1 0))
+ (\"http://www.U0.org/\" (:title \"U0\" :foo \"bar\"))
+ (\"http://www.U1.org/\" (:title \"U1\" :foo \"bar\")
+ ((\"http://www.U100.org/\" (:title \"U100\" :foo \"bar\")
+ ((\"http://www.U10000.org/\" (:title \"U10000\" :foo \"bar\"))
+ (\"http://www.U10001.org/\" (:title \"U10001\" :foo \"bar\"))))
+ (\"http://www.U101.org/\" (:title \"U101\" :foo \"bar\"))
+ (\"http://www.U102.org/\" (:title \"U102\" :foo \"bar\"))))
+ (\"http://www.U2.org/\" (:title \"U2\" :foo \"bar\")
+ ((\"http://www.U200.org/\" (:title \"U200\" :foo \"bar\"))
+ (\"http://www.U201.org/\" (:title \"U201\" :foo \"bar\")))
+ ((\"http://www.U210.org/\" (:title \"U210\" :foo \"bar\"))
+ (\"http://www.U211.org/\" (:title \"U211\" :foo \"bar\")
+ ((\"http://www.U21100.org/\" (:title \"U21100\" :foo \"bar\"))))
+ (\"http://www.U212.org/\" (:title \"U212\" :foo \"bar\"))))
+ (\"http://www.U3.org/\" (:title \"U3\" :foo \"bar\"))
+ (\"http://www.U4.org/\" (:title \"U4\" :foo \"bar\"))
+ (\"http://www.U5.org/\" (:title \"U5\" :foo \"bar\"))
+ (\"http://www.U6.org/\" (:title \"U6\" :foo \"bar\")))")
+
+(defvar w3m-history-flat nil
+ "A flattened alist of all the links which you have visited.
+All history elements except for buffer-local properties are the same
+as ones of `w3m-history'. Each element will contain the following
+records:
+
+ (URL PROPERTIES POSITION [KEYWORD VALUE [KEYWORD VALUE ...]])
+
+Where URL is a string of an address of a link, PROPERTIES is a plist
+which is able to contain any kind of data to supplement the URL. Each
+PROPERTIES is the Lisp object identical with that corresponding
+element of `w3m-history'. POSITION is a list of integers to designate
+the current position in the history.
+
+The remaining [KEYWORD VALUE [KEYWORD VALUE ...]] is a plist similar
+to PROPERTIES, but it is buffer-local. You can manipulate
+buffer-local properties using the functions `w3m-history-plist-get',
+`w3m-history-plist-put', `w3m-history-add-properties' and
+`w3m-history-remove-properties'. See the documentation for the
+`w3m-history' variable for more information.")
+
+(make-variable-buffer-local 'w3m-history)
+(make-variable-buffer-local 'w3m-history-flat)
+
+;; Inline functions.
+(defsubst w3m-history-assoc (url)
+ "Extract a history element associated with URL from `w3m-history-flat'."
+ (assoc url w3m-history-flat))
+
+;; Functions for internal use.
+(defun w3m-history-set-current (position)
+ "Modify `w3m-history' so that POSITION might be the current position.
+What is called the current position is the `cadar' of `w3m-history'.
+The previous position and the next position will be computed
+automatically."
+ (setcar w3m-history (w3m-history-regenerate-pointers position)))
+
+(defun w3m-history-element (position &optional flat)
+ "Return a history element located in the POSITION of the history.
+If FLAT is nil, the value will be extracted from `w3m-history' and
+represented with the `(URL PROPERTIES BRANCH BRANCH ...)' form.
+Otherwise, the value will be extracted from `w3m-history-flat' and
+represented with the `(URL PROPERTIES POSITION [KEYWORD VALUE ...])'
+form. FYI, to know the current position, the `(cadar w3m-history)'
+form for example can be used."
+ (when position
+ (if flat
+ (let ((flat w3m-history-flat)
+ element)
+ (while flat
+ (if (equal (caddr (setq element (pop flat))) position)
+ (setq flat nil)
+ (setq element nil)))
+ element)
+ (let ((element (nth (pop position) (cdr w3m-history))))
+ (while position
+ (setq element (nth (pop position) (cddr element))
+ element (nth (pop position) element)))
+ element))))
+
+(defun w3m-history-previous-position (position)
+ "Return a history position of the previous location of POSITION.
+POSITION is a list of integers of the same form as being used in one
+of the elements of the `car' of `w3m-history' (which see)."
+ (let (class number previous)
+ (when position
+ (setq class (1- (length position))
+ number (nth class position))
+ (if (zerop number)
+ ;; This POSITION is the beginning of the branch.
+ (unless (zerop class)
+ ;; There's a parent.
+ (setq previous (copy-sequence position))
+ (setcdr (nthcdr (- class 2) previous) nil))
+ ;; This POSITION is not the beginning of the branch.
+ (setq previous (copy-sequence position))
+ (setcar (nthcdr class previous) (1- number))))
+ previous))
+
+(defun w3m-history-next-position (position)
+ "Return a history position of the next location of POSITION.
+POSITION is a list of integers of the same form as being used in one
+of the elements of the `car' of `w3m-history' (which see)."
+ (let (next branch element number)
+ (when position
+ (setq next position
+ branch (cdr w3m-history)
+ element (nth (pop next) branch))
+ (while next
+ (setq branch (nth (pop next) (cddr element))
+ element (nth (pop next) branch)))
+ (cond ((nth 2 element)
+ ;; There're branches sprouted from the POSITION.
+ (setq next (copy-sequence position))
+ (setcdr (nthcdr (1- (length next)) next)
+ (list (- (length element) 3) 0)))
+ ((> (length branch)
+ (setq number (1+ (nth (1- (length position)) position))))
+ ;; This POSITION is not the end of the branch.
+ (setq next (copy-sequence position))
+ (setcar (nthcdr (1- (length next)) next) number))))
+ next))
+
+(defun w3m-history-set-plist (plist property value)
+ "Similar to `plist-put' but PLIST is actually modified even in XEmacs.
+If VALUE is nil, the pair of PROPERTY and VALUE is removed from PLIST.
+Exceptionally, if PLIST is made empty because of removing, it will be
+instead set to `(nil nil)'. Return PLIST itself."
+ (let ((pair (memq property plist)))
+ (if pair
+ (if value
+ (setcar (cdr pair) value)
+ (if (eq (car plist) property)
+ (progn
+ (setcar plist (nth 2 plist))
+ (setcar (cdr plist) (nth 3 plist))
+ (setcdr (cdr plist) (nthcdr 4 plist)))
+ (setcdr (nthcdr (- (length plist) (length pair) 1) plist)
+ (nthcdr 2 pair))))
+ (when value
+ (setcdr (nthcdr (1- (length plist)) plist) (list property value)))))
+ plist)
+
+(defun w3m-history-modify-properties (old new &optional replace)
+ "Merge NEW plist into OLD plist and return a modified plist.
+If REPLACE is non-nil, OLD will be replaced with NEW. OLD plist is
+modified and also the new value is shared in all the history
+elements containing OLD plist. Properties whose values are nil are
+removed from OLD plist, but if OLD plist is made empty because of
+removing, it will be instead set to `(nil nil)'."
+ (prog1
+ old
+ (if replace
+ (progn
+ (setcar old (car new))
+ (setcdr old (or (cdr new) (list nil))))
+ (while new
+ (w3m-history-set-plist old (car new) (cadr new))
+ (setq new (cddr new))))
+ (setq new (copy-sequence old))
+ (while new
+ (w3m-history-set-plist old (car new) (cadr new))
+ (setq new (cddr new)))))
+
+(defun w3m-history-seek-element (url &optional newprops replace)
+ "Return a copy of history element corresponding to URL.
+Searching is performed in all emacs-w3m buffers and the first match
+found is returned. If REPLACE is nil, NEPROPS will be merged into
+properties of an element. Otherwise, properties of an element will be
+replaced with NEWPROPS."
+ (let* ((current (current-buffer))
+ (buffers (cons current (delq current (buffer-list))))
+ element)
+ (while buffers
+ (set-buffer (pop buffers))
+ (when (and (eq major-mode 'w3m-mode)
+ (setq element (w3m-history-assoc url)))
+ (setq buffers nil)))
+ (set-buffer current)
+ (prog1
+ (copy-sequence element)
+ (when element
+ (w3m-history-modify-properties (cadr element) newprops replace)))))
+
+;; Generic functions.
+(defun w3m-history-previous-link-available-p ()
+ "Return non-nil if the previous history element is available."
+ (caar w3m-history))
+
+(defun w3m-history-next-link-available-p ()
+ "Return non-nil if the next history element is available."
+ (caddar w3m-history))
+
+(defun w3m-history-backward (&optional count)
+ "Move backward COUNT times in the history structure.
+Return a cons of a new history element and new position pointers of
+the history. The position pointers of `w3m-history' will not change.
+If COUNT is omitted, it defaults to the number one. If COUNT is
+negative, moving forward is performed. Return nil if there is no
+previous element."
+ (when w3m-history
+ (let ((oposition (copy-sequence (car w3m-history)))
+ position last)
+ (cond ((or (unless count
+ (setq count 1))
+ (> count 0))
+ (while (and (> count 0)
+ (setq position (caar w3m-history)))
+ (w3m-history-set-current (setq last position))
+ (decf count)))
+ ((< count 0)
+ (while (and (< count 0)
+ (setq position (caddar w3m-history)))
+ (w3m-history-set-current (setq last position))
+ (incf count)))
+ (t ;; Don't move.
+ (setq last (cadar w3m-history))))
+ (prog1
+ (when last
+ (cons (w3m-history-element (cadar w3m-history))
+ (car w3m-history)))
+ (setcar w3m-history oposition)))))
+
+(defun w3m-history-forward (&optional count)
+ "Move forward COUNT times in the history structure.
+Return a cons of a new history element and new position pointers of
+the history. The position pointers of `w3m-history' will not change.
+If COUNT is omitted, it defaults to the number one. If COUNT is
+negative, moving backward is performed. If there is no room to move
+in the history, move as far as possible."
+ (w3m-history-backward (- (or count 1))))
+
+(defun w3m-history-regenerate-pointers (position)
+ "Regenerate the position pointers due to only the current POSITION.
+The history position pointers are made with the `(PREV CURRENT NEXT)'
+form which is mentioned in the documentation for `w3m-history'."
+ (list (w3m-history-previous-position position)
+ position
+ (w3m-history-next-position position)))
+
+(defun w3m-history-flat ()
+ "Set the value of `w3m-history-flat' due to the value of `w3m-history'.
+See also the documentations for those variables."
+ (setq w3m-history-flat nil)
+ (when w3m-history
+ (let ((history (cdr w3m-history))
+ (position (list 0))
+ element branches flag children)
+ (while (setq element (pop history))
+ (if (stringp (car element))
+ (progn
+ (push (list (car element) (cadr element) (reverse position))
+ w3m-history-flat)
+ (if (setq element (cddr element))
+ (progn
+ (setq history (append element history)
+ position (append (list 0 0) position))
+ (push (length element) branches))
+ (setcar position (1+ (car position)))
+ (setq flag t)
+ (while (and flag
+ children
+ (zerop (setcar children (1- (car children)))))
+ (setq children (cdr children))
+ (if (zerop (setcar branches (1- (car branches))))
+ (progn
+ (setq branches (cdr branches)
+ position (cddr position))
+ (setcar position (1+ (car position))))
+ (setcar position 0)
+ (setcar (cdr position) (1+ (cadr position)))
+ (setq flag nil)))))
+ (setq history (append element history))
+ (push (length element) children))))
+ (setq w3m-history-flat (nreverse w3m-history-flat))))
+
+(defun w3m-history-tree (&optional newpos)
+ "Set the value of `w3m-history' due to the value of `w3m-history-flat'.
+See also the documentations for those variables. NEWPOS specifies the
+current position of the history. It defaults to the beginning
+position of the history."
+ (if w3m-history-flat
+ (let ((flat w3m-history-flat)
+ element positions rest position)
+ (setq w3m-history (list (list nil nil)))
+ (while (setq element (pop flat))
+ (setq positions (caddr element)
+ rest w3m-history)
+ (while positions
+ (setq position (pop positions))
+ (unless (> (length rest) position)
+ (setcdr (nthcdr (1- (length rest)) rest)
+ (make-list (- position (length rest) -1)
+ (list nil nil))))
+ (setq rest (nth position rest))
+ (when positions
+ (setq position (pop positions))
+ (unless (> (- (length rest) 2) position)
+ (setcdr (nthcdr (1- (length rest)) rest)
+ (make-list (- position (length rest) -3)
+ (list (list nil nil)))))
+ (setq rest (nth (+ position 2) rest))))
+ (setcar rest (car element))
+ (setcar (cdr rest) (cadr element)))
+ (push 'dummy w3m-history)
+ (w3m-history-set-current (or newpos (list 0)))
+ w3m-history)
+ (setq w3m-history nil)))
+
+(defun w3m-history-push (url &optional newprops replace)
+ "Push URL into the history structure.
+A history which corresponds to URL becomes the current one. NEWPROPS
+is a plist which supplements URL. Return a new history position
+pointers. How this function behaves to the history structure (i.e.,
+`w3m-history' and `w3m-history-flat') is controlled by the value of
+`w3m-history-reuse-history-elements'.
+
+The case where `w3m-history-reuse-history-elements' is nil:
+ A new history element is always created. If there is another
+ element corresponding to the same URL, its properties are inherited
+ into the new history element.
+
+The case where `w3m-history-reuse-history-elements' is non-nil:
+ If there is an element corresponding to URL in the history, it
+ becomes the current history element. Otherwise, this function
+ behaves like the case where `w3m-history-reuse-history-elements' is
+ nil.
+
+If REPLACE is nil, NEWPROPS is merged into properties of the current
+history element. Otherwise, properties of the current history element
+are replaced with NEWPROPS."
+ (let ((element (w3m-history-seek-element url newprops replace))
+ position class number branch)
+ (if element
+ (setcdr (cdr element) nil)
+ (setq element (list url (w3m-history-modify-properties newprops nil))))
+ (cond
+ ((null w3m-history)
+ ;; The dawn of the history.
+ (setq position (list nil (list 0) nil)
+ w3m-history (list position element)
+ w3m-history-flat (list (append element (list (list 0)))))
+ position)
+
+ ((and w3m-history-reuse-history-elements
+ (setq position (caddr (w3m-history-assoc url))))
+ ;; Reuse the existing history element assigned to the current one.
+ ;; The position pointers will be fixed with correct values after
+ ;; visiting a page when moving back, moving forward or jumping from
+ ;; the about://history/ page.
+ (w3m-history-set-current position))
+
+ (t
+ ;; Sprout a new history element.
+ (setq position (copy-sequence (cadar w3m-history))
+ class (1- (length position))
+ number 0
+ branch (nthcdr (car position) (cdr w3m-history)))
+ (while (> class number)
+ (setq number (1+ number)
+ branch (nth (nth number position) (cddar branch))
+ number (1+ number)
+ branch (nthcdr (nth number position) branch)))
+ (if (cdr branch)
+ ;; We should sprout a new branch.
+ (progn
+ (setq number (1- (length (car branch))))
+ (setcdr (nthcdr class position) (list (1- number) 0))
+ (setcdr (nthcdr number (car branch)) (list (list element))))
+ ;; The current position is the last of the branch.
+ (setcar (nthcdr class position)
+ (1+ (car (nthcdr class position))))
+ (setcdr branch (list element)))
+ (setq w3m-history-flat (nconc w3m-history-flat
+ (list (append element (list position)))))
+ (setcar w3m-history (list (cadar w3m-history) position nil))))))
+
+(defun w3m-history-copy (buffer)
+ "Copy the history structure from BUFFER to the current buffer.
+This function keeps corresponding elements identical Lisp objects
+between buffers while copying the frameworks of `w3m-history' and
+`w3m-history-flat'. Exceptionally, buffer-local properties contained
+in `w3m-history-flat' will not be copied. If
+`w3m-history-minimize-in-new-session' is non-nil, the copied history
+structure will be shrunk so that it may contain only the current
+history element."
+ (let ((current (current-buffer))
+ position flat element rest)
+ (set-buffer buffer)
+ (when w3m-history
+ (setq position (copy-sequence (cadar w3m-history))
+ flat w3m-history-flat))
+ (set-buffer current)
+ (when position
+ (if w3m-history-minimize-in-new-session
+ (progn
+ (setq w3m-history-flat flat
+ element (copy-sequence (w3m-history-element position t)))
+ (setcdr (cdr element) nil)
+ (setq w3m-history (list (list nil (list 0) nil) element)
+ w3m-history-flat (list (append element (list (list 0))))))
+ ;; Remove buffer-local properties from the new `w3m-history-flat'.
+ (while flat
+ (setq element (copy-sequence (car flat))
+ flat (cdr flat))
+ (setcdr (cddr element) nil)
+ (push element rest))
+ (setq w3m-history-flat (nreverse rest))
+ (w3m-history-tree position)))))
+
+(defun w3m-history-plist-get (keyword &optional not-buffer-local)
+ "Extract a value from the properties of the current history element.
+KEYWORD is usually a symbol. This function returns the value
+corresponding to KEYWORD, but it returns nil if the properties don't
+contain KEYWORD. If NOT-BUFFER-LOCAL is nil, this function searches a
+value in buffer-local properties, otherwise looks over the global
+properties instead."
+ (let ((element (w3m-history-element (cadar w3m-history) t)))
+ (plist-get (if not-buffer-local
+ (cadr element)
+ (cdddr element))
+ keyword)))
+
+(defun w3m-history-add-properties (newprops &optional not-buffer-local)
+ "Add NEWPROPS to the properties of the current history element.
+NEWPROPS should be a plist, which is merged into the properties.
+Return new properties. If NOT-BUFFER-LOCAL is nil, NEWPROPS will be
+added to the buffer-local properties. Otherwise, NEWPROPS will be
+added to the global properties instead."
+ (if not-buffer-local
+ (cadr (w3m-history-seek-element
+ (car (w3m-history-element (cadar w3m-history)))
+ newprops))
+ (let ((element (w3m-history-element (cadar w3m-history) t))
+ properties)
+ (if element
+ (progn
+ (setq properties (cdddr element)
+ properties
+ (if properties
+ (w3m-history-modify-properties properties newprops)
+ ;; Use `w3m-history-modify-properties' to remove
+ ;; keyword-value pairs whose value is nil.
+ (w3m-history-modify-properties newprops nil)))
+ (unless (car properties) ;; check whether it is `(nil nil)'.
+ (setq properties nil))
+ (setcdr (cddr element) properties))
+ (message "\
+Warning: the history database in this session seems corrupted.")
+ (sit-for 1)
+ nil))))
+
+(defun w3m-history-plist-put (keyword value &optional not-buffer-local)
+ "Put KEYWORD and VALUE into the current history element.
+Return new properties. If NOT-BUFFER-LOCAL is nil, KEYWORD and VALUE
+will be put into the buffer-local properties. Otherwise, KEYWORD and
+VALUE will be put into the global properties instead."
+ (w3m-history-add-properties (list keyword value) not-buffer-local))
+
+(defun w3m-history-remove-properties (properties &optional not-buffer-local)
+ "Remove PROPERTIES from the current history element.
+PROPERTIES should be one or more keyword-value pairs (i.e., plist) but
+values are ignored (treated as nil). Return new properties. If
+NOT-BUFFER-LOCAL is nil, the buffer-local properties will be modified.
+Otherwise, the global properties will be modified instead."
+ (let (rest)
+ (while properties
+ (setq rest (cons nil (cons (car properties) rest))
+ properties (cddr properties)))
+ (w3m-history-add-properties (nreverse rest) not-buffer-local)))
+
+(defun w3m-history-store-position ()
+ "Store the current cursor position into the current history element.
+Data consist of the position where the window starts and the cursor
+position. Naturally, those should be treated as buffer-local."
+ (interactive)
+ (when (cadar w3m-history)
+ (w3m-history-add-properties
+ (list :window-start (window-start)
+ :position (cons (count-lines (point-min) (point-at-bol))
+ (current-column))
+ :window-hscroll (window-hscroll)))
+ (when (interactive-p)
+ (message "The current cursor position saved"))))
+
+(defun w3m-history-restore-position ()
+ "Restore the saved cursor position in the page.
+Even if the page has been shrunk (by reloading, for example), somehow
+it works although it may not be perfect."
+ (interactive)
+ (when (cadar w3m-history)
+ (let ((start (w3m-history-plist-get :window-start))
+ position window)
+ (cond ((and start
+ (setq position (w3m-history-plist-get :position)))
+ (when (<= start (point-max))
+ (setq window (get-buffer-window (current-buffer) 'all-frames))
+ (when window
+ (set-window-start window start)
+ (set-window-hscroll
+ window (or (w3m-history-plist-get :window-hscroll) 0)))
+ (goto-char (point-min))
+ (forward-line (car position))
+ (move-to-column (cdr position))
+ (let ((deactivate-mark nil))
+ (run-hooks 'w3m-after-cursor-move-hook))))
+ ((interactive-p)
+ (message "No cursor position saved"))))))
+
+(defun w3m-history-minimize ()
+ "Minimize the history so that there may be the current page only."
+ (interactive)
+ (let ((position (cadar w3m-history))
+ element)
+ (when position
+ (setq element (w3m-history-element position t))
+ (setcar (cddr element) (list 0))
+ (setq w3m-history-flat (list element)
+ w3m-history (list (list nil (list 0) nil)
+ (list (car element) (cadr element)))))))
+
+(defun w3m-history-slimmed-history-flat ()
+ "Return slimmed history."
+ (let ((position (cadar w3m-history))
+ flat-map new-flat)
+ (dolist (l w3m-history-flat)
+ (setq flat-map (cons (cons (nth 2 l) l)
+ flat-map)))
+ (setq new-flat (cons (cdr (assoc position flat-map)) nil))
+ (let ((pos (w3m-history-previous-position position)))
+ (while pos
+ (setq new-flat (cons (cdr (assoc pos flat-map))
+ new-flat))
+ (setq pos (w3m-history-previous-position pos))))
+ (let ((pos (w3m-history-next-position position)))
+ (while pos
+ (setq new-flat (cons (cdr (assoc pos flat-map))
+ new-flat))
+ (setq pos (w3m-history-next-position pos))))
+ new-flat))
+
+(defun w3m-history-slim ()
+ "Slim the history.
+This makes the history slim so that it may have only the pages that
+are accessible by PREV and NEXT operations."
+ (interactive)
+ (let ((position (cadar w3m-history)))
+ (setq w3m-history-flat (w3m-history-slimmed-history-flat))
+ (w3m-history-tree position)))
+
+(eval-when-compile
+ (defvar w3m-arrived-db)
+ (autoload 'w3m-goto-url "w3m"))
+
+(defun w3m-history-add-arrived-db ()
+ "Add the arrived database to the history structure unreasonably.
+This function is useless normally, so you may not want to use it.
+\(The reason it is here is because it is useful once in a while when
+debugging w3m-hist.el.)"
+ (interactive)
+ (unless (eq 'w3m-mode major-mode)
+ (error "`%s' must be invoked from an emacs-w3m buffer" this-command))
+ (when (and w3m-arrived-db
+ (prog1
+ (yes-or-no-p
+ "Are you sure you really want to destroy the history? ")
+ (message "")))
+ (setq w3m-history nil
+ w3m-history-flat nil)
+ (let ((w3m-history-reuse-history-elements t)
+ url-title title)
+ (mapatoms (lambda (symbol)
+ (when symbol
+ (if (setq title (get symbol 'title))
+ (push (list (symbol-name symbol)
+ (list :title title))
+ url-title)
+ (push (list (symbol-name symbol)) url-title))))
+ w3m-arrived-db)
+ (apply 'w3m-history-push (nth (random (length url-title)) url-title))
+ (while url-title
+ (w3m-history-push (car (nth (random (length w3m-history-flat))
+ w3m-history-flat)))
+ (apply 'w3m-history-push (pop url-title))))
+ (w3m-goto-url "about://history/" t)))
+
+(provide 'w3m-hist)
+
+;;; w3m-hist.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-image.el b/share/emacs/site-lisp/w3m/w3m-image.el
new file mode 100644
index 00000000000..23a6392bc16
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-image.el
@@ -0,0 +1,266 @@
+;;; w3m-image.el --- Image conversion routines.
+
+;; Copyright (C) 2001, 2002, 2003, 2005, 2007, 2008
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Yuuichi Teranishi <teranisi@gohome.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; This file contains the stuffs to convert images for emacs-w3m.
+;; For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+;;
+;; Routines in this file require ImageMagick's convert.
+;; For more detail about ImageMagick, see:
+;;
+;; http://www.imagemagick.org/
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+(require 'w3m-proc)
+
+(eval-when-compile
+ (if (not (fboundp 'defcustom))
+ (require 'pcustom)))
+
+;; Functions and variables which should be defined in the other module
+;; at run-time.
+(eval-when-compile
+ (defvar w3m-async-exec)
+ (defvar w3m-current-url)
+ (defvar w3m-profile-directory)
+ (defvar w3m-work-buffer-name)
+ (defvar w3m-work-buffer-list))
+
+(defcustom w3m-imagick-convert-program (if noninteractive
+ nil
+ (w3m-which-command "convert"))
+ "*Program name of ImageMagick's `convert'."
+ :group 'w3m
+ :set (lambda (symbol value)
+ (custom-set-default symbol (if (and (not noninteractive)
+ value)
+ (if (file-name-absolute-p value)
+ (if (file-executable-p value)
+ value)
+ (w3m-which-command value)))))
+ :type 'file)
+
+(defcustom w3m-imagick-identify-program (if noninteractive
+ nil
+ (w3m-which-command "identify"))
+ "*Program name of ImageMagick's `identify'."
+ :group 'w3m
+ :set (lambda (symbol value)
+ (custom-set-default symbol (if (and (not noninteractive)
+ value)
+ (if (file-name-absolute-p value)
+ (if (file-executable-p value)
+ value)
+ (w3m-which-command value)))))
+ :type 'file)
+
+;;; Image handling functions.
+(defcustom w3m-resize-images (and w3m-imagick-convert-program t)
+ "*If non-nil, resize images to the specified width and height."
+ :group 'w3m
+ :set (lambda (symbol value)
+ (custom-set-default symbol (and w3m-imagick-convert-program value)))
+ :type 'boolean)
+
+(put 'w3m-imagick-convert-program 'available-p 'unknown)
+
+(defun w3m-imagick-convert-program-available-p ()
+ "Return non-nil if ImageMagick's `convert' program is available.
+If not, `w3m-imagick-convert-program' and `w3m-resize-images' are made
+nil forcibly."
+ (cond ((eq (get 'w3m-imagick-convert-program 'available-p) 'yes)
+ t)
+ ((eq (get 'w3m-imagick-convert-program 'available-p) 'no)
+ nil)
+ ((and (stringp w3m-imagick-convert-program)
+ (file-executable-p w3m-imagick-convert-program))
+ (put 'w3m-imagick-convert-program 'available-p 'yes)
+ ;; Check whether convert supports png32.
+ (put 'w3m-imagick-convert-program 'png32
+ (unless (or (featurep 'xemacs)
+ (< emacs-major-version 22))
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert "P1 1 1 1")
+ (condition-case nil
+ (call-process-region (point-min) (point-max)
+ w3m-imagick-convert-program
+ t t nil "pbm:-" "png32:-")
+ (error))
+ (goto-char (point-min))
+ (looking-at "\211PNG\r\n"))))
+ t)
+ (t
+ (when w3m-imagick-convert-program
+ (message "ImageMagick's `convert' program is not available")
+ (sit-for 1))
+ (setq w3m-imagick-convert-program nil
+ w3m-resize-images nil)
+ (put 'w3m-imagick-convert-program 'available-p 'no)
+ nil)))
+
+;;; Synchronous image conversion.
+(defun w3m-imagick-convert-buffer (from-type to-type &rest args)
+ (when (w3m-imagick-convert-program-available-p)
+ (let* ((in-file (make-temp-name
+ (expand-file-name "w3mel" w3m-profile-directory)))
+ (buffer-file-coding-system 'binary)
+ (coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ (default-process-coding-system (cons 'binary 'binary))
+ return)
+ (write-region (point-min) (point-max) in-file nil 'nomsg)
+ (erase-buffer)
+ (setq return
+ (apply 'call-process
+ w3m-imagick-convert-program
+ nil t nil
+ (append args (list
+ (concat
+ (if from-type
+ (concat from-type ":"))
+ in-file)
+ (if to-type
+ (if (and (string-equal to-type "png")
+ (get 'w3m-imagick-convert-program
+ 'png32))
+ "png32:-"
+ (concat to-type ":-"))
+ "-")))))
+ (when (file-exists-p in-file) (delete-file in-file))
+ (if (and (numberp return)
+ (zerop return))
+ t
+ (message "Image conversion failed (code `%s')"
+ (if (stringp return)
+ (string-as-multibyte return)
+ return))
+ nil))))
+
+(defun w3m-imagick-convert-data (data from-type to-type &rest args)
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert data)
+ (and (apply 'w3m-imagick-convert-buffer from-type to-type args)
+ (not (zerop (buffer-size)))
+ (buffer-string))))
+
+;;; Asynchronous image conversion.
+(defun w3m-imagick-start-convert-data (handler
+ data from-type to-type &rest args)
+ (w3m-process-do-with-temp-buffer
+ (success (when (w3m-imagick-convert-program-available-p)
+ (set-buffer-multibyte nil)
+ (insert data)
+ (apply 'w3m-imagick-start-convert-buffer
+ handler from-type to-type args)))
+ (if (and success
+ (not (zerop (buffer-size))))
+ (buffer-string))))
+
+(defun w3m-imagick-start-convert-buffer (handler from-type to-type &rest args)
+ (lexical-let ((in-file (make-temp-name
+ (expand-file-name "w3mel" w3m-profile-directory)))
+ (out-buffer (current-buffer)))
+ (setq w3m-current-url "non-existent")
+ (let ((coding-system-for-write 'binary)
+ (buffer-file-coding-system 'binary)
+ jka-compr-compression-info-list
+ format-alist)
+ (write-region (point-min) (point-max) in-file nil 'nomsg))
+ (w3m-process-do
+ (success (with-current-buffer out-buffer
+ (erase-buffer)
+ (w3m-process-start
+ handler
+ w3m-imagick-convert-program
+ (append args
+ (list
+ (concat
+ (if from-type
+ (concat from-type ":"))
+ in-file)
+ (if to-type
+ (if (and (string-equal to-type "png")
+ (get 'w3m-imagick-convert-program
+ 'png32))
+ "png32:-"
+ (concat to-type ":-"))
+ "-"))))))
+ (when (file-exists-p in-file)
+ (delete-file in-file))
+ success)))
+
+(defun w3m-resize-image (data width height handler)
+ "Resize image DATA to WIDTH and HEIGHT asynchronously.
+HANDLER is called after conversion with resized data as an argument."
+ (w3m-process-do
+ (result (w3m-imagick-start-convert-data
+ handler
+ data nil nil "-geometry"
+ (concat (number-to-string width)
+ "x"
+ (number-to-string height)
+ "!")))
+ result))
+
+(defun w3m-resize-image-by-rate (data rate handler)
+ "Resize image DATA at RATE asynchronously.
+HANDLER is called after conversion with resized data as an argument.
+Note that this function requires that the `convert' program allows the
+`-resize' option."
+ (w3m-process-do
+ (result (w3m-imagick-start-convert-data
+ handler
+ data nil nil "-resize"
+ (concat (number-to-string rate) "%")))
+ result))
+
+(defun w3m-favicon-usable-p ()
+ "Check whether ImageMagick's `convert' supports a Windoze ico format in
+a large number of bits per pixel."
+ (let ((xpm (condition-case nil
+ (w3m-imagick-convert-data
+ (string 0 0 1 0 1 0 2 1 0 0 1 0 24 0 52 0
+ 0 0 22 0 0 0 40 0 0 0 2 0 0 0 2 0
+ 0 0 1 0 24 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 255 255 255 0 0 0 0 0 0)
+ "ico" "xpm")
+ (error nil))))
+ (and xpm (string-match "\"2 1 2 1\"" xpm) t)))
+
+(provide 'w3m-image)
+
+;;; w3m-image.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-lnum.el b/share/emacs/site-lisp/w3m/w3m-lnum.el
new file mode 100644
index 00000000000..622a1e6bf84
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-lnum.el
@@ -0,0 +1,144 @@
+;;; w3m-lnum.el --- Operations using link numbers
+
+;; Copyright (C) 2004, 2005, 2006, 2007, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file provides a minor mode to enable operations using link
+;; numbers.
+
+;;; Usage:
+
+;; Install this file to an appropriate directory, and add these
+;; expressions to your ~/.emacs-w3m.
+
+;; (autoload 'w3m-link-numbering-mode "w3m-lnum" nil t)
+;; (add-hook 'w3m-mode-hook 'w3m-link-numbering-mode)
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m)
+
+(defface w3m-link-numbering
+ '((((class color) (background light)) (:foreground "gray60"))
+ (((class color) (background dark)) (:foreground "gray50")))
+ "Face used to highlight link numbers."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-link-numbering-face 'face-alias 'w3m-link-numbering)
+
+(defcustom w3m-link-numbering-mode-hook nil
+ "*Hook run after `w3m-link-numbering-mode' initialization."
+ :group 'w3m
+ :type 'hook)
+
+(defvar w3m-link-numbering-mode-map
+ (let ((keymap (make-sparse-keymap)))
+ (substitute-key-definition 'w3m-view-this-url
+ 'w3m-move-numbered-anchor
+ keymap w3m-mode-map)
+ keymap)
+ "Keymap used when `w3m-link-numbering-mode' is active.")
+
+(defvar w3m-link-numbering-mode nil
+ "Non-nil if w3m operations using link numbers are enabled.")
+(make-variable-buffer-local 'w3m-link-numbering-mode)
+(unless (assq 'w3m-link-numbering-mode minor-mode-map-alist)
+ (push (cons 'w3m-link-numbering-mode w3m-link-numbering-mode-map)
+ minor-mode-map-alist))
+
+;;;###autoload
+(defun w3m-link-numbering-mode (&optional arg)
+ "Minor mode to enable operations using link numbers."
+ (interactive "P")
+ (add-hook 'w3m-display-functions 'w3m-link-numbering)
+ (if (setq w3m-link-numbering-mode
+ (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not w3m-link-numbering-mode)))
+ (progn
+ (w3m-link-numbering)
+ (run-hooks 'w3m-link-numbering-mode-hook))
+ (dolist (overlay (overlays-in (point-min) (point-max)))
+ (when (overlay-get overlay 'w3m-link-numbering-overlay)
+ (delete-overlay overlay)))))
+
+(defun w3m-link-numbering (&rest args)
+ "Make overlays that display link numbers."
+ (when w3m-link-numbering-mode
+ (save-excursion
+ (goto-char (point-min))
+ (let ((i 0)
+ overlay num)
+ (catch 'already-numbered
+ (while (w3m-goto-next-anchor)
+ (when (w3m-anchor)
+ (when (get-char-property (point) 'w3m-link-numbering-overlay)
+ (throw 'already-numbered nil))
+ (setq overlay (make-overlay (point) (1+ (point)))
+ num (format "[%d]" (incf i)))
+ (w3m-static-if (featurep 'xemacs)
+ (progn
+ (overlay-put overlay 'before-string num)
+ (set-glyph-face (extent-begin-glyph overlay)
+ 'w3m-link-numbering))
+ (w3m-add-face-property 0 (length num) 'w3m-link-numbering num)
+ (overlay-put overlay 'before-string num)
+ (overlay-put overlay 'evaporate t))
+ (overlay-put overlay 'w3m-link-numbering-overlay i))))))))
+
+(defun w3m-move-numbered-anchor (&optional arg)
+ "Move the point to the specified anchor.
+When no prefix argument is specified, call `w3m-view-this-url' instead
+of moving cursor."
+ (interactive "P")
+ (if (and arg
+ (> (setq arg (prefix-numeric-value arg)) 0))
+ (catch 'found
+ (dolist (overlay (overlays-in (point-min) (point-max)))
+ (when (eq arg (overlay-get overlay 'w3m-link-numbering-overlay))
+ (goto-char (overlay-start overlay))
+ (push (w3m-anchor-sequence) w3m-goto-anchor-hist)
+ (w3m-horizontal-on-screen)
+ (throw 'found (w3m-print-this-url))))
+ (error "Cannot found your specified link: %d" arg))
+ (w3m-view-this-url)))
+
+(defun w3m-go-to-linknum ()
+ "Turn on link numbers and ask for one to go to."
+ (interactive)
+ (let ((active w3m-link-numbering-mode))
+ (unless active
+ (w3m-link-numbering-mode 1))
+ (unwind-protect
+ (w3m-move-numbered-anchor (w3m-read-number "Anchor number: "))
+ (unless active
+ (w3m-link-numbering-mode 0)))))
+
+(provide 'w3m-lnum)
+
+;;; w3m-lnum.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-load.el b/share/emacs/site-lisp/w3m/w3m-load.el
new file mode 100644
index 00000000000..dbb37739858
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-load.el
@@ -0,0 +1,447 @@
+;;; w3m-load.el --- automatically extracted autoload
+;;
+;; This file should be generated by make in emacs-w3m source directory.
+;;
+;;; Code:
+
+(provide 'w3m-load)
+
+;;;### (autoloads (w3m-buffer w3m-region w3m-find-file w3m-browse-url
+;;;;;; w3m w3m-gohome w3m-goto-url-new-session w3m-goto-url w3m-download
+;;;;;; w3m-retrieve) "w3m" "w3m.el" (19330 25100))
+;;; Generated autoloads from w3m.el
+
+(autoload 'w3m-retrieve "w3m" "\
+Retrieve web contents pointed to by URL.
+It will put the retrieved contents into the current buffer.
+
+If HANDLER is nil, this function will retrieve web contents, return
+the content type of the retrieved data, and then come to an end. This
+behavior is what is called a synchronous operation. You have to
+specify HANDLER in order to make this function show its real ability,
+which is called an asynchronous operation.
+
+If HANDLER is a function, this function will come to an end in no time.
+In this case, contents will be retrieved by the asynchronous process
+after a while. And after finishing retrieving contents successfully,
+HANDLER will be called on the buffer where this function starts. The
+content type of the retrieved data will be passed to HANDLER as a
+string argument.
+
+NO-UNCOMPRESS specifies whether this function should not uncompress contents.
+NO-CACHE specifies whether this function should not use cached contents.
+POST-DATA and REFERER will be sent to the web server with a request.
+
+\(fn URL &optional NO-UNCOMPRESS NO-CACHE POST-DATA REFERER HANDLER)" nil nil)
+
+(autoload 'w3m-download "w3m" "\
+Download contents of URL to a file named FILENAME.
+NO-CHACHE (which the prefix argument gives when called interactively)
+specifies not using the cached data.
+
+\(fn URL &optional FILENAME NO-CACHE HANDLER POST-DATA)" t nil)
+
+(autoload 'w3m-goto-url "w3m" "\
+Visit World Wide Web pages. This is the primitive function of `w3m'.
+If the second argument RELOAD is non-nil, reload a content of URL.
+Except that if it is 'redisplay, re-display the page without reloading.
+The third argument CHARSET specifies a charset to be used for decoding
+a content.
+The fourth argument POST-DATA should be a string or a cons cell. If
+it is a string, it makes this function request a body as if the
+content-type is \"x-www-form-urlencoded\". If it is a cons cell, the
+car of a cell is used as the content-type and the cdr of a cell is
+used as the body.
+If the fifth argument REFERER is specified, it is used for a Referer:
+field for this request.
+The remaining HANDLER, ELEMENT[1], and NO-POPUP are for the
+internal operations of emacs-w3m.
+You can also use \"quicksearch\" url schemes such as \"gg:emacs\" which
+would search for the term \"emacs\" with the Google search engine. See
+the `w3m-search' function and the variable `w3m-uri-replace-alist'.
+
+\[1] A note for the developers: ELEMENT is a history element which has
+already been registered in the `w3m-history-flat' variable. It is
+corresponding to URL to be retrieved at this time, not for the url of
+the current page.
+
+\(fn URL &optional RELOAD CHARSET POST-DATA REFERER HANDLER ELEMENT NO-POPUP)" t nil)
+
+(autoload 'w3m-goto-url-new-session "w3m" "\
+Visit World Wide Web pages in a new session.
+If you invoke this command in the emacs-w3m buffer, the new session
+will be created by copying the current session. Otherwise, the new
+session will start afresh.
+
+\(fn URL &optional RELOAD CHARSET POST-DATA REFERER)" t nil)
+
+(autoload 'w3m-gohome "w3m" "\
+Go to the Home page.
+
+\(fn)" t nil)
+
+(autoload 'w3m "w3m" "\
+Visit World Wide Web pages using the external w3m command.
+
+When you invoke this command interactively for the first time, it will
+visit a page which is pointed to by a string like url around the
+cursor position or the home page specified by the `w3m-home-page'
+variable, but you will be prompted for a URL if `w3m-quick-start' is
+nil (default t) or `w3m-home-page' is nil.
+
+The variables `w3m-pop-up-windows' and `w3m-pop-up-frames' control
+whether this command should pop to a window or a frame up for the
+session.
+
+When emacs-w3m sessions have already been opened, this command will
+pop to the existing window or frame up, but if `w3m-quick-start' is
+nil, (default t), you will be prompted for a URL (which defaults to
+`popup' meaning to pop to an existing emacs-w3m buffer up).
+
+In addition, if the prefix argument is given or you enter the empty
+string for the prompt, it will visit the home page specified by the
+`w3m-home-page' variable or the \"about:\" page.
+
+You can also run this command in the batch mode as follows:
+
+ emacs -f w3m http://emacs-w3m.namazu.org/ &
+
+In that case, or if this command is called non-interactively, the
+variables `w3m-pop-up-windows' and `w3m-pop-up-frames' will be ignored
+\(treated as nil) and it will run emacs-w3m at the current (or the
+initial) window.
+
+If the optional NEW-SESSION is non-nil, this function makes a new
+emacs-w3m buffer. Besides that, it also makes a new emacs-w3m buffer
+if `w3m-make-new-session' is non-nil and a user specifies a url string.
+
+The optional INTERACTIVE-P is for the internal use; it is mainly used
+to check whether Emacs 22 or later calls this function as an
+interactive command in the batch mode.
+
+\(fn &optional URL NEW-SESSION INTERACTIVE-P)" t nil)
+
+(autoload 'w3m-browse-url "w3m" "\
+Ask emacs-w3m to browse URL.
+NEW-SESSION specifies whether to create a new emacs-w3m session. URL
+defaults to the string looking like a url around the cursor position.
+Pop to a window or a frame up according to `w3m-pop-up-windows' and
+`w3m-pop-up-frames'.
+
+\(fn URL &optional NEW-SESSION)" t nil)
+
+(autoload 'w3m-find-file "w3m" "\
+Function used to open FILE whose name is expressed in ordinary format.
+The file name will be converted into the file: scheme.
+
+\(fn FILE)" t nil)
+
+(autoload 'w3m-region "w3m" "\
+Render the region of the current buffer between START and END.
+URL specifies the address where the contents come from. It can be
+omitted or nil when the address is not identified. CHARSET is used
+for decoding the contents. If it is nil, this function attempts to
+parse the meta tag to extract the charset.
+
+\(fn START END &optional URL CHARSET)" t nil)
+
+(autoload 'w3m-buffer "w3m" "\
+Render the current buffer.
+See `w3m-region' for the optional arguments.
+
+\(fn &optional URL CHARSET)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-antenna w3m-about-antenna) "w3m-antenna" "w3m-antenna.el"
+;;;;;; (19188 5056))
+;;; Generated autoloads from w3m-antenna.el
+
+(autoload 'w3m-about-antenna "w3m-antenna" "\
+Not documented
+
+\(fn URL &optional NO-DECODE NO-CACHE POST-DATA REFERER HANDLER)" nil nil)
+
+(autoload 'w3m-antenna "w3m-antenna" "\
+Report changes of WEB sites, which is specified in `w3m-antenna-sites'.
+
+\(fn &optional NO-CACHE)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-setup-bookmark-menu w3m-about-bookmark w3m-bookmark-view-new-session
+;;;;;; w3m-bookmark-view w3m-bookmark-add-current-url-group w3m-bookmark-add-all-urls
+;;;;;; w3m-bookmark-add-current-url w3m-bookmark-add-this-url) "w3m-bookmark"
+;;;;;; "w3m-bookmark.el" (19276 22621))
+;;; Generated autoloads from w3m-bookmark.el
+
+(autoload 'w3m-bookmark-add-this-url "w3m-bookmark" "\
+Add link under cursor to bookmark.
+
+\(fn)" t nil)
+
+(autoload 'w3m-bookmark-add-current-url "w3m-bookmark" "\
+Add a url of the current page to the bookmark.
+With prefix, ask for a new url instead of the present one.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'w3m-bookmark-add-all-urls "w3m-bookmark" "\
+Add urls of all pages being visited to the bookmark.
+
+\(fn)" t nil)
+
+(autoload 'w3m-bookmark-add-current-url-group "w3m-bookmark" "\
+Add link of the group of current urls to the bookmark.
+
+\(fn)" t nil)
+
+(autoload 'w3m-bookmark-view "w3m-bookmark" "\
+Display the bookmark.
+
+\(fn &optional RELOAD)" t nil)
+
+(autoload 'w3m-bookmark-view-new-session "w3m-bookmark" "\
+Display the bookmark on a new session.
+
+\(fn &optional RELOAD)" t nil)
+
+(autoload 'w3m-about-bookmark "w3m-bookmark" "\
+Not documented
+
+\(fn &rest ARGS)" nil nil)
+
+(autoload 'w3m-setup-bookmark-menu "w3m-bookmark" "\
+Setup w3m bookmark items in menubar.
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-about-cookie w3m-cookie w3m-cookie-get w3m-cookie-set
+;;;;;; w3m-cookie-shutdown) "w3m-cookie" "w3m-cookie.el" (19277
+;;;;;; 43559))
+;;; Generated autoloads from w3m-cookie.el
+
+(autoload 'w3m-cookie-shutdown "w3m-cookie" "\
+Save cookies, and reset cookies' data.
+
+\(fn)" t nil)
+
+(autoload 'w3m-cookie-set "w3m-cookie" "\
+Register cookies which correspond to URL.
+BEG and END should be an HTTP response header region on current buffer.
+
+\(fn URL BEG END)" nil nil)
+
+(autoload 'w3m-cookie-get "w3m-cookie" "\
+Get a cookie field string which corresponds to the URL.
+
+\(fn URL)" nil nil)
+
+(autoload 'w3m-cookie "w3m-cookie" "\
+Display cookies and enable you to manage them.
+
+\(fn &optional NO-CACHE)" t nil)
+
+(autoload 'w3m-about-cookie "w3m-cookie" "\
+Make the html contents to display and to enable you to manage cookies.
+
+\(fn URL &optional NO-DECODE NO-CACHE POST-DATA &rest ARGS)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-dtree w3m-about-dtree) "w3m-dtree" "w3m-dtree.el"
+;;;;;; (18965 10114))
+;;; Generated autoloads from w3m-dtree.el
+
+(autoload 'w3m-about-dtree "w3m-dtree" "\
+Not documented
+
+\(fn URL &optional NODECODE ALLFILES &rest ARGS)" nil nil)
+
+(autoload 'w3m-dtree "w3m-dtree" "\
+Display directory tree on local file system.
+If called with 'prefix argument', display all directorys and files.
+
+\(fn ALLFILES PATH)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-fb-mode) "w3m-fb" "w3m-fb.el" (17681 2386))
+;;; Generated autoloads from w3m-fb.el
+
+(defvar w3m-fb-mode nil "\
+Non-nil if W3m-Fb mode is enabled.
+See the command `w3m-fb-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `w3m-fb-mode'.")
+
+(custom-autoload 'w3m-fb-mode "w3m-fb" nil)
+
+(autoload 'w3m-fb-mode "w3m-fb" "\
+Toggle W3M Frame Buffer mode.
+This allows frame-local lists of buffers (tabs).
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-filter) "w3m-filter" "w3m-filter.el" (18560
+;;;;;; 26042))
+;;; Generated autoloads from w3m-filter.el
+
+(autoload 'w3m-filter "w3m-filter" "\
+Apply filtering rule of URL against a content in this buffer.
+
+\(fn URL)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-fontify-forms) "w3m-form" "w3m-form.el" (19276
+;;;;;; 22621))
+;;; Generated autoloads from w3m-form.el
+
+(autoload 'w3m-fontify-forms "w3m-form" "\
+Process half-dumped data and fontify forms in this buffer.
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-link-numbering-mode) "w3m-lnum" "w3m-lnum.el"
+;;;;;; (18851 53425))
+;;; Generated autoloads from w3m-lnum.el
+
+(autoload 'w3m-link-numbering-mode "w3m-lnum" "\
+Minor mode to enable operations using link numbers.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-namazu w3m-about-namazu) "w3m-namazu" "w3m-namazu.el"
+;;;;;; (18965 10114))
+;;; Generated autoloads from w3m-namazu.el
+
+(autoload 'w3m-about-namazu "w3m-namazu" "\
+Not documented
+
+\(fn URL &optional NO-DECODE NO-CACHE &rest ARGS)" nil nil)
+
+(autoload 'w3m-namazu "w3m-namazu" "\
+Search indexed files with Namazu.
+
+\(fn INDEX QUERY &optional RELOAD)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-perldoc w3m-about-perldoc) "w3m-perldoc" "w3m-perldoc.el"
+;;;;;; (18199 13480))
+;;; Generated autoloads from w3m-perldoc.el
+
+(autoload 'w3m-about-perldoc "w3m-perldoc" "\
+Not documented
+
+\(fn URL &optional NO-DECODE NO-CACHE &rest ARGS)" nil nil)
+
+(autoload 'w3m-perldoc "w3m-perldoc" "\
+View Perl documents.
+
+\(fn DOCNAME)" t nil)
+
+;;;***
+
+;;;### (autoloads (w3m-search-uri-replace w3m-search-new-session
+;;;;;; w3m-search) "w3m-search" "w3m-search.el" (19102 18473))
+;;; Generated autoloads from w3m-search.el
+
+(autoload 'w3m-search "w3m-search" "\
+Search QUERY using SEARCH-ENGINE.
+When called interactively with a prefix argument, you can choose one of
+the search engines defined in `w3m-search-engine-alist'. Otherwise use
+`w3m-search-default-engine'.
+If Transient Mark mode, use the region as an initial string of query
+and deactivate the mark.
+
+\(fn SEARCH-ENGINE QUERY)" t nil)
+
+(autoload 'w3m-search-new-session "w3m-search" "\
+Like `w3m-search', but do the search in a new session.
+
+\(fn SEARCH-ENGINE QUERY)" t nil)
+
+(autoload 'w3m-search-uri-replace "w3m-search" "\
+Generate query string for ENGINE from URI matched by last search.
+
+\(fn URI ENGINE)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-session-last-crashed-session w3m-session-last-autosave-session
+;;;;;; w3m-setup-session-menu w3m-session-select w3m-session-save)
+;;;;;; "w3m-session" "w3m-session.el" (19277 43559))
+;;; Generated autoloads from w3m-session.el
+
+(autoload 'w3m-session-save "w3m-session" "\
+Save list of displayed session.
+
+\(fn)" t nil)
+
+(autoload 'w3m-session-select "w3m-session" "\
+Select session from session list.
+
+\(fn)" t nil)
+
+(autoload 'w3m-setup-session-menu "w3m-session" "\
+Setup w3m session items in menubar.
+
+\(fn)" nil nil)
+
+(autoload 'w3m-session-last-autosave-session "w3m-session" "\
+Not documented
+
+\(fn)" nil nil)
+
+(autoload 'w3m-session-last-crashed-session "w3m-session" "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-replace-symbol) "w3m-symbol" "w3m-symbol.el"
+;;;;;; (18791 12168))
+;;; Generated autoloads from w3m-symbol.el
+
+(autoload 'w3m-replace-symbol "w3m-symbol" "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (w3m-about-weather w3m-weather) "w3m-weather" "w3m-weather.el"
+;;;;;; (18199 13480))
+;;; Generated autoloads from w3m-weather.el
+
+(autoload 'w3m-weather "w3m-weather" "\
+Display weather report.
+
+\(fn AREA)" t nil)
+
+(autoload 'w3m-about-weather "w3m-weather" "\
+Not documented
+
+\(fn URL NO-DECODE NO-CACHE POST-DATA REFERER HANDLER)" nil nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; w3m-load.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-mail.el b/share/emacs/site-lisp/w3m/w3m-mail.el
new file mode 100644
index 00000000000..05e5a438803
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-mail.el
@@ -0,0 +1,396 @@
+;;; w3m-mail.el --- an interface to mail-user-agent for sending web pages
+
+;; Copyright (C) 2006, 2009 TSUCHIYA Masatoshi
+
+;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This module provides the `w3m-mail' command which enables you to
+;; send web pages as mails respecting those content types (typically
+;; text/html). Currently this program works if and only if you set
+;; the `mail-user-agent' variable to one of the following agents:
+;; `gnus-user-agent'
+;; `message-user-agent'
+;; `mew-user-agent'
+;; `vm-user-agent'
+;; `wl-user-agent'
+;; To send the page you are looking at, type `M-x w3m-mail' or click
+;; the menu button, fill message headers properly, and type `C-c C-c'.
+
+;;; Code:
+
+(require 'w3m)
+
+(defcustom w3m-mail-subject '("Emailing:" url)
+ "A list of strings and symbols used to generate the subject header.
+Valid symbols include `url' which is replaced with the url of the page
+and `title' which is replaced with the page title. You can also use
+just a string for this variable."
+ :group 'w3m
+ :type '(radio (editable-list :format "\n%v%i\n"
+ (radio-button-choice
+ (const :format "%v " url)
+ (const :format "%v " title)
+ string))
+ string
+ (const :format "no subject" nil)))
+
+(defvar w3m-mail-user-agent-compose-function-alist
+ (let ((alist '((gnus-user-agent . w3m-mail-compose-with-mml)
+ (message-user-agent . w3m-mail-compose-with-mml)
+ (mew-user-agent . w3m-mail-compose-with-mew)
+ (vm-user-agent . w3m-mail-compose-with-vm)
+ (wl-user-agent . w3m-mail-compose-with-semi)))
+ composer)
+ (delq nil (mapcar (lambda (agent)
+ (if (setq composer (cdr (assq agent alist)))
+ (cons agent composer)))
+ w3m-mail-user-agents)))
+ "Alist of mail user agents and functions to compose a mail.
+The function will be called with the arguments `source', `url',
+`charset', `content-type', `to', `subject', and `other-headers'; where
+`source' is a string containing the page source, `url' is the url of
+the page, `charset' is a charset that the page uses, `content-type' is
+the one such as \"text/html\", and the rest are the same as those of
+`compose-mail'.")
+
+(eval-when-compile
+ (autoload 'message-add-action "message")
+ (autoload 'mml-insert-empty-tag "mml")
+ (autoload 'vm-mime-attach-buffer "vm-mime")
+ (condition-case nil
+ (require 'mime-edit)
+ (error
+ (dolist (symbol '(encode-mime-charset-region
+ detect-mime-charset-region
+ std11-wrap-as-quoted-string
+ mime-find-file-type
+ mime-edit-insert-tag
+ mime-edit-define-encoding
+ mime-encode-region))
+ (defalias symbol 'ignore)))))
+
+(eval-and-compile
+ (autoload 'mm-find-mime-charset-region "mm-util")
+ (autoload 'w3m-mail-compose-with-mew "mew-w3m"
+ "Compose a mail using Mew." t))
+
+(defun w3m-mail-make-subject ()
+ "Return a string used for the Subject header."
+ (cond ((consp w3m-mail-subject)
+ (w3m-replace-in-string
+ (w3m-replace-in-string
+ (mapconcat (lambda (elem)
+ (cond ((eq elem 'url) w3m-current-url)
+ ((eq elem 'title) w3m-current-title)
+ ((stringp elem) elem)
+ (t (format "%s" elem))))
+ w3m-mail-subject
+ " ")
+ "[\t\n ]+" " ")
+ "\\(?:\\` \\| \\'\\)" ""))
+ ((stringp w3m-mail-subject) w3m-mail-subject)
+ (t "(no subject)")))
+
+(defun w3m-mail-compute-base-url ()
+ "Compute a base url of the page if it is not provided."
+ (let ((url (substring w3m-current-url 15)))
+ (unless (string-match "\\`about:" url)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ start end)
+ (unless (and (setq start (search-forward "<head>" nil t))
+ (setq end (search-forward "</head>" nil t))
+ (progn
+ (goto-char start)
+ (re-search-forward "<base[\t\n\r ]+" end t))
+ (w3m-parse-attributes (href) (> (length href) 0)))
+ (substring (w3m-expand-url "x" url) 0 -1)))))))
+
+(defun w3m-mail-embed-base-url (source base-url)
+ "Embed BASE-URL in SOURCE."
+ (with-temp-buffer
+ (w3m-static-unless (featurep 'xemacs)
+ (set-buffer-multibyte t))
+ (setq case-fold-search t)
+ (insert source)
+ (goto-char (point-min))
+ (while (search-forward "\r\n" nil t)
+ (replace-match "\n"))
+ (goto-char (point-min))
+ (let ((nohead t)
+ (points (list (point-min) (point-min)))
+ (margin 0))
+ (when (re-search-forward "\\(<html>\\)[\t\n ]*" nil t)
+ (setq points (list (match-end 1) (match-end 0))
+ margin (current-column)))
+ (when (re-search-forward "\\(<head>\\)[\t\n ]*" nil t)
+ (setq nohead nil
+ points (list (match-end 1) (match-end 0))
+ margin (current-column)))
+ (setq margin (make-string margin ? ))
+ (goto-char (car points))
+ (apply 'delete-region points)
+ (if nohead
+ (insert "\n" margin "<head><base href=\"" base-url "\"></head>\n"
+ margin)
+ (insert "\n" margin "<base href=\"" base-url "\">\n" margin)))
+ (buffer-string)))
+
+(defun w3m-mail-goto-body-and-clear-body ()
+ "Go to the beginning of the body and clear the body."
+ (goto-char (point-min))
+ (if (re-search-forward (concat "^\\(?:"
+ (regexp-quote mail-header-separator)
+ "\\)?\n")
+ nil 'move)
+ (delete-region (point) (point-max))
+ (insert (if (bolp) "\n" "\n\n"))))
+
+(defun w3m-mail-position-point (bob)
+ "Go to empty or bogus header, otherwise the beginning of the body BOB."
+ (goto-char (point-min))
+ (when (re-search-forward "^\\(Subject: \\)(no subject)\\|\
+^\\([0-9A-Za-z-]+: ?\\)[\t ]*\n\\(?:[\t ]+\n\\)*[^\t ]"
+ bob 'move)
+ (goto-char (or (match-end 1) (match-end 2)))))
+
+(defun w3m-mail-compose-with-mml (source url charset content-type
+ to subject other-headers)
+ "Compose a mail using MML."
+ (let ((buffer (generate-new-buffer " *w3m-mail*")))
+ (with-current-buffer buffer
+ (w3m-static-unless (featurep 'xemacs)
+ (set-buffer-multibyte (not (string-match "\\`image/" content-type))))
+ (insert source))
+ (if (eq mail-user-agent 'gnus-user-agent)
+ (progn
+ (require 'gnus)
+ (let (gnus-newsgroup-name)
+ (compose-mail to subject other-headers)))
+ (compose-mail to subject other-headers))
+ (message-add-action `(kill-buffer ,buffer) 'exit 'kill 'postpone 'send)
+ (w3m-mail-goto-body-and-clear-body)
+ (w3m-mail-position-point
+ (prog1
+ (point)
+ (mml-insert-empty-tag
+ 'part
+ 'type content-type
+ 'buffer (buffer-name buffer)
+ ;; Use the base64 encoding if the body contains non-ASCII text
+ ;; or very long lines which might be broken by MTAs.
+ 'encoding "base64"
+ 'charset (when charset (symbol-name charset))
+ 'disposition "inline"
+ 'description url)))))
+
+;; This function is implemented in mew-w3m.el.
+;; (defun w3m-mail-compose-with-mew (source url charset content-type
+;; to subject other-headers)
+;; "Compose a mail using Mew.")
+
+(defun w3m-mail-compose-with-vm (source url charset content-type
+ to subject other-headers)
+ "Compose a mail using VM."
+ (let* ((coding (and charset (w3m-charset-to-coding-system charset)))
+ (multibytep (and (not coding)
+ (or charset
+ (and (not (string-match "\\`image/"
+ content-type))
+ (w3m-static-if (featurep 'xemacs)
+ (string-match "[^\000-\177]" source)
+ (multibyte-string-p source))))))
+ (buffer (generate-new-buffer " *w3m-mail*")))
+ (with-current-buffer buffer
+ (w3m-static-unless (featurep 'xemacs)
+ (set-buffer-multibyte (and (not coding) multibytep)))
+ (cond (coding
+ (insert (encode-coding-string source coding)))
+ (multibytep
+ (insert source)
+ (when (and (setq charset (car (mm-find-mime-charset-region
+ (point-min) (point-max))))
+ (setq coding (w3m-charset-to-coding-system charset)))
+ (w3m-static-if (featurep 'xemacs)
+ (encode-coding-region (point-min) (point-max) coding)
+ (insert (prog1
+ (encode-coding-string (buffer-string) coding)
+ (erase-buffer)
+ (set-buffer-multibyte nil))))))
+ (t
+ (insert source))))
+ (require 'vm-startup)
+ (compose-mail to subject other-headers)
+ (add-to-list 'mail-send-actions `(kill-buffer ,buffer))
+ (w3m-add-local-hook 'kill-buffer-hook `(lambda nil (kill-buffer ,buffer)))
+ (w3m-mail-goto-body-and-clear-body)
+ (w3m-mail-position-point
+ (prog1
+ (point)
+ (vm-mime-attach-buffer buffer content-type
+ (when charset (symbol-name charset))
+ url)))))
+
+(defun w3m-mail-compose-with-semi (source url charset content-type
+ to subject other-headers)
+ "Compose a mail using SEMI."
+ (require 'mime-edit)
+ (let* ((content-type (and content-type
+ (split-string (downcase content-type) "/")))
+ (basename (file-name-nondirectory (w3m-url-strip-query url)))
+ (filename (cond
+ ((and (string-match "^[\t ]*$" basename)
+ (equal content-type '("text" "html")))
+ "index.html")
+ ((string-match "^[\t ]*$" basename)
+ "dummy")
+ (t
+ basename)))
+ (type (or (nth 0 content-type) "text"))
+ (subtype (or (nth 1 content-type) "html"))
+ parameters
+ (encoding "base64")
+ (disposition-type "inline")
+ disposition-params
+ (guess (mime-find-file-type filename))
+ (textp (string= type "text")))
+ (when (and guess
+ (string= (nth 0 guess) type)
+ (string= (nth 1 guess) subtype))
+ (setq parameters (nth 2 guess)
+ encoding (or (nth 3 guess) encoding)
+ disposition-type (or (nth 4 guess) disposition-type)
+ disposition-params (nth 5 guess)))
+ (compose-mail to subject other-headers)
+ (w3m-mail-goto-body-and-clear-body)
+ (let ((parameters-to-string
+ (lambda (parameters)
+ (when parameters
+ (mapconcat
+ (lambda (parameter)
+ (concat "; " (car parameter)
+ "=" (if (eq (cdr parameter) 'file)
+ (std11-wrap-as-quoted-string filename)
+ (cdr parameter))))
+ parameters
+ ""))))
+ (body (point))
+ (edit-buffer (current-buffer))
+ work-buffer)
+ (with-temp-buffer
+ (if textp
+ (progn
+ (insert source)
+ (unless charset
+ (setq charset (detect-mime-charset-region (point-min)
+ (point-max))))
+ (when charset
+ (setq parameters (cons (cons "charset" (symbol-name charset))
+ parameters))
+ (encode-mime-charset-region (point-min) (point-max) charset)))
+ (set-buffer-multibyte nil)
+ (insert source))
+ (mime-encode-region (point-min) (point-max) encoding)
+ (setq work-buffer (current-buffer))
+ (set-buffer edit-buffer)
+ (mime-edit-insert-tag
+ type subtype
+ (concat (funcall parameters-to-string parameters)
+ "\nContent-Disposition: " disposition-type
+ (funcall parameters-to-string disposition-params)
+ "\nContent-Description: " url))
+ (mime-edit-define-encoding encoding)
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (insert-buffer-substring work-buffer)
+ (unless (bolp)
+ (insert "\n"))
+ (when (or (string= disposition-type "attachment")
+ (not (member encoding '("7bit" "8bit" "binary"))))
+ (add-text-properties
+ (point-min) (point-max) '(invisible t mime-edit-invisible t)))))
+ (w3m-mail-position-point body))))
+
+(defun w3m-mail (&optional headers)
+ "Send a web page as a mail.
+By default the subject is generated according to `w3m-mail-subject'.
+The optional HEADERS is a list in which each element is a cons of the
+symbol of a header name and a string. Here is an example to use this
+function:
+
+\(w3m-mail '((To . \"foo@bar\") (Subject . \"The emacs-w3m home page\")))"
+ (interactive (unless (eq major-mode 'w3m-mode)
+ (error "`%s' must be invoked from an emacs-w3m buffer"
+ this-command)))
+ (let ((composer (cdr (assq mail-user-agent
+ w3m-mail-user-agent-compose-function-alist)))
+ ;; Don't move the history position.
+ (w3m-history-reuse-history-elements t)
+ source base url charset content-type to subject)
+ (cond
+ ((not composer)
+ (error "`%s' is not supported (yet) by `w3m-mail'" mail-user-agent))
+ ((not w3m-current-url)
+ (error "The source for this page is not available"))
+ ((string-match "\\`about://source/" w3m-current-url)
+ (setq source (buffer-string)
+ base (w3m-mail-compute-base-url))
+ (w3m-view-source)
+ (setq url w3m-current-url
+ charset (w3m-coding-system-to-charset w3m-current-coding-system)
+ content-type (or (w3m-arrived-content-type w3m-current-url)
+ (w3m-content-type w3m-current-url)))
+ (w3m-view-source))
+ ((string-match "\\`about://header/" w3m-current-url)
+ (w3m-view-source)
+ (setq source (buffer-string)
+ base (w3m-mail-compute-base-url))
+ (w3m-view-source)
+ (setq url w3m-current-url
+ charset (w3m-coding-system-to-charset w3m-current-coding-system)
+ content-type (or (w3m-arrived-content-type w3m-current-url)
+ (w3m-content-type w3m-current-url)))
+ (w3m-view-header))
+ (t
+ (setq url w3m-current-url
+ charset (w3m-coding-system-to-charset w3m-current-coding-system)
+ content-type (or (w3m-arrived-content-type w3m-current-url)
+ (w3m-content-type w3m-current-url)))
+ (w3m-view-source)
+ (setq source (buffer-string)
+ base (w3m-mail-compute-base-url))
+ (w3m-view-source)))
+ (when (and base (string= "text/html" content-type))
+ (setq source (w3m-mail-embed-base-url source base)))
+ (setq to (or (assq 'To headers) (assq 'to headers))
+ subject (or (assq 'Subject headers) (assq 'subject headers)))
+ (when (or to subject)
+ (setq headers (delq to (delq subject (copy-sequence headers)))
+ to (cdr to)
+ subject (cdr subject)))
+ (unless subject
+ (setq subject (let ((w3m-current-url url)) (w3m-mail-make-subject))))
+ (funcall composer source url charset content-type to subject headers)))
+
+;;; w3m-mail.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-namazu.el b/share/emacs/site-lisp/w3m/w3m-namazu.el
new file mode 100644
index 00000000000..913212a7942
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-namazu.el
@@ -0,0 +1,278 @@
+;;; w3m-namazu.el --- The add-on program to search files with Namazu.
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia, namazu
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-namazu.el is the add-on program of emacs-w3m to search files
+;; with Namazu. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; History:
+
+;; Original program was posted by
+;; Takayuki Arakawa <takayu@pop02.odn.ne.jp> in [emacs-w3m:01340] at
+;; Jul 31, 2001.
+
+;; Many codes are imported from namazu.el written by
+;; Yukihiro Matsumoto <matz@netlab.co.jp> et al.
+
+;; All stuffs are rewritten by
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org> at Aug 2, 2001.
+
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m)
+
+(eval-and-compile
+ (autoload 'w3m-search-read-query "w3m-search"))
+
+(defgroup w3m-namazu nil
+ "w3m-namazu front-end for Emacs."
+ :group 'w3m
+ :prefix "w3m-namazu-")
+
+(defcustom w3m-namazu-command "namazu"
+ "*Name of the executable file of Namazu."
+ :group 'w3m-namazu
+ :type '(string :size 0))
+
+(defcustom w3m-namazu-arguments
+ '("-h" ; print in HTML format.
+ "-H" ; print further result links.
+ "-n" w3m-namazu-page-max ; set number of documents shown to NUM.
+ "-w" whence) ; set first number of documents shown to NUM.
+ "*Arguments of Namazu."
+ :group 'w3m-namazu
+ :type '(repeat
+ (restricted-sexp :format "Argument: %v\n"
+ :match-alternatives
+ (stringp 'w3m-namazu-page-max 'whence)
+ :size 0)))
+
+(defcustom w3m-namazu-page-max
+ (if (boundp 'namazu-search-num)
+ (symbol-value 'namazu-search-num)
+ 30)
+ "*A maximum number of documents which are retrieved by one-time search."
+ :group 'w3m-namazu
+ :type '(integer :size 0))
+
+(defconst w3m-namazu-default-index-customize-spec
+ '`(choice
+ (const :tag "No default index" nil)
+ ,@(mapcar (lambda (x) (list 'const (car x)))
+ w3m-namazu-index-alist)
+ (directory :format "Index directory: %v\n" :size 0)))
+
+(defcustom w3m-namazu-index-alist
+ (when (boundp 'namazu-dir-alist)
+ (mapcar (lambda (pair)
+ (cons (car pair)
+ (split-string (cdr pair))))
+ (symbol-value 'namazu-dir-alist)))
+ "*Alist of alias and index directories."
+ :group 'w3m-namazu
+ :type '(repeat
+ (group
+ :indent 0 :inline t
+ (cons :format "%v"
+ (string :format "Alias: %v\n" :size 0)
+ (repeat
+ :format "%v%i\n" :indent 8
+ (directory :format "Index directory: %v\n" :size 0)))))
+ :set (lambda (symbol value)
+ (custom-set-default symbol value)
+ (put 'w3m-namazu-default-index 'custom-type
+ (eval w3m-namazu-default-index-customize-spec))))
+
+(defcustom w3m-namazu-default-index
+ (unless (and (boundp 'namazu-always-query-index-directory)
+ (symbol-value 'namazu-always-query-index-directory))
+ (when (boundp 'namazu-default-dir)
+ (symbol-value 'namazu-default-dir)))
+ "*Alias or directory of the default index.
+If this variable equals nil, it is required to input an index path
+whenever `w3m-namazu' is called interactively without prefix
+argument."
+ :group 'w3m-namazu
+ :type (eval w3m-namazu-default-index-customize-spec))
+
+(defcustom w3m-namazu-output-coding-system
+ (if (boundp 'namazu-cs-write)
+ (symbol-value 'namazu-cs-write)
+ (if (memq system-type '(OS/2 emx windows-nt))
+ 'shift_jis-dos
+ 'euc-japan-unix))
+ "*Coding system for namazu process."
+ :group 'w3m-namazu
+ :type '(coding-system :size 0))
+
+(defcustom w3m-namazu-input-coding-system
+ (if (boundp 'namazu-cs-read)
+ (symbol-value 'namazu-cs-read)
+ 'undecided)
+ "*Coding system for namazu process."
+ :group 'w3m-namazu
+ :type '(coding-system :size 0))
+
+
+(defun w3m-namazu-call-process (index query whence)
+ (setq index (if (assoc index w3m-namazu-index-alist)
+ (mapcar 'expand-file-name
+ (cdr (assoc index w3m-namazu-index-alist)))
+ (list (expand-file-name index))))
+ (let ((file-name-coding-system w3m-file-name-coding-system)
+ (coding-system-for-read w3m-namazu-input-coding-system)
+ (coding-system-for-write w3m-namazu-output-coding-system)
+ (default-process-coding-system
+ (cons w3m-namazu-input-coding-system
+ w3m-namazu-output-coding-system)))
+ (apply 'call-process w3m-namazu-command nil t nil
+ (let ((w3m-namazu-page-max
+ (number-to-string w3m-namazu-page-max)))
+ (nconc (mapcar 'eval w3m-namazu-arguments)
+ (list query)
+ index)))))
+
+;;;###autoload
+(defun w3m-about-namazu (url &optional no-decode no-cache &rest args)
+ (let (index query (whence "0"))
+ (when (string-match "\\`about://namazu/\\?" url)
+ (dolist (s (split-string (substring url (match-end 0)) "&"))
+ (when (string-match "\\`\\(?:index\\|\\(query\\)\\|\\(whence\\)\\)=" s)
+ (set (cond
+ ((match-beginning 1) 'query)
+ ((match-beginning 2) 'whence)
+ (t 'index))
+ (substring s (match-end 0)))))
+ (when (zerop (w3m-namazu-call-process (w3m-url-decode-string index)
+ (w3m-url-decode-string query)
+ whence))
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (let ((max (if (re-search-forward
+ "<!-- HIT -->\\([0-9]+\\)<!-- HIT -->" nil t)
+ (string-to-number (match-string 1))
+ 0))
+ (cur (string-to-number whence)))
+ (goto-char (point-min))
+ (when (search-forward "<head>" nil t)
+ (when (> cur 0)
+ (insert
+ (format "
+<link rel=\"prev\" href=\"about://namazu/?index=%s&query=%s&whence=%d\">"
+ index
+ query
+ (max (- cur w3m-namazu-page-max) 0))))
+ (when (> max (+ cur w3m-namazu-page-max))
+ (insert
+ (format "
+<link rel=\"next\" href=\"about://namazu/?index=%s&query=%s&whence=%d\">"
+ index
+ query
+ (+ cur w3m-namazu-page-max))))))
+ (goto-char (point-min))
+ (while (search-forward "<a href=\"/" nil t)
+ (forward-char -1)
+ (insert "file://"))
+ (goto-char (point-min))
+ (while (re-search-forward "<a href=\"\\(\\?\\)&\\(?:amp;\\)?whence="
+ nil t)
+ (goto-char (match-beginning 1))
+ (delete-char 1)
+ (insert (format "about://namazu/?index=%s&query=%s" index query))))
+ "text/html"))))
+
+(defun w3m-namazu-complete-index (index predicate flag)
+ "Function to complete index name"
+ (if (eq flag 'lambda)
+ (and (or (and (assoc index w3m-namazu-index-alist) t)
+ (file-directory-p index))
+ (or (not predicate)
+ (funcall predicate index)))
+ (let ((alist
+ (mapcar
+ 'list
+ (nconc
+ (all-completions index w3m-namazu-index-alist)
+ (let ((partial (file-name-nondirectory index))
+ (dir (file-name-as-directory
+ (or (file-name-directory index)
+ default-directory))))
+ (delq nil
+ (mapcar
+ (lambda (file)
+ (when (file-directory-p (expand-file-name file dir))
+ (concat dir file)))
+ (file-name-all-completions partial dir))))))))
+ (cond
+ ((not flag) (try-completion index alist predicate))
+ ((eq flag t) (all-completions index alist predicate))))))
+
+(defvar w3m-namazu-index-history nil)
+(defvar w3m-namazu-query-history nil)
+
+;;;###autoload
+(defun w3m-namazu (index query &optional reload)
+ "Search indexed files with Namazu."
+ (interactive
+ (list
+ (if (if w3m-namazu-default-index
+ current-prefix-arg
+ (not (and current-prefix-arg
+ w3m-namazu-index-history)))
+ (let* ((default (or (car w3m-namazu-index-history)
+ w3m-namazu-default-index))
+ (s (completing-read
+ (if default
+ (format "Namazu index (default %s): " default)
+ "Namazu index: ")
+ 'w3m-namazu-complete-index nil t nil
+ 'w3m-namazu-index-history)))
+ (if (string= s "") default s))
+ (or w3m-namazu-default-index
+ (car w3m-namazu-index-history)))
+ (w3m-search-read-query "Namazu query: " "Namazu query (default %s): "
+ 'w3m-namazu-query-history)
+ current-prefix-arg))
+ (unless (stringp index)
+ (error "%s" "Index is required"))
+ (unless (stringp query)
+ (error "%s" "Query is required"))
+ (w3m-goto-url (format "about://namazu/?index=%s&query=%s&whence=0"
+ (w3m-url-encode-string index)
+ (w3m-url-encode-string query))
+ reload))
+
+(provide 'w3m-namazu)
+
+;;; w3m-namazu.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-perldoc.el b/share/emacs/site-lisp/w3m/w3m-perldoc.el
new file mode 100644
index 00000000000..b97d0160cc2
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-perldoc.el
@@ -0,0 +1,124 @@
+;;; w3m-perldoc.el --- The add-on program to view Perl documents.
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, perldoc
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-perldoc.el is the add-on program of emacs-w3m to view Perl
+;; documents. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;;; Code:
+(require 'w3m)
+
+(defgroup w3m-perldoc nil
+ "Perldoc front-end for emacs-w3m."
+ :group 'w3m
+ :prefix "w3m-perldoc-")
+
+(defcustom w3m-perldoc-command "perldoc"
+ "*Name of the executable file of perldoc."
+ :group 'w3m-perldoc
+ :type '(string :size 0))
+
+(defcustom w3m-perldoc-pod2html-command "pod2html"
+ "*Name of the executable file of pod2html."
+ :group 'w3m-perldoc
+ :type '(string :size 0))
+
+(defcustom w3m-perldoc-pod2html-arguments
+ '("--noindex")
+ "*Arguments of pod2html."
+ :group 'w3m-perldoc
+ :type '(repeat (string :format "Argument: %v\n" :size 0))
+ :get (lambda (symbol)
+ (delq nil (delete "" (mapcar (lambda (x) (if (stringp x) x))
+ (default-value symbol)))))
+ :set (lambda (symbol value)
+ (custom-set-default
+ symbol
+ (delq nil (delete "" (mapcar (lambda (x) (if (stringp x) x))
+ value))))))
+
+(defcustom w3m-perldoc-input-coding-system
+ (if (string= "Japanese" w3m-language)
+ 'euc-japan
+ (if (w3m-find-coding-system 'utf-8)
+ 'utf-8
+ 'iso-latin-1))
+ "*Coding system used when writing to `w3m-perldoc-command'."
+ :group 'w3m-perldoc
+ :type '(coding-system :size 0))
+
+(defcustom w3m-perldoc-output-coding-system
+ 'undecided
+ "*Coding system used when reading from `w3m-perldoc-command'."
+ :group 'w3m-perldoc
+ :type '(coding-system :size 0))
+
+;;;###autoload
+(defun w3m-about-perldoc (url &optional no-decode no-cache &rest args)
+ (when (string-match "\\`about://perldoc/" url)
+ (let ((docname (if (= (length url) (match-end 0))
+ "perl"
+ (w3m-url-decode-string (substring url (match-end 0)))))
+ (default-directory w3m-profile-directory)
+ (process-environment (copy-sequence process-environment)))
+ ;; To specify the place in which pod2html generates its cache files.
+ (setenv "HOME" (expand-file-name w3m-profile-directory))
+ (and (let ((coding-system-for-read w3m-perldoc-output-coding-system))
+ (zerop (call-process w3m-perldoc-command
+ nil t nil "-u" docname)))
+ (let ((coding-system-for-write w3m-perldoc-input-coding-system)
+ (coding-system-for-read w3m-perldoc-input-coding-system))
+ (zerop (apply (function call-process-region)
+ (point-min) (point-max)
+ w3m-perldoc-pod2html-command
+ t '(t nil) nil
+ (append w3m-perldoc-pod2html-arguments
+ '("--htmlroot=about://perldoc")))))
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<a href=\"about://perldoc/\\([^\"]*\\)\\(\\.html\\)\">" nil t)
+ (delete-region (match-beginning 2) (match-end 2))
+ (save-restriction
+ (narrow-to-region (match-beginning 1) (match-end 1))
+ (while (search-backward "/" nil t)
+ (delete-char 1)
+ (insert "::"))
+ (goto-char (point-max))))
+ "text/html")))))
+
+;;;###autoload
+(defun w3m-perldoc (docname)
+ "View Perl documents."
+ (interactive "sDocument: ")
+ (w3m-goto-url (concat "about://perldoc/" (w3m-url-encode-string docname))))
+
+(provide 'w3m-perldoc)
+
+;;; w3m-perldoc.el ends here.
diff --git a/share/emacs/site-lisp/w3m/w3m-proc.el b/share/emacs/site-lisp/w3m/w3m-proc.el
new file mode 100644
index 00000000000..fe76a52ed50
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-proc.el
@@ -0,0 +1,801 @@
+;;; w3m-proc.el --- Functions and macros to control sub-processes
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
+;; Hideyuki SHIRAI <shirai@meadowy.org>,
+;; Keisuke Nishida <kxn30@po.cwru.edu>,
+;; Yuuichi Teranishi <teranisi@gohome.org>,
+;; Akihiro Arisawa <ari@mbf.sphere.ne.jp>,
+;; Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This module is a part of emacs-w3m which provides functions and
+;; macros to control sub-processes. Visit
+;; <URL:http://emacs-w3m.namazu.org/> for more details of emacs-w3m.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+
+(eval-when-compile
+ ;; Variable(s) which are used in the following inline functions.
+ ;; They should be defined in the other module at run-time.
+ (defvar w3m-current-url)
+ (defvar w3m-current-buffer)
+ (defvar w3m-current-process)
+ (defvar w3m-profile-directory)
+ (defvar w3m-terminal-coding-system)
+ (defvar w3m-command)
+ (defvar w3m-command-arguments)
+ (defvar w3m-command-environment)
+ (defvar w3m-async-exec)
+ (defvar w3m-process-connection-type)
+ (defvar w3m-process-modeline-format)
+ (defvar w3m-work-buffer-list)
+ (autoload 'w3m-idle-images-show-unqueue "w3m"))
+
+;; Silence the Emacs' byte-compiler that says ``might not be defined''.
+(eval-when-compile
+ (defun w3m-decode-coding-string-with-priority (str coding)
+ ()))
+
+(defvar w3m-process-inhibit-quit t
+ "`w3m-process-sentinel' binds `inhibit-quit' according to this variable.")
+(defvar w3m-process-timeout 300
+ "Number of seconds idle time waiting for processes to terminate.")
+(defvar w3m-process-kill-surely (featurep 'meadow)
+ "If non-nil, kill the process surely.")
+
+(defconst w3m-process-max 5 "The maximum limit of the working processes.")
+(defvar w3m-process-queue nil "Queue of processes.")
+
+(defvar w3m-process-exit-status nil "The last exit status of a process.")
+(defvar w3m-process-authinfo-alist nil)
+(defvar w3m-process-accept-alist nil)
+
+(defvar w3m-process-user nil)
+(defvar w3m-process-passwd nil)
+(defvar w3m-process-realm nil)
+(defvar w3m-process-object nil)
+(make-variable-buffer-local 'w3m-process-user)
+(make-variable-buffer-local 'w3m-process-passwd)
+(make-variable-buffer-local 'w3m-process-realm)
+(make-variable-buffer-local 'w3m-process-object)
+
+(defvar w3m-process-modeline-string nil
+ "Modeline string to show status of retrieving process.")
+(make-variable-buffer-local 'w3m-process-modeline-string)
+
+(defvar w3m-process-proxy-user nil "User name of the proxy server.")
+(defvar w3m-process-proxy-passwd nil "Password of the proxy server.")
+(defvar w3m-process-ssl-passphrase nil
+ "Passphrase for the client certificate.")
+
+(defmacro w3m-process-with-coding-system (&rest body)
+ "Set coding systems for `w3m-command', and evaluate BODY."
+ `(let ((coding-system-for-read 'binary)
+ (coding-system-for-write w3m-terminal-coding-system)
+ (default-process-coding-system
+ (cons 'binary w3m-terminal-coding-system))
+ (process-connection-type w3m-process-connection-type))
+ ,@body))
+(put 'w3m-process-with-coding-system 'lisp-indent-function 0)
+(put 'w3m-process-with-coding-system 'edebug-form-spec '(body))
+
+(defmacro w3m-process-with-environment (alist &rest body)
+ "Set the environment variables according to ALIST, and evaluate BODY."
+ `(let ((process-environment (copy-sequence process-environment))
+ (temporary-file-directory
+ (if (file-directory-p w3m-profile-directory)
+ (file-name-as-directory w3m-profile-directory)
+ ,(if (featurep 'xemacs)
+ ;; Though `temporary-file-directory' exists even in XEmacs,
+ ;; that's only an imitation provided by APEL.
+ '(temp-directory)
+ 'temporary-file-directory)))
+ (default-directory
+ (cond ((file-directory-p w3m-profile-directory)
+ (file-name-as-directory w3m-profile-directory))
+ ((file-directory-p (expand-file-name "~/"))
+ (expand-file-name "~/"))
+ (t temporary-file-directory))))
+ ;; XEmacs obtains tmp-dir from the `temp-directory' function of which
+ ;; return value can only be modified by the following env vars.
+ ,@(if (featurep 'xemacs)
+ '((setenv "TEMP" temporary-file-directory) ;; Windoze
+ (setenv "TMPDIR" temporary-file-directory))) ;; Un|x
+ (dolist (pair ,alist)
+ (setenv (car pair) (cdr pair)))
+ ,@body))
+(put 'w3m-process-with-environment 'lisp-indent-function 1)
+(put 'w3m-process-with-environment 'edebug-form-spec '(form body))
+
+(defun w3m-process-p (object)
+ "Return t if OBJECT is a `w3m-process' object."
+ (and (consp object)
+ (vectorp (cdr object))
+ (eq 'w3m-process-object (aref (cdr object) 0))))
+
+(put 'w3m-process-new 'edebug-form-spec '(form form form &optional form form))
+(defmacro w3m-process-new (command arguments buffer &optional process handlers)
+ "Return a new `w3m-process' object."
+ `(cons (cons ,command ,arguments)
+ (vector 'w3m-process-object
+ ,buffer
+ ,process
+ ,handlers)))
+
+(defmacro w3m-process-command (object)
+ `(car (car ,object)))
+(defmacro w3m-process-arguments (object)
+ `(cdr (car ,object)))
+(defmacro w3m-process-buffer (object)
+ `(aref (cdr ,object) 1))
+(defmacro w3m-process-process (object)
+ `(aref (cdr ,object) 2))
+(defmacro w3m-process-handlers (object)
+ `(aref (cdr ,object) 3))
+
+(put 'w3m-process-handler-new 'edebug-form-spec '(form form form))
+(defmacro w3m-process-handler-new (buffer parent-buffer functions)
+ `(vector ,buffer ,parent-buffer ,functions nil))
+(defmacro w3m-process-handler-buffer (handler)
+ `(aref ,handler 0))
+(defmacro w3m-process-handler-parent-buffer (handler)
+ `(aref ,handler 1))
+(defmacro w3m-process-handler-functions (handler)
+ `(aref ,handler 2))
+(defmacro w3m-process-handler-result (handler)
+ `(aref ,handler 3))
+
+(defun w3m-process-push (handler command arguments)
+ "Generate a new `w3m-process' object which is provided by HANDLER,
+ARGUMENTS and this buffer, regist it to `w3m-process-queue', and
+return it."
+ (let ((x (assoc (cons command arguments) w3m-process-queue)))
+ (unless x
+ (setq x (w3m-process-new command arguments (current-buffer)))
+ (push x w3m-process-queue))
+ (push (w3m-process-handler-new (current-buffer) w3m-current-buffer handler)
+ (w3m-process-handlers x))
+ (with-current-buffer (w3m-process-buffer x)
+ (setq w3m-process-object x))))
+
+(defun w3m-process-kill-process (process)
+ "Kill process PROCESS safely."
+ (when (processp process)
+ (set-process-filter process 'ignore)
+ (set-process-sentinel process 'ignore)
+ (when (memq (process-status process) '(run stop))
+ (kill-process process)
+ (when w3m-process-kill-surely
+ (while (memq (process-status process) '(run stop))
+ (sit-for 0.1))))))
+
+(defun w3m-process-start-process (object &optional no-sentinel)
+ "Start a process specified by the OBJECT, return always nil.
+When NO-SENTINEL is not equal to nil, all status changes of the
+generated asynchronous process is ignored. Otherwise,
+`w3m-process-sentinel' is given to the process as the sentinel."
+ (if (w3m-process-process object)
+ (when no-sentinel
+ (set-process-sentinel (w3m-process-process object) 'ignore))
+ (with-current-buffer (w3m-process-buffer object)
+ (w3m-process-with-coding-system
+ (w3m-process-with-environment w3m-command-environment
+ (let* ((command (w3m-process-command object))
+ (proc (apply 'start-process command
+ (current-buffer) command
+ (w3m-process-arguments object)))
+ (authinfo (when w3m-current-url
+ (w3m-url-authinfo w3m-current-url)))
+ (set-process-query-on-exit-flag
+ (if (fboundp 'set-process-query-on-exit-flag)
+ 'set-process-query-on-exit-flag
+ 'process-kill-without-query)))
+ (setq w3m-process-user (car authinfo)
+ w3m-process-passwd (cdr authinfo)
+ w3m-process-realm nil)
+ (setf (w3m-process-process object) proc)
+ (set-process-filter proc 'w3m-process-filter)
+ (set-process-sentinel proc (if no-sentinel
+ 'ignore
+ 'w3m-process-sentinel))
+ (funcall set-process-query-on-exit-flag proc nil))))))
+ nil) ;; The return value of `w3m-process-start-process'.
+
+(defun w3m-process-kill-stray-processes ()
+ "Kill stray processes."
+ (dolist (obj w3m-process-queue)
+ (unless (buffer-name (w3m-process-buffer obj))
+ (setq w3m-process-queue (delq obj w3m-process-queue))
+ (when (w3m-process-process obj)
+ (w3m-process-kill-process (w3m-process-process obj))))))
+
+(defun w3m-process-start-queued-processes ()
+ "Start a process which is registerd in `w3m-process-queue' if the
+number of current working processes is less than `w3m-process-max'."
+ (w3m-process-kill-stray-processes)
+ (let ((num 0))
+ (catch 'last
+ (dolist (obj (reverse w3m-process-queue))
+ (when (buffer-name (w3m-process-buffer obj))
+ (if (> (incf num) w3m-process-max)
+ (throw 'last nil)
+ (w3m-process-start-process obj)))))))
+
+(defun w3m-process-stop (buffer)
+ "Remove handlers related to the buffer BUFFER, and stop processes
+which have no handler."
+ (interactive (list (current-buffer)))
+ (w3m-cancel-refresh-timer buffer)
+ (setq w3m-process-queue
+ (delq nil
+ (mapcar
+ (lambda (obj)
+ (let ((handlers
+ ;; List up handlers related to other buffer
+ ;; than the buffer BUFFER.
+ (delq nil
+ (mapcar
+ (lambda (handler)
+ (unless (eq buffer
+ (w3m-process-handler-parent-buffer
+ handler))
+ handler))
+ (w3m-process-handlers obj)))))
+ (if handlers
+ (w3m-process-new
+ (w3m-process-command obj)
+ (w3m-process-arguments obj)
+ (w3m-process-buffer obj)
+ (w3m-process-process obj)
+ (if (memq (w3m-process-buffer obj)
+ (mapcar (lambda (x)
+ (w3m-process-handler-buffer x))
+ handlers))
+ handlers
+ (cons
+ ;; Dummy handler to remove buffer.
+ (w3m-process-handler-new
+ (w3m-process-buffer obj)
+ (w3m-process-handler-parent-buffer (car handlers))
+ (lambda (x) (w3m-kill-buffer (current-buffer))))
+ handlers)))
+ (when (w3m-process-process obj)
+ (w3m-process-kill-process (w3m-process-process obj)))
+ (dolist (handler (w3m-process-handlers obj))
+ (w3m-kill-buffer (w3m-process-handler-buffer handler)))
+ nil)))
+ w3m-process-queue)))
+ (when (buffer-name buffer)
+ (with-current-buffer buffer
+ (setq w3m-current-process nil)))
+ (w3m-process-start-queued-processes)
+ (w3m-force-window-update-later buffer))
+
+(defun w3m-process-shutdown ()
+ (let ((list w3m-process-queue))
+ (setq w3m-process-queue nil
+ w3m-process-authinfo-alist nil
+ w3m-process-accept-alist nil)
+ (dolist (obj list)
+ (when (buffer-name (w3m-process-buffer obj))
+ (when (w3m-process-process obj)
+ (w3m-process-kill-process (w3m-process-process obj))))
+ (w3m-kill-buffer (w3m-process-buffer obj)))))
+
+(defmacro w3m-process-with-null-handler (&rest body)
+ "Generate the null handler, and evaluate BODY.
+When BODY is evaluated, the local variable `handler' keeps the null
+handler."
+ (let ((var (gensym "--tempvar--")))
+ `(let ((,var (let (handler) ,@body)))
+ (when (w3m-process-p ,var)
+ (w3m-process-start-process ,var))
+ ,var)))
+(put 'w3m-process-with-null-handler 'lisp-indent-function 0)
+(put 'w3m-process-with-null-handler 'edebug-form-spec '(body))
+
+;; Error symbol:
+(put 'w3m-process-timeout 'error-conditions '(error w3m-process-timeout))
+(put 'w3m-process-timeout 'error-message "Time out")
+
+(defun w3m-process-error-handler (error-data process)
+ (setq w3m-process-queue (delq process w3m-process-queue))
+ (w3m-process-kill-process (w3m-process-process process))
+ (signal (car error-data) (cdr error-data)))
+
+(defvar w3m-process-waited nil
+ "Non-nil means that `w3m-process-with-wait-handler' is being evaluated.")
+
+(defun w3m-process-wait-process (process seconds)
+ "Wait for SECONDS seconds or until PROCESS will exit.
+Returns the exit status of the PROCESS when it exit normally,
+otherwise returns nil."
+ (catch 'timeout
+ (let ((start (current-time)))
+ (while (or (and (prog2
+ (discard-input)
+ (not (save-current-buffer (sit-for 0.1)))
+ (discard-input))
+ ;; Some input is detected but it may be a key
+ ;; press event which should be ignored when the
+ ;; process is not running.
+ (memq (process-status process) '(open run)))
+ (memq (process-status process) '(open run stop)))
+ (and seconds
+ (< seconds (w3m-time-lapse-seconds start (current-time)))
+ (throw 'timeout nil)))
+ (process-exit-status process))))
+
+(defmacro w3m-process-with-wait-handler (&rest body)
+ "Generate the waiting handler, and evaluate BODY.
+When BODY is evaluated, the local variable `handler' keeps the handler
+which will wait for the end of the evaluation."
+ (let ((result (gensym "--result--"))
+ (wait-function (gensym "--wait-function--")))
+ `(let ((w3m-process-waited t)
+ (,result)
+ (,wait-function (make-symbol "wait-function")))
+ (fset ,wait-function 'identity)
+ (setq ,result (let ((handler (list ,wait-function))) ,@body))
+ (while (w3m-process-p ,result)
+ (condition-case error
+ (let (w3m-process-inhibit-quit inhibit-quit)
+ ;; No sentinel function is registered and the process
+ ;; sentinel function is called from this macro, in
+ ;; order to avoid the dead-locking which occurs when
+ ;; this macro is called in the environment that
+ ;; `w3m-process-sentinel' is evaluated.
+ (w3m-process-start-process ,result t)
+ (unless (w3m-process-wait-process (w3m-process-process ,result)
+ w3m-process-timeout)
+ (w3m-process-error-handler (cons 'w3m-process-timeout nil)
+ ,result)))
+ (quit (w3m-process-error-handler error ,result)))
+ (w3m-process-sentinel (w3m-process-process ,result) "finished\n" t)
+ (setq ,result
+ (catch 'result
+ (dolist (handler (w3m-process-handlers ,result))
+ (when (memq ,wait-function
+ (w3m-process-handler-functions handler))
+ (throw 'result (w3m-process-handler-result handler))))
+ (w3m-process-error-handler (cons 'error
+ "Can't find wait handler")
+ ,result))))
+ ,result)))
+(put 'w3m-process-with-wait-handler 'lisp-indent-function 0)
+(put 'w3m-process-with-wait-handler 'edebug-form-spec '(body))
+
+;;; Explanation of w3m-process-do in Japanese:
+;;
+;; w3m-process-do $B$O!"HsF14|=hM}$r4JC1$K=q$/$?$a$N%^%/%m$G$"$k!#Nc$($P!"(B
+;;
+;; (w3m-process-do
+;; (var (async-form...))
+;; post-body...)
+;;
+;; $B$H$$$&$h$&$K=q$/$H!"0J2<$N=g=x$G=hM}$,9T$o$l$k!#(B
+;;
+;; (1) async-form $B$rI>2A(B
+;; --> async-form $BFb$GHsF14|%W%m%;%9$,@8@.$5$l$?>l9g$O!"$=$NHsF1(B
+;; $B4|%W%m%;%9=*N;8e$K(B post-body $B$,I>2A$5$l$k$h$&$K!"%O%s%I%i(B
+;; $B$KDI2C(B
+;; --> $BHsF14|%W%m%;%9$,@8@.$5$l$J$+$C$?>l9g$O!"C1$K<!$N%9%F%C%W(B
+;; $B$K?J$`(B(= post-body $B$rI>2A$9$k(B)$B!#(B
+;; (2) post-body $B$rI>2A(B
+;;
+;; $B$J$*!"(Basync-form / post-body $B$,I>2A$5$l$k;~!"$=$NFbIt$GHsF14|%W%m%;(B
+;; $B%9$,@8@.$5$l$?>l9g$K!"$=$NJV$jCM$r=hM}$9$k$?$a$N%O%s%I%i$,!"JQ?t(B
+;; handler $B$K@_Dj$5$l$F$$$k!#HsF14|$J=hM}$r9T$&4X?t$r8F$S=P$9>l9g$K$O!"(B
+;; $B$=$N4X?t$N0z?t$H$7$FI,$:(B handler $B$rEO$5$J$1$l$P$J$i$J$$!#(B
+;;
+;; $B$^$?!"(Bw3m-process-do $B$O!"8=:_$N%O%s%I%i$NFbMF$rD4$Y$k$?$a!"$=$N%^%/(B
+;; $B%m$,8F$S=P$5$l$F$$$k4D6-$NJQ?t(B handler $B$r;2>H$9$k!#Nc$($P!"(B
+;;
+;; (let (handler) (w3m-process-do ...))
+;;
+;; $B$HJQ?t(B handler $B$r(B nil $B$KB+G{$7$F$*$/$H!"!V8=;~E@$N%O%s%I%i$O6u$G$"(B
+;; $B$k(B = $BHsF14|%W%m%;%9<B9T8e$KI,MW$J=hM}$OB8:_$7$J$$!W$H$$$&0UL#$K$J$j!"(B
+;; w3m-process-do() $B$O!"HsF14|%W%m%;%9$,@8@.$5$l$?>l9g$K$OC1$K(B nil $B$r(B
+;; $BJV$7!"$=$l0J30$N>l9g$O(B post-body $B$NCM$rJV$9!#(B
+;;
+(defmacro w3m-process-do (spec &rest body)
+ "(w3m-process-do (VAR FORM) BODY...): Eval the body BODY asynchronously.
+If an asynchronous process is generated in the evaluation of the form
+FORM, this macro returns its object immdiately, and the body BODY will
+be evaluated after the end of the process with the variable VAR which
+is set to the result of the form FORM. Otherwise, the body BODY is
+evaluated at the same time, and this macro returns the result of the
+body BODY."
+ (let ((var (or (car spec) (gensym "--tempvar--")))
+ (form (cdr spec))
+ (post-function (gensym "--post-function--")))
+ `(let ((,post-function (lambda (,var) ,@body)))
+ (let ((,var (let ((handler (cons ,post-function handler)))
+ ,@form)))
+ (if (w3m-process-p ,var)
+ (if handler
+ ,var
+ (w3m-process-start-process ,var))
+ (if (w3m-process-p (setq ,var (funcall ,post-function ,var)))
+ (if handler
+ ,var
+ (w3m-process-start-process ,var))
+ ,var))))))
+(put 'w3m-process-do 'lisp-indent-function 1)
+(put 'w3m-process-do 'edebug-form-spec '((symbolp form) def-body))
+
+(defmacro w3m-process-do-with-temp-buffer (spec &rest body)
+ "(w3m-process-do-with-temp-buffer (VAR FORM) BODY...):
+Like `w3m-process-do', but the form FORM and the body BODY are
+evaluated in a temporary buffer."
+ (let ((var (or (car spec) (gensym "--tempvar--")))
+ (form (cdr spec))
+ (post-body (gensym "--post-body--"))
+ (post-handler (gensym "--post-handler--"))
+ (temp-buffer (gensym "--temp-buffer--"))
+ (current-buffer (gensym "--current-buffer--")))
+ `(lexical-let ((,temp-buffer
+ (w3m-get-buffer-create
+ (generate-new-buffer-name w3m-work-buffer-name)))
+ (,current-buffer (current-buffer)))
+ (labels ((,post-body (,var)
+ (when (buffer-name ,temp-buffer)
+ (set-buffer ,temp-buffer))
+ ,@body)
+ (,post-handler (,var)
+ (w3m-kill-buffer ,temp-buffer)
+ (when (buffer-name ,current-buffer)
+ (set-buffer ,current-buffer))
+ ,var))
+ (let ((,var (let ((handler
+ (cons ',post-body (cons ',post-handler handler))))
+ (with-current-buffer ,temp-buffer ,@form))))
+ (if (w3m-process-p ,var)
+ (if handler
+ ,var
+ (w3m-process-start-process ,var))
+ (if (w3m-process-p
+ (setq ,var (save-current-buffer
+ (let ((handler (cons ',post-handler handler)))
+ (,post-body ,var)))))
+ (if handler
+ ,var
+ (w3m-process-start-process ,var))
+ (,post-handler ,var))))))))
+(put 'w3m-process-do-with-temp-buffer 'lisp-indent-function 1)
+(put 'w3m-process-do-with-temp-buffer 'edebug-form-spec
+ '((symbolp form) def-body))
+
+
+(defun w3m-process-start (handler command arguments)
+ "Run COMMAND with ARGUMENTS, and eval HANDLER asynchronously."
+ (if w3m-async-exec
+ (w3m-process-do
+ (exit-status (w3m-process-push handler command arguments))
+ (w3m-process-start-after exit-status))
+ (w3m-process-start-after
+ (w3m-process-with-coding-system
+ (w3m-process-with-environment w3m-command-environment
+ (apply 'call-process command nil t nil arguments))))))
+
+(defun w3m-process-start-after (exit-status)
+ (when w3m-current-buffer
+ (with-current-buffer w3m-current-buffer
+ (setq w3m-process-modeline-string nil)))
+ (cond
+ ((numberp exit-status)
+ (zerop (setq w3m-process-exit-status exit-status)))
+ ((not exit-status)
+ (setq w3m-process-exit-status nil))
+ (t
+ (setq w3m-process-exit-status
+ (string-as-multibyte (format "%s" exit-status)))
+ nil)))
+
+(defvar w3m-process-background nil
+ "Non-nil means that an after handler is being evaluated.")
+
+(defun w3m-process-sentinel (process event &optional ignore-queue)
+ ;; Ensure that this function will be never called repeatedly.
+ (set-process-sentinel process 'ignore)
+ (let ((inhibit-quit w3m-process-inhibit-quit)
+ (w3m-process-background t))
+ (unwind-protect
+ (if (buffer-name (process-buffer process))
+ (with-current-buffer (process-buffer process)
+ (w3m-static-unless (featurep 'xemacs)
+ (accept-process-output process 1))
+ (setq w3m-process-queue
+ (delq w3m-process-object w3m-process-queue))
+ (let ((exit-status (process-exit-status process))
+ (buffer (current-buffer))
+ (realm w3m-process-realm)
+ (user w3m-process-user)
+ (passwd w3m-process-passwd)
+ (obj w3m-process-object))
+ (setq w3m-process-object nil)
+ (dolist (x (w3m-process-handlers obj))
+ (when (and
+ (buffer-name (w3m-process-handler-buffer x))
+ (buffer-name (w3m-process-handler-parent-buffer x)))
+ (set-buffer (w3m-process-handler-buffer x))
+ (unless (eq buffer (current-buffer))
+ (insert-buffer-substring buffer))))
+ (dolist (x (w3m-process-handlers obj))
+ (when (and
+ (buffer-name (w3m-process-handler-buffer x))
+ (buffer-name (w3m-process-handler-parent-buffer x)))
+ (set-buffer (w3m-process-handler-buffer x))
+ (let ((w3m-process-exit-status)
+ (w3m-current-buffer
+ (w3m-process-handler-parent-buffer x))
+ (handler
+ (w3m-process-handler-functions x))
+ (exit-status exit-status))
+ (when realm
+ (w3m-process-set-authinfo w3m-current-url
+ realm user passwd))
+ (while (and handler
+ (not (w3m-process-p
+ (setq exit-status
+ (funcall (pop handler)
+ exit-status))))))
+ (setf (w3m-process-handler-result x) exit-status))))))
+ ;; Something wrong has been occured.
+ (catch 'last
+ (dolist (obj w3m-process-queue)
+ (when (eq process (w3m-process-process obj))
+ (setq w3m-process-queue (delq obj w3m-process-queue))
+ (throw 'last nil)))))
+ (delete-process process)
+ (unless ignore-queue
+ (w3m-process-start-queued-processes)))))
+
+(defun w3m-process-filter (process string)
+ (when (buffer-name (process-buffer process))
+ (with-current-buffer (process-buffer process)
+ (let ((buffer-read-only nil)
+ (case-fold-search nil))
+ (goto-char (process-mark process))
+ (insert string)
+ (set-marker (process-mark process) (point))
+ (unless (string= "" string)
+ (goto-char (point-min))
+ (cond
+ ((and (looking-at
+ "\\(?:Accept [^\n]+\n\\)*\\([^\n]+: accept\\? \\)(y/n)")
+ (= (match-end 0) (point-max)))
+ ;; SSL certificate
+ (message "")
+ (let ((yn (w3m-process-y-or-n-p w3m-current-url (match-string 1))))
+ (ignore-errors
+ (process-send-string process (if yn "y\n" "n\n"))
+ (delete-region (point-min) (point-max)))))
+ ((and (looking-at "\n?Accept unsecure SSL session:.*\n")
+ (= (match-end 0) (point-max)))
+ (delete-region (point-min) (point-max)))
+ ((and (looking-at "\\(\n?Wrong username or password\n\\)?\
+Proxy Username for \\(?:.*\\): Proxy Password: ")
+ (= (match-end 0) (point-max)))
+ (when (or (match-beginning 1)
+ (not (stringp w3m-process-proxy-passwd)))
+ (setq w3m-process-proxy-passwd
+ (read-passwd "Proxy Password: ")))
+ (ignore-errors
+ (process-send-string process
+ (concat w3m-process-proxy-passwd "\n"))
+ (delete-region (point-min) (point-max))))
+ ((and (looking-at "\\(\n?Wrong username or password\n\\)?\
+Proxy Username for \\(.*\\): ")
+ (= (match-end 0) (point-max)))
+ (when (or (match-beginning 1)
+ (not (stringp w3m-process-proxy-user)))
+ (setq w3m-process-proxy-user
+ (read-from-minibuffer (concat
+ "Proxy Username for "
+ (match-string 2) ": "))))
+ (ignore-errors
+ (process-send-string process
+ (concat w3m-process-proxy-user "\n"))))
+ ((and (looking-at "\\(\n?Wrong username or password\n\\)?\
+Username for [^\n]*\n?: Password: ")
+ (= (match-end 0) (point-max)))
+ (when (or (match-beginning 1)
+ (not (stringp w3m-process-passwd)))
+ (setq w3m-process-passwd
+ (w3m-process-read-passwd w3m-current-url
+ w3m-process-realm
+ w3m-process-user
+ (match-beginning 1))))
+ (ignore-errors
+ (process-send-string process
+ (concat w3m-process-passwd "\n"))
+ (delete-region (point-min) (point-max))))
+ ((and (looking-at "\\(\n?Wrong username or password\n\\)?\
+Username for \\(.*\\)\n?: ")
+ (= (match-end 0) (point-max)))
+ (setq w3m-process-realm (w3m-decode-coding-string-with-priority
+ (match-string 2) nil))
+ (when (or (match-beginning 1)
+ (not (stringp w3m-process-user)))
+ (setq w3m-process-user
+ (w3m-process-read-user w3m-current-url
+ w3m-process-realm
+ (match-beginning 1))))
+ (ignore-errors
+ (process-send-string process
+ (concat w3m-process-user "\n"))))
+ ((and (looking-at "Enter PEM pass phrase:")
+ (= (match-end 0) (point-max)))
+ (unless (stringp w3m-process-ssl-passphrase)
+ (setq w3m-process-ssl-passphrase
+ (read-passwd "PEM pass phrase: ")))
+ (ignore-errors
+ (process-send-string process
+ (concat w3m-process-ssl-passphrase "\n"))
+ (delete-region (point-min) (point-max))))
+ ((progn
+ (or (search-forward "\nW3m-current-url:" nil t)
+ (goto-char (process-mark process)))
+ (re-search-backward
+ "^W3m-\\(?:in-\\)?progress: \\([.0-9]+/[.0-9]+[a-zA-Z]?b\\)$"
+ nil t))
+ (let ((str (w3m-process-modeline-format (match-string 1)))
+ (buf))
+ (save-current-buffer
+ (dolist (handler (w3m-process-handlers w3m-process-object))
+ (when (setq buf (w3m-process-handler-parent-buffer handler))
+ (if (buffer-name buf)
+ (progn
+ (set-buffer buf)
+ (setq w3m-process-modeline-string str))
+ (w3m-process-kill-stray-processes)))))))))))))
+
+(defun w3m-process-modeline-format (str)
+ (ignore-errors
+ (cond
+ ((stringp w3m-process-modeline-format)
+ (format w3m-process-modeline-format
+ (if (string-match "/0\\([a-zA-Z]?b\\)\\'" str)
+ (replace-match "\\1" t nil str)
+ str)))
+ ((functionp w3m-process-modeline-format)
+ (funcall w3m-process-modeline-format str)))))
+
+;; w3m-process-authinfo-alist has an association list as below format.
+;; (("root1" ("realm11" ("user11" . "pass11")
+;; ("user12" . "pass12"))
+;; ("realm12" ("user13" . "pass13")))
+;; ("root2" ("realm21" ("user21" . "pass21"))))
+(defun w3m-process-set-authinfo (url realm username password)
+ (let (x y z (root (w3m-get-server-hostname url)))
+ (if (setq x (assoc root w3m-process-authinfo-alist))
+ (if (setq y (assoc realm x))
+ (if (setq z (assoc username y))
+ ;; Change a password only.
+ (setcdr z password)
+ ;; Add a pair of a username and a password.
+ (setcdr y (cons (cons username password) (cdr y))))
+ ;; Add a 3-tuple of a realm, a username and a password.
+ (setcdr x (cons (cons realm (list (cons username password)))
+ (cdr x))))
+ ;; Add a 4-tuple of a server root, a realm, a username and a password.
+ (push (cons root (list (cons realm (list (cons username password)))))
+ w3m-process-authinfo-alist))))
+
+(defun w3m-process-read-user (url &optional realm ignore-history)
+ "Read a user name for URL and REALM."
+ (let* ((root (when (stringp url) (w3m-get-server-hostname url)))
+ (ident (or realm root))
+ (alist))
+ (if (and (not ignore-history)
+ (setq alist
+ (cdr (assoc realm
+ (cdr (assoc root
+ w3m-process-authinfo-alist))))))
+ (if (= 1 (length alist))
+ (caar alist)
+ (completing-read (if ident
+ (format "Select username for %s: " ident)
+ "Select username: ")
+ (mapcar (lambda (x) (cons (car x) (car x))) alist)
+ nil t))
+ (read-from-minibuffer (if ident
+ (format "Username for %s: " ident)
+ "Username: ")))))
+
+(defun w3m-process-read-passwd (url &optional realm username ignore-history)
+ "Read a password for URL, REALM, and USERNAME."
+ (let* ((root (when (stringp url) (w3m-get-server-hostname url)))
+ (ident (or realm root))
+ (pass (cdr (assoc username
+ (cdr (assoc realm
+ (cdr (assoc root
+ w3m-process-authinfo-alist))))))))
+ (if (and pass (not ignore-history))
+ pass
+ (read-passwd (format (if ident
+ (format "Password for %s%%s: " ident)
+ "Password%s: ")
+ (if (and (stringp pass)
+ (> (length pass) 0)
+ (not (featurep 'xemacs)))
+ (concat " (default "
+ (make-string (length pass) ?\*)
+ ")")
+ ""))
+ nil pass))))
+
+(defun w3m-process-y-or-n-p (url prompt)
+ "Ask user a \"y or n\" question. Return t if answer is \"y\".
+NOTE: This function is designed to avoid annoying questions. So when
+the same questions is reasked, its previous answer is reused without
+prompt."
+ (let ((root (w3m-get-server-hostname url))
+ (map (copy-keymap query-replace-map))
+ elem answer)
+ ;; ignore [space] to avoid answering y without intention.
+ (define-key map " " 'ignore)
+ (let ((query-replace-map map))
+ (if (setq elem (assoc root w3m-process-accept-alist))
+ (if (member prompt (cdr elem))
+ ;; When the same question has been asked, the previous
+ ;; answer is reused.
+ (setq answer t)
+ ;; When any question for the same server has been asked,
+ ;; regist the pair of this question and its answer to
+ ;; `w3m-process-accept-alist'.
+ (when (setq answer (y-or-n-p prompt))
+ (setcdr elem (cons prompt (cdr elem)))))
+ ;; When no question for the same server has been asked, regist
+ ;; the 3-tuple of the server, the question and its answer to
+ ;; `w3m-process-accept-alist'.
+ (when (setq answer (y-or-n-p prompt))
+ (push (cons root (list prompt)) w3m-process-accept-alist)))
+ answer)))
+
+;; Silence the byte compiler complaining against `gensym' like:
+;; "Warning: the function `gensym' might not be defined at runtime."
+(eval-when-compile
+ (and (boundp 'byte-compile-unresolved-functions)
+ (fboundp 'gensym)
+ (symbol-file 'gensym)
+ (string-match "/cl-macs\\.el[^/]*\\'" (symbol-file 'gensym))
+ (condition-case nil
+ (setq byte-compile-unresolved-functions
+ (delq (assq 'gensym byte-compile-unresolved-functions)
+ byte-compile-unresolved-functions))
+ (error))))
+
+(provide 'w3m-proc)
+
+;;; w3m-proc.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-rss.el b/share/emacs/site-lisp/w3m/w3m-rss.el
new file mode 100644
index 00000000000..7bac9d4b47d
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-rss.el
@@ -0,0 +1,169 @@
+;;; w3m-rss.el --- RSS functions
+
+;; Copyright (C) 2004, 2005 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-rss.el provides RSS-related functions for emacs-w3m. For more
+;; detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; Acknowledgment:
+
+;; I refered functions in `sb-rss.el' to implement this module.
+;; Thanks to Koichiro Ohba and NAKAJIMA Mikio.
+
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(autoload 'xml-parse-region "xml")
+
+(eval-and-compile
+ (autoload 'timezone-parse-date "timezone")
+ (autoload 'timezone-parse-time "timezone"))
+
+(eval-when-compile
+ ;; Avoid warning for Emacs 19 and XEmacs.
+ (unless (fboundp 'match-string-no-properties)
+ (autoload 'match-string-no-properties "poe"))
+ ;; Avoid warning for Emacs 19.
+ (unless (fboundp 'split-string)
+ (autoload 'split-string "poe")))
+
+(defun w3m-rss-parse-date-string (date)
+ "Decode DATE string written in the ISO 8601 format or the RFC822 style.
+Return a list of numbers which conforms to the Emacs internal format.
+Valid types in the ISO 8601 format include:
+
+ Year:
+ YYYY (eg 1997)
+ Year and month:
+ YYYY-MM (eg 1997-07)
+ Complete date:
+ YYYY-MM-DD (eg 1997-07-16)
+ Complete date plus hours and minutes:
+ YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
+ Complete date plus hours, minutes and seconds:
+ YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
+ Complete date plus hours, minutes, seconds and a decimal fraction
+ of a second
+ YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
+
+where:
+ YYYY = four-digit year
+ MM = two-digit month (01=January, etc.)
+ DD = two-digit day of month (01 through 31)
+ hh = two digits of hour (00 through 23) (am/pm NOT allowed)
+ mm = two digits of minute (00 through 59)
+ ss = two digits of second (00 through 59)
+ s = one or more digits representing a decimal fraction of a second
+ TZD = time zone designator (Z or +hh:mm or -hh:mm)
+
+For more detail about ISO 8601 date format, see
+<URL:http://www.w3.org/TR/NOTE-datetime>.
+
+In addition to the above, it also supports the date format in the
+RFC822 style which RSS 2.0 allows. Valid types are the same as ones
+which are supported by the `timezone-parse-date' function (which see)."
+ (cond ((not date) nil)
+ ((string-match " [0-9]+ " date)
+ (let* ((vector (timezone-parse-date date))
+ (year (string-to-number (aref vector 0)))
+ time)
+ (when (>= year 1970)
+ (setq time (timezone-parse-time (aref vector 3)))
+ (encode-time
+ (string-to-number (aref time 2))
+ (string-to-number (aref time 1))
+ (string-to-number (aref time 0))
+ (string-to-number (aref vector 2))
+ (string-to-number (aref vector 1))
+ year
+ (aref vector 4)))))
+ ((string-match "\
+\\([0-9][0-9][0-9][0-9]\\)\\(?:-\\([0-9][0-9]\\)\\)?\\(?:-\\([0-9][0-9]\\)\\)?\
+T?\\(?:\\([0-9][0-9]\\):\\([0-9][0-9]\\)\\(?::\\([.0-9]+\\)\\)?\\)?\
+\\(?:\\([-+]\\)\\([0-9][0-9]\\):?\\([0-9][0-9]\\)\\|Z\\)?"
+ date)
+ (labels ((substr (n default)
+ (if (match-beginning n)
+ (string-to-number
+ (match-string-no-properties n date))
+ default)))
+ (encode-time
+ (substr 6 0) ;; seconds
+ (substr 5 0) ;; minitue
+ (substr 4 0) ;; hour
+ (substr 3 1) ;; day
+ (substr 2 1) ;; month
+ (substr 1 0) ;; year
+ (if (match-beginning 7)
+ (funcall (intern (match-string-no-properties 7 date))
+ 0
+ (* 3600 (substr 8 0))
+ (* 60 (substr 9 0)))
+ 0))))))
+
+(defun w3m-rss-find-el (tag data)
+ "Find the all matching elements in the data. Careful with this on
+large documents!"
+ (let (found)
+ (when (listp data)
+ (dolist (bit data)
+ (when (car-safe bit)
+ (when (equal tag (car bit))
+ (setq found (nconc found (list bit))))
+ (setq found
+ (nconc found
+ (w3m-rss-find-el
+ tag
+ (if (and (listp (car-safe (caddr bit)))
+ (not (stringp (caddr bit))))
+ (caddr bit)
+ (cddr bit))))))))
+ found))
+
+(defun w3m-rss-get-namespace-prefix (el uri)
+ "Given EL (containing a parsed element) and URI (containing a string
+that gives the URI for which you want to retrieve the namespace
+prefix), return the prefix.
+See http://feeds.archive.org/validator/docs/howto/declare_namespaces.html
+for more RSS namespaces."
+ (let* ((prefix (car (rassoc uri (cadar el))))
+ (nslist (when prefix
+ (split-string (symbol-name prefix) ":")))
+ (ns (cond ((eq (length nslist) 1) ; no prefix given
+ "")
+ ((eq (length nslist) 2) ; extract prefix
+ (cadr nslist)))))
+ (if (and ns (not (equal ns "")))
+ (concat ns ":")
+ ns)))
+
+(provide 'w3m-rss)
+
+;;; w3m-rss.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-search.el b/share/emacs/site-lisp/w3m/w3m-search.el
new file mode 100644
index 00000000000..bf4fa21dd6f
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-search.el
@@ -0,0 +1,365 @@
+;;; w3m-search.el --- functions convenient to access web search engines
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Keisuke Nishida <kxn30@po.cwru.edu>,
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Romain FRANCOISE <romain@orebokech.com>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This module contains the `w3m-search' command and some utilities
+;; to improve your cyberlife. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m)
+
+(defcustom w3m-search-engine-alist
+ (let* ((ja (equal "Japanese" w3m-language))
+ (utf-8 (or (and (boundp 'mule-version)
+ (not (string< (symbol-value 'mule-version) "6.0")))
+ (featurep 'un-define)
+ (fboundp 'utf-translate-cjk-mode)
+ (and (not ja) (w3m-find-coding-system 'utf-8)))))
+ `(,@(if ja
+ '(("yahoo"
+ "http://search.yahoo.co.jp/bin/search?p=%s"
+ euc-japan)
+ ("yahoo-en"
+ "http://search.yahoo.com/bin/search?p=%s"))
+ '(("yahoo"
+ "http://search.yahoo.com/bin/search?p=%s")
+ ("yahoo-ja"
+ "http://search.yahoo.co.jp/bin/search?p=%s"
+ euc-japan)))
+ ("alc" "http://eow.alc.co.jp/%s/UTF-8/" utf-8)
+ ,@(cond
+ ((and ja utf-8)
+ '(("blog"
+ "http://blogsearch.google.com/blogsearch?q=%s&hl=ja&lr=lang_ja&oe=utf-8&ie=utf-8"
+ utf-8)
+ ("blog-en"
+ "http://blogsearch.google.com/blogsearch?q=%s&hl=en&oe=utf-8&ie=utf-8"
+ utf-8)))
+ (ja
+ '(("blog"
+ "http://blogsearch.google.com/blogsearch?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
+ shift_jis)
+ ("blog-en"
+ "http://blogsearch.google.com/blogsearch?q=%s&hl=en")))
+ (utf-8
+ '(("blog"
+ "http://blogsearch.google.com/blogsearch?q=%s&oe=utf-8&ie=utf-8"
+ utf-8)
+ ("blog-en"
+ "http://blogsearch.google.com/blogsearch?q=%s&hl=en&oe=utf-8&ie=utf-8"
+ utf-8)))
+ (t
+ '(("blog"
+ "http://blogsearch.google.com/blogsearch?q=%s")
+ ("blog-ja"
+ "http://blogsearch.google.com/blogsearch?q=%s&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
+ shift_jis))))
+ ,@(cond
+ ((and ja utf-8)
+ '(("google"
+ "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=utf-8&oe=utf-8"
+ utf-8)
+ ("google-en"
+ "http://www.google.com/search?q=%s&hl=en&ie=utf-8&oe=utf-8"
+ utf-8)))
+ (ja
+ '(("google"
+ "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
+ shift_jis)
+ ("google-en"
+ "http://www.google.com/search?q=%s&hl=en")))
+ (utf-8
+ '(("google"
+ "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8"
+ utf-8)
+ ("google-en"
+ "http://www.google.com/search?q=%s&hl=en&ie=utf-8&oe=utf-8"
+ utf-8)))
+ (t
+ '(("google"
+ "http://www.google.com/search?q=%s")
+ ("google-ja"
+ "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
+ shift_jis))))
+ ,@(cond
+ ((and ja utf-8)
+ '(("google news"
+ "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s&oe=utf-8"
+ utf-8)
+ ("google news-en"
+ "http://news.google.com/news?hl=en&q=%s")))
+ (ja
+ '(("google news"
+ "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s&oe=Shift_JIS"
+ shift_jis)
+ ("google news-en"
+ "http://news.google.com/news?hl=en&q=%s")))
+ (utf-8
+ '(("google news"
+ "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s&oe=utf-8"
+ utf-8)
+ ("google news-en"
+ "http://news.google.com/news?hl=en&q=%s")))
+ (t
+ '(("google news"
+ "http://news.google.com/news?q=%s")
+ ("google news-ja"
+ "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s&oe=Shift_JIS"
+ shift_jis))))
+ ("google groups"
+ "http://groups.google.com/groups?q=%s")
+ ,@(if ja
+ '(("All the Web"
+ "http://www.alltheweb.com/search?web&_sb_lang=ja&cs=euc-jp\
+&q=%s"
+ euc-japan)
+ ("All the Web-en"
+ "http://www.alltheweb.com/search?web&_sb_lang=en&q=%s"))
+ '(("All the Web"
+ "http://www.alltheweb.com/search?web&_sb_lang=en&q=%s")
+ ("All the Web-ja"
+ "http://www.alltheweb.com/search?web&_sb_lang=ja&cs=euc-jp&q=%s"
+ euc-japan)))
+ ,@(if ja
+ '(("technorati"
+ "http://www.technorati.jp/search/search.html?query=%s&language=ja"
+ utf-8)
+ ("technorati-en"
+ "http://www.technorati.com/search/%s"
+ utf-8))
+ '(("technorati"
+ "http://www.technorati.com/search/%s"
+ utf-8)
+ ("technorati-ja"
+ "http://www.technorati.jp/search/search.html?query=%s&language=ja"
+ utf-8)))
+ ("technorati-tag"
+ "http://www.technorati.com/tag/%s"
+ utf-8)
+ ("goo-ja"
+ "http://search.goo.ne.jp/web.jsp?MT=%s"
+ euc-japan)
+ ("excite-ja"
+ "http://www.excite.co.jp/search.gw?target=combined&look=excite_jp\
+&lang=jp&tsug=-1&csug=-1&search=%s"
+ shift_jis)
+ ("altavista"
+ "http://altavista.com/sites/search/web?q=\"%s\"&kl=ja&search=Search")
+ ("rpmfind"
+ "http://rpmfind.net/linux/rpm2html/search.php?query=%s"
+ nil)
+ ("debian-pkg"
+ "http://packages.debian.org/cgi-bin/search_contents.pl\
+?directories=yes&arch=i386&version=unstable&case=insensitive&word=%s")
+ ("debian-bts"
+ "http://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=yes&pkg=%s")
+ ("freebsd-users-jp"
+ "http://home.jp.FreeBSD.org/cgi-bin/namazu.cgi?key=\"%s\"&whence=0\
+&max=50&format=long&sort=score&dbname=FreeBSD-users-jp"
+ euc-japan)
+ ("iij-archie"
+ "http://www.iij.ad.jp/cgi-bin/archieplexform?query=%s\
+&type=Case+Insensitive+Substring+Match&order=host&server=archie1.iij.ad.jp\
+&hits=95&nice=Nice")
+ ("waei"
+ "http://dictionary.goo.ne.jp/search.php?MT=%s&kind=je"
+ euc-japan)
+ ("eiwa"
+ "http://dictionary.goo.ne.jp/search.php?MT=%s&kind=ej")
+ ("kokugo"
+ "http://dictionary.goo.ne.jp/search.php?MT=%s&kind=jn"
+ euc-japan)
+ ("eiei"
+ "http://www.dictionary.com/cgi-bin/dict.pl?term=%s&r=67")
+ ,@(if ja
+ '(("amazon"
+ "http://www.amazon.co.jp/gp/search?\
+__mk_ja_JP=%%83J%%83%%5E%%83J%%83i&url=search-alias%%3Daps&field-keywords=%s"
+ shift_jis)
+ ("amazon-en"
+ "http://www.amazon.com/exec/obidos/search-handle-form/\
+250-7496892-7797857"
+ iso-8859-1
+ "url=index=blended&field-keywords=%s"))
+ '(("amazon"
+ "http://www.amazon.com/exec/obidos/search-handle-form/\
+250-7496892-7797857"
+ iso-8859-1
+ "url=index=blended&field-keywords=%s")
+ ("amazon-ja"
+ "http://www.amazon.co.jp/gp/search?\
+__mk_ja_JP=%%83J%%83%%5E%%83J%%83i&url=search-alias%%3Daps&field-keywords=%s"
+ shift_jis)))
+ ("emacswiki" "http://www.emacswiki.org/cgi-bin/wiki?search=%s")
+ ("en.wikipedia" "http://en.wikipedia.org/wiki/Special:Search?search=%s")
+ ("de.wikipedia" "http://de.wikipedia.org/wiki/Spezial:Search?search=%s"
+ utf-8)
+ ("ja.wikipedia" "http://ja.wikipedia.org/wiki/Special:Search?search=%s"
+ utf-8)
+ ("msdn" "http://search.msdn.microsoft.com/search/default.aspx?query=%s")
+ ("freshmeat" "http://freshmeat.net/search/?q=%s&section=projects")))
+ "*An alist of search engines.
+Each element looks like (ENGINE ACTION CODING POST-DATA)
+ENGINE is a string, the name of the search engine.
+ACTION is a string, the URL that performs a search.
+ACTION must contain a \"%s\", which is substituted by a query string.
+CODING is optional value which is coding system for query string.
+POST-DATA is optional value which is a string for POST method search engine.
+If CODING is omitted, it defaults to `w3m-default-coding-system'."
+ :group 'w3m
+ :type `(repeat
+ (group :indent 2
+ (string :format "Engine: %v\n" :size 0)
+ (string :format " Action: %v\n" :size 0)
+ (coding-system :format "%t: %v\n" :size 0)
+ (checklist :inline t
+ :entry-format ,(if (w3m-device-on-window-system-p)
+ "%b %v"
+ "%b %v")
+ (string :format "PostData: %v\n" :size 0)))))
+
+(defcustom w3m-search-default-engine "google"
+ "*Name of the default search engine.
+See also `w3m-search-engine-alist'."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-search-word-at-point t
+ "*Non-nil means that the word at point is used as an initial string.
+If Transient Mark mode, this option is ignored and the region is used
+as an initial string."
+ :group 'w3m
+ :type 'boolean)
+
+(defvar w3m-search-engine-history nil
+ "History variable used by `w3m-search' for prompting a search engine.")
+
+(defvar w3m-search-thing-at-point-arg 'word
+ "Argument for `thing-at-point' used in `w3m-search-read-query'")
+
+(defun w3m-search-escape-query-string (str &optional coding)
+ (mapconcat
+ (lambda (s)
+ (w3m-url-encode-string s (or coding w3m-default-coding-system)))
+ (split-string str)
+ "+"))
+
+(defun w3m-search-read-query (prompt prompt-with-default &optional history)
+ "Read a query from the minibuffer, prompting with string PROMPT.
+When a default value for the query is discovered, prompt with string
+PROMPT-WITH-DEFAULT instead of string PROMPT."
+ (let ((default
+ (if (w3m-region-active-p)
+ (buffer-substring (region-beginning) (region-end))
+ (unless (and (eq major-mode 'w3m-mode)
+ (listp (get-text-property (point-at-bol) 'face))
+ (memq 'w3m-header-line-location-title
+ (get-text-property (point-at-bol) 'face)))
+ (thing-at-point w3m-search-thing-at-point-arg))))
+ initial)
+ (when default
+ (set-text-properties 0 (length default) nil default)
+ (when (or w3m-search-word-at-point (w3m-region-active-p))
+ (setq initial default
+ default nil))
+ (when (w3m-region-active-p)
+ (w3m-deactivate-region)))
+ (read-string (if default
+ (format prompt-with-default default)
+ prompt)
+ initial history default)))
+
+(defun w3m-search-read-variables ()
+ "Ask for a search engine and words to query and return them as a list."
+ (let* ((search-engine
+ (if current-prefix-arg
+ (let ((default (or (car w3m-search-engine-history)
+ w3m-search-default-engine))
+ (completion-ignore-case t))
+ (completing-read (format "Which engine? (default %s): "
+ default)
+ w3m-search-engine-alist nil t nil
+ 'w3m-search-engine-history default))
+ w3m-search-default-engine))
+ (query
+ (w3m-search-read-query
+ (format "%s search: " search-engine)
+ (format "%s search (default %%s): " search-engine))))
+ (list search-engine query)))
+
+(defun w3m-search-do-search (w3m-goto-function search-engine query)
+ "Call W3M-GOTO-FUNCTION with the URL for the search."
+ (unless (string= query "")
+ (let ((info (assoc search-engine w3m-search-engine-alist)))
+ (if info
+ (let ((query-string (w3m-search-escape-query-string query
+ (caddr info)))
+ (post-data (cadddr info)))
+ (funcall w3m-goto-function
+ (format (cadr info) query-string)
+ post-data
+ nil
+ (and post-data (format post-data query-string))))
+ (error "Unknown search engine: %s" search-engine)))))
+
+;;;###autoload
+(defun w3m-search (search-engine query)
+ "Search QUERY using SEARCH-ENGINE.
+When called interactively with a prefix argument, you can choose one of
+the search engines defined in `w3m-search-engine-alist'. Otherwise use
+`w3m-search-default-engine'.
+If Transient Mark mode, use the region as an initial string of query
+and deactivate the mark."
+ (interactive (w3m-search-read-variables))
+ (w3m-search-do-search 'w3m-goto-url search-engine query))
+
+;;;###autoload
+(defun w3m-search-new-session (search-engine query)
+ "Like `w3m-search', but do the search in a new session."
+ (interactive (w3m-search-read-variables))
+ (w3m-search-do-search 'w3m-goto-url-new-session search-engine query))
+
+;;;###autoload
+(defun w3m-search-uri-replace (uri engine)
+ "Generate query string for ENGINE from URI matched by last search."
+ (let ((query (substring uri (match-end 0)))
+ (info (assoc engine w3m-search-engine-alist)))
+ (when info
+ (format (cadr info)
+ (w3m-search-escape-query-string query (caddr info))))))
+
+(provide 'w3m-search)
+
+;;; w3m-search.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-session.el b/share/emacs/site-lisp/w3m/w3m-session.el
new file mode 100644
index 00000000000..acc1ae0e241
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-session.el
@@ -0,0 +1,909 @@
+;;; w3m-session.el --- Functions to operate session of w3m -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Author: Hideyuki SHIRAI <shirai@meadowy.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; w3m-session.el is the add-on program of emacs-w3m to save and load
+;; sessions. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; Code:
+(eval-when-compile (require 'cl))
+(require 'w3m-util)
+
+(eval-when-compile
+ (defvar w3m-async-exec)
+ (defvar w3m-async-exec-with-many-urls)
+ (defvar w3m-current-title)
+ (defvar w3m-current-url)
+ (defvar w3m-history)
+ (defvar w3m-history-flat)
+ (defvar w3m-language)
+ (defvar w3m-mode-map)
+ (defvar w3m-profile-directory)
+ (autoload 'w3m-goto-url-new-session "w3m")
+ (autoload 'w3m-history-tree "w3m-hist")
+ (autoload 'w3m-load-list "w3m")
+ (autoload 'w3m-save-list "w3m"))
+
+(defcustom w3m-session-file
+ (expand-file-name ".sessions" w3m-profile-directory)
+ "*File name to keep sessions."
+ :group 'w3m
+ :type '(file :size 0))
+
+(defcustom w3m-session-autosave t
+ "*Non-nil means save automatically when w3m quit."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-session-deleted-save t
+ "*Non-nil means save deleted sessions."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-session-crash-recovery t
+ "*Non-nil means emacs-w3m save session set automatically, and recover it when emacs-w3m crash."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-session-time-format
+ (if (and (equal "Japanese" w3m-language)
+ (not (featurep 'xemacs)))
+ "%Y$BG/(B%m$B7n(B%d$BF|(B(%a) %H:%M"
+ "%Y-%m-%d (%a) %H:%M")
+ "*Format of saved time."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-session-automatic-title
+ (if (equal "Japanese" w3m-language)
+ "$B<+F0J]B8(B"
+ "Automatic saved sessions")
+ "*String of title to save session automatically."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-session-deleted-title
+ (if (equal "Japanese" w3m-language)
+ "$B:o=|%;%C%7%g%s(B"
+ "Removed sessions")
+ "*String of title to save session when buffer delete."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-session-crash-recovery-title
+ (if (equal "Japanese" w3m-language)
+ "$B%/%i%C%7%e2sI|(B"
+ "Crash recovery sessions")
+ "*String of title to save session to use for crash recovering."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-session-deleted-keep-number 5
+ "*Number to keep sessions when buffers delete."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-session-automatic-keep-number 5
+ "*Number to keep sessions automatically."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-session-unknown-title "<Unknown Title>"
+ "*String of title to use when title is not specified."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-session-load-last-sessions nil
+ "*Whether to load the last sessions when emacs-w3m starts."
+ :group 'w3m
+ :type '(radio (const :format "Load the last sessions automatically." t)
+ (const :format "Ask whether to load the last sessions." ask)
+ (const :format "Never load the last sessions automatically." nil)))
+
+(defcustom w3m-session-load-crashed-sessions 'ask
+ "*Whether to load the crashed sessions when emacs-w3m starts."
+ :group 'w3m
+ :type '(radio (const :format "Load the crashed sessions automatically." t)
+ (const :format "Ask whether to load the crashed sessions." ask)
+ (const :format "Never load the crashed sessions automatically." nil)))
+
+(defface w3m-session-select
+ `((((class color) (background light) (type tty))
+ (:foreground "black"))
+ (((class color) (background dark) (type tty))
+ (:foreground "cyan"))
+ (((class color) (background light))
+ (:foreground "dark blue"))
+ (((class color) (background dark))
+ (:foreground "white"))
+ (t nil))
+ "Face of w3m-session."
+ :group 'w3m)
+;; backward-compatibility alias
+(put 'w3m-session-select-face 'face-alias 'w3m-session-select)
+
+(defface w3m-session-selected
+ `((((class color) (background light) (type tty))
+ (:foreground "blue" :bold t :underline t))
+ (((class color) (background dark) (type tty))
+ (:foreground "cyan" :bold t :underline t))
+ (((class color) (background light))
+ (:foreground "dark blue" :bold t :underline t))
+ (((class color) (background dark))
+ (:foreground "white" :bold t :underline t))
+ (t (:bold t :underline t)))
+ "Face of selected w3m-session."
+ :group 'w3m)
+;; backward-compatibility alias
+(put 'w3m-session-selected-face 'face-alias 'w3m-session-selected)
+
+(defun w3m-session-history-to-save ()
+ "Return a copy of `w3m-history-flat' without current page data."
+ (let ((pos (cadar w3m-history)))
+ (apply
+ 'append
+ (mapcar (lambda (x)
+ (unless (equal (nth 2 x) pos)
+ (list x)))
+ (copy-sequence (w3m-history-slimmed-history-flat))))))
+
+;; format of sessin file.
+;; '((sessiontitle1 time1 ((url11 pos11 hflat11 urltitle11)
+;; (url12 pos12 hflat12 urltitle12) ...) current1)
+;; ...
+
+(defmacro w3m-session-ignore-errors (&rest forms)
+ "Run FORMS. Remove `w3m-session-file' and quit if any error happens."
+ `(condition-case err
+ (progn ,@forms)
+ (error
+ (if (and (file-exists-p w3m-session-file)
+ (yes-or-no-p (format
+ "\
+Sorry, an error found in \"%s\"; may we remove it? "
+ ,(if (featurep 'xemacs)
+ '(abbreviate-file-name w3m-session-file t)
+ '(abbreviate-file-name w3m-session-file)))))
+ (progn
+ (delete-file w3m-session-file)
+ (run-at-time 0.1 nil #'message
+ "\"%s\" has been removed; try again"
+ (abbreviate-file-name w3m-session-file))
+ (keyboard-quit))
+ (signal (car err) (cdr err))))))
+
+;;;###autoload
+(defun w3m-session-save ()
+ "Save list of displayed session."
+ (interactive)
+ (w3m-session-ignore-errors
+ (let ((sessions (w3m-load-list w3m-session-file))
+ (bufs (w3m-list-buffers))
+ (prompt "New session title: ")
+ (cnum 0)
+ (i 0)
+ title titles urls len buf cbuf)
+ (mapc (lambda (x)
+ (setq titles (cons (cons (car x) (car x)) titles)))
+ sessions)
+ (setq title (or w3m-current-title
+ (with-current-buffer (car bufs)
+ w3m-current-title)))
+ (setq titles (cons (cons title title) titles))
+ (catch 'loop
+ (while t
+ (setq title (completing-read prompt titles nil nil title))
+ (if (or (string= title "")
+ (and (assoc title sessions)
+ (not (y-or-n-p (format "\"%s\" is exist. Overwrite? "
+ title)))))
+ (setq prompt "Again New session title: ")
+ (throw 'loop t))))
+ (setq cbuf (current-buffer))
+ (save-current-buffer
+ (while (setq buf (car bufs))
+ (setq bufs (cdr bufs))
+ (set-buffer buf)
+ (when w3m-current-url
+ (when (eq cbuf (current-buffer))
+ (setq cnum i))
+ (setq i (1+ i))
+ (setq urls (cons (list w3m-current-url
+ (copy-sequence (caar w3m-history))
+ (w3m-session-history-to-save)
+ w3m-current-title)
+ urls)))))
+ (if (not urls)
+ (message "%s: no session save...done" title)
+ (setq len (length urls))
+ (setq urls (nreverse urls))
+ (when (assoc title sessions)
+ (setq sessions (delete (assoc title sessions) sessions)))
+ (setq sessions (cons (list title (current-time) urls cnum) sessions))
+ (w3m-save-list w3m-session-file sessions)
+ (if (= len 1)
+ (message "%s: 1 session save...done" title)
+ (message "%s: %d sessions save...done" title len))))))
+
+(defun w3m-session-automatic-save ()
+ "Save list of displayed session automatically."
+ (when w3m-session-autosave
+ (w3m-session-ignore-errors
+ (let ((sessions (w3m-load-list w3m-session-file))
+ (bufs (w3m-list-buffers))
+ (title (concat w3m-session-automatic-title "-1"))
+ (titleregex (concat "^"
+ (regexp-quote w3m-session-automatic-title)
+ "-[0-9]+$"))
+ (cnum 0)
+ (i 0)
+ urls buf cbuf session
+ tmp tmptitle tmptime tmpurls)
+ (when bufs
+ (setq cbuf (current-buffer))
+ (save-current-buffer
+ (while (setq buf (car bufs))
+ (setq bufs (cdr bufs))
+ (set-buffer buf)
+ (when w3m-current-url
+ (when (eq cbuf (current-buffer))
+ (setq cnum i))
+ (setq i (1+ i))
+ (setq urls (cons (list w3m-current-url
+ (copy-sequence (caar w3m-history))
+ (w3m-session-history-to-save)
+ w3m-current-title)
+ urls)))))
+ (when urls
+ (setq i 2)
+ (while (setq session (car sessions))
+ (setq sessions (cdr sessions))
+ (if (string-match titleregex (nth 0 session))
+ (when (<= i w3m-session-automatic-keep-number)
+ (setq tmptitle (format (concat w3m-session-automatic-title
+ "-%d") i))
+ (setq tmptime (nth 1 session))
+ (setq tmpurls (nth 2 session))
+ (setq tmp (cons (list tmptitle tmptime tmpurls nil) tmp))
+ (setq i (1+ i)))
+ (setq tmp (cons session tmp))))
+ (setq sessions (nreverse tmp))
+ (setq urls (nreverse urls))
+ (setq sessions (cons (list title (current-time) urls cnum)
+ sessions))
+ (w3m-save-list w3m-session-file sessions)))))))
+
+(defun w3m-session-deleted-save (buffers)
+ "Save list of deleted session."
+ (when w3m-session-deleted-save
+ (w3m-session-ignore-errors
+ (let ((sessions (w3m-load-list w3m-session-file))
+ (title (concat w3m-session-deleted-title "-1"))
+ (titleregex (concat "^"
+ (regexp-quote w3m-session-deleted-title)
+ "-[0-9]+$"))
+ (bufs (copy-sequence buffers))
+ (i 2)
+ urls buf session
+ tmp tmptitle tmptime tmpurls)
+ (when bufs
+ (setq bufs (sort bufs 'w3m-buffer-name-lessp))
+ (save-current-buffer
+ (while (setq buf (car bufs))
+ (setq bufs (cdr bufs))
+ (set-buffer buf)
+ (when w3m-current-url
+ (setq urls (cons (list w3m-current-url
+ (copy-sequence (caar w3m-history))
+ (w3m-session-history-to-save)
+ w3m-current-title)
+ urls)))))
+ (when urls
+ (while (setq session (car sessions))
+ (setq sessions (cdr sessions))
+ (if (string-match titleregex (nth 0 session))
+ (when (<= i w3m-session-deleted-keep-number)
+ (setq tmptitle (format (concat w3m-session-deleted-title
+ "-%d") i))
+ (setq tmptime (nth 1 session))
+ (setq tmpurls (nth 2 session))
+ (setq tmp (cons (list tmptitle tmptime tmpurls nil) tmp))
+ (setq i (1+ i)))
+ (setq tmp (cons session tmp))))
+ (setq sessions (nreverse tmp))
+ (setq urls (nreverse urls))
+ (setq sessions (cons (list title (current-time) urls nil) sessions))
+ (w3m-save-list w3m-session-file sessions)))))))
+
+(defun w3m-session-crash-recovery-save ()
+ "Save list of displayed session."
+ (when w3m-session-crash-recovery
+ (w3m-session-ignore-errors
+ (let ((sessions (w3m-load-list w3m-session-file))
+ (bufs (w3m-list-buffers))
+ (title w3m-session-crash-recovery-title)
+ urls buf tmp)
+ (when bufs
+ (save-current-buffer
+ (while (setq buf (car bufs))
+ (setq bufs (cdr bufs))
+ (set-buffer buf)
+ (when w3m-current-url
+ (setq urls (cons (list w3m-current-url
+ (copy-sequence (caar w3m-history))
+ (w3m-session-history-to-save)
+ w3m-current-title)
+ urls)))))
+ (when urls
+ (setq urls (nreverse urls))
+ (setq tmp (assoc title sessions))
+ (when tmp (setq sessions (delete tmp sessions)))
+ (setq sessions (cons (list title (current-time) urls nil) sessions))
+ (w3m-save-list w3m-session-file sessions)))))))
+
+(defun w3m-session-crash-recovery-remove ()
+ "Remove crash recovery session set."
+ (when w3m-session-crash-recovery
+ (w3m-session-ignore-errors
+ (let* ((sessions (w3m-load-list w3m-session-file))
+ (item (assoc w3m-session-crash-recovery-title sessions)))
+ (when item
+ (setq sessions (delete item sessions))
+ (w3m-save-list w3m-session-file sessions))))))
+
+(defvar w3m-session-select-mode-map nil)
+(unless w3m-session-select-mode-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" 'w3m-session-select-quit)
+ (define-key map "Q" 'w3m-session-select-quit)
+ (define-key map "\C-g" 'w3m-session-select-quit)
+ (define-key map "\C-m" 'w3m-session-select-select)
+ (define-key map "\M-s" 'w3m-session-select-open-session-group)
+ (define-key map "d" 'w3m-session-select-delete)
+ (define-key map "D" 'w3m-session-select-delete)
+ (define-key map "s" 'w3m-session-select-save)
+ (define-key map "S" 'w3m-session-select-save)
+ (define-key map "r" 'w3m-session-select-rename)
+ (define-key map "R" 'w3m-session-select-rename)
+ (define-key map "n" 'w3m-session-select-next)
+ (define-key map "j" 'w3m-session-select-next)
+ (define-key map "\C-n" 'w3m-session-select-next)
+ (define-key map [down] 'w3m-session-select-next)
+ (define-key map "p" 'w3m-session-select-previous)
+ (define-key map "k" 'w3m-session-select-previous)
+ (define-key map "\C-p" 'w3m-session-select-previous)
+ (define-key map [up] 'w3m-session-select-previous)
+ (setq w3m-session-select-mode-map map)))
+
+;;; Local variables
+(defvar w3m-session-select-wincfg nil)
+(defvar w3m-session-select-sessions nil)
+(make-variable-buffer-local 'w3m-session-select-wincfg)
+(make-variable-buffer-local 'w3m-session-select-sessions)
+
+(defun w3m-session-select-mode (&optional sessions)
+ "Major mode for selecting emacs-w3m session.
+
+\\<w3m-session-select-mode-map>
+\\[w3m-session-select-select] Select the session.
+\\[w3m-session-select-open-session-group] Open the session group.
+\\[w3m-session-select-delete] Delete the session.
+\\[w3m-session-select-rename] Rename the session.
+\\[w3m-session-select-save] Save the session.
+\\[w3m-session-select-next] Move the point to the next session.
+\\[w3m-session-select-previous] Move the point to the previous session.
+\\[w3m-session-select-quit] Exit selecting session.
+"
+ (w3m-session-ignore-errors
+ (let ((sessions (or sessions
+ (w3m-load-list w3m-session-file))))
+ (buffer-disable-undo)
+ (setq mode-name "w3m session"
+ truncate-lines t
+ buffer-read-only nil
+ major-mode 'w3m-session-select-mode
+ w3m-session-select-sessions sessions
+ buffer-read-only t)
+ (use-local-map w3m-session-select-mode-map)
+ (w3m-session-select-list-all-sessions))))
+
+(defun w3m-session-select-list-all-sessions ()
+ "List up all saved sessions."
+ (let* ((sessions w3m-session-select-sessions)
+ (num 0)
+ (max 0)
+ (buffer-read-only nil)
+ title titles time times url urls wid pos)
+ (if (not sessions)
+ (progn
+ (message "No saved session")
+ (w3m-session-select-quit))
+ (mapc (lambda (x)
+ (setq title (format "%s[%d]" (nth 0 x) (length (nth 2 x))))
+ (setq wid (string-width title))
+ (when (> wid max)
+ (setq max wid))
+ (setq titles (cons title titles))
+ (setq times (cons (format-time-string w3m-session-time-format
+ (nth 1 x))
+ times))
+ (setq urls (cons (mapconcat (lambda (url)
+ (if (stringp url)
+ url
+ (car url)))
+ (nth 2 x) ", ")
+ urls)))
+ sessions)
+ (setq titles (nreverse titles))
+ (setq times (nreverse times))
+ (setq urls (nreverse urls))
+ (setq max (+ max 2))
+ (erase-buffer)
+ (insert "Select session:\n\n")
+ (while (and (setq title (car titles))
+ (setq time (car times))
+ (setq url (car urls)))
+ (setq titles (cdr titles))
+ (setq times (cdr times))
+ (setq urls (cdr urls))
+ (setq pos (point))
+ (insert title)
+ (add-text-properties pos (point)
+ `(face w3m-session-select
+ w3m-session-number ,num))
+ (setq num (1+ num))
+ (insert (make-string (- max (string-width title)) ?\ ))
+ (insert time " " url "\n"))
+ (goto-char (point-min))
+ (goto-char (next-single-property-change
+ (point) 'w3m-session-number))
+ (put-text-property (point)
+ (next-single-property-change
+ (point) 'w3m-session-number)
+ 'face 'w3m-session-selected)
+ (set-buffer-modified-p nil)
+ (setq buffer-read-only t))))
+
+(defun w3m-session-select-list-session-group (arg)
+ (let ((session (nth 2 (nth arg w3m-session-select-sessions)))
+ (num 0)
+ (max 0)
+ (buffer-read-only nil)
+ title url wid
+ titles urls pos)
+ (when session
+ (mapc (lambda (x)
+ (setq title (format "%s" (or (nth 3 x) w3m-session-unknown-title)))
+ (setq wid (string-width title))
+ (when (> wid max)
+ (setq max wid))
+ (setq titles (cons title titles))
+ (setq urls (cons (nth 0 x)
+ urls)))
+ session)
+ (setq titles (nreverse titles))
+ (setq urls (nreverse urls))
+ (setq max (+ max 2))
+ (erase-buffer)
+ (insert "Select session:\n\n")
+ (setq pos (point))
+ (insert "Open all sessions")
+ (add-text-properties pos (point)
+ `(face w3m-session-selected
+ w3m-session-number ,arg))
+ (insert "\n")
+ (while (and (setq title (car titles))
+ (setq url (car urls)))
+ (setq titles (cdr titles))
+ (setq urls (cdr urls))
+ (setq pos (point))
+ (insert title)
+ (add-text-properties pos (point)
+ `(face w3m-session-select
+ w3m-session-number ,(cons arg num)))
+ (setq num (1+ num))
+ (insert (make-string (- max (string-width title)) ?\ ))
+ (insert url "\n"))
+ (goto-char (point-min))
+ (goto-char (next-single-property-change
+ (point) 'w3m-session-number)))
+ (set-buffer-modified-p nil)
+ (setq buffer-read-only t)))
+
+(defun w3m-session-select-next (&optional arg)
+ "Move the point to the next session."
+ (interactive "p")
+ (unless arg (setq arg 1))
+ (let ((positive (< 0 arg))
+ (buffer-read-only nil))
+ (beginning-of-line)
+ (put-text-property (point)
+ (next-single-property-change
+ (point) 'w3m-session-number)
+ 'face 'w3m-session-select)
+ (while (not (zerop arg))
+ (forward-line (if positive 1 -1))
+ (unless (get-text-property (point) 'w3m-session-number)
+ (if positive
+ (goto-char (next-single-property-change
+ (point-min) 'w3m-session-number))
+ (goto-char (previous-single-property-change
+ (point-max) 'w3m-session-number))))
+ (setq arg (if positive
+ (1- arg)
+ (1+ arg))))
+ (beginning-of-line)
+ (put-text-property (point)
+ (next-single-property-change
+ (point) 'w3m-session-number)
+ 'face 'w3m-session-selected)
+ (set-buffer-modified-p nil)))
+
+(defun w3m-session-select-previous (&optional arg)
+ "the point to the previous session."
+ (interactive "p")
+ (w3m-session-select-next (- arg)))
+
+(defun w3m-session-select-quit ()
+ "Exit from w3m session select mode."
+ (interactive)
+ (let ((buffer (current-buffer))
+ (wincfg w3m-session-select-wincfg))
+ (or (one-window-p) (delete-window))
+ (kill-buffer buffer)
+ (set-window-configuration wincfg)))
+
+(defun w3m-session-select-select ()
+ "Select the session."
+ (interactive)
+ (beginning-of-line)
+ (let* ((num (get-text-property
+ (point) 'w3m-session-number))
+ (item (if (consp num)
+ (nth (cdr num)
+ (caddr (nth (car num)
+ w3m-session-select-sessions)))
+ (nth num w3m-session-select-sessions)))
+ (session (if (consp num)
+ (list (or (cadddr item) w3m-session-unknown-title)
+ nil
+ (list item)
+ nil)
+ item)))
+ (w3m-session-select-quit)
+ (w3m-session-goto-session session)))
+
+(defun w3m-session-select-open-session-group ()
+ "Open the session group."
+ (interactive)
+ (beginning-of-line)
+ (let ((num (get-text-property
+ (point) 'w3m-session-number))
+ wheight)
+ (if (consp num)
+ (message "There is no session group.")
+ (setq wheight
+ (max (+ (length (caddr (nth num w3m-session-select-sessions))) 6)
+ window-min-height))
+ (condition-case nil
+ (enlarge-window (- wheight (window-height)))
+ (error nil))
+ (w3m-session-select-list-session-group num))))
+
+(defun w3m-session-select-save ()
+ "Save the session."
+ (interactive)
+ (when (y-or-n-p "Save this sessions? ")
+ (w3m-session-select-quit)
+ (w3m-session-save)
+ (w3m-session-select)))
+
+(defun w3m-session-select-rename ()
+ "Rename this session."
+ (interactive)
+ (beginning-of-line)
+ (let ((num (get-text-property
+ (point) 'w3m-session-number))
+ (sessions w3m-session-select-sessions))
+ (w3m-session-select-quit)
+ (w3m-session-rename sessions num)
+ (w3m-session-select)))
+
+(defun w3m-session-select-delete ()
+ "Delete the session."
+ (interactive)
+ (when (y-or-n-p "Delete this session? ")
+ (beginning-of-line)
+ (let ((num (get-text-property
+ (point) 'w3m-session-number))
+ (sessions w3m-session-select-sessions))
+ (w3m-session-select-quit)
+ (w3m-session-delete sessions num)
+ (w3m-session-select))))
+
+;;;###autoload
+(defun w3m-session-select ()
+ "Select session from session list."
+ (interactive)
+ (w3m-session-ignore-errors
+ (let* ((sessions (w3m-load-list w3m-session-file))
+ (showbuf (w3m-get-buffer-create " *w3m-session select*"))
+ (wheight (max (+ (length sessions) 5) window-min-height))
+ (wincfg (current-window-configuration))
+ window last-window)
+ (setq last-window (previous-window
+ (w3m-static-if (fboundp 'frame-highest-window)
+ (frame-highest-window)
+ (frame-first-window))))
+ (while (minibuffer-window-active-p last-window)
+ (setq last-window (previous-window last-window)))
+ (while (and
+ (not (one-window-p))
+ (or (< (window-width last-window)
+ (frame-width))
+ (< (window-height last-window)
+ (+ wheight window-min-height))))
+ (setq window last-window)
+ (setq last-window (previous-window window))
+ (delete-window window))
+ (select-window (split-window last-window))
+ (condition-case nil
+ (shrink-window (- (window-height) wheight))
+ (error nil))
+ (switch-to-buffer showbuf)
+ (setq w3m-session-select-wincfg wincfg)
+ (w3m-session-select-mode sessions))))
+
+(defun w3m-session-goto-session (session)
+ "Goto URLs."
+ (let ((title (nth 0 session))
+ (urls (nth 2 session))
+ (cnum (nth 3 session))
+ (i 0)
+ (w3m-async-exec (and w3m-async-exec-with-many-urls w3m-async-exec))
+ url cbuf buf pos history)
+ (message "Session goto(%s)..." title)
+ (while (setq url (car urls))
+ (setq urls (cdr urls))
+ (unless (stringp url)
+ (setq pos (nth 1 url)
+ history (nth 2 url)
+ url (nth 0 url)))
+ (w3m-goto-url-new-session url)
+ (setq buf (car (nreverse (w3m-list-buffers))))
+ (when (or (and (numberp cnum) (= cnum i))
+ (and (not cnum) (= i 0)))
+ (setq cbuf buf))
+ (when (and buf pos history)
+ (set-buffer buf)
+ (setq w3m-history-flat history)
+ (w3m-history-tree pos))
+ (setq i (1+ i)))
+ (when (and cbuf (eq major-mode 'w3m-mode))
+ (set-window-buffer (selected-window) cbuf))
+ (message "Session goto(%s)...done" title)))
+
+(defun w3m-session-rename (sessions num)
+ (if (consp num)
+ (message "This command can execute in Main session area")
+ (let ((prompt "New session title: ")
+ (overwrite nil)
+ tmp title otitle)
+ (setq tmp (nth num sessions))
+ (setq otitle (car tmp))
+ (setq title otitle)
+ (catch 'loop
+ (while t
+ (setq title (read-from-minibuffer prompt otitle))
+ (cond
+ ((string= title "")
+ nil)
+ ((string= title otitle)
+ (when (y-or-n-p
+ (format "\"%s\" is same as original title. Do not rename? "
+ title))
+ (throw 'loop t)))
+ ((assoc title sessions)
+ (when (y-or-n-p (format "\"%s\" is exist. Overwrite? " title))
+ (setq overwrite t)
+ (throw 'loop t))))
+ (setq prompt "Again New session title: ")))
+ (when overwrite
+ (setq sessions (delete (assoc title sessions) sessions)))
+ (unless (string= title otitle)
+ (setq sessions (delete tmp sessions))
+ (setcar tmp title)
+ (setq sessions (cons tmp sessions))
+ (w3m-save-list w3m-session-file sessions)))))
+
+(defun w3m-session-delete (sessions num)
+ (let (tmp)
+ (if (consp num)
+ (let ((item (nth 2 (nth (car num) sessions))))
+ (setq tmp (delete (nth (cdr num) item)
+ item))
+ (setf (nth 2 (nth (car num) sessions))
+ tmp))
+ (setq tmp (nth num sessions))
+ (setq sessions (delete tmp sessions)))
+ (if sessions
+ (w3m-save-list w3m-session-file sessions)
+ (let ((file (expand-file-name w3m-session-file)))
+ (when (and (file-exists-p file)
+ (file-writable-p file))
+ (delete-file file))))))
+
+(defvar w3m-session-menu-items
+ `([,(w3m-make-menu-item "$B?7$7$$%;%C%7%g%s$r:n$k(B..."
+ "Create New Session...")
+ w3m-goto-new-session-url t]
+ [,(w3m-make-menu-item "$B$3$N%;%C%7%g%s$rJ#@=$9$k(B" "Copy This Session")
+ w3m-copy-buffer w3m-current-url]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$BA0$N%;%C%7%g%s$K0\F0$9$k(B"
+ "Move Previous Session")
+ w3m-previous-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ [,(w3m-make-menu-item "$B<!$N%;%C%7%g%s$K0\F0$9$k(B" "Move Next Session")
+ w3m-next-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B$3$N%;%C%7%g%s$rJD$8$k(B" "Close This Session")
+ w3m-delete-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ [,(w3m-make-menu-item "$BB>$N%;%C%7%g%s$rJD$8$k(B" "Close Other Sessions")
+ w3m-delete-other-buffers
+ (> (safe-length (w3m-list-buffers)) 1)]
+ [,(w3m-make-menu-item "$B8=:_$N%;%C%7%g%s$rJ]B8$9$k(B"
+ "Save Displayed Sessions")
+ w3m-session-save t]
+ [,(w3m-make-menu-item "$B%;%C%7%g%s$rA*Br$9$k(B" "Select Sessions")
+ w3m-session-select t])
+ "*List of the session menu items.")
+
+;;;###autoload
+(defun w3m-setup-session-menu ()
+ "Setup w3m session items in menubar."
+ (w3m-static-if (featurep 'xemacs)
+ (unless (car (find-menu-item current-menubar '("Session")))
+ (easy-menu-define w3m-session-menu w3m-mode-map
+ "" '("Session" ["(empty)" ignore nil]))
+ (easy-menu-add w3m-session-menu)
+ (add-hook 'activate-menubar-hook 'w3m-session-menubar-update))
+ (unless (lookup-key w3m-mode-map [menu-bar Session])
+ (easy-menu-define w3m-session-menu w3m-mode-map "" '("Session"))
+ (easy-menu-add w3m-session-menu)
+ (add-hook 'menu-bar-update-hook 'w3m-session-menubar-update))))
+
+(defvar w3m-session-menu-items-pre nil)
+(defvar w3m-session-menu-items-time nil)
+
+(defun w3m-session-menubar-update ()
+ "Update w3m session menubar."
+ (when (and (eq major-mode 'w3m-mode)
+ (w3m-static-if (featurep 'xemacs)
+ (frame-property (selected-frame) 'menubar-visible-p)
+ menu-bar-mode))
+ (let ((items w3m-session-menu-items)
+ (pages (w3m-session-make-menu-items)))
+ (easy-menu-define w3m-session-menu w3m-mode-map
+ "The menu kepmap for the emacs-w3m session."
+ (cons "Session" (if pages
+ (append items '("----") pages)
+ items)))
+ (w3m-static-when (featurep 'xemacs)
+ (when (setq items (car (find-menu-item current-menubar '("Session"))))
+ (setcdr items (cdr w3m-session-menu))
+ (set-buffer-menubar current-menubar))))))
+
+(defun w3m-session-file-modtime ()
+ "Return the modification time of the session file `w3m-session-file'.
+The value is a list of two time values `(HIGH LOW)' if the session
+file exists, otherwise nil."
+ (nth 5 (file-attributes w3m-session-file)))
+
+(defvar w3m-session-make-item-xmas
+ (and (equal "Japanese" w3m-language) (featurep 'xemacs)))
+
+(defun w3m-session-make-item (item)
+ (if w3m-session-make-item-xmas
+ (concat item "%_ ")
+ item))
+
+(defun w3m-session-make-menu-items ()
+ "Create w3m session menu items."
+ (if (and w3m-session-menu-items-pre
+ w3m-session-menu-items-time
+ (equal w3m-session-menu-items-time
+ (w3m-session-file-modtime)))
+ w3m-session-menu-items-pre
+ (w3m-session-ignore-errors
+ (let ((sessions (w3m-load-list w3m-session-file)))
+ (setq w3m-session-menu-items-time (w3m-session-file-modtime))
+ (setq w3m-session-menu-items-pre
+ (and sessions
+ (mapcar
+ (lambda (entry)
+ (cons (w3m-session-make-item (car entry))
+ (cons (vector "Open all sessions"
+ `(w3m-session-goto-session
+ (quote ,entry)))
+ (mapcar
+ (lambda (item)
+ (let ((title
+ (w3m-session-make-item
+ (or (nth 3 item)
+ w3m-session-unknown-title))))
+ (vector
+ title
+ `(w3m-session-goto-session
+ (quote
+ ,(list title
+ nil
+ (list item)
+ nil))))))
+ (nth 2 entry)))))
+ sessions)))))))
+
+;;;###autoload
+(defun w3m-session-last-autosave-session ()
+ (when w3m-session-load-last-sessions
+ (w3m-session-ignore-errors
+ (let ((item
+ (let ((sessions (w3m-load-list w3m-session-file))
+ (n 1) x)
+ (catch 'loop
+ (while t
+ (if (< w3m-session-automatic-keep-number n)
+ (throw 'loop nil)
+ (setq x (assoc (format "%s-%d"
+ w3m-session-automatic-title n)
+ sessions))
+ (when x (throw 'loop x)))
+ (setq n (1+ n)))))))
+ (when (and item
+ (or (and (eq w3m-session-load-last-sessions 'ask)
+ (y-or-n-p "Load the last sessions? "))
+ w3m-session-load-last-sessions))
+ item)))))
+
+;;;###autoload
+(defun w3m-session-last-crashed-session ()
+ (when (and w3m-session-crash-recovery w3m-session-load-crashed-sessions)
+ (w3m-session-ignore-errors
+ (let ((item (assoc w3m-session-crash-recovery-title
+ (w3m-load-list w3m-session-file))))
+ (when (and item
+ (or (and (eq w3m-session-load-crashed-sessions 'ask)
+ (y-or-n-p "Load the crashed sessions? "))
+ (eq w3m-session-load-crashed-sessions t)))
+ item)))))
+
+(provide 'w3m-session)
+
+;;; w3m-session.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-symbol.el b/share/emacs/site-lisp/w3m/w3m-symbol.el
new file mode 100644
index 00000000000..e89a2811d46
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-symbol.el
@@ -0,0 +1,230 @@
+;;; w3m-symbol.el --- Stuffs to replace symbols for emacs-w3m -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
+;; ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+
+;; Author: ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+;; Keywords: w3m, WWW, hypermedia, i18n
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(eval-when-compile
+ (defvar w3m-output-coding-system)
+ (defvar w3m-language)
+ (defvar w3m-use-symbol)
+ (autoload 'w3m-mule-unicode-p "w3m"))
+
+(defgroup w3m-symbol nil
+ "Symbols for w3m"
+ :group 'w3m)
+
+(defvar w3m-symbol-custom-type
+ '(list
+ :convert-widget w3m-widget-type-convert-widget
+ (let* ((w `(sexp :match (lambda (widget value) (stringp value))
+ :size 4 :value ""
+ ,@(if (not (widget-get widget :copy))
+ ;; Emacs versions prior to 22.
+ '(:value-to-internal
+ (lambda (widget value)
+ (if (string-match "\\`\".*\"\\'" value)
+ value
+ (prin1-to-string value)))))))
+ (a `(,@w :format "%v "))
+ (b `(,@w :format "%v\n"))
+ (c (list a a a a a a a b))
+ (d (list a a a a a b)))
+ `(:indent 4 :tag "Customize"
+ ,@c ,@c ,@c ,@c ,@d ,@d ,b ,b))))
+
+(defcustom w3m-default-symbol
+ '("-+" " |" "--" " +" "-|" " |" "-+" ""
+ "--" " +" "--" "" "-+" "" "" ""
+ "-+" " |" "--" " +" "-|" " |" "-+" ""
+ "--" " +" "--" "" "-+" "" "" ""
+ " *" " +" " o" " #" " @" " -"
+ " =" " x" " %" " *" " o" " #"
+ " #"
+ "<=UpDn ")
+ "List of symbol string, used by defaultly."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-Chinese-BIG5-symbol
+ '("$(0#3(B" "$(0#7(B" "$(0#5(B" "$(0#<(B" "$(0#6(B" "$(0#:(B" "$(0#=(B" ""
+ "$(0#4(B" "$(0#>(B" "$(0#9(B" "" "$(0#?(B" "" "" ""
+ "$(0#3(B" "$(0#7(B" "$(0#5(B" "$(0#<(B" "$(0#6(B" "$(0#:(B" "$(0#=(B" ""
+ "$(0#4(B" "$(0#>(B" "$(0#9(B" "" "$(0#?(B" "" "" ""
+ "$(0!&(B" "$(0!{(B" "$(0!w(B" "$(0!r(B" "$(0!|(B" "$(0!x(B"
+ "$(0!v(B" "$(0!s(B" "$(0!t(B" "$(0!s(B" "$(0!r(B" "$(0!{(B"
+ "$(0!s(B"
+ "$(0!N"U"V(B")
+ "List of symbol string, used in Chienese-BIG5 environment."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-Chinese-CNS-symbol
+ '("$(G#3(B" "$(G#7(B" "$(G#5(B" "$(G#<(B" "$(G#6(B" "$(G#:(B" "$(G#=(B" ""
+ "$(G#4(B" "$(G#>(B" "$(G#9(B" "" "$(G#?(B" "" "" ""
+ "$(G#3(B" "$(G#7(B" "$(G#5(B" "$(G#<(B" "$(G#6(B" "$(G#:(B" "$(G#=(B" ""
+ "$(G#4(B" "$(G#>(B" "$(G#9(B" "" "$(G#?(B" "" "" ""
+ "$(G!&(B" "$(G!{(B" "$(G!w(B" "$(G!r(B" "$(G!|(B" "$(G!x(B"
+ "$(G!v(B" "$(G!s(B" "$(G!t(B" "$(G!s(B" "$(G!r(B" "$(G!{(B"
+ "$(G!s(B"
+ "$(G!N"U"V(B")
+ "List of symbol string, used in Chienese-CNS environment."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-Chinese-GB-symbol
+ '("$A)`(B" "$A)@(B" "$A)P(B" "$A)0(B" "$A)H(B" "$A)&(B" "$A)4(B" ""
+ "$A)X(B" "$A)8(B" "$A)$(B" "" "$A)<(B" "" "" ""
+ "$A)`(B" "$A)D(B" "$A)S(B" "$A)3(B" "$A)L(B" "$A)'(B" "$A)7(B" ""
+ "$A)[(B" "$A);(B" "$A)%(B" "" "$A)?(B" "" "" ""
+ "$A!$(B" "$A!u(B" "$A!n(B" "$A!p(B" "$A!v(B" "$A!o(B"
+ "$A!r(B" "$A!q(B" "$A!w(B" "$A!q(B" "$A!p(B" "$A!u(B"
+ "$A!q(B"
+ "$A!6!|!}(B")
+ "List of symbol string, used in Chienese-GB environment."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-Japanese-symbol
+ '("$B(+(B" "$B('(B" "$B(((B" "$B(#(B" "$B()(B" "$B("(B" "$B($(B" ""
+ "$B(*(B" "$B(&(B" "$B(!(B" "" "$B(%(B" "" "" ""
+ "$B(+(B" "$B(7(B" "$B(8(B" "$B(.(B" "$B(9(B" "$B(-(B" "$B(/(B" ""
+ "$B(:(B" "$B(1(B" "$B(,(B" "" "$B(0(B" "" "" ""
+ "$B!&(B" "$B""(B" "$B!y(B" "$B!{(B" "$B"#(B" "$B!z(B"
+ "$B!}(B" "$B!|(B" "$B"$(B" "$B!|(B" "$B!{(B" "$B""(B"
+ "$B!|(B"
+ "$B"c","-(B")
+ "List of symbol string, used in Japanese environment."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-Korean-symbol
+ '("$(C&+(B" "$(C&'(B" "$(C&((B" "$(C&#(B" "$(C&)(B" "$(C&"(B" "$(C&$(B" ""
+ "$(C&*(B" "$(C&&(B" "$(C&!(B" "" "$(C&%(B" "" "" ""
+ "$(C&+(B" "$(C&7(B" "$(C&8(B" "$(C&.(B" "$(C&9(B" "$(C&-(B" "$(C&/(B" ""
+ "$(C&:(B" "$(C&1(B" "$(C&,(B" "" "$(C&0(B" "" "" ""
+ "$(C!$(B" "$(C!`(B" "$(C!Y(B" "$(C![(B" "$(C!a(B" "$(C!Z(B"
+ "$(C!](B" "$(C!\(B" "$(C!b(B" "$(C!\(B" "$(C![(B" "$(C!`(B"
+ "$(C!\(B"
+ "$(C!l!h!i(B")
+ "List of symbol string, used in Korean environment."
+ :group 'w3m-symbol
+ :type w3m-symbol-custom-type)
+
+(defcustom w3m-mule-unicode-symbol
+ (when (w3m-mule-unicode-p)
+ (append
+ (mapcar (lambda (p)
+ (if p
+ (char-to-string
+ (make-char (or (nth 2 p) 'mule-unicode-2500-33ff)
+ (car p) (cadr p)))
+ ""))
+ '((32 92) (32 60) (32 76) (32 44) (32 68) (32 34) (32 48) nil
+ (32 84) (32 52) (32 32) nil (32 56) nil nil nil
+ (32 92) (32 64) (32 79) (32 47) (32 72) (32 35) (32 51) nil
+ (32 87) (32 55) (32 33) nil (32 59) nil nil nil
+ (115 34 mule-unicode-0100-24ff) (33 97) (34 102) (34 43) (33 96) (34 101)
+ (34 46) (34 47) (33 115) (34 47) (34 43) (33 97)
+ (34 47)))
+ (list (format "%c %c %c "
+ (make-char 'mule-unicode-0100-24ff 121 42)
+ (make-char 'mule-unicode-0100-24ff 118 113)
+ (make-char 'mule-unicode-0100-24ff 118 115)))))
+ "List of symbol string, using mule-unicode characters."
+ :group 'w3m-symbol
+ :type (if (w3m-mule-unicode-p)
+ w3m-symbol-custom-type
+ '(const :format "%{%t%}: %v")))
+
+(defcustom w3m-symbol nil
+ "List of symbol string."
+ :group 'w3m-symbol
+ :type `(radio (const :format "Auto detect " nil)
+ (const :tag "Default" w3m-default-symbol)
+ (const :format "Chinese BIG5 " w3m-Chinese-BIG5-symbol)
+ (const :format "Chinese CNS " w3m-Chinese-CNS-symbol)
+ (const :tag "Chinese GB" w3m-Chinese-GB-symbol)
+ (const :format "Japanese " w3m-Japanese-symbol)
+ (const :format "Korean " w3m-Korean-symbol)
+ ,@(when w3m-mule-unicode-symbol
+ '((const :tag "Mule-Unicode" w3m-mule-unicode-symbol)))
+ (variable :format "%t symbol: %v\n" :size 0
+ :value w3m-default-symbol)
+ ,w3m-symbol-custom-type))
+
+(defun w3m-use-symbol ()
+ (cond ((functionp w3m-use-symbol)
+ (funcall w3m-use-symbol))
+ (t w3m-use-symbol)))
+
+(eval-when-compile (defvar current-language-environment))
+
+(defun w3m-symbol ()
+ (cond (w3m-symbol
+ (if (symbolp w3m-symbol)
+ (symbol-value w3m-symbol)
+ w3m-symbol))
+ ((and (eq w3m-output-coding-system 'utf-8)
+ w3m-mule-unicode-symbol))
+ ((let ((lang (or w3m-language
+ (and (boundp 'current-language-environment)
+ current-language-environment
+ ;; In XEmacs 21.5 it may be the one like
+ ;; "Japanese (UTF-8)".
+ (if (string-match "[\t ]+("
+ current-language-environment)
+ (substring current-language-environment
+ 0 (match-beginning 0))
+ current-language-environment)))))
+ (when (boundp (intern (format "w3m-%s-symbol" lang)))
+ (symbol-value (intern (format "w3m-%s-symbol" lang))))))
+ (t w3m-default-symbol)))
+
+;;;###autoload
+(defun w3m-replace-symbol ()
+ (when (w3m-use-symbol)
+ (let ((symbol-list (w3m-symbol)))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "<_SYMBOL TYPE=\\([0-9]+\\)>" nil t)
+ (let ((symbol (nth (string-to-number (match-string 1)) symbol-list))
+ (start (point))
+ end symbol-cnt)
+ (search-forward "</_SYMBOL>" nil t)
+ (setq end (match-beginning 0)
+ symbol-cnt (/ (string-width (buffer-substring start end))
+ (string-width symbol)))
+ (goto-char start)
+ (delete-region start end)
+ (insert (apply 'concat (make-list symbol-cnt symbol)))))))))
+
+(provide 'w3m-symbol)
+
+;;; w3m-symbol.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-tabmenu.el b/share/emacs/site-lisp/w3m/w3m-tabmenu.el
new file mode 100644
index 00000000000..21817a70599
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-tabmenu.el
@@ -0,0 +1,188 @@
+;;; w3m-tabmenu.el --- Functions for TAB menu browsing
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: Hideyuki SHIRAI <shirai@meadowy.org>,
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file contains the functions for TAB browsing. For more detail
+;; about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'w3m-util)
+(require 'w3m)
+(require 'easymenu)
+
+(defun w3m-setup-tab-menu ()
+ "Setup w3m tab menubar."
+ (when w3m-use-tab-menubar
+ (w3m-static-if (featurep 'xemacs)
+ (unless (car (find-menu-item current-menubar '("Tab")))
+ (easy-menu-define w3m-tab-menu w3m-mode-map
+ "" '("Tab" ["dummy" w3m-switch-buffer t]))
+ (easy-menu-add w3m-tab-menu)
+ (add-hook 'activate-menubar-hook 'w3m-tab-menubar-update))
+ (unless (lookup-key w3m-mode-map [menu-bar Tab])
+ (easy-menu-define w3m-tab-menu w3m-mode-map "" '("Tab"))
+ (easy-menu-add w3m-tab-menu)
+ (add-hook 'menu-bar-update-hook 'w3m-tab-menubar-update)))))
+
+(defun w3m-switch-buffer ()
+ "Switch `w3m-mode' buffer in the current window."
+ (interactive)
+ (let ((items (w3m-tab-menubar-make-items 'nomenu))
+ (minibuffer-setup-hook
+ (append minibuffer-setup-hook '(beginning-of-line)))
+ (count 1)
+ (form "%s [%s]")
+ (completion-ignore-case t)
+ comp hist histlen default buf)
+ (dolist (item items)
+ (when (nth 2 item) ;; current-buffer
+ (setq default count))
+ (setq comp (cons
+ (cons
+ (format form (nth 1 item) (nth 0 item)) (nth 0 item))
+ comp))
+ (setq hist (cons (format form (nth 1 item) (nth 0 item)) hist))
+ (setq count (1+ count)))
+ (setq comp (nreverse comp))
+ (setq histlen (length hist))
+ (setq hist (append hist hist hist hist hist)) ;; STARTPOS at 3rd hist
+ (setq buf
+ (completing-read
+ "Switch to w3m buffer: "
+ comp nil t (car (nth (1- default) comp))
+ (cons 'hist (+ (* 3 histlen) (- histlen default -1)))
+ (car (nth (1- default) comp))))
+ (setq buf (cdr (assoc buf comp)))
+ (when (get-buffer buf)
+ (switch-to-buffer buf))))
+
+(defun w3m-tab-menubar-open-item (buf)
+ "Open w3m buffer from tab menubar."
+ (interactive)
+ (when (get-buffer buf)
+ (switch-to-buffer buf)))
+
+(defun w3m-tab-menubar-update ()
+ "Update w3m tab menubar."
+ (when (and (eq major-mode 'w3m-mode)
+ (w3m-static-if (featurep 'xemacs)
+ (frame-property (selected-frame) 'menubar-visible-p)
+ menu-bar-mode))
+ (easy-menu-define w3m-tab-menu w3m-mode-map
+ "The menu kepmap for the emacs-w3m tab."
+ (cons "Tab" (w3m-tab-menubar-make-items)))
+ (w3m-static-when (featurep 'xemacs)
+ (let ((items (car (find-menu-item current-menubar '("Tab")))))
+ (when items
+ (setcdr items (cdr w3m-tab-menu))
+ (set-buffer-menubar current-menubar))))))
+
+(defvar w3m-tab-menubar-items-sub-coeff 30) ;; 30?
+(defvar w3m-tab-menubar-items-width 50) ;; 50?
+
+(defun w3m-tab-menubar-make-items-1 (buffers &optional nomenu)
+ (let ((i 0)
+ (current (current-buffer))
+ (width w3m-tab-menubar-items-width)
+ title unseen)
+ (mapcar
+ (lambda (buffer)
+ (if nomenu
+ (list (buffer-name buffer)
+ (format "%s%s"
+ (if (w3m-unseen-buffer-p buffer) "(u)" "")
+ (w3m-buffer-title buffer))
+ (eq buffer current))
+ (setq title (w3m-buffer-title buffer))
+ (setq unseen (w3m-unseen-buffer-p buffer))
+ (when (>= (string-width title) width)
+ (setq title
+ (concat (w3m-truncate-string title
+ (- width 3))
+ "...")))
+ (vector (format "%d:%s%s"
+ (incf i)
+ (cond ((eq buffer current) "* ")
+ (unseen "u ")
+ (t " "))
+ title)
+ `(w3m-tab-menubar-open-item ,(buffer-name buffer))
+ buffer)))
+ buffers)))
+
+(defvar w3m-tab-menubar-make-items-precbuf nil)
+(defvar w3m-tab-menubar-make-items-prebuflst nil)
+(defvar w3m-tab-menubar-make-items-preurl nil)
+(defvar w3m-tab-menubar-make-items-preitems nil)
+
+(defun w3m-tab-menubar-force-update (&rest args)
+ (setq w3m-tab-menubar-make-items-preitems nil)
+ (w3m-tab-menubar-update))
+
+(add-hook 'w3m-display-functions 'w3m-tab-menubar-force-update)
+
+(defun w3m-tab-menubar-make-items (&optional nomenu)
+ "Create w3m tab menu items."
+ (let (menu buflst total max)
+ (if nomenu
+ (w3m-tab-menubar-make-items-1 (w3m-list-buffers) t)
+ (setq w3m-tab-button-menu-current-buffer (current-buffer))
+ (setq buflst (w3m-list-buffers))
+ (if (and w3m-tab-menubar-make-items-preitems
+ (eq w3m-tab-button-menu-current-buffer
+ w3m-tab-menubar-make-items-precbuf)
+ (equal w3m-tab-menubar-make-items-prebuflst buflst)
+ (equal w3m-tab-menubar-make-items-preurl w3m-current-url))
+ w3m-tab-menubar-make-items-preitems
+ (setq w3m-tab-menubar-make-items-precbuf
+ w3m-tab-button-menu-current-buffer)
+ (setq w3m-tab-menubar-make-items-prebuflst buflst)
+ (setq w3m-tab-menubar-make-items-preurl w3m-current-url)
+ (setq total (length buflst))
+ (setq max (- (frame-height (selected-frame))
+ w3m-tab-menubar-items-sub-coeff))
+ (if (< total max)
+ (setq menu (w3m-tab-menubar-make-items-1 buflst))
+ (setq menu (list `(,(w3m-make-menu-item "¥¿¥Ö¤ÎÁªÂò"
+ "Select TAB")
+ ,@(w3m-tab-menubar-make-items-1 buflst)))))
+ (setq w3m-tab-menubar-make-items-preitems
+ (append menu
+ '("-")
+ '("-")
+ (w3m-make-menu-commands
+ w3m-tab-button-menu-commands)))))))
+
+(provide 'w3m-tabmenu)
+
+;;; w3m-tabmenu.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-ucs.el b/share/emacs/site-lisp/w3m/w3m-ucs.el
new file mode 100644
index 00000000000..a9eab004ab1
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-ucs.el
@@ -0,0 +1,109 @@
+;;; w3m-ucs.el --- CCL programs to process Unicode.
+
+;; Copyright (C) 2001, 2005, 2007 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file contains CCL codes to handle UCS characters in emacs-w3m.
+;; For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+;; This module requires `Mule-UCS' package. It can be downloaded from:
+;;
+;; ftp://ftp.m17n.org/pub/mule/Mule-UCS/
+
+;;; Code:
+
+;; Enable XEmacs 21.5-Mule to compile this module anyway.
+(eval-when-compile
+ (if (featurep 'xemacs)
+ (let ((mucs-ignore-version-incompatibilities t))
+ (defvar font-ccl-encoder-alist nil)
+ (require 'un-define))))
+
+(require 'un-define)
+(require 'w3m-ccl)
+
+(eval-and-compile
+ (autoload 'w3m-make-ccl-coding-system "w3m"))
+
+(defun w3m-ucs-to-char (codepoint)
+ (condition-case nil
+ (or (ucs-to-char codepoint) ?~)
+ (error ?~)))
+
+(eval-and-compile
+ (defconst w3m-ccl-get-ucs-codepoint-with-mule-ucs
+ '(;; (1) Convert a set of r1 (charset-id) and r0 (codepoint) to a
+ ;; character in Emacs internal representation.
+ (if (r0 > 255)
+ ((r4 = (r0 & 127))
+ (r0 = (((r0 >> 7) * 96) + r4))
+ (r0 |= (r1 << 16)))
+ ((r0 |= (r1 << 16))))
+ ;; (2) Convert a character in Emacs to a UCS codepoint.
+ (call emacs-char-to-ucs-codepoint-conversion)
+ (if (r0 <= 0)
+ (write-repeat ?~))) ; unknown character.
+ "CCL program to convert multibyte char to ucs with Mule-UCS."))
+
+(define-ccl-program w3m-euc-japan-mule-ucs-encoder
+ `(4
+ (loop
+ ,@w3m-ccl-write-euc-japan-character
+ ,@w3m-ccl-get-ucs-codepoint-with-mule-ucs
+ ,@w3m-ccl-generate-ncr)))
+
+(w3m-make-ccl-coding-system
+ 'w3m-euc-japan-mule-ucs ?E
+ "ISO 2022 based EUC encoding for Japanese with w3m internal characters.
+A character that can not be encoded with `euc-japan' is converted to a
+UCS codepoint with Mule-UCS, and the codepoint is represented as a
+string which represents the character in Numeric Character
+References (NCR).
+ (generated by `w3m')"
+ 'w3m-euc-japan-decoder
+ 'w3m-euc-japan-mule-ucs-encoder)
+
+(define-ccl-program w3m-iso-latin-1-mule-ucs-encoder
+ `(4
+ (loop
+ ,@w3m-ccl-write-iso-latin-1-character
+ ,@w3m-ccl-get-ucs-codepoint-with-mule-ucs
+ ,@w3m-ccl-generate-ncr)))
+
+(w3m-make-ccl-coding-system
+ 'w3m-iso-latin-1-mule-ucs ?1
+ "ISO 2022 based 8-bit encoding for Latin-1 with w3m internal characters.
+A character that can not be encoded with `iso-latin-1' is converted to
+a UCS codepoint with Mule-UCS, and the codepoint is represented as a
+string which represents the character in Numeric Character
+References (NCR).
+ (generated by `w3m')"
+ 'w3m-iso-latin-1-decoder
+ 'w3m-iso-latin-1-mule-ucs-encoder)
+
+(provide 'w3m-ucs)
+;;; w3m-ucs.el ends here.
diff --git a/share/emacs/site-lisp/w3m/w3m-util.el b/share/emacs/site-lisp/w3m/w3m-util.el
new file mode 100644
index 00000000000..b0ea30b15be
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-util.el
@@ -0,0 +1,1421 @@
+;;; w3m-util.el --- Utility macros and functions for emacs-w3m
+
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
+;; Hideyuki SHIRAI <shirai@meadowy.org>,
+;; Keisuke Nishida <kxn30@po.cwru.edu>,
+;; Yuuichi Teranishi <teranisi@gohome.org>,
+;; Akihiro Arisawa <ari@mbf.sphere.ne.jp>,
+;; Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This module is a part of emacs-w3m which provides utility macros
+;; and inline functions. Visit <URL:http://emacs-w3m.namazu.org/> for
+;; more details of emacs-w3m.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+;; Variables and functions which are used in the following inline
+;; functions. They should be defined in the other module at run-time.
+(eval-when-compile
+ (defvar w3m-current-process)
+ (defvar w3m-current-refresh)
+ (defvar w3m-current-title)
+ (defvar w3m-current-url)
+ (defvar w3m-fb-list-buffers-frame)
+ (defvar w3m-fb-mode)
+ (defvar w3m-mode-hook)
+ (defvar w3m-pop-up-frames)
+ (defvar w3m-pop-up-windows)
+ (defvar w3m-popup-frame-parameters)
+ (defvar w3m-refresh-timer)
+ (defvar w3m-select-buffer-name)
+ (defvar w3m-use-refresh)
+ (defvar w3m-use-tab)
+ (defvar w3m-work-buffer-list)
+ (defvar w3m-use-japanese-menu)
+ (defvar w3m-mode-map)
+ (defvar w3m-use-title-buffer-name)
+ (defvar w3m-buffer-unseen)
+ (defvar w3m-puny-utf-16be)
+ (unless (fboundp 'select-frame-set-input-focus)
+ (defalias 'select-frame-set-input-focus 'ignore)))
+
+(eval-and-compile
+ (when (featurep 'xemacs)
+ (require 'poe)
+ (require 'poem)))
+
+;;; Things should be defined in advance:
+(eval-when-compile
+ (autoload 'w3m-fb-frame-parameter "w3m-fb")
+ (autoload 'w3m-history-restore-position "w3m-hist" nil t))
+
+;;; Control structures:
+
+(defmacro w3m-static-if (cond then &rest else)
+ "Like `if', except that it evaluates COND at compile-time."
+ (if (eval cond) then `(progn ,@else)))
+(put 'w3m-static-if 'lisp-indent-function 2)
+
+(put 'w3m-static-when 'lisp-indent-function 1)
+(defmacro w3m-static-when (cond &rest body)
+ "Like `when', but evaluate COND at compile time."
+ (if (eval cond)
+ `(progn ,@body)))
+
+(put 'w3m-static-unless 'lisp-indent-function 1)
+(defmacro w3m-static-unless (cond &rest body)
+ "Like `unless', but evaluate COND at compile time."
+ (if (eval cond)
+ nil
+ `(progn ,@body)))
+
+(defmacro w3m-static-cond (&rest clauses)
+ "Like `cond', except that it evaluates CONDITION part of each clause at
+compile-time."
+ (while (and clauses
+ (not (eval (car (car clauses)))))
+ (setq clauses (cdr clauses)))
+ (if clauses
+ (cons 'progn (cdr (car clauses)))))
+
+(put 'w3m-condition-case lisp-indent-function 2)
+(defmacro w3m-condition-case (var bodyform &rest handlers)
+ "Like `condition-case', except that signal an error if `debug-on-error'
+or `debug-on-quit' is non-nil."
+ `(if (or debug-on-error debug-on-quit)
+ ,bodyform
+ (condition-case ,var
+ ,bodyform
+ ,@handlers)))
+
+
+;;; Text props:
+
+(defmacro w3m-add-text-properties (start end props &optional object)
+ "Like `add-text-properties' but always add non-sticky properties."
+ (let ((non-stickies
+ (if (featurep 'xemacs)
+ ;; Default to start-closed and end-open in XEmacsen.
+ '(list 'start-open t)
+ ;; Default to front-nonsticky and rear-sticky in Emacsen.
+ '(list 'rear-nonsticky t))))
+ `(add-text-properties ,start ,end
+ (append ,non-stickies ,props)
+ ,object)))
+
+(defun w3m-add-face-property (start end name &optional object)
+ "Add face NAME to the face text property of the text from START to END.
+The value of the existing text property should be a list.
+If the optional fourth argument OBJECT is a buffer (or nil, which means
+the current buffer), START and END are buffer positions (integers or
+markers). If OBJECT is a string, START and END are 0-based indices
+into it."
+ (let ((pos start)
+ next prop)
+ (while (< pos end)
+ (setq prop (get-text-property pos 'face object)
+ next (next-single-property-change pos 'face object end))
+ (w3m-add-text-properties pos next (list 'face (cons name prop)) object)
+ (setq pos next))))
+
+(defun w3m-remove-face-property (start end name &optional object)
+ "Remove face NAME from the face text property of text from START to END.
+The value of the existing text property should be a list.
+If the optional fourth argument OBJECT is a buffer (or nil, which means
+the current buffer), START and END are buffer positions (integers or
+markers). If OBJECT is a string, START and END are 0-based indices
+into it."
+ (let ((pos start)
+ next prop new-prop elem)
+ (while (< pos end)
+ (setq prop (get-text-property pos 'face object))
+ (setq next (next-single-property-change pos 'face object end))
+ (setq new-prop nil)
+ (while prop
+ (setq elem (pop prop))
+ (unless (eq elem name)
+ (push elem new-prop)))
+ (when new-prop
+ (w3m-add-text-properties pos next
+ (list 'face new-prop)))
+ (setq pos next))))
+
+(defmacro w3m-get-text-property-around (prop)
+ "Search for the text property PROP in one character before and behind
+the current position. Return the value corresponding to PROP or nil.
+If PROP is not found at the current position, point will move to the
+position where PROP exists."
+ `(let ((position (point))
+ value)
+ (or (get-text-property position ,prop)
+ (and (not (bolp))
+ (setq value (get-text-property (1- position) ,prop))
+ (goto-char (1- position))
+ value)
+ (and (not (eolp))
+ (setq value (get-text-property (1+ position) ,prop))
+ (goto-char (1+ position))
+ value))))
+
+(defmacro w3m-action (&optional position)
+ "Return the value of the `w3m-action' property at the given POSITION.
+NOTE: If POSITION is omitted, it searches for the property in one
+character before and behind the current position, and point will move
+to the position where the property exists."
+ (if position
+ `(get-text-property ,position 'w3m-action)
+ `(w3m-get-text-property-around 'w3m-action)))
+
+(defmacro w3m-anchor (&optional position)
+ "Return the value of the `w3m-href-anchor' property at the given POSITION.
+NOTE: If POSITION is omitted, it searches for the property in one
+character before and behind the current position, and point will move
+to the position where the property exists."
+ (if position
+ `(get-text-property ,position 'w3m-href-anchor)
+ `(w3m-get-text-property-around 'w3m-href-anchor)))
+
+(defmacro w3m-image (&optional position)
+ "Return the value of the `w3m-image' property at the given POSITION.
+NOTE: If POSITION is omitted, it searches for the property in one
+character before and behind the current position, and point will move
+to the position where the property exists."
+ (if position
+ `(get-text-property ,position 'w3m-image)
+ `(w3m-get-text-property-around 'w3m-image)))
+
+(defmacro w3m-image-alt (&optional position)
+ "Return the value of the `w3m-image-alt' property at the given POSITION.
+NOTE: If POSITION is omitted, it searches for the property in one
+character before and behind the current position, and point will move
+to the position where the property exists."
+ (if position
+ `(get-text-property ,position 'w3m-image-alt)
+ `(w3m-get-text-property-around 'w3m-image-alt)))
+
+(defmacro w3m-submit (&optional position)
+ "Return the value of the `w3m-submit' property at the given POSITION.
+NOTE: If POSITION is omitted, it searches for the property in one
+character before and behind the current position, and point will move
+to the position where the property exists."
+ (if position
+ `(get-text-property ,position 'w3m-submit)
+ `(w3m-get-text-property-around 'w3m-submit)))
+
+(defmacro w3m-anchor-sequence (&optional position)
+ "Return the value of the `w3m-anchor-sequence' property at POSITION.
+If POSITION is omitted, the current position is assumed."
+ (if position
+ `(get-text-property ,position 'w3m-anchor-sequence)
+ '(get-text-property (point) 'w3m-anchor-sequence)))
+
+
+;;; Attributes:
+
+(eval-and-compile
+ ;; `eval-and-compile' is necessary since the value of the constant
+ ;; is referred to at the compile time.
+ (defconst w3m-html-string-regexp
+ "\\(\"\\([^\"]+\\)\"\\|'\\([^']+\\)'\\|[^\"'<> \t\r\f\n]*\\)"
+ "Regexp matching a string of the field-value like <a href=\"VALUE\">."))
+
+(put 'w3m-parse-attributes 'lisp-indent-function '1)
+(def-edebug-spec w3m-parse-attributes
+ ((&rest &or (symbolp &optional symbolp) symbolp) body))
+(defmacro w3m-parse-attributes (attributes &rest forms)
+ "Extract ATTRIBUTES, KEYWORD=\"VALUE\" pairs, in a tag and run FORMS.
+ATTRIBUTES is a list of symbols that looks like `(KEYWORD KEYWORD...)'.
+A symbol KEYWORD, that will express a value extracted from a tag, can
+be used as a Lisp variable within FORMS. The point has to be within
+a tag initially, and only attributes that follow the point will be
+extracted.
+
+The value of KEYWORD is a string by default, or is nil if the KEYWORD
+is not found in a tag. KEYWORD can be `(KEYWORD TYPE)', where TYPE is
+one of `:case-ignore', `:integer', `:bool', and `:decode-entity'.
+Those types mean converting the value into a lower-case string,
+an integer, a boolean (t or nil), and a decoded string respectively."
+ `(let (,@(mapcar (lambda (attr)
+ (if (listp attr)
+ (car attr)
+ attr))
+ attributes))
+ (skip-chars-forward " \t\r\f\n")
+ (while
+ (cond
+ ,@(mapcar
+ (lambda (attr)
+ (or (symbolp attr)
+ (and (listp attr)
+ (<= (length attr) 2)
+ (symbolp (car attr)))
+ (error "Internal error, type mismatch"))
+ (let ((sexp (quote
+ (w3m-remove-redundant-spaces
+ (or (match-string-no-properties 2)
+ (match-string-no-properties 3)
+ (match-string-no-properties 1)))))
+ type)
+ (when (listp attr)
+ (setq type (nth 1 attr))
+ (cond
+ ((eq type :case-ignore)
+ (setq sexp (list 'downcase sexp)))
+ ((eq type :integer)
+ (setq sexp (list 'string-to-number sexp)))
+ ((eq type :bool)
+ (setq sexp t))
+ ((eq type :decode-entity)
+ (setq sexp (list 'w3m-decode-entities-string sexp)))
+ ((nth 1 attr)
+ (error "Internal error, unknown modifier")))
+ (setq attr (car attr)))
+ `((looking-at
+ ,(if (eq type :bool)
+ (format "%s\\(?:[ \t\r\f\n]*=[ \t\r\f\n]*%s\\)?"
+ (symbol-name attr)
+ w3m-html-string-regexp)
+ (format "%s[ \t\r\f\n]*=[ \t\r\f\n]*%s"
+ (symbol-name attr)
+ w3m-html-string-regexp)))
+ (setq ,attr ,sexp))))
+ attributes)
+ ((looking-at ,(concat "[A-Za-z]*[ \t\r\f\n]*=[ \t\r\f\n]*"
+ w3m-html-string-regexp)))
+ ((looking-at "[^<> \t\r\f\n]+")))
+ (goto-char (match-end 0))
+ (skip-chars-forward " \t\r\f\n"))
+ (skip-chars-forward "^>")
+ (forward-char)
+ ,@forms))
+
+
+;;; Working buffers:
+
+(defun w3m-get-buffer-create (name)
+ "Return the buffer named NAME, or create such a buffer and return it."
+ (or (get-buffer name)
+ (let ((buf (get-buffer-create name)))
+ (setq w3m-work-buffer-list (cons buf w3m-work-buffer-list))
+ (buffer-disable-undo buf)
+ buf)))
+
+(defun w3m-kill-buffer (buffer)
+ "Kill the buffer BUFFER and remove it from `w3m-work-buffer-list'.
+The argument may be a buffer or may be the name of a buffer.
+An argument of nil means kill the current buffer."
+ (unless buffer
+ (setq buffer (current-buffer)))
+ (when (stringp buffer)
+ (setq buffer (get-buffer buffer)))
+ (when (buffer-live-p buffer)
+ (kill-buffer buffer))
+ (setq w3m-work-buffer-list (delq buffer w3m-work-buffer-list))
+ nil)
+
+(defun w3m-kill-all-buffer ()
+ "Kill all working buffer."
+ (dolist (buf w3m-work-buffer-list)
+ (when (buffer-live-p buf)
+ (kill-buffer buf)))
+ (setq w3m-work-buffer-list nil))
+
+(defun w3m-current-title ()
+ "Return the title of the current buffer."
+ (cond
+ (w3m-current-process
+ "<retrieving>")
+ ((and (stringp w3m-current-title)
+ (not (string= w3m-current-title "<no-title>")))
+ w3m-current-title)
+ ((stringp w3m-current-url)
+ (directory-file-name
+ (if (string-match "^[^/:]+:/+" w3m-current-url)
+ (substring w3m-current-url (match-end 0))
+ w3m-current-url)))
+ (t "<no-title>")))
+
+(defun w3m-buffer-title (buffer)
+ "Return the title of the buffer BUFFER."
+ (with-current-buffer buffer
+ (w3m-current-title)))
+
+(defun w3m-buffer-number (buffer)
+ (when (and (bufferp buffer)
+ (string-match "\\*w3m\\*\\(<\\([0-9]+\\)>\\)?\\'"
+ (buffer-name buffer)))
+ (if (match-beginning 1)
+ (string-to-number (match-string 2 (buffer-name buffer)))
+ 1))) ;; `1' should not be represented in the buffer name.
+
+(defun w3m-buffer-set-number (buffer number)
+ (with-current-buffer buffer
+ (let ((newname (if w3m-use-title-buffer-name
+ (if (= number 1)
+ (format "%s *w3m*" (w3m-current-title))
+ (format "%s *w3m*<%d>" (w3m-current-title) number))
+ (if (= number 1)
+ "*w3m*"
+ (format "*w3m*<%d>" number)))))
+ (if (eq (w3m-buffer-number buffer) number)
+ (when w3m-use-title-buffer-name
+ (unless (get-buffer newname)
+ (rename-buffer newname)))
+ (unless (get-buffer newname)
+ (rename-buffer newname))))))
+
+(defun w3m-buffer-name-add-title ()
+ "Add current tile to buffer name."
+ (when w3m-use-title-buffer-name
+ (let ((number (w3m-buffer-number (current-buffer)))
+ newname)
+ (if (= number 1)
+ (setq newname (format "%s *w3m*" (w3m-current-title)))
+ (setq newname (format "%s *w3m*<%d>" (w3m-current-title) number)))
+ (rename-buffer newname))))
+
+(defun w3m-generate-new-buffer (name)
+ (if w3m-use-title-buffer-name
+ (let* ((maxbuf (let ((w3m-fb-mode nil))
+ (car (nreverse (w3m-list-buffers)))))
+ (number (w3m-buffer-number maxbuf)))
+ (when (string-match "\\*w3m\\*\\(<\\([0-9]+\\)>\\)?\\'" name)
+ (setq name "*w3m*"))
+ (if (and maxbuf number)
+ (generate-new-buffer (format "%s<%d>" name (1+ number)))
+ (generate-new-buffer name)))
+ (generate-new-buffer name)))
+
+(defun w3m-buffer-name-lessp (x y)
+ "Return t if first arg buffer's name is less than second."
+ (when (bufferp x)
+ (setq x (buffer-name x)))
+ (when (bufferp y)
+ (setq y (buffer-name y)))
+ (if (and (string-match "\\*w3m\\*\\(<\\([0-9]+\\)>\\)?\\'" x)
+ (setq x (cons x
+ (if (match-beginning 1)
+ (string-to-number (match-string 2 x))
+ 1))))
+ (if (string-match "\\*w3m\\*\\(<\\([0-9]+\\)>\\)?\\'" y)
+ (< (cdr x)
+ (if (match-beginning 1)
+ (string-to-number (match-string 2 y))
+ 1))
+ (string< (car x) y))
+ (string< x y)))
+
+(defun w3m-list-buffers (&optional nosort)
+ "Return a list of buffers in which emacs-w3m sessions are open.
+If the optional NOSORT is nil, the list is sorted in the order of
+buffer names."
+ (let ((buffers (buffer-list))
+ buffer rest)
+ (save-current-buffer
+ (while buffers
+ (set-buffer (setq buffer (pop buffers)))
+ (when (eq major-mode 'w3m-mode)
+ (push buffer rest))))
+ (setq buffers (if nosort
+ (nreverse rest)
+ (sort rest #'w3m-buffer-name-lessp)))
+ (when (and (boundp 'w3m-fb-mode)
+ w3m-fb-mode
+ (if (or w3m-pop-up-frames
+ (not (memq 'w3m-fb-add w3m-mode-hook)))
+ ;; `w3m-fb-mode' might have been set by something
+ ;; other than the `w3m-fb-mode' function.
+ (setq w3m-fb-mode nil)
+ t))
+ ;; Don't just return `w3m-fb-buffer-list' for the selected frame
+ ;; because `buffers' may have been sorted.
+ (let ((fbs (w3m-fb-frame-parameter w3m-fb-list-buffers-frame
+ 'w3m-fb-buffer-list)))
+ (setq rest buffers)
+ (while rest
+ (unless (memq (setq buffer (pop rest)) fbs)
+ (setq buffers (delq buffer buffers))))))
+ buffers))
+
+
+;;; Pop up and delete buffers, windows or frames:
+
+(defmacro w3m-popup-frame-parameters ()
+ "Return a pop-up frame plist if this file is compiled for XEmacs,
+otherwise return an alist."
+ (if (featurep 'xemacs)
+ '(let ((params (or w3m-popup-frame-parameters pop-up-frame-plist)))
+ (if (consp (car-safe params))
+ (alist-to-plist params)
+ params))
+ '(let ((params (or w3m-popup-frame-parameters pop-up-frame-alist))
+ alist)
+ (if (consp (car-safe params))
+ params
+ (while params
+ (push (cons (car params) (cdr params)) alist)
+ (setq params (cddr params)))
+ (nreverse alist)))))
+
+(defun w3m-device-on-window-system-p ()
+ "Return non-nil if the selected frame is on a widnow system"
+ (w3m-static-if (featurep 'xemacs)
+ (device-on-window-system-p)
+ window-system))
+
+(defmacro w3m-popup-frame-p ()
+ "Return non-nil if `w3m-pop-up-frames' is non-nil and Emacs really
+supports separate frames."
+ '(and w3m-pop-up-frames (w3m-device-on-window-system-p)))
+
+(defmacro w3m-use-tab-p ()
+ "Return non-nil if `w3m-use-tab' is non-nil and Emacs really supports
+the tabs line."
+ (cond ((featurep 'xemacs)
+ '(and w3m-use-tab (device-on-window-system-p)))
+ (t
+ 'w3m-use-tab)))
+
+(defun w3m-lefttab-exist-p (&optional buffer)
+ (not (eq (or buffer (current-buffer)) (car (w3m-list-buffers)))))
+
+(defun w3m-righttab-exist-p (&optional buffer)
+ (let ((bufs (w3m-list-buffers))
+ (cbuf (or buffer (current-buffer)))
+ buf)
+ (catch 'exist
+ (while (setq buf (car bufs))
+ (setq bufs (cdr bufs))
+ (when (eq cbuf buf)
+ (throw 'exist bufs))))))
+
+(defmacro w3m-popup-window-p ()
+ "Return non-nil if `w3m-pop-up-windows' is non-nil and the present
+situation allows it."
+ '(and w3m-pop-up-windows
+ (not (w3m-use-tab-p))
+ (not (get-buffer-window w3m-select-buffer-name))))
+
+(defvar w3m-initial-frames nil
+ "Variable used to keep a list of the frame-IDs when emacs-w3m sessions
+are popped-up as new frames. This variable is used for the control
+for not deleting frames made for aims other than emacs-w3m sessions.")
+(make-variable-buffer-local 'w3m-initial-frames)
+
+(defun w3m-popup-buffer (buffer)
+ "Pop up BUFFER as a new window or a new frame
+according to `w3m-pop-up-windows' and `w3m-pop-up-frames' (which see)."
+ (let ((window (get-buffer-window buffer t))
+ (oframe (selected-frame))
+ (popup-frame-p (w3m-popup-frame-p))
+ frame pop-up-frames buffers other)
+ (if (setq
+ pop-up-frames
+ (if window ;; The window showing BUFFER already exists.
+ ;; Don't pop up a new frame if it is just the current frame.
+ (not (eq (setq frame (window-frame window)) oframe))
+ ;; There is no window for BUFFER, so look for the existing
+ ;; emacs-w3m window if the tabs line is enabled or the
+ ;; selection window exists (i.e., we can reuse it).
+ (if (or (w3m-use-tab-p)
+ (get-buffer-window w3m-select-buffer-name t))
+ (progn
+ (setq buffers (delq buffer (w3m-list-buffers t)))
+ (while (and (not window)
+ buffers)
+ (setq window
+ (get-buffer-window (setq other (pop buffers)) t)))
+ (if window ;; The window showing another buffer exists.
+ (not (eq (setq frame (window-frame window)) oframe))
+ (setq other nil)
+ ;; There is no window after all, so leave to the value
+ ;; of `w3m-pop-up-frames' whether to pop up a new frame.
+ popup-frame-p))
+ ;; Ditto.
+ popup-frame-p)))
+ (progn
+ (cond (other
+ ;; Pop up another emacs-w3m buffer and switch to BUFFER.
+ (pop-to-buffer other)
+ ;; Change the value for BUFFER's `w3m-initial-frames'.
+ (setq w3m-initial-frames
+ (prog1
+ (copy-sequence w3m-initial-frames)
+ (switch-to-buffer buffer))))
+ (frame
+ ;; Pop up the existing frame which shows BUFFER.
+ (pop-to-buffer buffer))
+ (t
+ ;; Pop up a new frame.
+ (let* ((pop-up-frame-alist (w3m-popup-frame-parameters))
+ (pop-up-frame-plist pop-up-frame-alist))
+ (pop-to-buffer buffer))
+ (setq frame (window-frame (get-buffer-window buffer t)))))
+ ;; Raise, select and focus the frame.
+ (if (fboundp 'select-frame-set-input-focus)
+ (select-frame-set-input-focus frame)
+ (raise-frame frame)
+ (select-frame frame)
+ (w3m-static-when (featurep 'xemacs)
+ (focus-frame frame)))
+ (w3m-history-restore-position))
+ (unless (prog1
+ (eq buffer (current-buffer))
+ ;; Simply switch to BUFFER in the current frame.
+ (if (w3m-popup-window-p)
+ (let ((pop-up-windows t))
+ (pop-to-buffer buffer))
+ (switch-to-buffer buffer)))
+ (w3m-history-restore-position)))))
+
+(eval-when-compile
+ (when (and (fboundp 'select-frame-set-input-focus)
+ (eq (symbol-function 'select-frame-set-input-focus) 'ignore))
+ (fmakunbound 'select-frame-set-input-focus)))
+
+(defun w3m-add-w3m-initial-frames (&optional frame)
+ "Add FRAME into `w3m-initial-frames', the buffer-local variable.
+It is done when FRAME is newly created for the emacs-w3m session.
+This function is added to the hook which is different with the Emacs
+version as follows:
+
+XEmacs `create-frame-hook'
+Emacs 21,22 `after-make-frame-functions'
+Emacs 19 `after-make-frame-hook'
+
+Note that `after-make-frame-hook' doesn't take an argument."
+ (unless frame
+ (setq frame (selected-frame)))
+ ;; Share the opened frame in `w3m-initial-frames' over all emacs-w3m
+ ;; buffers if `w3m-use-tab' is non-nil. Otherwise, the frame is
+ ;; appended into `w3m-initial-frames' only in the current buffer.
+ (with-current-buffer (window-buffer (frame-first-window frame))
+ (when (eq major-mode 'w3m-mode)
+ (unless (memq frame w3m-initial-frames)
+ (push frame w3m-initial-frames))
+ (when w3m-use-tab
+ (dolist (buffer (delq (current-buffer) (w3m-list-buffers t)))
+ (set-buffer buffer)
+ (unless (memq frame w3m-initial-frames)
+ (push frame w3m-initial-frames)))))))
+
+(add-hook (if (featurep 'xemacs)
+ 'create-frame-hook
+ 'after-make-frame-functions)
+ 'w3m-add-w3m-initial-frames)
+
+(defun w3m-delete-w3m-initial-frames (frame)
+ "Delete FRAME from `w3m-initial-frames', the buffer-local variable.
+It is done when the FRAME in which emacs-w3m is running is deleted.
+This function is added to `delete-frame-hook' (`delete-frame-functions'
+is used instead in Emacs 22) or merged into the `delete-frame' function
+using `defadvice'."
+ (save-current-buffer
+ (dolist (buffer (w3m-list-buffers t))
+ (set-buffer buffer)
+ (setq w3m-initial-frames (delq frame w3m-initial-frames)))))
+
+(cond ((boundp 'delete-frame-functions)
+ (add-hook 'delete-frame-functions 'w3m-delete-w3m-initial-frames))
+ (t
+ (add-hook 'delete-frame-hook 'w3m-delete-w3m-initial-frames)))
+
+(defun w3m-delete-frames-and-windows (&optional exception)
+ "Delete all frames and windows related to emacs-w3m buffers.
+If EXCEPTION is a buffer, a window or a frame, it and related visible
+objects will not be deleted. There are special cases; the following
+objects will not be deleted:
+
+1. The sole frame in the display device.
+2. Frames created not for emacs-w3m sessions.
+3. Frames showing not only emacs-w3m sessions but also other windows.\
+"
+ (let ((buffers (delq exception (w3m-list-buffers t)))
+ buffer windows window frame one-window-p flag)
+ (save-current-buffer
+ (while buffers
+ (setq buffer (pop buffers)
+ windows (delq exception
+ (get-buffer-window-list buffer 'no-minibuf t)))
+ (set-buffer buffer)
+ (while windows
+ (setq window (pop windows)
+ frame (window-frame window))
+ (when (and frame
+ (not (eq frame exception)))
+ (setq one-window-p
+ (w3m-static-if (featurep 'xemacs)
+ (one-window-p t frame)
+ ;; Emulate XEmacs version's `one-window-p'.
+ (prog2
+ (setq flag nil)
+ (catch 'exceeded
+ (walk-windows (lambda (w)
+ (when (eq (window-frame w) frame)
+ (if flag
+ (throw 'exceeded nil)
+ (setq flag t))))
+ 'no-minibuf t)
+ flag)
+ (set-buffer buffer))))
+ (if (and (memq frame w3m-initial-frames)
+ (not (eq (next-frame frame) frame)))
+ (if (or
+ ;; A frame having the sole window can be deleted.
+ one-window-p
+ ;; Also a frame having only windows for emacs-w3m
+ ;; sessions or the buffer selection can be deleted.
+ (progn
+ (setq flag t)
+ (walk-windows
+ (lambda (w)
+ (when flag
+ (if (eq w exception)
+ (setq flag nil)
+ (set-buffer (window-buffer w))
+ (setq flag (or (memq major-mode
+ '(w3m-mode
+ w3m-select-buffer-mode
+ w3m-session-select-mode))
+ (string-match "\\` ?\\*w3m[ -]"
+ (buffer-name)))))))
+ 'no-minibuf)
+ (set-buffer buffer)
+ flag))
+ (delete-frame frame)
+ (delete-window window))
+ (unless one-window-p
+ (delete-window window)))))))))
+
+
+;;; Miscellaneous:
+
+(defconst w3m-url-fallback-base "http:///")
+(defconst w3m-url-invalid-regexp "\\`http:///")
+
+(defun w3m-url-valid (url)
+ (and url (not (string-match w3m-url-invalid-regexp url))
+ url))
+
+(defmacro w3m-set-match-data (list)
+ "Same as the `set-match-data'; convert points into markers under XEmacs."
+ (if (featurep 'xemacs)
+ `(let ((list ,list))
+ (store-match-data (dolist (pt (prog1 list (setq list nil))
+ (nreverse list))
+ (push (if (markerp pt)
+ pt
+ (set-marker (make-marker) pt))
+ list))))
+ `(set-match-data ,list)))
+
+(defun w3m-search-tag-1 (regexp)
+ "Subroutine used by `w3m-search-tag'."
+ (let ((start (point))
+ begin end)
+ (if (and (re-search-forward regexp nil t)
+ (setq begin (match-beginning 0)
+ end (match-end 0))
+ (or (looking-at "/?>")
+ (and (looking-at "[ \t\f\n]")
+ (search-forward ">" nil t))))
+ (prog1
+ (goto-char (match-end 0))
+ (w3m-set-match-data
+ (cond ((= end (match-beginning 0))
+ (list begin (match-end 0)
+ (1+ begin) end))
+ ((eq (char-before (match-beginning 0)) ?/)
+ (if (= end (1- (match-beginning 0)))
+ (list begin (match-end 0)
+ (1+ begin) end)
+ (list begin (match-end 0)
+ (1+ begin) end
+ end (- (match-end 0) 2))))
+ (t
+ (list begin (match-end 0)
+ (1+ begin) end
+ end (1- (match-end 0)))))))
+ (set-match-data nil)
+ (goto-char start)
+ nil)))
+
+(defmacro w3m-search-tag (&rest names)
+ "Search forward for a tag which begins with one of NAMES.
+This macro generates the form equivalent to:
+
+\(re-search-forward \"<\\\\(NAMES\\\\)\\\\([ \\t\\f\\n]+[^>]*\\\\)?/?>\" nil t)
+
+but it works even if the tag is considerably large.
+
+Note: this macro allows only strings for NAMES, that is, a form
+something like `(if foo \"bar\" \"baz\")' cannot be used."
+ `(w3m-search-tag-1 ,(concat "<" (regexp-opt names t))))
+
+(defun w3m-string-match-url-components-1 (string)
+ "Subroutine used by `w3m-string-match-url-components'."
+
+ ;; ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
+ ;; 12 3 4 5 6 7 8 9
+
+ (let ((md (make-vector 20 nil))
+ pt)
+ (with-temp-buffer
+ (w3m-static-unless (featurep 'xemacs)
+ (set-buffer-multibyte (multibyte-string-p string)))
+ (insert string)
+ (goto-char (point-min))
+ (aset md 0 0)
+ (aset md 1 (1- (point-max)))
+ (when (looking-at "[^:/?#]+:")
+ (aset md 2 0)
+ (aset md 4 0)
+ (goto-char (match-end 0))
+ (aset md 3 (setq pt (1- (point))))
+ (aset md 5 (1- pt)))
+ (when (looking-at "//")
+ (aset md 6 (1- (point)))
+ (forward-char 2)
+ (aset md 8 (1- (point)))
+ (skip-chars-forward "^/?#")
+ (aset md 7 (setq pt (1- (point))))
+ (aset md 9 pt))
+ (aset md 10 (1- (point)))
+ (skip-chars-forward "^?#")
+ (aset md 11 (setq pt (1- (point))))
+ (when (eq (char-after) ??)
+ (aset md 12 pt)
+ (forward-char 1)
+ (aset md 14 (1- (point)))
+ (skip-chars-forward "^#")
+ (aset md 13 (setq pt (1- (point))))
+ (aset md 15 pt))
+ (unless (eobp)
+ (aset md 16 (1- (point)))
+ (aset md 18 (point))
+ (aset md 17 (setq pt (1- (point-max))))
+ (aset md 19 pt)))
+ (set-match-data (append md nil)))
+ 0)
+
+(defconst w3m-url-components-regexp
+ "\\`\\(\\([^:/?#]+\\):\\)?\\(//\\([^/?#]*\\)\\)?\
+\\([^?#]*\\)\\(\\?\\([^#]*\\)\\)?\\(#\\(.*\\)\\)?\\'"
+ "Regexp used for parsing a URI Reference.
+It matches the potential four components and fragment identifier of a
+URI reference. See RFC2396, Appendix B for details.")
+
+(defmacro w3m-string-match-url-components (string)
+ "Do the same thing as `(string-match w3m-url-components-regexp STRING)'.
+But this function should work even if STRING is considerably long."
+ `(let ((string ,string))
+ (condition-case nil
+ (string-match w3m-url-components-regexp string)
+ (error ;; Stack overflow in regexp matcher
+ (w3m-string-match-url-components-1 string)))))
+
+(defun w3m-time-newer-p (a b)
+ "Return t, if A is newer than B. Otherwise return nil.
+A and B are lists which represent time in Emacs-style. If value is
+nil, it is regarded as the oldest time."
+ (and a
+ (or (not b)
+ (or (> (car a) (car b))
+ (and (= (car a) (car b))
+ (> (nth 1 a) (nth 1 b)))))))
+
+(defun w3m-time-lapse-seconds (start end)
+ "Return lapse seconds from START to END.
+START and END are lists which represent time in Emacs-style."
+ (+ (* (- (car end) (car start)) 65536)
+ (cadr end)
+ (- (cadr start))))
+
+(defalias 'w3m-float-time
+ (if (fboundp 'float-time)
+ 'float-time
+ (lambda (&optional specified-time)
+ "Return the current time, as a float number of seconds since the epoch.
+If an argument is given, it specifies a time to convert to float
+instead of the current time. The argument should have the forms:
+ (HIGH . LOW) or (HIGH LOW USEC) or (HIGH LOW . USEC).
+
+WARNING: Since the result is floating point, it may not be exact.
+Do not use this function if precise time stamps are required."
+ (let ((time (or specified-time (current-time))))
+ (+ (* (car time) 65536.0)
+ (cadr time)
+ (cond ((consp (setq time (cddr time)))
+ (/ (car time) 1000000.0))
+ (time
+ (/ time 1000000.0))
+ (t
+ 0)))))))
+
+(defun w3m-url-local-p (url)
+ "If URL points a file on the local system, return non-nil value.
+Otherwise return nil."
+ (string-match "\\`file:" url))
+
+(defconst w3m-url-authinfo-regexp
+ "\\`\\([^:/?#]+:\\)?//\\([^/?#:]+\\)\\(?::\\([^/?#@]+\\)\\)?@"
+ "Regular expression for parsing the authentication part of a URI reference")
+
+(defun w3m-url-authinfo (url)
+ "Return a user name and a password to authenticate URL."
+ (when (string-match w3m-url-authinfo-regexp url)
+ (cons (match-string 2 url)
+ (match-string 3 url))))
+
+(defun w3m-url-strip-authinfo (url)
+ "Remove the authentication part from the URL."
+ (if (string-match w3m-url-authinfo-regexp url)
+ (concat (match-string 1 url)
+ "//"
+ (substring url (match-end 0)))
+ url))
+
+(defun w3m-url-strip-fragment (url)
+ "Remove the fragment identifier from the URL."
+ (if (string-match "\\`\\([^#]*\\)#" url)
+ (match-string 1 url)
+ url))
+
+(defun w3m-url-strip-query (url)
+ "Remove the query part and the fragment identifier from the URL."
+ (if (string-match "\\`\\([^?#]*\\)[?#]" url)
+ (match-string 1 url)
+ url))
+
+(defun w3m-get-server-hostname (url)
+ "Extract a server root from URL."
+ (when (string-match "\\`about://[^/?#]+/" url)
+ (setq url (substring url (match-end 0))))
+ (setq url (w3m-url-strip-authinfo url))
+ (if (string-match "\\`[^:/?#]+://\\([^/?#]+\\)" url)
+ (downcase (match-string 1 url))
+ url))
+
+(defun w3m-which-command (command)
+ (when (stringp command)
+ (if (and (file-name-absolute-p command)
+ (file-executable-p command))
+ command
+ (setq command (file-name-nondirectory command))
+ (catch 'found-command
+ (let (bin)
+ (dolist (dir exec-path)
+ (setq bin (expand-file-name command dir))
+ (when (or (and (file-executable-p bin)
+ (not (file-directory-p bin)))
+ (and (file-executable-p (setq bin (concat bin ".exe")))
+ (not (file-directory-p bin))))
+ (throw 'found-command bin))))))))
+
+(defun w3m-cancel-refresh-timer (&optional buffer)
+ "Cancel the timer for REFRESH attribute in META tag."
+ (when w3m-use-refresh
+ (with-current-buffer (or buffer (current-buffer))
+ (setq w3m-current-refresh nil)
+ (when w3m-refresh-timer
+ (w3m-static-if (featurep 'xemacs)
+ (delete-itimer w3m-refresh-timer)
+ (cancel-timer w3m-refresh-timer))
+ (setq w3m-refresh-timer nil)))))
+
+(cond ((featurep 'xemacs)
+ ;; The function of the XEmacs version doesn't work correctly
+ ;; for wide characters.
+ (defun w3m-truncate-string (str end-column)
+ "Truncate string STR to end at column END-COLUMN."
+ (let ((len (length str))
+ (column 0)
+ (idx 0))
+ (condition-case nil
+ (while (< column end-column)
+ (setq column (+ column (char-width (aref str idx)))
+ idx (1+ idx)))
+ (args-out-of-range (setq idx len)))
+ (when (> column end-column)
+ (setq idx (1- idx)))
+ (substring str 0 idx))))
+ (t
+ (defalias 'w3m-truncate-string 'truncate-string-to-width)))
+
+(defun w3m-assoc-ignore-case (name alist)
+ "Return the element of ALIST whose car equals NAME ignoring its case."
+ (let ((dname (downcase name))
+ match)
+ (while alist
+ (when (and (consp (car alist))
+ (string= dname (downcase (car (car alist)))))
+ (setq match (car alist)
+ alist nil))
+ (setq alist (cdr alist)))
+ match))
+
+(defun w3m-prin1 (object &optional stream)
+ "Like `prin1', except that control chars will be represented with ^ as
+`cat -v' does."
+ (if (stringp object)
+ (let (rest)
+ (dolist (char (append object nil) rest)
+ (cond ((eq char ?\C-?)
+ (push "^?" rest))
+ ((or (memq char '(?\t ?\n))
+ (>= char ?\ ))
+ (push (char-to-string char) rest))
+ (t
+ (push (concat "^" (char-to-string (+ 64 char))) rest))))
+ (prin1 (apply 'concat (nreverse rest)) stream))
+ (prin1 object stream)))
+
+(defun w3m-modify-plist (plist &rest properties)
+ "Change values in PLIST corresponding to PROPERTIES. This is similar
+to `plist-put', but handles plural symbol and value pairs and remove
+pairs from PLIST whose value is nil."
+ (while properties
+ (setq plist (plist-put plist (car properties) (cadr properties))
+ properties (cddr properties)))
+ (while plist
+ (if (cadr plist)
+ (setq properties (nconc properties (list (car plist) (cadr plist)))))
+ (setq plist (cddr plist)))
+ properties)
+
+(def-edebug-spec w3m-insert-string (form))
+(defmacro w3m-insert-string (string)
+ "Insert STRING at point without conversions in either case the
+multibyteness of the buffer."
+ (if (and (fboundp 'string-as-multibyte)
+ (subrp (symbol-function 'string-as-multibyte)))
+ `(let ((string ,string))
+ (insert (if enable-multibyte-characters
+ (string-as-multibyte string)
+ (string-as-unibyte string))))
+ `(insert ,string)))
+
+(defun w3m-custom-hook-initialize (symbol value)
+ "Initialize the hook option pointed by the SYMBOL with the default VALUE."
+ (if (boundp symbol)
+ (progn
+ (setq value (eval value))
+ (while value
+ (add-hook symbol (car value))
+ (setq value (cdr value))))
+ (custom-initialize-set symbol value)))
+
+(defun w3m-run-mode-hooks (&rest funcs)
+ "Run `run-mode-hooks' if it is available, otherwise `run-hooks'."
+ (if (fboundp 'run-mode-hooks)
+ (apply 'run-mode-hooks funcs)
+ (apply 'run-hooks funcs)))
+
+(defmacro w3m-keep-region-active ()
+ "Keep the region active after evaluating this current command.
+In XEmacs, `zmacs-region-stays' is set to nil everywhen a command is
+evaluated. This means that the region is always deactivated after
+evaluating the current command. This macro sets t to it, and keeps
+the region active."
+ (when (featurep 'xemacs)
+ '(if (interactive-p)
+ (setq zmacs-region-stays t))))
+
+(defmacro w3m-deactivate-region ()
+ "Deactivate the region."
+ (if (featurep 'xemacs)
+ '(zmacs-deactivate-region)
+ '(deactivate-mark)))
+
+(defmacro w3m-region-active-p ()
+ "Say whether the region is active."
+ (if (fboundp 'region-active-p)
+ (list 'region-active-p)
+ (list 'and 'transient-mark-mode 'mark-active)))
+
+(eval-and-compile
+ (cond
+ ((fboundp 'replace-regexp-in-string)
+ (defun w3m-replace-in-string (string regexp newtext &optional literal)
+ ;;(replace-regexp-in-string regexp newtext string nil literal)))
+ ;;
+ ;; Don't call the symbol function `replace-regexp-in-string' directly
+ ;; in order to silence the byte-compiler when an Emacs which doesn't
+ ;; provide it is used. The following form generates exactly the same
+ ;; byte-code.
+ (funcall (symbol-function 'replace-regexp-in-string)
+ regexp newtext string nil literal)))
+ (t
+ (defalias 'w3m-replace-in-string 'replace-in-string))))
+
+(if (fboundp 'compare-strings)
+ (defalias 'w3m-compare-strings 'compare-strings)
+ (defun w3m-compare-strings (string1 start1 end1 string2 start2 end2)
+ "Compare the contents of two strings."
+ (let* ((str1 (substring string1 start1 end1))
+ (str2 (substring string2 start2 end2))
+ (len (min (length str1) (length str2)))
+ (i 0))
+ (if (string= str1 str2)
+ t
+ (setq i (catch 'ignore
+ (while (< i len)
+ (when (not (eq (aref str1 i) (aref str2 i)))
+ (throw 'ignore i))
+ (setq i (1+ i)))
+ i))
+ (1+ i)))))
+
+(eval-and-compile
+ ;; This function will be redefined in w3m-ems.el.
+ (unless (fboundp 'w3m-force-window-update)
+ (defalias 'w3m-force-window-update 'ignore)))
+
+(if (boundp 'header-line-format)
+ (defun w3m-force-window-update-later (buffer &optional seconds)
+ "Update the header-line appearance in BUFFER after SECONDS.
+If SECONDS is omitted, it defaults to 0.5."
+ (run-at-time (or seconds 0.5) nil
+ (lambda (buffer)
+ (when (and (buffer-live-p buffer)
+ (eq (get-buffer-window buffer t)
+ (selected-window)))
+ (w3m-force-window-update)))
+ buffer))
+ (defalias 'w3m-force-window-update-later 'ignore))
+
+(if (fboundp 'read-number)
+ (defalias 'w3m-read-number 'read-number)
+ (defun w3m-read-number (prompt &optional default)
+ "Read a numeric value in the minibuffer, prompting with PROMPT.
+DEFAULT specifies a default value to return if the user just types RET.
+The value of DEFAULT is inserted into PROMPT."
+ (let ((n nil))
+ (when default
+ (setq prompt
+ (if (string-match "\\(\\):[ \t]*\\'" prompt)
+ (replace-match (format " (default %s)" default) t t prompt 1)
+ (w3m-replace-in-string prompt "[ \t]*\\'"
+ (format " (default %s) " default)
+ t))))
+ (while
+ (progn
+ (let ((str (read-from-minibuffer
+ prompt nil nil nil nil
+ (and default (number-to-string default)))))
+ (condition-case nil
+ (setq n (cond
+ ((zerop (length str)) default)
+ ((stringp str) (read str))))
+ (error nil)))
+ (unless (numberp n)
+ (message "Please enter a number.")
+ (sit-for 1)
+ t)))
+ n)))
+
+(defun w3m-make-menu-item (japan english)
+ "Make menu item."
+ (cond
+ ((and w3m-use-japanese-menu (featurep 'xemacs))
+ (concat japan "%_ "))
+ (w3m-use-japanese-menu
+ japan)
+ (t
+ english)))
+
+(defvar w3m-make-menu-commands-keys nil)
+
+(defun w3m-make-menu-commands (menu-commands)
+ "Make menu items."
+ (mapcar
+ (lambda (c)
+ (if (consp c)
+ (vector
+ (cadr c)
+ (if (nth 3 c)
+ `(progn
+ (switch-to-buffer w3m-tab-button-menu-current-buffer)
+ (funcall (function ,(car c)) ,@(nthcdr 4 c)))
+ `(save-window-excursion
+ (switch-to-buffer w3m-tab-button-menu-current-buffer)
+ (funcall (function ,(car c)) ,@(nthcdr 4 c))))
+ :active (nth 2 c)
+ :keys (or (and (assq (car c) w3m-make-menu-commands-keys)
+ (cdr (assq (car c) w3m-make-menu-commands-keys)))
+ (let ((key (where-is-internal (car c) w3m-mode-map)))
+ (when key
+ (setq w3m-make-menu-commands-keys
+ (cons (cons (car c)
+ (key-description (car key)))
+ w3m-make-menu-commands-keys))
+ (cdr (car w3m-make-menu-commands-keys))))))
+ (symbol-name c)))
+ menu-commands))
+
+(eval-when-compile (require 'wid-edit))
+(defun w3m-widget-type-convert-widget (widget)
+ "Convert the car of `:args' as a widget type in WIDGET."
+ (apply 'widget-convert (widget-type widget)
+ (eval (car (widget-get widget :args)))))
+
+(defun w3m-unseen-buffer-p (buffer)
+ "Return t if buffer unseen."
+ (with-current-buffer buffer
+ w3m-buffer-unseen))
+
+(defun w3m-visited-file-modtime ()
+ "Replacement of `visited-file-modtime'.
+It returns a list of two integers if the current buffer visits a file,
+otherwise returns the number 0. In modern Emacsen, this function will
+get to be the alias to `visited-file-modtime'."
+ (let ((modtime (visited-file-modtime)))
+ (cond ((consp (cdr-safe modtime))
+ (defalias 'w3m-visited-file-modtime 'visited-file-modtime)
+ modtime)
+ ((integerp (cdr-safe modtime))
+ ;; XEmacs version returns `(0 . 0)' if no file is visited.
+ (if (and (= (car modtime) 0) (= (cdr modtime) 0))
+ 0
+ (list (car modtime) (cdr modtime))))
+ (t
+ modtime))))
+
+;;; Punycode RFC 3492:
+
+(defconst w3m-puny-code-regex "xn--\\([-0-9a-zA-z]+\\)")
+(defconst w3m-puny-code-nonascii "[^\000-\177]")
+
+(defconst w3m-puny-base 36)
+(defconst w3m-puny-tmin 1)
+(defconst w3m-puny-tmax 26)
+(defconst w3m-puny-damp 700)
+(defconst w3m-puny-skew 38)
+(defconst w3m-puny-initial-bias 72)
+(defconst w3m-puny-initial-n 128)
+(defconst w3m-puny-delimiter ?-)
+
+(defun w3m-puny-adapt (delta numpoints firsttime)
+ (let ((k 0))
+ (if firsttime
+ (setq delta (/ delta w3m-puny-damp))
+ (setq delta (/ delta 2)))
+ (setq delta (+ delta (/ delta numpoints)))
+ (while (> delta (/ (* (- w3m-puny-base w3m-puny-tmin) w3m-puny-tmax) 2))
+ (setq delta (/ delta (- w3m-puny-base w3m-puny-tmin)))
+ (setq k (+ k w3m-puny-base)))
+ (+ k (/ (* (1+ (- w3m-puny-base w3m-puny-tmin)) delta) (+ delta w3m-puny-skew)))))
+
+(defun w3m-puny-decode-digit (cp)
+ (if (< (- cp 48) 10)
+ (- cp 22)
+ (if (< (- cp 65) 26)
+ (- cp 65)
+ (if (< (- cp 97) 26)
+ (- cp 97)
+ w3m-puny-base))))
+
+(defun w3m-puny-encode-digit (d)
+ (if (< d 26)
+ (+ d 22 75) ;; a-z
+ (+ d 22))) ;; 0-9
+
+(defun w3m-puny-decode1 (input)
+ (let* ((n w3m-puny-initial-n)
+ (bias w3m-puny-initial-bias)
+ (len (length input))
+ (in 0) (out 0)
+ (i 0) (b 0)
+ digit thr oldi w k output ret)
+ (dotimes (j len)
+ (if (= (aref input j) w3m-puny-delimiter) (setq b j)))
+ (dotimes (j b)
+ (setq output (cons (aref input j) output))
+ (setq out (1+ out)))
+ (setq output (nreverse output))
+ (if (> b 0) (setq in (1+ b)) (setq in 0))
+ (while (< in len)
+ (setq oldi i)
+ (setq w 1)
+ (setq k w3m-puny-base)
+ (catch 'loop
+ (while t
+ (if (>= in len) (error "punycode bad input"))
+ (setq digit (w3m-puny-decode-digit (aref input in)))
+ (if (>= digit w3m-puny-base) (error "punycode bad input"))
+ (setq in (1+ in))
+ (setq i (+ i (* digit w)))
+ (if (<= k bias)
+ (setq thr w3m-puny-tmin)
+ (if (>= k (+ bias w3m-puny-tmax))
+ (setq thr w3m-puny-tmax)
+ (setq thr (- k bias))))
+ (if (< digit thr) (throw 'loop nil))
+ (setq w (* w (- w3m-puny-base thr)))
+ (setq k (+ k w3m-puny-base))))
+ (setq out (1+ out))
+ (setq bias (w3m-puny-adapt (- i oldi) out (= oldi 0)))
+ (setq n (+ n (/ i out)))
+ (setq i (% i out))
+ (if (= i 0)
+ (setq output (cons n (nthcdr i output)))
+ (setcdr (nthcdr (1- i) output) (cons n (nthcdr i output))))
+ (setq i (1+ i)))
+ (setq ret (make-string (* out 2) ?a))
+ (let ((j 0))
+ (dolist (op output)
+ (aset ret j (/ op 256))
+ (setq j (1+ j))
+ (aset ret j (% op 256))
+ (setq j (1+ j))))
+ ret))
+
+(defun w3m-puny-decode (input)
+ (condition-case nil
+ (save-match-data
+ (decode-coding-string
+ (w3m-puny-decode1 (substring input 4)) ;; xn--
+ w3m-puny-utf-16be))
+ (error input)))
+
+(defun w3m-puny-decode-url (url)
+ "Decode URL from punycode."
+ (let ((case-fold-search t)
+ prot host after)
+ (when (and w3m-puny-utf-16be
+ (string-match w3m-puny-code-regex url))
+ (when (string-match "\\`[^:/]+://\\([^/]+\\)" url)
+ (setq prot (substring url 0 (match-beginning 1)))
+ (setq host (substring url (match-beginning 1) (match-end 1)))
+ (setq after (substring url (match-end 0)))
+ (while (string-match w3m-puny-code-regex host)
+ (setq host
+ (concat (substring host 0 (match-beginning 0))
+ (w3m-puny-decode
+ (substring host (match-beginning 0) (match-end 0)))
+ (substring host (match-end 0)))))
+ (setq url (concat prot host after))))
+ url))
+
+(defun w3m-puny-encode1 (input)
+ (let* ((len (length input))
+ (h-len (/ len 2))
+ (n w3m-puny-initial-n)
+ (bias w3m-puny-initial-bias)
+ (delta 0) (out 0)
+ (output (make-string (* len 4) ?a))
+ h b m q k thr uni)
+ (dotimes (j len)
+ (setq uni (aref input j))
+ (setq j (1+ j))
+ (setq uni (+ (* uni 256) (aref input j)))
+ (when (< uni 128) ;; basic
+ (aset output out uni)
+ (setq out (1+ out))))
+ (setq h out)
+ (setq b out)
+ (when (> b 0)
+ (aset output out w3m-puny-delimiter)
+ (setq out (1+ out)))
+ (while (< h h-len)
+ (setq m 65536) ;; 17bits
+ (dotimes (j len)
+ (setq uni (aref input j))
+ (setq j (1+ j))
+ (setq uni (+ (* uni 256) (aref input j)))
+ (if (and (>= uni n) (< uni m)) (setq m uni)))
+ (setq delta (+ delta (* (- m n) (1+ h))))
+ (setq n m)
+ (dotimes (j len)
+ (setq uni (aref input j))
+ (setq j (1+ j))
+ (setq uni (+ (* uni 256) (aref input j)))
+ (when (< uni n)
+ (setq delta (1+ delta))
+ (if (= delta 0) (error "punycode overflow")))
+ (when (= uni n)
+ (setq q delta)
+ (setq k w3m-puny-base)
+ (catch 'loop
+ (while t
+ (if (<= k bias)
+ (setq thr w3m-puny-tmin)
+ (if (>= k (+ bias w3m-puny-tmax))
+ (setq thr w3m-puny-tmax)
+ (setq thr (- k bias))))
+ (if (< q thr) (throw 'loop nil))
+ (aset output out (w3m-puny-encode-digit (+ thr (% (- q thr) (- w3m-puny-base thr)))))
+ (setq out (1+ out))
+ (setq q (/ (- q thr) (- w3m-puny-base thr)))
+ (setq k (+ k w3m-puny-base))))
+ (aset output out (w3m-puny-encode-digit q))
+ (setq out (1+ out))
+ (setq bias (w3m-puny-adapt delta (1+ h) (= h b)))
+ (setq delta 0)
+ (setq h (1+ h))))
+ (setq delta (1+ delta))
+ (setq n (1+ n)))
+ (substring output 0 out)))
+
+(defun w3m-puny-encode (input)
+ (condition-case nil
+ (concat "xn--" (w3m-puny-encode1
+ (encode-coding-string input w3m-puny-utf-16be)))
+ (error input)))
+
+(defun w3m-puny-encode-url (url)
+ "Encode URL to punycode."
+ (if (and w3m-puny-utf-16be
+ (not (w3m-url-local-p url))
+ (string-match w3m-puny-code-nonascii url))
+ (let (beg end idn)
+ (with-temp-buffer
+ (insert url)
+ (goto-char (point-min))
+ (if (search-forward "://" nil t)
+ (setq beg (point))
+ (setq beg (point-min)))
+ (if (search-forward "/" nil t)
+ (setq end (1- (point)))
+ (setq end (point-max)))
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (while (re-search-forward "[^.]?[^.\000-\177][^.]*" nil t)
+ (setq idn (match-string-no-properties 0))
+ (delete-region (match-beginning 0) (match-end 0))
+ (insert (w3m-puny-encode idn))))
+ (buffer-substring-no-properties (point-min) (point-max))))
+ url))
+
+(provide 'w3m-util)
+
+;;; w3m-util.el ends here
diff --git a/share/emacs/site-lisp/w3m/w3m-weather.el b/share/emacs/site-lisp/w3m/w3m-weather.el
new file mode 100644
index 00000000000..a74884a3b67
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m-weather.el
@@ -0,0 +1,510 @@
+;;; w3m-weather.el --- Look weather forecast -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 2001, 2002, 2003, 2005
+;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is a part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; w3m-weather.el is the add-on program of emacs-w3m to look weather
+;; foracast. For more detail about emacs-w3m, see:
+;;
+;; http://emacs-w3m.namazu.org/
+
+
+;;; How to install:
+
+;; Please put this file to appropriate directory, and if you want
+;; byte-compile it. And add following lisp expressions to your
+;; ~/.emacs.
+;;
+;; (autoload 'w3m-weather "w3m-weather" "Display weather report." t)
+
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(require 'w3m)
+
+(defconst w3m-weather-completion-table
+ (eval-when-compile
+ (let* ((format "http://weather.yahoo.co.jp/weather/jp/%s.html")
+ (alist
+ '(;; URL$B$N0lIt(B, $B4A;zI=5-(B, $B%m!<%^;zI=5-(B, $BJLL>(B
+ ;; ($B%m!<%^;zI=5-$G$OD92;$r>JN,$7$J$$$3$H(B)
+ ("1a/1100" "$BF;KL!&=!C+(B" "douhokusouya" "souya")
+ ("1a/1200" "$BF;KL!&>e@n(B" "douhokukamikawa" "kamikawa")
+ ("1a/1300" "$BF;KL!&N1K((B" "douhokurumoi" "rumoi")
+ ("1c/1710" "$BF;El!&LVAv(B" "doutouabashiri" "abashiri")
+ ("1c/1720" "$BF;El!&KL8+(B" "doutoukitami" "kitami")
+ ("1c/1730" "$BF;El!&LfJL(B" "doutoumonbetsu" "monbetsu")
+ ("1c/1800" "$BF;El!&:,<<(B" "doutounemuro" "nemuro")
+ ("1c/1900" "$BF;El!&6|O)(B" "doutoukushiro" "kushiro")
+ ("1c/2000" "$BF;El!&==>!(B" "doutoutokachi" "tokachi")
+ ("1b/1400" "$BF;1{!&@P<m(B" "dououishikari" "ishikari")
+ ("1b/1500" "$BF;1{!&6uCN(B" "douousorachi" "sorachi")
+ ("1b/1600" "$BF;1{!&8e;V(B" "dououshiribeshi" "shiribeshi")
+ ("1d/2400" "$BF;Fn!&I0;3(B" "dounanhiyama" "hiyama")
+ ("1d/2100" "$BF;Fn!&C@?6(B" "dounaniburi" "iburi")
+ ("1d/2200" "$BF;Fn!&F|9b(B" "dounanhidaka" "hidaka")
+ ("1d/2300" "$BF;Fn!&EOEg(B" "dounanoshima" "oshima")
+ ("1d/2400" "$BF;Fn!&[X;3(B" "dounanhiyama" "hiyama")
+ ("2/3110" "$B@D?98)!&DE7Z(B" "aomorikentsugaru" "tsugaru")
+ ("2/3120" "$B@D?98)!&2<KL(B" "aomorikenshimokita" "shimokita")
+ ("2/3130" "$B@D?98)!&;0H,>eKL(B"
+ "aomorikensanpachikamikita" "sanpachikamikita")
+ ("3/3310" "$B4d<j8)!&FbN&It(B" "iwatekennairikubu")
+ ("3/3320" "$B4d<j8)!&1h4_KLIt(B" "iwatekenenganhokubu")
+ ("3/3330" "$B4d<j8)!&1h4_FnIt(B" "iwatekenengannanbu")
+ ("5/3210" "$B=)ED8)!&1h4_It(B" "akitakenenganbu")
+ ("5/3220" "$B=)ED8)!&FbN&It(B" "akitakennairikubu")
+ ("4/3410" "$B5\>k8)!&ElIt(B" "miyagikentoubu")
+ ("4/3420" "$B5\>k8)!&@>It(B" "miyagikenseibu")
+ ("6/3510" "$B;37A8)!&B<;3(B" "yamagatakenmurayama" "murayama")
+ ("6/3520" "$B;37A8)!&CV;r(B" "yamagatakenokitama" "okitama")
+ ("6/3530" "$B;37A8)!&>1Fb(B" "yamagatakenshonai" "shounai")
+ ("6/3540" "$B;37A8)!&:G>e(B" "yamagatakenmogami" "mogami")
+ ("7/3610" "$BJ!Eg8)!&CfDL$j(B" "hukushimakennakadoori" "nakadoori")
+ ("7/3620" "$BJ!Eg8)!&IMDL$j(B" "hukushimakenhamadoori" "hamadoori")
+ ("7/3630" "$BJ!Eg8)!&2qDE(B" "hukushimakenaidu" "aidu")
+ ("8/4010" "$B0q>k8)!&KLIt(B" "ibaragikenhokubu")
+ ("8/4020" "$B0q>k8)!&FnIt(B" "ibaragikennanbu")
+ ("9/4110" "$BFJLZ8)!&FnIt(B" "tochigikennanbu")
+ ("9/4120" "$BFJLZ8)!&KLIt(B" "tochigikenhokubu")
+ ("10/4210" "$B72GO8)!&FnIt(B" "gunmakennanbu")
+ ("10/4220" "$B72GO8)!&KLIt(B" "gunmakenhokubu")
+ ("11/4310" "$B:k6L8)!&FnIt(B" "saitamakennanbu")
+ ("11/4320" "$B:k6L8)!&KLIt(B" "saitamakenhokubu")
+ ("11/4330" "$B:k6L8)!&CaIc(B" "saitamakenchichibu")
+ ("12/4510" "$B@iMU8)!&KL@>It(B" "chibakenhokuseibu")
+ ("12/4520" "$B@iMU8)!&KLElIt(B" "chibakenhokutoubu")
+ ("12/4530" "$B@iMU8)!&FnIt(B" "chibakennanbu")
+ ("13/4410" "$BEl5~ET!&El5~(B" "toukyoutotoukyou" "toukyou")
+ ("13/4420" "$BEl5~ET!&0KF&=tEgKLIt(B"
+ "toukyoutoizushotouhokubu" "izushotouhokubu")
+ ("13/100" "$BEl5~ET!&0KF&=tEgFnIt(B"
+ "toukyoutoizushotounanbu" "izushotounanbu")
+ ("13/9600" "$BEl5~ET!&>.3^86=tEg(B"
+ "toukyoutoogasawarashotou" "ogasawarashotou")
+ ("14/4610" "$B?@F`@n8)!&ElIt(B" "kanagawakentoubu")
+ ("14/4620" "$B?@F`@n8)!&@>It(B" "kanagawakenseibu")
+ ("15/5410" "$B?73c8)!&2<1[(B" "niigatakenkaetsu" "kaetsu")
+ ("15/5420" "$B?73c8)!&Cf1[(B" "niigatakenchuuetsu" "chuuetsu")
+ ("15/5430" "$B?73c8)!&>e1[(B" "niigatakenjouetsu" "jouetsu")
+ ("15/5440" "$B?73c8)!&:4EO(B" "niigatakensado" "sado")
+ ("16/5510" "$BIY;38)!&ElIt(B" "toyamakentoubu")
+ ("16/5520" "$BIY;38)!&@>It(B" "toyamakenseibu")
+ ("17/5610" "$B@P@n8)!&2C2l(B" "ishikawakenkaga" "kaga")
+ ("17/5620" "$B@P@n8)!&G=EP(B" "ishikawakennoto" "noto")
+ ("18/5710" "$BJ!0f8)!&NfKL(B" "hukuikenreihoku" "reihoku")
+ ("18/5720" "$BJ!0f8)!&NfFn(B" "hukuikenreinan" "reinan")
+ ("19/4910" "$B;3M|8)!&Cf@>It(B" "yamanashikenchuuseibu")
+ ("19/4920" "$B;3M|8)!&IY;N8^8P(B" "yamanashikenhujigoko" "hujigoko")
+ ("20/4810" "$BD9Ln8)!&KLIt(B" "naganokenhokubu")
+ ("20/4820" "$BD9Ln8)!&CfIt(B" "naganokenchuubu")
+ ("20/4830" "$BD9Ln8)!&FnIt(B" "naganokennanbu")
+ ("21/5210" "$B4tIl8)!&H~G;(B" "gihukenmino" "mino")
+ ("21/5220" "$B4tIl8)!&HtBM(B" "gihukenhida" "hida")
+ ("22/5010" "$B@E2,8)!&CfIt(B" "shizuokakenchuubu")
+ ("22/5020" "$B@E2,8)!&0KF&(B" "shizuokakenizu" "izu")
+ ("22/5030" "$B@E2,8)!&ElIt(B" "shizuokakentoubu")
+ ("22/5040" "$B@E2,8)!&@>It(B" "shizuokakenseibu")
+ ("23/5110" "$B0&CN8)!&@>It(B" "aichikenseibu")
+ ("23/5120" "$B0&CN8)!&ElIt(B" "aichikentoubu")
+ ("24/5310" "$B;0=E8)!&KLCfIt(B" "miekenhokuchuubu")
+ ("24/5320" "$B;0=E8)!&FnIt(B" "miekennanbu")
+ ("25/6010" "$B<"2l8)!&FnIt(B" "shigakennanbu")
+ ("25/6020" "$B<"2l8)!&KLIt(B" "shigakenhokubu")
+ ("26/400" "$B5~ETI\!&KLIt(B" "kyoutohuhokubu")
+ ("26/6100" "$B5~ETI\!&FnIt(B" "kyoutohunanbu")
+ ("27/6200" "$BBg:eI\(B" "oosakahu" "oosaka")
+ ("28/500" "$BJ<8K8)!&KLIt(B" "hyougokenhokubu")
+ ("28/6300" "$BJ<8K8)!&FnIt(B" "hyougokennanbu")
+ ("29/6410" "$BF`NI8)!&KLIt(B" "narakenhokubu")
+ ("29/6420" "$BF`NI8)!&FnIt(B" "narakennanbu")
+ ("30/6510" "$BOB2N;38)!&KLIt(B" "wakayamakenhokubu")
+ ("30/6520" "$BOB2N;38)!&FnIt(B" "wakayamakennanbu")
+ ("31/6910" "$BD;<h8)!&ElIt(B" "tottorikentoubu")
+ ("31/6920" "$BD;<h8)!&@>It(B" "tottorikenseibu")
+ ("32/600" "$BEg:,8)!&1#4t(B" "shimanekenoki" "oki")
+ ("32/6810" "$BEg:,8)!&ElIt(B" "shimanekentoubu")
+ ("32/6820" "$BEg:,8)!&@>It(B" "shimanekenseibu")
+ ("33/6610" "$B2,;38)!&FnIt(B" "okayamakennanbu")
+ ("33/6620" "$B2,;38)!&KLIt(B" "okayamakenhokubu")
+ ("34/6710" "$B9-Eg8)!&FnIt(B" "hiroshimakennanbu")
+ ("34/6720" "$B9-Eg8)!&KLIt(B" "hiroshimakenhokubu")
+ ("35/8110" "$B;38}8)!&@>It(B" "yamaguchikenseibu")
+ ("35/8120" "$B;38}8)!&CfIt(B" "yamaguchikenchuubu")
+ ("35/8140" "$B;38}8)!&KLIt(B" "yamaguchikenhokubu")
+ ("35/8130" "$B;38}8)!&ElIt(B" "yamaguchikentoubu")
+ ("36/7110" "$BFAEg8)!&KLIt(B" "tokushimakenhokubu")
+ ("36/7120" "$BFAEg8)!&FnIt(B" "tokushimakennanbu")
+ ("37/7200" "$B9a@n8)(B" "kagawaken" "kagawa")
+ ("38/7320" "$B0&I28)!&ElM=(B" "ehimekentouyo" "touyo")
+ ("38/7330" "$B0&I28)!&FnM=(B" "ehimekennanyo" "nanyo")
+ ("38/7310" "$B0&I28)!&CfM=(B" "ehimekenchuuyo" "chuuyo")
+ ("39/7410" "$B9bCN8)!&CfIt(B" "kouchikenchuubu")
+ ("39/7420" "$B9bCN8)!&ElIt(B" "kouchikentoubu")
+ ("39/7430" "$B9bCN8)!&@>It(B" "kouchikenseibu")
+ ("40/8210" "$BJ!2,8)!&J!2,(B" "hukuokakenhukuoka" "hukuoka")
+ ("40/8220" "$BJ!2,8)!&KL6e=#(B" "hukuokakenkitakyushu" "kitakyuushu")
+ ("40/8230" "$BJ!2,8)!&C^K-(B" "hukuokakenchikuhou" "chikuhou")
+ ("40/8240" "$BJ!2,8)!&C^8e(B" "hukuokakenchikugo" "chikugo")
+ ("41/8510" "$B:42l8)!&FnIt(B" "sagakennanbu")
+ ("41/8520" "$B:42l8)!&KLIt(B" "sagakenhokubu")
+ ("42/700" "$BD9:j8)!&0m4tBPGO(B"
+ "nagasakikenikitsushima" "iki" "tsushima" "ikitsushima")
+ ("42/800" "$BD9:j8)!&8^Eg(B" "nagasakikengotou" "gotou")
+ ("42/8410" "$BD9:j8)!&FnIt(B" "nagasakikennanbu")
+ ("42/8420" "$BD9:j8)!&KLIt(B" "nagasakikenhokubu")
+ ("43/8610" "$B7'K\8)!&7'K\(B" "kumamotokenkumamoto" "kumamoto")
+ ("43/8620" "$B7'K\8)!&0$AI(B" "kumamotokenaso" "aso")
+ ("43/8630" "$B7'K\8)!&E7Ap02KL(B"
+ "kumamotokenamakusaashikita" "amakusa" "ashikita" "amakusaashikita")
+ ("43/8640" "$B7'K\8)!&5eKa(B" "kumamotokenkuma" "kuma")
+ ("44/8310" "$BBgJ,8)!&CfIt(B" "ooitakenchuubu")
+ ("44/8320" "$BBgJ,8)!&KLIt(B" "ooitakenhokubu")
+ ("44/8330" "$BBgJ,8)!&@>It(B" "ooitakenseibu")
+ ("44/8340" "$BBgJ,8)!&FnIt(B" "ooitakennanbu")
+ ("45/8710" "$B5\:j8)!&FnItJ?LnIt(B" "miyazakikennanbuheiyabu")
+ ("45/8720" "$B5\:j8)!&KLItJ?LnIt(B" "miyazakikenhokubuheiyabu")
+ ("45/8730" "$B5\:j8)!&FnIt;31h$$(B" "miyazakikennanbuyamazoi")
+ ("45/8740" "$B5\:j8)!&KLIt;31h$$(B" "miyazakikenhokubuyamazoi")
+ ("46/8810" "$B</;yEg8)!&;'K`(B" "kagoshimakensatsuma" "satsuma")
+ ("46/8820" "$B</;yEg8)!&Bg6y(B" "kagoshimakenoosumi" "oosumi")
+ ("46/900" "$B</;yEg8)!&<o;REg!&205WEg(B"
+ "kagoshimakentanegashimayakushima" "tanegashima" "yakushima" "tanegashimayakushima")
+ ("46/1000" "$B</;yEg8)!&1bH~(B" "kagoshimakenamami" "amami")
+ ("47/9110" "$B2-Fl8)!&K\EgCfFnIt(B"
+ "okinawakenhontouchuunanbu" "hontouchuunanbu")
+ ("47/9120" "$B2-Fl8)!&K\EgKLIt(B"
+ "okinawakenhontouhokubu" "hontouhokubu")
+ ("47/9130" "$B2-Fl8)!&5WJFEg(B" "okinawakenkumejima" "kumejima")
+ ("47/9200" "$B2-Fl8)!&BgElEg(B" "okinawakendaitoujima" "daitoujima")
+ ("47/9300" "$B2-Fl8)!&5\8EEg(B" "okinawakenmiyakojima" "miyakojima")
+ ("47/9400" "$B2-Fl8)!&@P3@Eg(B"
+ "okinawakenishigakijima" "ishigakijima")
+ ("47/9500" "$B2-Fl8)!&M?Fa9qEg(B"
+ "okinawakenyonagunijima" "yonagunijima")))
+ (table)
+ ;; $B%X%\%s<0$H71Na<0$NBP1~I=(B
+ (hepburn-table
+ (let (table)
+ (dolist (x '(("si" "shi")
+ ("zi" "ji")
+ ("zu" "du")
+ ("ti" "chi")
+ ("tu" "tsu")
+ ("hu" "fu")))
+ (push x table)
+ (push (reverse x)table))
+ (dolist (x '(("sy" . "sh")
+ ("zy" . "j")
+ ("ty" . "ch")))
+ (dolist (y '("a" "u" "o"))
+ (push (list (concat (car x) y) (concat (cdr x) y)) table)
+ (push (list (concat (cdr x) y) (concat (car x) y)) table)))
+ table))
+ ;; $BBP1~I=$K>h$C$F$$$kJ8;zNs$rC5$9@55,I=8=(B
+ (hepburn-regexp
+ (format "\\(?:\\`\\|[aiueo]\\)\\(n\\([^aiueoy]\\)\\|%s\\)"
+ (regexp-opt (mapcar (function car) hepburn-table))))
+ ;; $BD92;$NM-L5$K$h$kGI@87A$NI=(B
+ (prolonged-table
+ (let (table)
+ (dolist (x '("k" "ky"
+ "s" "sy" "sh"
+ "t" "ty" "ch"
+ "n" "ny"
+ "h" "hy"
+ "m" "my"
+ "y"
+ "r" "ry"
+ "w"
+ "g" "gy"
+ "z" "zy" "j"
+ "d" "dy"
+ "b" "by"
+ "p" "py"))
+ (let ((long-vowels '("ou" "oo" "o-")))
+ (dolist (y long-vowels)
+ (push (cons (concat x y)
+ (append
+ (mapcar
+ (lambda (z) (concat x z))
+ (delete y (copy-sequence long-vowels)))
+ (list (concat x "o"))))
+ table)))
+ (push (list (concat x "uu") (concat x "u"))
+ table))
+ table))
+ ;; $BGI@87A$NI=$K>h$C$F$$$kJ8;zNs$rC5$9@55,I=8=(B
+ (prolonged-regexp (format "\\(?:\\`\\|[aiueo]\\)\\(%s\\)"
+ (regexp-opt (mapcar (function car)
+ prolonged-table)))))
+ (labels ((hepburn-candidates
+ (str)
+ "$B%X%\%s<0$H71Na<0$N:9$K$h$C$F@8$8$kGI@87A$rF@$k(B"
+ (if (string-match hepburn-regexp str)
+ (let ((prefix (substring str 0 (match-beginning 1)))
+ (candidates (if (match-beginning 2)
+ '("n" "nn")
+ (assoc (match-string 1 str)
+ hepburn-table)))
+ (suffixes
+ (hepburn-candidates
+ (substring str (or (match-beginning 2)
+ (match-end 0)))))
+ (buf))
+ (dolist (x candidates)
+ (dolist (y suffixes)
+ (push (concat prefix x y) buf)))
+ buf)
+ (list str)))
+ (prolonged-candidates
+ (str)
+ "$BD92;$NM-L5$K$h$C$F@8$8$kGI@87A$rF@$k(B"
+ (let (buf)
+ (if (string-match prolonged-regexp str)
+ (let ((prefix (substring str 0 (match-beginning 1)))
+ (candidates (assoc (match-string 1 str)
+ prolonged-table))
+ (suffixes (prolonged-candidates
+ (substring str (match-end 0)))))
+ (dolist (x candidates)
+ (dolist (y suffixes)
+ (push (concat prefix x y) buf))))
+ (setq buf (list str)))
+ (dolist (x buf)
+ (when (string-match "\\(\\`\\|[aiue]\\)oo" x)
+ (let ((prefix (substring x 0 (match-end 1)))
+ (suffix (substring x (match-end 0))))
+ (dolist (y '("o" "oh" "o-"))
+ (push (concat prefix y suffix) buf)))))
+ buf))
+ (romaji-candidates
+ (str)
+ "$BA4$F$NGI@87A$rF@$k(B"
+ (let (buf)
+ (dolist (x (hepburn-candidates str))
+ (dolist (y (prolonged-candidates x))
+ (push y buf)))
+ buf)))
+ (dolist (area alist)
+ (let ((url (format format (car area)))
+ (kanji (cadr area)))
+ (push (list kanji (nth 2 area) url) table)
+ (dolist (romaji (cddr area))
+ (dolist (x (romaji-candidates romaji))
+ (push (list x kanji) table)))))
+ (nreverse table))))
+ "Completion table of areas and urls.")
+
+(defcustom w3m-weather-default-area
+ "$B5~ETI\!&FnIt(B"
+ "Default region to check weather."
+ :group 'w3m
+ :type (cons 'radio
+ (delq nil
+ (mapcar (lambda (area)
+ (when (nth 2 area)
+ (list 'const (car area))))
+ w3m-weather-completion-table))))
+
+(defcustom w3m-weather-filter-functions
+ '(w3m-weather-extract-contents
+ w3m-weather-adjust-contents
+ w3m-weather-expand-anchors
+ w3m-weather-insert-title)
+ "Filter functions to remove useless tags."
+ :group 'w3m
+ :type 'hook)
+
+(defvar w3m-weather-input-history nil)
+
+(defun w3m-weather-input-area ()
+ (let* ((str
+ (completing-read (format "Input area (default %s): "
+ w3m-weather-default-area)
+ 'w3m-weather-area-completion nil t nil
+ 'w3m-weather-input-history))
+ (area
+ (cond
+ ((string= "" str) w3m-weather-default-area)
+ ((string-match "[^-a-zA-Z]" str) str)
+ (t (cadr (assoc str w3m-weather-completion-table))))))
+ (setq w3m-weather-input-history
+ (cons area
+ (delete area
+ (delete str w3m-weather-input-history))))
+ area))
+
+(defun w3m-weather-area-completion (partial predicate flag)
+ (if (eq flag 'lambda)
+ (and (assoc partial w3m-weather-completion-table)
+ (or (not predicate)
+ (funcall predicate partial))
+ t)
+ (let ((kanji "")
+ (romaji "")
+ (romaji-partial partial))
+ (when (string-match "\\`\\(?:[^-a-zA-Z]+\\)" partial)
+ (let ((suffix (substring partial (match-end 0))))
+ (setq kanji (substring partial 0 (match-end 0))
+ romaji (try-completion
+ ""
+ (mapcar
+ (lambda (x)
+ (list (cadr (assoc x w3m-weather-completion-table))))
+ (all-completions kanji w3m-weather-completion-table)))
+ romaji-partial (concat romaji suffix))))
+ (let ((collection)
+ (regexp
+ (and (string-match "$B!&(B\\'" kanji)
+ (string-match "[aiueo]n\\'" romaji)
+ (concat "\\`" romaji "n[^aiueoy]"))))
+ (dolist (x (all-completions romaji-partial w3m-weather-completion-table))
+ (unless (and regexp (string-match regexp x))
+ (setq x (assoc x w3m-weather-completion-table))
+ (unless (assoc (cadr x) collection)
+ (push (cons (cadr x) (car x)) collection))))
+ (cond
+ ((not flag)
+ (let ((s (try-completion kanji collection predicate)))
+ (if (and (stringp s) (string< s partial))
+ (when (setq s (try-completion romaji-partial
+ (mapcar (lambda (x) (list (cdr x)))
+ collection)
+ predicate))
+ (concat kanji (substring s (if romaji (length romaji) 0))))
+ s)))
+ ((eq flag t)
+ (all-completions kanji collection predicate)))))))
+
+;;;###autoload
+(defun w3m-weather (area)
+ "Display weather report."
+ (interactive
+ (list (if current-prefix-arg
+ (w3m-weather-input-area)
+ w3m-weather-default-area)))
+ (w3m-goto-url (format "about://weather/%s" area)))
+
+;;;###autoload
+(defun w3m-about-weather (url no-decode no-cache post-data referer handler)
+ (if (string-match "\\`about://weather/" url)
+ (lexical-let* ((url url)
+ (no-cache no-cache)
+ (area (substring url (match-end 0)))
+ (furl (nth 2 (assoc area w3m-weather-completion-table))))
+ (w3m-process-do
+ (type (w3m-retrieve furl nil no-cache nil nil handler))
+ (when type
+ (w3m-decode-buffer furl)
+ (w3m-weather-run-filter-functions w3m-weather-filter-functions
+ area furl no-cache handler))))
+ (w3m-message "Unknown URL: %s" url)
+ nil))
+
+(defun w3m-weather-run-filter-functions (functions area url no-cache handler)
+ (if functions
+ (lexical-let ((functions functions)
+ (area area)
+ (url url)
+ (no-cache no-cache))
+ (w3m-process-do
+ (nil (funcall (pop functions) area url no-cache handler))
+ (w3m-weather-run-filter-functions functions area url
+ no-cache handler)))
+ "text/html"))
+
+(defun w3m-weather-extract-contents (&rest args)
+ "Remove both header and footer in the weather forecast pages."
+ (goto-char (point-min))
+ (when (search-forward "<!---MAIN_CONTENTS_table--->" nil t)
+ (delete-region (point-min) (match-beginning 0)))
+ (goto-char (point-max))
+ (when (search-backward "<!---Local_Link--->" nil t)
+ (delete-region (match-beginning 0) (point-max))))
+
+(defun w3m-weather-adjust-contents (&rest args)
+ ;; Remove spacers.
+ (goto-char (point-min))
+ (while (search-forward "<tr><td>\
+<img src=\"http://img.yahoo.co.jp/images/clear.gif\" width=1>\
+</td></tr>" nil t)
+ (delete-region (match-beginning 0) (match-end 0)))
+ ;; Remove execessive tables.
+ (goto-char (point-min))
+ (while (re-search-forward "<table[^>]*>[ \t\r\f\n]*</table>" nil t)
+ (delete-region (match-beginning 0) (match-end 0)))
+ (goto-char (point-min))
+ ;; Remove too narrow width parameters.
+ (while (re-search-forward "<td[^>]*\\(width=1%\\)" nil t)
+ (delete-region (match-beginning 1) (match-end 1)))
+ ;; Display border lines.
+ (goto-char (point-min))
+ (while (re-search-forward "\
+<table border=\\(0\\) cellpadding=[1-9][0-9]* cellspacing=[1-9][0-9]*" nil t)
+ (goto-char (match-beginning 1))
+ (delete-char 1)
+ (insert "1"))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "<td align=center width=25%>[ \t\r\f\n]*<table border=1" nil t)
+ (delete-char -1)
+ (insert "0")))
+
+(defun w3m-weather-insert-title (area url &rest args)
+ "Insert title."
+ (goto-char (point-min))
+ (insert "<head><title>Weather forecast of "
+ area
+ "</title></head>\n"
+ "<body><p align=left><a href=\""
+ url
+ "\">[Yahoo!]</a></p>\n")
+ (goto-char (point-max))
+ (insert "</body>"))
+
+(defun w3m-weather-expand-anchors (area url &rest args)
+ ;; FIXME: $BE75$M=Js%Z!<%8$K4^$^$l$F$$$kAjBP%j%s%/$r@dBP%j%s%/$K=q$-49(B
+ ;; $B$($k$?$a$N4X?t!%$3$l$i$NAjBP%j%s%/$r0BA4$K<h$j07$&$?$a$K$O!$(Bbase
+ ;; URL $B$rJV$;$k$h$&$K!$(Babout:// $B$N9=B$$r=q$-D>$9I,MW$,$"$k$H9M$($i$l(B
+ ;; $B$k$,!$$H$j$"$($:8e2s$7!%(B
+ (goto-char (point-min))
+ (while (re-search-forward
+ (eval-when-compile
+ (concat "<a[ \t\r\f\n]+href=" w3m-html-string-regexp))
+ nil t)
+ (replace-match (format
+ "<a href=\"%s\""
+ (w3m-expand-url (w3m-remove-redundant-spaces
+ (or (match-string-no-properties 2)
+ (match-string-no-properties 3)
+ (match-string-no-properties 1)))
+ url)))))
+
+(provide 'w3m-weather)
+
+;;; w3m-weather.el ends here.
diff --git a/share/emacs/site-lisp/w3m/w3m.el b/share/emacs/site-lisp/w3m/w3m.el
new file mode 100644
index 00000000000..5f6cde7e801
--- /dev/null
+++ b/share/emacs/site-lisp/w3m/w3m.el
@@ -0,0 +1,10648 @@
+;;; w3m.el --- an Emacs interface to w3m -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+;; Authors: TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
+;; Shun-ichi GOTO <gotoh@taiyo.co.jp>,
+;; Satoru Takabayashi <satoru-t@is.aist-nara.ac.jp>,
+;; Hideyuki SHIRAI <shirai@meadowy.org>,
+;; Keisuke Nishida <kxn30@po.cwru.edu>,
+;; Yuuichi Teranishi <teranisi@gohome.org>,
+;; Akihiro Arisawa <ari@mbf.sphere.ne.jp>,
+;; Katsumi Yamaoka <yamaoka@jpl.org>,
+;; Tsuyoshi CHO <tsuyoshi_cho@ybb.ne.jp>
+;; Keywords: w3m, WWW, hypermedia
+
+;; This file is the main part of emacs-w3m.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+
+;;; Commentary:
+
+;; Emacs-w3m is an Emacs interface to the w3m program. For more
+;; detail about w3m, see:
+;;
+;; http://w3m.sourceforge.net/
+
+
+;;; How to install:
+
+;; See the README file in any case. We also recommend you check
+;; whether a newer version of w3m is released.
+;;
+;; The outline of installation is: run the `configure' script and type
+;; `make install' in the top directory of the emacs-w3m distribution.
+
+
+;;; Code:
+
+;; Developers, you must not use the cl functions (e.g., `coerce',
+;; `equalp', `merge', etc.) in any emacs-w3m or shimbun modules. To
+;; exclude run-time cl is the policy of emacs-w3m. However, XEmacs
+;; employs the cl package for all time, or those functions are
+;; possibly provided in the other modules like APEL, so you may use
+;; them only in w3m-xmas.el. Note that `caaaar', for example, is not
+;; a cl function if it is byte compiled; see cl-macs.el.
+(eval-when-compile
+ (require 'cl))
+
+(eval-when-compile
+ (unless (dolist (var nil t))
+ ;; Override the `dolist' macro which may be faultily provided by
+ ;; old egg.el.
+ (load "cl-macs" nil t)))
+
+;; The following variables will be referred to by the external modules
+;; which bind such variables only when compiling themselves. And also
+;; some modules have the `defadvice' forms including them and run
+;; `byte-compile' at run-time.
+(eval-and-compile
+ (defvar w3m-current-title nil
+ "Title of a page visiting in the current buffer.")
+ (defvar w3m-current-url nil
+ "A url of a page visiting in the current buffer."))
+
+(require 'w3m-util)
+(require 'w3m-proc)
+
+;; Silence the Emacs' byte-compiler that says ``might not be defined''.
+(eval-when-compile
+ (defalias 'w3m-setup-menu 'ignore))
+
+(eval-and-compile
+ (cond
+ ((featurep 'xemacs)
+ (require 'w3m-xmas))
+ ((>= emacs-major-version 21)
+ (require 'w3m-ems))
+ (t
+ (error "Emacs-w3m of this version no longer supports Emacs %s"
+ (mapconcat 'identity
+ (nbutlast (split-string emacs-version "\\."))
+ ".")))))
+
+(require 'w3m-fb)
+(require 'w3m-hist)
+(require 'timezone)
+
+;; Add-on programs:
+(eval-and-compile
+ (autoload 'w3m-bookmark-view "w3m-bookmark"
+ "Display the bookmark" t)
+ (autoload 'w3m-bookmark-view-new-session "w3m-bookmark"
+ "Display the bookmark on a new session" t)
+ (autoload 'w3m-bookmark-add-this-url "w3m-bookmark"
+ "Add a link under point to the bookmark." t)
+ (autoload 'w3m-bookmark-add-current-url "w3m-bookmark"
+ "Add a url of the current page to the bookmark." t)
+ (autoload 'w3m-bookmark-add-all-urls "w3m-bookmark"
+ "Add urls of all pages being visited to the bookmark." t)
+ (autoload 'w3m-search "w3m-search"
+ "Search a word using search engines." t)
+ (autoload 'w3m-search-new-session "w3m-search"
+ "Search a word using search engines in a new session." t)
+ (autoload 'w3m-search-uri-replace "w3m-search")
+ (autoload 'w3m-weather "w3m-weather"
+ "Display a weather report." t)
+ (autoload 'w3m-about-weather "w3m-weather")
+ (autoload 'w3m-antenna "w3m-antenna"
+ "Report changes of web sites." t)
+ (autoload 'w3m-antenna-add-current-url "w3m-antenna"
+ "Add a link address of the current page to the antenna database." t)
+ (autoload 'w3m-about-antenna "w3m-antenna")
+ (autoload 'w3m-dtree "w3m-dtree"
+ "Display a directory tree." t)
+ (autoload 'w3m-about-dtree "w3m-dtree")
+ (autoload 'w3m-namazu "w3m-namazu"
+ "Search files with Namazu." t)
+ (autoload 'w3m-about-namazu "w3m-namazu")
+ (autoload 'w3m-perldoc "w3m-perldoc"
+ "View Perl documents" t)
+ (autoload 'w3m-about-perldoc "w3m-perldoc")
+ (autoload 'w3m-fontify-forms "w3m-form")
+ (autoload 'w3m-fontify-textareas "w3m-form")
+ (autoload 'w3m-form-textarea-file-cleanup "w3m-form")
+ (autoload 'w3m-form-textarea-files-remove "w3m-form")
+ (autoload 'w3m-form-kill-buffer "w3m-form")
+ (autoload 'w3m-form-set-number "w3m-form")
+ (autoload 'w3m-filter "w3m-filter")
+ (autoload 'w3m-setup-tab-menu "w3m-tabmenu")
+ (autoload 'w3m-setup-bookmark-menu "w3m-bookmark")
+ (autoload 'w3m-switch-buffer "w3m-tabmenu")
+ (autoload 'w3m-cookie-set "w3m-cookie")
+ (autoload 'w3m-cookie-get "w3m-cookie")
+ (autoload 'w3m-cookie "w3m-cookie")
+ (autoload 'w3m-about-cookie "w3m-cookie")
+ (autoload 'w3m-cookie-shutdown "w3m-cookie" nil t)
+ (autoload 'report-emacs-w3m-bug "w3m-bug" nil t)
+ (autoload 'w3m-replace-symbol "w3m-symbol" nil t)
+ (autoload 'w3m-mail "w3m-mail" nil t)
+ (autoload 'w3m-go-to-linknum "w3m-lnum" nil t)
+ (autoload 'w3m-session-select "w3m-session"
+ "Select session from session list." t)
+ (autoload 'w3m-session-save "w3m-session"
+ "Save list of displayed session." t)
+ (autoload 'w3m-setup-session-menu "w3m-session")
+ (autoload 'w3m-session-automatic-save "w3m-session")
+ (autoload 'w3m-session-deleted-save "w3m-session")
+ (autoload 'w3m-session-last-autosave-session "w3m-session")
+ (autoload 'w3m-session-goto-session "w3m-session")
+ (autoload 'w3m-session-crash-recovery-save "w3m-session")
+ (autoload 'w3m-session-last-crashed-session "w3m-session"))
+
+;; Avoid byte-compile warnings.
+(eval-when-compile
+ (autoload 'doc-view-mode "doc-view" nil t)
+ (autoload 'doc-view-mode-p "doc-view")
+ (autoload 'quit-window "window" nil t)
+ (autoload 'rfc2368-parse-mailto-url "rfc2368")
+ (autoload 'widget-convert-button "wid-edit")
+ (autoload 'widget-forward "wid-edit" nil t)
+ (autoload 'widget-get "wid-edit")
+ (unless (fboundp 'char-to-int)
+ (defalias 'char-to-int 'identity))
+ (defvar doc-view-mode-map)
+ (defvar w3m-bookmark-mode)
+ (defvar w3m-bookmark-menu-items)
+ (defvar w3m-bookmark-menu-items-pre)
+ (defvar w3m-tab-menubar-make-items-preitems)
+ (defvar w3m-session-menu-items-pre)
+ (defvar w3m-session-menu-items))
+
+(defconst emacs-w3m-version
+ (eval-when-compile
+ (let ((rev "$Revision: 1.1471 $"))
+ (and (string-match "\\.\\([0-9]+\\) \\$\\'" rev)
+ (setq rev (- (string-to-number (match-string 1 rev)) 1136))
+ (format "1.4.%d" (+ rev 50)))))
+ "Version number of this package.")
+
+(defgroup w3m nil
+ "Emacs-w3m - the web browser of choice."
+ :group 'hypermedia)
+
+(defgroup w3m-face nil
+ "Faces used for emacs-w3m."
+ :group 'w3m
+ :prefix "w3m-")
+
+(defcustom w3m-command nil
+ "*Name of the executable file of the w3m command.
+You normally don't have to specify the value, since emacs-w3m looks
+for the existing commands in order of w3m, w3mmee and w3m-m17n in the
+`exec-path' directories in order if it is nil in the beginning.
+
+If you want to use the other w3m command, specify the value of this
+variable explicitly in the .emacs file or customize the value and save
+it. In this case, you need to restart Emacs and emacs-w3m. That is,
+there is currently no way to apply the changing of the w3m command to
+all the emacs-w3m programs safely after loading the w3m.elc module."
+ :group 'w3m
+ :type '(radio (const :format "Not specified " nil)
+ (string :format "Command: %v\n" :size 0)))
+
+(defcustom w3m-display-ins-del 'auto
+ "*Value of `display_ins_del' option."
+ :group 'w3m
+ :type '(radio (const :format "Delect automatically" auto)
+ (const :format "Use fontify" fontify)
+ (const :format "Use tag" tag)
+ (const :format "No have option" nil)))
+
+(defvar w3m-type nil
+ "Type of the w3m command.
+The valid values include `w3m', `w3mmee', and `w3m-m17n'.")
+(defvar w3m-compile-options nil
+ "Compile options that the w3m command was built with.")
+(defvar w3m-version nil
+ "Version string of the w3m command.")
+
+;; Set w3m-command, w3m-type, w3m-version and w3m-compile-options
+(if noninteractive ;; Don't call the external command when compiling.
+ (unless w3m-command
+ (setq w3m-command "w3m"))
+ (when (or (null w3m-command)
+ (null w3m-type)
+ (null w3m-version)
+ (null w3m-compile-options))
+ (let ((command (or w3m-command
+ (w3m-which-command "w3m")
+ (w3m-which-command "w3mmee")
+ (w3m-which-command "w3m-m17n"))))
+ (when command
+ (setq w3m-command command)
+ (with-temp-buffer
+ (call-process command nil t nil "-version")
+ (goto-char (point-min))
+ (when (re-search-forward "version \\(w3m/0\\.[3-9]\
+\\(?:\\.[0-9\\]\\)*\\(?:rc[0-9]+\\)?\
+\\(?:-stable\\|\\(?:\\+cvs\\(?:-[0-9]+\\.[0-9]+\\)?\\)\\)?\
+\\(?:-inu\\|\\(-m17n\\|\\(\\+mee\\)\\)\\)?[^,]*\\)" nil t)
+ (setq w3m-version (match-string 1))
+ (setq w3m-type
+ (cond
+ ((match-beginning 3) 'w3mmee)
+ ((match-beginning 2) 'w3m-m17n)
+ ((match-beginning 1) 'w3m)
+ (t 'other))))
+ (when (re-search-forward "options +" nil t)
+ (setq w3m-compile-options
+ (or (split-string (buffer-substring (match-end 0)
+ (point-at-eol))
+ ",")
+ (list nil)))
+ (when (member "m17n" w3m-compile-options)
+ (setq w3m-type 'w3m-m17n))))))))
+
+(when (not (stringp w3m-command))
+ (error "\
+Install w3m command in `exec-path' or set `w3m-command' variable correctly"))
+
+(defcustom w3m-user-agent (concat "Emacs-w3m/" emacs-w3m-version
+ " " w3m-version)
+ "String used for the User-Agent field. See also `w3m-add-user-agent'."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-add-user-agent t
+ "Non-nil means add the User-Agent field to the request header.
+The value of `w3m-user-agent' is used for the field body."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-language
+ (if (and (boundp 'current-language-environment)
+ ;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)".
+ (string-match "\\`Japanese"
+ (symbol-value 'current-language-environment)))
+ "Japanese")
+ "*Your preferred language used in emacs-w3m sessions."
+ :group 'w3m
+ :type '(radio (const :format "%v " "Japanese")
+ (const :tag "Other" nil))
+ :get (lambda (symbol)
+ (let ((value (format "%s" (default-value symbol)))
+ (case-fold-search t))
+ (prog1
+ (setq value (if (string-match "\\`japan" value) "Japanese"))
+ (custom-set-default symbol value))))
+ :set (lambda (symbol value)
+ (custom-set-default symbol (if (equal value "Japanese") "Japanese"))))
+
+(defcustom w3m-command-arguments
+ (if (eq w3m-type 'w3mmee) '("-o" "concurrent=0" "-F") nil)
+ "*List of the default arguments passed to the w3m command.
+See also `w3m-command-arguments-alist'."
+ :group 'w3m
+ :type '(repeat (string :format "Argument: %v\n" :size 0)))
+
+(defcustom w3m-command-arguments-alist nil
+ "*Alist of regexps matching urls and additional arguments passed to w3m.
+A typical usage of this variable is to specify whether to use the proxy
+server for the particular hosts. The first match made will be used.
+Here is an example of how to set this variable:
+
+\(setq w3m-command-arguments-alist
+ '(;; Don't use the proxy server to visit local web pages.
+ (\"^http://\\\\(?:[^/]*\\\\.\\\\)*your-company\\\\.com\\\\(?:/\\\\|$\\\\)\"
+ \"-no-proxy\")
+ ;; Use the proxy server to visit any foreign urls.
+ (\"\"
+ \"-o\" \"http_proxy=http://proxy.your-company.com:8080/\")))
+
+Where the first element matches the url that the scheme is \"http\" and
+the hostname is either \"your-company.com\" or a name ended with
+\".your-company.com\", and the proxy server is not used for those hosts.
+If you are a novice on the regexps, you can use the
+`w3m-no-proxy-domains' variable instead."
+ :group 'w3m
+ :type '(repeat (cons :format "%v" :indent 4
+ (regexp :format "%t: %v\n" :size 0)
+ (repeat :tag "Arguments passed to w3m command"
+ (string :format "Arg: %v\n" :size 0)))))
+
+(defcustom w3m-no-proxy-domains nil
+ "*List of domain names with which emacs-w3m will not use a proxy server.
+Each element should be exactly a domain name which means the latter
+common part of the host names, not a regexp."
+ :group 'w3m
+ :type '(repeat (string :format "Domain name: %v\n" :size 0)))
+
+(defcustom w3m-command-environment
+ (delq nil
+ (list
+ (if (eq w3m-type 'w3mmee)
+ (cons "W3MLANG" "ja_JP.kterm"))
+ (if (eq system-type 'windows-nt)
+ (cons "CYGWIN" "binmode tty"))))
+ "*Alist of environment variables for subprocesses to inherit."
+ :group 'w3m
+ :type '(repeat
+ (cons :format "%v" :indent 4
+ (string :format "Name: %v\n" :size 0)
+ (string :format " Value: %v\n" :size 0))))
+
+(defcustom w3m-fill-column -1
+ "*Integer used as the value for `fill-column' in emacs-w3m buffers.
+If it is positive, pages will be displayed within the columns of that
+number. If it is zero or negative, the number of columns which
+subtracted that number from the window width is applied to the maximum
+width of pages. Note that XEmacs does not always obey this setting."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-mailto-url-function nil
+ "*Function used to handle the `mailto' urls.
+Function is called with one argument, just a url. If it is nil, a
+function specified by the `mail-user-agent' variable will be used for
+composing mail messages."
+ :group 'w3m
+ :type '(radio (const :tag "Not specified" nil)
+ (function :format "%t: %v\n" :size 0)))
+
+(defcustom w3m-mailto-url-popup-function-alist
+ '((cmail-mail-mode . pop-to-buffer)
+ (mail-mode . pop-to-buffer)
+ (message-mode . pop-to-buffer)
+ (mew-draft-mode . pop-to-buffer)
+ (mh-letter-mode . pop-to-buffer)
+ (wl-draft-mode . pop-to-buffer))
+ "*Alist of (MAJOR-MODE . FUNCTION) pairs used to pop to a mail buffer up.
+If a user clicks on a `mailto' url and a mail buffer is composed by
+`mail-user-agent' with the MAJOR-MODE, FUNCTION will be called with a
+mail buffer as an argument. Note that the variables
+`special-display-buffer-names', `special-display-regexps',
+`same-window-buffer-names' and `same-window-regexps' will be bound to
+nil while popping to a buffer up."
+ :group 'w3m
+ :type '(repeat (cons :format "%v" :indent 11
+ (symbol :format "Major-mode: %v\n" :size 0)
+ (function :format "%t: %v\n" :size 0))))
+
+(defcustom w3m-use-mule-ucs
+ (and (eq w3m-type 'w3m) (featurep 'un-define))
+ "*Non-nil means use the multi-script support with Mule-UCS."
+ :group 'w3m
+ :type 'boolean
+ :require 'w3m-ucs)
+
+(when w3m-use-mule-ucs
+ (condition-case nil
+ (require 'w3m-ucs)
+ (error (setq w3m-use-mule-ucs nil))))
+
+(defcustom w3m-use-ange-ftp nil
+ "*Non-nil means that `ange-ftp' or `efs' is used to access FTP servers."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-doc-view-content-types
+ (condition-case nil
+ (delq nil (mapcar (lambda (type)
+ (if (doc-view-mode-p type)
+ (format "application/%s" type)))
+ '(dvi postscript pdf)))
+ (error nil))
+ "List of content types for which to use `doc-view-mode' to view contents.
+This overrides `w3m-content-type-alist'."
+ :group 'w3m
+ :type '(repeat (string :tag "Type" :value "application/")))
+
+(defcustom w3m-imitate-widget-button '(eq major-mode 'gnus-article-mode)
+ "*If non-nil, imitate the widget buttons on link (anchor) buttons.
+It is useful for moving about in a Gnus article buffer using TAB key.
+It can also be any Lisp form that should return a boolean value."
+ :group 'w3m
+ :type '(sexp :size 0))
+
+(defcustom w3m-treat-image-size t
+ "*Non-nil means let w3m mind the ratio of the size of images and text.
+
+If it is non-nil, the w3m command will make a halfdump which reserves
+rectangle spaces in which images will be put, and also `alt' texts
+will be truncated or padded with spaces so that their display width
+will be the same as the width of images.
+
+See also `w3m-pixels-per-character' and `w3m-pixels-per-line'. Those
+values will be passed to the w3m command in order to compute columns
+and lines which images occupy."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-pixels-per-line 64
+ "*Integer used for the `-ppl' argument of the w3m command.
+If nil, the height of the default face is used. It is valid only when
+`w3m-treat-image-size' is non-nil. Note that a small value may not
+induce a good result. If you want to use emacs-w3m in a character
+terminal and make `w3m-treat-image-size' effective, you need to set
+this variable properly."
+ :group 'w3m
+ :type '(choice (const :tag "Auto Detect" nil)
+ (integer :tag "Specify Pixels")))
+
+(defcustom w3m-pixels-per-character nil
+ "*Integer used for the `-ppc' argument of the w3m command.
+If nil, the width of the default face is used. It is valid only when
+`w3m-treat-image-size' is non-nil. If you want to use emacs-w3m in a
+character terminal and make `w3m-treat-image-size' effective, you need
+to set this variable properly."
+ :group 'w3m
+ :type '(radio (const :tag "Auto Detect" nil)
+ (integer :format "Specify Pixels: %v\n" :size 0)))
+
+(defcustom w3m-image-default-background nil
+ "Color name used as transparent color of image.
+Nil means to use the background color of the Emacs frame. The
+null string \"\" is special, that will be replaced with the
+background color of the buffer. Note that this value is effective
+only with Emacs 22 and greater."
+ :group 'w3m
+ :type '(radio (string :format "Color: %v\n" :size 0
+ :match (lambda (widget value)
+ (and (stringp value) (> (length value) 0))))
+ (const :tag "Use the background color of the Emacs frame" nil)
+ (const :tag "Null string" "")))
+
+(defvar w3m-accept-japanese-characters
+ (and (not noninteractive)
+ (featurep 'mule)
+ (or (memq w3m-type '(w3mmee w3m-m17n))
+ ;; Examine whether the w3m command specified by `w3m-command'
+ ;; uses `euc-japan' for the internal character set.
+ (let ((str
+ (eval-when-compile
+ (format
+ (concat
+ "<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">"
+ "<html><head><meta http-equiv=\"Content-Type\" "
+ "content=\"text/html; charset=ISO-2022-JP\">"
+ "</head><body>%s</body>\n")
+ (string 27 36 66 52 65 59 122 27 40 66)))))
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert str)
+ (let ((coding-system-for-write 'binary)
+ (coding-system-for-read 'binary)
+ (default-process-coding-system (cons 'binary 'binary)))
+ (call-process-region (point-min) (point-max) w3m-command
+ t t nil "-T" "text/html" "-halfdump")
+ (goto-char (point-min))
+ (and (re-search-forward (string ?\264 ?\301 ?\273 ?\372)
+ nil t)
+ t))))))
+ "Non-nil means that the w3m command accepts Japanese characters.")
+
+(defcustom w3m-coding-system (if (featurep 'mule)
+ (if (eq w3m-type 'w3mmee)
+ 'iso-2022-7bit-ss2
+ 'iso-2022-7bit)
+ 'iso-8859-1)
+ "*Default coding system used to communicate with the w3m command."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-terminal-coding-system
+ (if w3m-accept-japanese-characters
+ 'euc-japan 'iso-8859-1)
+ "*Default coding system used when writing to w3m processes.
+It is just a default value to set process' coding system initially.
+\(This variable name is analogically derived from the behavior of the
+w3m command which accepts data from Emacs just like reads from the
+terminal.)"
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-output-coding-system
+ (cond
+ ((not (featurep 'mule)) 'iso-8859-1)
+ ((eq w3m-type 'w3mmee) 'ctext)
+ ((eq w3m-type 'w3m-m17n)
+ (if (and (w3m-find-coding-system 'utf-8)
+ (not (and (equal "Japanese" w3m-language)
+ (featurep 'w3m-ems)
+ (= emacs-major-version 21))))
+ 'utf-8
+ 'iso-2022-7bit-ss2))
+ (w3m-accept-japanese-characters 'w3m-euc-japan)
+ (t 'w3m-iso-latin-1))
+ "*Coding system used when reading from w3m processes."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-input-coding-system
+ (if (memq w3m-type '(w3mmee w3m-m17n))
+ w3m-output-coding-system
+ (if w3m-accept-japanese-characters
+ (if w3m-use-mule-ucs
+ 'w3m-euc-japan-mule-ucs
+ (if (featurep 'w3m-ems)
+ 'w3m-euc-japan
+ 'euc-japan))
+ (if w3m-use-mule-ucs
+ 'w3m-iso-latin-1-mule-ucs
+ (if (featurep 'w3m-ems)
+ 'w3m-iso-latin-1
+ 'iso-8859-1))))
+ "*Coding system used when writing to w3m processes.
+It overrides `coding-system-for-write' if it is not `binary'.
+Otherwise, the value of the `w3m-current-coding-system' variable is
+used instead."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-file-coding-system (if (featurep 'mule)
+ 'iso-2022-7bit
+ 'iso-8859-1)
+ "*Coding system used when writing configuration files.
+This value will be referred to by the `w3m-save-list' function."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defvar w3m-file-coding-system-for-read nil
+ "*Coding system used when reading configuration files.
+It is strongly recommended that you do not set this variable if there
+is no particular reason. The value will be referred to by the
+`w3m-load-list' function.")
+
+(defcustom w3m-file-name-coding-system
+ (if (memq system-type '(windows-nt OS/2 emx))
+ 'shift_jis 'euc-japan)
+ "*Coding system used to convert pathnames when emacs-w3m accesses files."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-default-coding-system
+ (if (equal "Japanese" w3m-language) 'shift_jis 'iso-8859-1)
+ "*Default coding system used to encode url strings and post-data."
+ :group 'w3m
+ :type '(coding-system :size 0))
+
+(defcustom w3m-coding-system-priority-list
+ (if (equal "Japanese" w3m-language) '(shift_jis))
+ "*Coding systems in order of priority used for emacs-w3m sessions."
+ :group 'w3m
+ :type '(repeat (coding-system :format "%t: %v\n" :size 0)))
+
+(defcustom w3m-key-binding nil
+ "*Type of key binding set used in emacs-w3m sessions.
+The valid values include `info' which provides Info-like keys, and
+nil which provides Lynx-like keys."
+ :group 'w3m
+ :type '(choice
+ (const :tag "Use Info-like key mapping." info)
+ (const :tag "Use Lynx-like key mapping." nil))
+ ;; Since the following form won't be byte-compiled, you developers
+ ;; should never use CL macros like `caaaar', `when', `unless' ...
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (if (or noninteractive
+ ;; Loading w3m.elc is just in progress...
+ (not (featurep 'w3m)))
+ nil
+ (if (and;; Gnus binds `w3m-mode-map' for compiling.
+ (boundp 'w3m-mode-map)
+ (boundp 'w3m-info-like-map)
+ (boundp 'w3m-lynx-like-map))
+ ;; It won't be bound at the first time.
+ (eval
+ '(setq w3m-mode-map (if (eq value 'info)
+ w3m-info-like-map
+ w3m-lynx-like-map)
+ w3m-minor-mode-map (w3m-make-minor-mode-keymap))))
+ (let ((buffers (buffer-list)))
+ (save-current-buffer
+ (while buffers
+ (set-buffer (car buffers))
+ (if (eq major-mode 'w3m-mode)
+ (condition-case nil
+ (progn
+ (use-local-map (symbol-value 'w3m-mode-map))
+ (w3m-setup-toolbar)
+ (w3m-setup-menu))
+ (error)))
+ (setq buffers (cdr buffers)))))))))
+
+(defcustom w3m-use-cygdrive (eq system-type 'windows-nt)
+ "*If non-nil, use the /cygdrive/ rule when performing `expand-file-name'."
+ :group 'w3m
+ :type 'boolean)
+
+(eval-and-compile
+ (defconst w3m-treat-drive-letter (memq system-type '(windows-nt OS/2 emx))
+ "Say whether the system uses drive letters."))
+
+(defcustom w3m-profile-directory
+ (concat "~/." (file-name-sans-extension
+ (file-name-nondirectory w3m-command)))
+ "*Directory where emacs-w3m config files are loaded from or saved to."
+ :group 'w3m
+ :type '(directory :size 0))
+
+(defcustom w3m-init-file "~/.emacs-w3m"
+ "*Your emacs-w3m startup file name.
+If a file with the `.el' or `.elc' suffixes exists, it will be read
+instead.
+
+Note: This file is used as the startup configuration *NOT* for the w3m
+command but for emacs-w3m. In order to modify configurations for the
+w3m command, edit the file named \"~/.w3m/config\" normally."
+ :group 'w3m
+ :type '(file :size 0))
+
+(defcustom w3m-default-save-directory
+ (concat "~/." (file-name-sans-extension
+ (file-name-nondirectory w3m-command)))
+ "*Default directory where downloaded files will be saved to."
+ :group 'w3m
+ :type '(directory :size 0))
+
+(defcustom w3m-default-directory nil
+ "*Directory used as the current directory in emacs-w3m buffers.
+The valid values include a string specifying an existing directory,
+a symbol of which the value specifies an existing directory,
+a function which takes a url as an argument and returns a directory,
+and nil. If the specified directory does not exist or it is nil,
+the value of `w3m-profile-directory' is used.
+
+Note that there is an exception: if a page visits a local file or
+visits a remote file using ftp, the directory in which the file exists
+is used as the current directory instead."
+ :group 'w3m
+ :type '(radio (directory :format "%{%t%}: %v\n" :size 0 :value "~/")
+ (symbol :format "%{%t%}: %v\n"
+ :match (lambda (widget value) value)
+ :size 0
+ :value default-directory)
+ (function :format "%{%t%}: %v\n"
+ :size 0)
+ (const nil)))
+
+(defcustom w3m-accept-languages
+ (let ((file (expand-file-name "config" w3m-profile-directory)))
+ (or (when (file-readable-p file)
+ (with-temp-buffer
+ (insert-file-contents file)
+ (goto-char (point-min))
+ (when (re-search-forward "^accept_language[\t ]+\\(.+\\)$" nil t)
+ (delete "" (split-string (match-string 1)
+ "[ \t\r\f\n]*,[ \t\r\f\n]*")))))
+ (when (string= w3m-language "Japanese")
+ '("ja" "en"))))
+ "*List of acceptable languages in descending order of priority.
+The default value is set according to the accept_language entry of the
+w3m configuration file (normally \"~/.w3m/config\")."
+ :group 'w3m
+ :type '(repeat (string :format "Lang: %v\n" :size 0)))
+
+(defcustom w3m-delete-duplicated-empty-lines t
+ "*Non-nil means display two or more continuous empty lines into single."
+ :group 'w3m
+ :type 'boolean)
+
+(defvar w3m-display-inline-images nil
+ "Internal variable controls whether to show images in emacs-w3m buffers.
+This variable is buffer-local which defaults to the value of
+`w3m-default-display-inline-images'. Don't set it directly; modify
+the `w3m-default-display-inline-images' variable or use the\
+ `\\<w3m-mode-map>\\[w3m-toggle-inline-images]' command
+to change the appearance of images.
+See also `w3m-toggle-inline-images-permanently'.")
+(make-variable-buffer-local 'w3m-display-inline-images)
+
+(defcustom w3m-default-display-inline-images nil
+ "*Non-nil means display images inline in emacs-w3m buffers.
+You can toggle the visibility of images by the\
+ `\\<w3m-mode-map>\\[w3m-toggle-inline-images]' command.
+See also `w3m-toggle-inline-images-permanently'."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-toggle-inline-images-permanently t
+ "*Non-nil means let the visibility of images continue permanently.
+The visibility of images is initialized according to
+`w3m-default-display-inline-images' at the first time, and except that
+it may be toggled by the `\\<w3m-mode-map>\\[w3m-toggle-inline-images]'\
+ command, it does not change hereafter, if
+it is non-nil. Otherwise, whether images are visible is initialized
+according to `w3m-default-display-inline-images' whenever you visit a
+new page or reload the current page in an emacs-w3m buffer."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-icon-directory
+ (let (dir)
+ (or
+ (catch 'found-dir
+ (let* ((path (locate-library "w3m"))
+ (paths (if path
+ (cons (file-name-directory path) load-path)
+ load-path)))
+ (while paths
+ (setq path (car paths)
+ paths (cdr paths))
+ (if path
+ (progn
+ (if (file-directory-p
+ (setq dir
+ (expand-file-name "../../etc/images/w3m/" path)))
+ (throw 'found-dir dir))
+ (if (file-directory-p
+ (setq dir
+ (expand-file-name "../etc/images/w3m/" path)))
+ (throw 'found-dir dir))
+ (if (file-directory-p
+ (setq dir
+ (expand-file-name "../../etc/w3m/icons/" path)))
+ (throw 'found-dir dir))
+ (if (file-directory-p
+ (setq dir
+ (expand-file-name "../etc/w3m/icons/" path)))
+ (throw 'found-dir dir)))))))
+ (and (fboundp 'locate-data-directory)
+ (or (locate-data-directory "images/w3m")
+ (locate-data-directory "w3m")))
+ (and (file-directory-p
+ (setq dir (expand-file-name "images/w3m/" data-directory)))
+ dir)
+ (and (file-directory-p
+ (setq dir (expand-file-name "w3m/icons/" data-directory)))
+ dir)))
+ "*Directory where emacs-w3m should find icon files."
+ :group 'w3m
+ :type '(radio (const :tag "Not specified")
+ (directory :format "%t: %v\n" :size 0)))
+
+(defcustom w3m-broken-proxy-cache nil
+ "*Set it to t if the proxy server seems not to work properly in caching.
+Note that this may be the double-edged sword; setting it to t will
+likely be harmful if the proxy server sends bad requests (e.g., not
+including the Host header, see RFC2616 section 14.23) to foreign
+servers when the w3m command specifies the \"no-cache\" directive. Also
+note that it may not be effective if you are using old w3m command."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-quick-start t
+ "*Non-nil means let emacs-w3m start quickly w/o requiring confirmation.
+When you invoke the `w3m' command, it attempts to visit the page of a
+string like url around the cursor or the value of `w3m-home-page'.
+You won't be asked for the confirmation then if this value is non-nil.
+Otherwise, you will be prompted for that url with the editing form."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-home-page
+ (or (getenv "HTTP_HOME")
+ (getenv "WWW_HOME")
+ "about:")
+ "*This variable specifies the url string to open when emacs-w3m starts.
+Don't say HP, which is the abbreviated name of a certain company. ;-)"
+ :group 'w3m
+ :type '(radio
+ :convert-widget w3m-widget-type-convert-widget
+ `(,@(if (getenv "HTTP_HOME")
+ `((const :format "HTTP_HOME: \"%v\"\n"
+ ,(getenv "HTTP_HOME"))))
+ ,@(if (getenv "WWW_HOME")
+ `((const :format "WWW_HOME: \"%v\"\n"
+ (getenv "WWW_HOME"))))
+ (const :tag "About emacs-w3m" "about:")
+ (const :tag "Blank page" "about:blank")
+ (string :format "URL: %v\n" :size 0))))
+
+(defcustom w3m-arrived-file
+ (expand-file-name ".arrived" w3m-profile-directory)
+ "*Name of the file to keep the arrived URLs database."
+ :group 'w3m
+ :type '(file :size 0))
+
+(defcustom w3m-keep-arrived-urls 500
+ "*Maximum number of URLs which the arrived URLs database keeps."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-prefer-cache nil
+ "*Non-nil means that cached contents are used without checking headers."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-keep-cache-size 300
+ "*Maximum number of pages to be cached in emacs-w3m."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-follow-redirection 9
+ "*Maximum number of redirections which emacs-w3m honors and follows.
+If nil, redirections are followed by the w3m command. Don't set it to
+nil if you allow to use cookies (i.e., you have set `w3m-use-cookies'
+to non-nil) since cookies may be shared among many redirected pages."
+ :group 'w3m
+ :type '(radio (const :format "Ignore redirections " nil)
+ (integer :size 0)))
+
+(defcustom w3m-redirect-with-get t
+ "*If non-nil, use the GET method after redirection.
+It controls how emacs-w3m works when a server responds the code 301 or
+302. Here is an extract from RFC2616:
+
+Note: RFC 1945 and RFC 2068 specify that the client is not allowed
+to change the method on the redirected request. However, most
+existing user agent implementations treat 302 as if it were a 303
+response, performing a GET on the Location field-value regardless
+of the original request method."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-resize-image-scale 50
+ "*Number of steps in percent used when resizing images."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defface w3m-anchor
+ '((((class color) (background light)) (:foreground "blue"))
+ (((class color) (background dark)) (:foreground "cyan"))
+ (t (:underline t)))
+ "Face used for displaying anchors."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-anchor-face 'face-alias 'w3m-anchor)
+
+(defface w3m-arrived-anchor
+ '((((class color) (background light)) (:foreground "navy"))
+ (((class color) (background dark)) (:foreground "LightSkyBlue"))
+ (t (:underline t)))
+ "Face used for displaying anchors which have already arrived."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-arrived-anchor-face 'face-alias 'w3m-arrived-anchor)
+
+(defface w3m-current-anchor
+ '((t (:underline t :bold t)))
+ "Face used to highlight the current anchor."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-current-anchor-face 'face-alias 'w3m-current-anchor)
+
+(defface w3m-image
+ '((((class color) (background light)) (:foreground "ForestGreen"))
+ (((class color) (background dark)) (:foreground "PaleGreen"))
+ (t (:underline t)))
+ "Face used for displaying alternate strings of images."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-image-face 'face-alias 'w3m-image)
+
+(defface w3m-image-anchor
+ '((((class color) (background light)) (:background "light yellow"))
+ (((class color) (background dark)) (:background "dark green"))
+ (t (:underline t)))
+ "Face used for displaying alternate strings of images which are in anchors."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-image-anchor-face 'face-alias 'w3m-image-anchor)
+
+(defface w3m-history-current-url
+ ;; The following strange code compounds the attributes of the
+ ;; `secondary-selection' face and the `w3m-arrived-anchor' face,
+ ;; and generates the new attributes for this face.
+ (let ((base 'secondary-selection)
+ (fn (if (featurep 'xemacs)
+ 'face-custom-attributes-get
+ 'custom-face-attributes-get));; What a perverseness it is.
+ ;; Both `face-custom-attributes-get' in XEmacs and
+ ;; `custom-face-attributes-get' in CUSTOM 1.9962 attempt to
+ ;; require `font' in Emacs/w3 and `cl' arbitrarily. :-/
+ (features (cons 'font features))
+ base-attributes attributes attribute)
+ (setq base-attributes (funcall fn base nil)
+ attributes (funcall fn 'w3m-arrived-anchor nil))
+ (while base-attributes
+ (setq attribute (car base-attributes))
+ (unless (memq attribute '(:foreground :underline))
+ (setq attributes (plist-put attributes attribute
+ (cadr base-attributes))))
+ (setq base-attributes (cddr base-attributes)))
+ (list (list t attributes)))
+ "Face used to highlight the current url in the \"about://history/\" page."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-history-current-url-face 'face-alias 'w3m-history-current-url)
+
+(defface w3m-bold '((t (:bold t)))
+ "Face used for displaying bold text."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-bold-face 'face-alias 'w3m-bold)
+
+(defface w3m-italic '((((type tty)) (:underline t))
+ (t (:italic t)))
+ "Face used for displaying italic text.
+By default it will be a underline face on a non-window system."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-italic-face 'face-alias 'w3m-italic)
+
+(defface w3m-underline '((t (:underline t)))
+ "Face used for displaying underlined text."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-underline-face 'face-alias 'w3m-underline)
+
+(defface w3m-strike-through
+ `((((class color))
+ ,(if (featurep 'xemacs)
+ '(:strikethru t)
+ '(:strike-through t)))
+ (t (:underline t)))
+ "Face used for displaying strike-through text."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-strike-through-face 'face-alias 'w3m-strike-through)
+
+(defface w3m-insert
+ '((((class color) (background light))
+ (:foreground "purple"))
+ (((class color) (background dark))
+ (:foreground "orchid"))
+ (t (:underline t)))
+ "Face used for displaying insert text."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-insert-face 'face-alias 'w3m-insert)
+
+(defcustom w3m-mode-hook nil
+ "*Hook run after `w3m-mode' initialization.
+This hook is evaluated by the `w3m-mode' function."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-fontify-before-hook nil
+ "*Hook run when starting to fontify emacs-w3m buffers.
+This hook is evaluated by the `w3m-fontify' function."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-fontify-after-hook nil
+ "*Hook run after fontifying emacs-w3m buffers.
+This hook is evaluated by the `w3m-fontify' function."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-display-hook
+ '(w3m-move-point-for-localcgi
+ w3m-history-highlight-current-url)
+ "*Hook run after displaying pages in emacs-w3m buffers.
+Each function is called with a url string as the argument. This hook
+is evaluated by the `w3m-goto-url' function."
+ :group 'w3m
+ :type 'hook
+ :initialize 'w3m-custom-hook-initialize)
+
+(defcustom w3m-after-cursor-move-hook
+ '(w3m-highlight-current-anchor
+ w3m-print-this-url
+ w3m-auto-show)
+ "*Hook run each time after the cursor moves in emacs-w3m buffers.
+This hook is called by the `w3m-check-current-position' function by
+way of `post-command-hook'."
+ :group 'w3m
+ :type 'hook
+ :initialize 'w3m-custom-hook-initialize)
+
+(defcustom w3m-delete-buffer-hook
+ '(w3m-pack-buffer-numbers)
+ "*Hook run when every emacs-w3m buffer is deleted."
+ :group 'w3m
+ :type 'hook
+ :initialize 'w3m-custom-hook-initialize)
+
+(defcustom w3m-select-buffer-hook nil
+ "*Hook run when a different emacs-w3m buffer is selected."
+ :group 'w3m
+ :type 'hook)
+
+(defcustom w3m-async-exec t
+ "*Non-nil means execute the w3m command asynchronously in Emacs process."
+ :group 'w3m
+ :type 'boolean)
+
+;; As far as we know, Emacs 21 under Mac OS X[1] and XEmacs under
+;; Solaris[2] won't run the asynchronous operations correctly when
+;; both `w3m-async-exec' and `w3m-process-connection-type' are non-nil;
+;; [1]the final kilobyte or so might get lost from raw data downloaded
+;; from a web site; [2]XEmacs hangs up.
+
+(defcustom w3m-process-connection-type
+ (not (or (and (memq system-type '(darwin macos))
+ (let ((ver (shell-command-to-string "uname -r")))
+ (and (string-match "^\\([0-9]+\\)\\." ver)
+ (< (string-to-number (match-string 1 ver)) 7))))
+ (and (featurep 'xemacs)
+ (string-match "solaris" system-configuration))))
+ "*Value for `process-connection-type' used when communicating with w3m."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-async-exec-with-many-urls
+ ;; XEmacs 21.5 tends to freeze when retrieving many urls at a time. :-<
+ (not (and (featurep 'xemacs) (not (featurep 'sxemacs))
+ (= emacs-major-version 21) (= emacs-minor-version 5)))
+ "Non-nil means allow retrieving many urls asynchronously.
+The value affects how emacs-w3m will work with group:* urls and the
+`w3m-session-select' feature. If it is nil, the asynchronous operation
+is inhibited in those cases even if `w3m-async-exec' is non-nil."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-default-content-type "text/html"
+ "*Default value assumed as the content type of local files."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defvar w3m-image-viewer
+ (or (w3m-which-command "display")
+ (w3m-which-command "eeyes")
+ (w3m-which-command "xloadimage")
+ (w3m-which-command "xv"))
+ "*Command used to view image files externally.
+Note that this option is installed temporally. It will be abolished
+when we implement the mailcap parser to set `w3m-content-type-alist'.")
+
+;; FIXME: we need to improve so that to set up the value of this
+;; variable may be performed by parsing the mailcap file.
+(defcustom w3m-content-type-alist
+ (let* ((fiber-viewer (when (and (eq system-type 'windows-nt)
+ (w3m-which-command "fiber"))
+ (list "fiber.exe" "-s" 'file)))
+ (external-browser
+ (if (and (eq system-type 'windows-nt) (w3m-which-command "fiber"))
+ 'w3m-w32-browser-with-fiber
+ (or (when (condition-case nil (require 'browse-url) (error nil))
+ (if (or (not (boundp 'browse-url-browser-function))
+ (eq 'w3m-browse-url
+ (symbol-value 'browse-url-browser-function)))
+ (cond
+ ((and (memq system-type '(windows-nt ms-dos cygwin))
+ (fboundp 'browse-url-default-windows-browser))
+ 'browse-url-default-windows-browser)
+ ((and (memq system-type '(darwin))
+ (fboundp 'browse-url-default-macosx-browser))
+ 'browse-url-default-macosx-browser)
+ ((fboundp 'browse-url-default-browser)
+ 'browse-url-default-browser)
+ ((fboundp 'browse-url-netscape)
+ 'browse-url-netscape))
+ (symbol-value 'browse-url-browser-function)))
+ (when (w3m-which-command "netscape")
+ (list "netscape" 'url)))))
+ (image-viewer (or fiber-viewer
+ (when w3m-image-viewer
+ (list w3m-image-viewer 'file))))
+ (video-viewer (or fiber-viewer
+ (when (w3m-which-command "mpeg_play")
+ (list "mpeg_play" 'file))))
+ (dvi-viewer (or fiber-viewer
+ (cond ((w3m-which-command "xdvi") (list "xdvi" 'file))
+ ((w3m-which-command "dvitty")
+ (list "dvitty" 'file)))))
+ (ps-viewer (or fiber-viewer
+ (cond
+ ((w3m-which-command "gv") (list "gv" 'file))
+ ((w3m-which-command "gs") (list "gs" 'file)))))
+ (pdf-viewer (or fiber-viewer
+ (cond
+ ((w3m-which-command "xpdf") (list "xpdf" 'file))
+ ((w3m-which-command "acroread")
+ (list "acroread" '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.
+Each element is a list which consists of the following data:
+
+1. Content type.
+
+2. Regexp matching a url or a file name.
+
+3. Method to view contents. The following three types may be used:
+ a. Lisp function which takes the url to view as an argument.
+ b. (\"COMMAND\" [ARG...]) -- where \"COMMAND\" is the external command
+ and ARG's are the arguments passed to the command if any. The
+ symbols `file' and `url' that appear in ARG's will be replaced
+ respectively with the name of a temporary file which contains
+ the contents and the string of the url to view.
+ c. nil which means to download the url into the local file.
+
+4. Content type that overrides the one specified by `1. Content type'.
+ Valid values include:
+ a. Lisp function that takes three arguments URL, CONTENT-TYPE, and
+ CHARSET, and returns a content type.
+ b. String that specifies a content type.
+ 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 'file '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)))))
+
+;; FIXME: we need to rearrange the complicated and redundant relation of
+;; `w3m-encoding-type-alist', `w3m-decoder-alist', and `w3m-encoding-alist'.
+(defcustom w3m-encoding-type-alist
+ '(("\\.gz\\'" . "gzip")
+ ("\\.bz2?\\'" . "bzip"))
+ "*Alist of file suffixes and content encoding types."
+ :group 'w3m
+ :type '(repeat
+ (cons :format "%v" :indent 14
+ (string :format "Regexp of Suffixes: %v\n" :size 0)
+ (string :format "Encoding Type: %v\n" :size 0))))
+
+(defcustom w3m-decoder-alist
+ `((gzip "gzip" ("-d")) ;; Don't use "gunzip" and "bunzip2"
+ (bzip "bzip2" ("-d")) ;; for broken OS and implementations.
+ (deflate
+ ,(if (not noninteractive)
+ (let ((exec-path
+ (let ((prefix (file-name-directory
+ (directory-file-name
+ (file-name-directory
+ (w3m-which-command w3m-command))))))
+ (list (expand-file-name "libexec/w3m" prefix)
+ (expand-file-name "lib/w3m" prefix)))))
+ (w3m-which-command "inflate")))
+ nil))
+ "Alist of encoding types, decoder commands, and arguments."
+ :group 'w3m
+ :type '(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)))))
+
+(defcustom w3m-charset-coding-system-alist
+ (let ((rest
+ '((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.
+Both charsets and coding systems must be symbols."
+ :group 'w3m
+ :type '(repeat (cons :format "%v" :indent 2
+ (symbol :format "%t: %v\n" :size 0)
+ (coding-system :format "%t: %v\n" :size 0))))
+
+(defcustom w3m-correct-charset-alist
+ '(("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."
+ :group 'w3m
+ :type '(repeat (cons :format "%v" :indent 11
+ (string :format "From: %v\n" :size 0)
+ (string :format "To: %v\n" :size 0))))
+
+(defcustom w3m-horizontal-scroll-columns 10
+ "*Number of steps in columns used when scrolling a window horizontally."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-horizontal-shift-columns 2
+ "*Number of steps in columns used when shifting a window horizontally.
+The term `shifting' means a fine level scrolling."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defcustom w3m-view-recenter 1
+ "Recenter window contents when going to an anchor.
+An integer is passed to `recenter', for instance the default 1
+ means put the anchor on the second line of the screen.
+t means `recenter' with no arguments, which puts it in the middle
+ of the screen.
+nil means don't recenter, let the display follow point in the
+ usual way."
+ :group 'w3m
+ ;; radio items in the same order as in the docstring, and `integer' first
+ ;; because it's the default
+ :type '(radio (integer :format "%{%t%}: %v\n" :value 1 :size 1)
+ (const :format "%t\n" t)
+ (const :format "%t\n" nil)))
+
+(defcustom w3m-use-form t
+ "*Non-nil means make it possible to use form extensions. (EXPERIMENTAL)"
+ :group 'w3m
+ :type 'boolean
+ :require 'w3m-form)
+
+(defcustom w3m-submit-form-safety-check nil
+ "Non-nil means ask you for confirmation when submitting a form."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-cookies nil
+ "*Non-nil means enable emacs-w3m to use cookies. (EXPERIMENTAL)"
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-filter nil
+ "*Non-nil means use filter programs to convert web contents.
+See also `w3m-filter-rules'."
+ :group 'w3m
+ :type 'boolean
+ :require 'w3m-filter)
+
+(defcustom w3m-use-symbol
+ (when (and (featurep 'mule)
+ (eq w3m-type 'w3m-m17n))
+ (if (eq w3m-output-coding-system 'utf-8)
+ (and (w3m-mule-unicode-p)
+ (or (featurep 'xemacs)
+ (< emacs-major-version 23))
+ 'w3m-device-on-window-system-p)
+ t))
+ "*Non-nil means replace symbols that the <_SYMBOL> tags lead into.
+It is meaningful only when the w3m-m17n command is used and (X)Emacs
+handles unicode charsets."
+ :group 'w3m
+ :type 'boolean
+ :require 'w3m-symbol)
+
+(defcustom w3m-edit-function 'find-file
+ "*Function used for editing local files.
+It is used when either `w3m-edit-current-url' or `w3m-edit-this-url'
+is invoked for local pages."
+ :group 'w3m
+ :type '(radio
+ (const :tag "Edit it in the current window" find-file)
+ (const :tag "Edit it in another window" find-file-other-window)
+ (const :tag "Edit it in another frame" find-file-other-frame)
+ (const :tag "View it in another window" view-file-other-window)
+ (function :format "Other function: %v\n" :size 0
+ :value view-file)))
+
+(defcustom w3m-edit-function-alist
+ '(("\\`[^?]+/hiki\\.cgi\\?" . hiki-edit-url))
+ "*Alist of functions used for editing pages.
+This option is referred to decide which function should be used to
+edit a specified page, when either `w3m-edit-current-url' or
+`w3m-edit-this-url' is invoked. When no suitable function is found
+from this alist, `w3m-edit-function' is used."
+ :group 'w3m
+ :type '(repeat (cons :format "%v" :indent 3
+ (regexp :format "URL: %v\n" :size 0)
+ (function))))
+
+(defcustom w3m-url-local-directory-alist
+ (when (boundp 'yahtml-path-url-alist)
+ (mapcar
+ (lambda (pair)
+ (cons (cdr pair) (car pair)))
+ (symbol-value 'yahtml-path-url-alist)))
+ "*Alist of URLs and local directories.
+If directory names of a given URL and the car of an element are the
+same, emacs-w3m assumes that the file exists in the local directory
+where the cdr of an element points to. The default value will be set
+to a value of the `yahtml-path-url-alist' variable which exchanged the
+car and the cdr in each element if it is available."
+ :type '(repeat
+ (cons :format "%v" :indent 3
+ (string :format "URL: %v\n" :size 0)
+ (directory :format "%t: %v\n" :size 0)))
+ :group 'w3m)
+
+(defcustom w3m-track-mouse t
+ "*Whether to track the mouse and message the url under the mouse.
+See also `show-help-function' if you are using GNU Emacs.
+
+A tip for XEmacs users:
+
+You can also use the `balloon-help' feature by the
+`M-x balloon-help-mode' command with arg 1. If the window manager
+decorates the balloon-help frame, and that is not to your taste, you
+may strip it off with the following directives:
+
+For ol[v]wm use this in .Xdefaults:
+ olvwm.NoDecor: balloon-help
+ or
+ olwm.MinimalDecor: balloon-help
+
+For fvwm version 1 use this in your .fvwmrc:
+ NoTitle balloon-help
+or
+ Style \"balloon-help\" NoTitle, NoHandles, BorderWidth 0
+
+For twm use this in your .twmrc:
+ NoTitle { \"balloon-help\" }
+
+See the balloon-help.el file for more information."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-show-decoded-url
+ '(("\\`http://\\(?:[^./?#]+\\.\\)*wikipedia\\.org/" . utf-8)
+ ("\\`http://\\(?:[^./?#]+\\.\\)*nikkei\\.co\\.jp/" . nil)
+ ("\\`http://\\(?:[^./?#]+\\.\\)*hatena\\.ne\\.jp/" . euc-jp)
+ ("\\`http://\\(?:[^./?#]+\\.\\)*ohmynews\\.co\\.jp/" . utf-8)
+ (t . t))
+ "*Non-nil means show decoded URIs in the echo area, the balloon, etc.
+This variable can take one of the following five kinds of forms:
+
+1. t
+ Decode URIs using the encoding guessed from the value of
+ `w3m-coding-system-priority-list'.
+
+2. Coding system
+ Decode URIs using this value.
+
+3. List of coding systems:
+ Decode URIs using the encoding assumed based on this list.
+
+4. Alist of predicates and forms described below:
+ Each element looks like the `(PREDICATE . ENCODING)' form. PREDICATE
+ should be a regexp, a function or a Lisp form, and ENCODING should be
+ one of the forms described here excluding this form. If PREDICATE is
+ a regexp, it will be tested whether it matches to the target url.
+ If it is a function, it will be called with the target url. If it
+ is a Lisp form, it will be simply evaluated. Elements are tested in
+ turn until the result of the test of the predicate is true and the
+ encoding which is associated to the predicate is used for decoding
+ URIs.
+
+5. nil
+ Don't decode URIs."
+ :group 'w3m
+ :type
+ '(choice
+ :format "%{%t%}: %[Value Menu%]\n %v"
+ (coding-system :tag "Specify encoding" :format "Use this encoding: %v"
+ :match (lambda (widget value)
+ (w3m-find-coding-system value)))
+ (const :tag "Prefer the encoding of the current page"
+ :format "%t: %{t%}\n" :sample-face widget-field-face
+ t)
+ (group :tag "List of prefered encodings"
+ :match (lambda (widget value)
+ (and (car-safe value)
+ (symbolp (car-safe value))))
+ (repeat :format "List of prefered encodings:\n%v%i\n"
+ :inline t
+ (coding-system :tag "Encoding")))
+ (group :tag "Rules to select an encoding of URIs on the current page"
+ :match (lambda (widget value) value)
+ (repeat
+ :format
+ "Rules to select an encoding of URIs on the current page:\n%v%i\n"
+ :inline t
+ (cons
+ :format "%v" :indent 2
+ (choice
+ :format "\n %[Value Menu for the car%]\n %v"
+ (regexp :tag "Regexp matches the current page")
+ (function :tag "Predicate checks for the current page")
+ (sexp :tag "Expression checks for the current page"))
+ (choice
+ :format "%[Value Menu for the cdr%]\n %v"
+ (coding-system :tag "Specify encoding"
+ :format "Use this encoding: %v"
+ :match (lambda (widget value)
+ (if (featurep 'xemacs)
+ nil ;; ??
+ (w3m-find-coding-system value))))
+ (const :tag "Prefer the encoding of the current page"
+ :format "%t: %{t%}\n" :sample-face widget-field-face
+ t)
+ (group :tag "List of prefered encodings"
+ (repeat :tag "List of prefered encodings"
+ :inline t
+ :extra-offset 4
+ (coding-system :tag "Encoding")))
+ (const :tag "Don't decode URIs"
+ :format "%t: %{nil%}\n" :sample-face widget-field-face
+ nil)))))
+ (const :tag "Don't decode URIs"
+ :format "%t: %{nil%}\n" :sample-face widget-field-face
+ nil)))
+
+(defcustom w3m-use-title-buffer-name nil
+ "Non-nil means use name of buffer included current title."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-japanese-menu
+ (and (equal "Japanese" w3m-language)
+ ;; Emacs 21, XEmacs 21.4 and SXEmacs don't seem to support
+ ;; non-ASCII text in the popup menu.
+ (not (featurep 'sxemacs))
+ (if (featurep 'xemacs)
+ (or (> emacs-major-version 21)
+ (and (= emacs-major-version 21)
+ (>= emacs-minor-version 5)))
+ (or (>= emacs-major-version 22)
+ (featurep 'meadow))))
+ "Non-nil means use Japanese characters for Menu if possible."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-menu-on-forefront nil
+ "Non-nil means place the emacs-w3m menus on the forefront of the menu bar."
+ :group 'w3m
+ :type 'boolean
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (unless noninteractive
+ (w3m-menu-on-forefront value)))))
+
+(defcustom w3m-use-tab t
+ "Non-nil means make emacs-w3m a tab browser.
+It makes it possible to show all emacs-w3m buffers in a single window
+with the tabs line, and you can choose one by clicking a mouse on it.
+See also `w3m-use-tab-menubar'."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-add-tab-number nil
+ "Non-nil means put sequential number to a title on tab."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-tab-menubar t
+ "Non-nil means use the TAB pull-down menu in the menubar.
+It makes it possible to show all emacs-w3m buffers in a single window,
+and you can choose one by clicking a mouse on it. This feature
+requires that Emacs has been built to be able to display multilingual
+text in the menubar if you often visit web sites written in non-ascii
+text. See also `w3m-use-tab'."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-new-session-url "about://bookmark/"
+ "*Default url to be opened in a tab or a session which is created newly."
+ :group 'w3m
+ :type '(radio
+ :convert-widget w3m-widget-type-convert-widget
+ `((const :tag "About emacs-w3m" "about:")
+ (const :tag "Blank page" "about:blank")
+ (const :tag "Bookmark" "about://bookmark/")
+ (const :tag ,(format "Home page (%s)" w3m-home-page)
+ ,w3m-home-page)
+ (string :format "URL: %v\n" :size 0
+ :value "http://emacs-w3m.namazu.org"))))
+
+(defcustom w3m-make-new-session nil
+ "*Non-nil means making new emacs-w3m buffers when visiting new pages.
+If it is non-nil and there are already emacs-w3m buffers, the `w3m'
+command makes a new emacs-w3m buffer if a user specifies a url string
+in the minibuffer, and the `w3m-safe-view-this-url' command also makes
+a new buffer if a user invokes it in a buffer not being running the
+`w3m-mode'."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-favicon t
+ "*Non-nil means show favicon images if they are available.
+It will be set to nil automatically if ImageMagick's `convert' program
+does not support the ico format."
+ :get (lambda (symbol)
+ (and (not noninteractive)
+ (default-value symbol)
+ (w3m-favicon-usable-p)))
+ :set (lambda (symbol value)
+ (custom-set-default symbol (and (not noninteractive)
+ value
+ (w3m-favicon-usable-p))))
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-show-graphic-icons-in-mode-line t
+ "Non-nil means show graphic status indicators in the mode-line.
+If it is nil, also the favicon won't be shown in the mode-line even if
+`w3m-use-favicon' is non-nil."
+ :set (lambda (symbol value)
+ (prog1
+ (custom-set-default symbol value)
+ (if (and (not noninteractive)
+ ;; Make sure it is not the first time.
+ (featurep 'w3m)
+ (fboundp 'w3m-initialize-graphic-icons))
+ (w3m-initialize-graphic-icons))))
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-show-graphic-icons-in-header-line t
+ "Non-nil means show graphic status indicators in the header-line.
+If it is nil, also the favicon won't be shown in the header-line even
+if `w3m-use-favicon' is non-nil. This variable is currently
+meaningless under XEmacs."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-pop-up-windows t
+ "Non-nil means split the windows when a new emacs-w3m session is created.
+This variable is similar to `pop-up-windows' and quite overridden by
+`w3m-pop-up-frames' as if `pop-up-frames' influences. Furthermore, if
+`w3m-use-tab' is non-nil or there is the buffers selection window (for
+the `w3m-select-buffer' feature), this variable is ignored when
+creating the second or more emacs-w3m session."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-pop-up-frames nil
+ "Non-nil means pop to a new frame up for an emacs-w3m session.
+This variable is similar to `pop-up-frames' and does override
+`w3m-pop-up-windows'. If `w3m-use-tab' is non-nil or there is the
+buffers selection window (for the `w3m-select-buffer' feature), this
+variable is ignored when creating the second or more emacs-w3m session."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-view-this-url-new-session-in-background nil
+ "*Obsolete."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-new-session-in-background
+ w3m-view-this-url-new-session-in-background
+ "*Say whether not to focus on a new tab or a new session in target.
+It influences only when a new emacs-w3m buffer is created."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-popup-frame-parameters nil
+ "Alist of frame parameters used when creating a new emacs-w3m frame.
+It allows not only the alist form but also XEmacs' plist form."
+ :group 'w3m
+ :type '(choice (group :inline t :tag "Frame Parameters (Emacs)"
+ (repeat :inline t :tag "Frame Parameters (Emacs)"
+ (cons :format "%v" :indent 3
+ (symbol :format "Parameter: %v\n"
+ :size 0)
+ (sexp :format "%t: %v\n" :size 0))))
+ (group :inline t :tag "Frame Plist (XEmacs)"
+ (repeat :inline t :tag "Frame Plist (XEmacs)"
+ (group :indent 2 :inline t
+ (symbol :format "Property: %v\n"
+ :size 0)
+ (sexp :format "%t: %v\n" :size 0))))))
+
+(defcustom w3m-auto-show t
+ "*Non-nil means provide the ability to horizontally scroll the window.
+Automatic horizontal scrolling is made when the point gets away from
+both ends of the window, but nothing occurs if `truncate-lines' is set
+to nil.
+
+This feature works with the specially made program in emacs-w3m; usual
+`auto-hscroll-mode', `automatic-hscrolling', `auto-show-mode' or
+`hscroll-mode' will all be invalidated in emacs-w3m buffers."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-horizontal-scroll-division 4
+ "*Integer used by the program making the point certainly visible.
+The cursor definitely does not go missing even when it has been driven
+out of the window while wandering around anchors and forms in an
+emacs-w3m buffer.
+
+Suppose that the value of this variable is N. When the point is
+outside the left of the window, emacs-w3m scrolls the window so that
+the point may be displayed on the position within 1/N of the width of
+the window from the left. Similarly, when the point is outside the
+right of the window, emacs-w3m scrolls the window so that the point
+may be displayed on the position of 1/N of the width of the window
+from the right.
+
+This feature doesn't work if `w3m-auto-show' is nil. The value must
+be a larger integer than 1."
+ :group 'w3m
+ :type '(integer :size 0)
+ :set (lambda (symbol value)
+ (custom-set-default symbol (if (and (integerp value) (> value 1))
+ value
+ 4))))
+
+(defcustom w3m-show-error-information t
+ "*Non-nil means show an error information as a web page.
+Page is made when the foreign server doesn't respond to a request to
+retrieve data."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-refresh t
+ "*Non-nil means honor the REFRESH attribute in META tags.
+Emacs-w3m arbitrarily takes you to a url specified by that attribute.
+Note that they may be malicious traps."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-mbconv-command "mbconv"
+ "*Name of the \"mbconv\" command provided by the \"libmoe\" package.
+The \"libmoe\" package is used when you use the w3mmee command instead
+of the w3m command. See also `w3m-command'."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-local-find-file-regexps
+ (cons nil
+ (concat "\\."
+ (regexp-opt (append '("htm"
+ "html"
+ "shtm"
+ "shtml"
+ "xhtm"
+ "xhtml"
+ "txt")
+ (and (w3m-image-type-available-p 'jpeg)
+ '("jpeg" "jpg"))
+ (and (w3m-image-type-available-p 'gif)
+ '("gif"))
+ (and (w3m-image-type-available-p 'png)
+ '("png"))
+ (and (w3m-image-type-available-p 'xbm)
+ '("xbm"))
+ (and (w3m-image-type-available-p 'xpm)
+ '("xpm")))
+ t) ;; with surrounding parens (for old Emacsen).
+ "\\'"))
+ "*Cons of two regexps matching and not matching with local file names.
+If a url of the `file:' scheme in which you entered matches the first
+form and does not match the latter form, it will be opened by the
+function specified by the `w3m-local-find-file-function' variable.
+Nil for the regexp matches any file names.
+
+For instance, the value `(nil . \"\\\\.[sx]?html?\\\\'\")' allows
+\"file:///some/where/w3m.el\", not \"file:///any/where/index.html\", to
+open by the function specified by `w3m-local-find-file-function'. The
+latter will be opened as a normal web page. Furthermore, if you would
+like to view some types of contents in the local system using the
+viewers specified by the `w3m-content-type-alist' variable, you can
+add regexps matching those file names to the second element of this
+variable. For example:
+
+\(setq w3m-local-find-file-regexps
+ '(nil . \"\\\\.\\\\(?:[sx]?html?\\\\|dvi\\\\|ps\\\\|pdf\\\\)\\\\'\"))
+
+It is effective only when the `w3m-local-find-file-function' variable
+is set properly."
+ :group 'w3m
+ :type '(cons (radio :tag "Match"
+ (const :format "All " nil)
+ (regexp :format "%t: %v\n" :size 0))
+ (radio :tag "Nomatch"
+ (const :format "All " nil)
+ (regexp :format "%t: %v\n" :size 0))))
+
+(defcustom w3m-local-find-file-function
+ '(if (w3m-popup-frame-p)
+ 'find-file-other-frame
+ 'find-file-other-window)
+ "*Function used to open local files.
+If a url of the `file:' scheme in which you entered agrees with the
+rule of the `w3m-local-find-file-regexps' variable (which see), it is
+used to open the file.
+
+Function should take one argument, the string naming the local file.
+It can also be any Lisp form returning a function. Set this to nil if
+you want to always use emacs-w3m to see local files."
+ :group 'w3m
+ :type '(sexp :size 0))
+
+(defcustom w3m-local-directory-view-method 'w3m-cgi
+ "*Symbol of the method to view a local directory tree.
+The valid values include `w3m-cgi' using the CGI program specified by
+the `w3m-dirlist-cgi-program' variable (which see), and `w3m-dtree'
+using the w3m-dtree Lisp module."
+ :group 'w3m
+ :type '(radio (const :format "Dirlist CGI " w3m-cgi)
+ (const :tag "Directory tree" w3m-dtree)))
+
+(defcustom w3m-dirlist-cgi-program
+ (cond ((eq system-type 'windows-nt)
+ "c:/usr/local/lib/w3m/dirlist.cgi")
+ ((memq system-type '(OS/2 emx))
+ (expand-file-name "dirlist.cmd" (getenv "W3M_LIB_DIR")))
+ (t nil))
+ "*Name of the CGI program to list a local directory.
+If it is nil, the dirlist.cgi module of the w3m command will be used."
+ :group 'w3m
+ :type `(radio
+ (const :tag "w3m internal CGI" nil)
+ (file :format "path of 'dirlist.cgi': %v\n"
+ :size 0
+ :value ,(if (not noninteractive)
+ (expand-file-name
+ (concat "../lib/"
+ (file-name-nondirectory w3m-command)
+ "/dirlist.cgi")
+ (file-name-directory
+ (w3m-which-command w3m-command)))))))
+
+(defcustom w3m-add-referer
+ (if (boundp 'w3m-add-referer-regexps)
+ (symbol-value 'w3m-add-referer-regexps)
+ (cons "\\`http:" "\\`http://\\(?:localhost\\|127\\.0\\.0\\.1\\)/"))
+ "*Rule of sending referers.
+There are five choices as the valid values of this option.
+
+\(1\) nil: this means that emacs-w3m never send referers.
+\(2\) t: this means that emacs-w3m always send referers.
+\(3\) lambda: this means that emacs-w3m send referers only when both
+ the current page and the target page are provided by the same
+ server.
+\(4\) a cons cell keeping two regular expressions: this means that
+ emacs-w3m send referers when the url of the current page matches
+ the first regular expression and does not match the second regular
+ expression. Nil for the regexp matches any url.
+\(5\) a function: emacs-w3m send referers when this function which has
+ two arguments, URL and REFERER, returns non-nil.
+
+If you become nervous about leak of your private WEB browsing history,
+set `nil' or `lambda' to this option. When your computer belongs to a
+secret network, you may set a pair of regular expressions to inhibit
+sending referers which will disclose your private informations, as
+follows:
+
+\(setq w3m-add-referer
+ '(\"\\\\`http:\"
+ . \"\\\\`http://\\\\(?:[^./]+\\\\.\\\\)*example\\\\.net/\")\)
+"
+ :group 'w3m
+ :type '(choice
+ (const :tag "Never send referers" nil)
+ (const :tag "Always send referers" t)
+ (const :tag "Send referers when accessing the same server" lambda)
+ (cons :tag "Send referers when URI matches:"
+ (list :inline t :format "%v"
+ (radio :indent 2 :sample-face underline
+ :tag "Allow"
+ (regexp :format "%t: %v\n" :size 0)
+ (const :tag "Don't allow all" nil))
+ (radio :indent 2 :sample-face underline
+ :tag "Don't allow"
+ (regexp :format "%t: %v\n" :size 0)
+ (const :tag "Allow all" nil))))
+ (function :tag "Send referers when your function returns non-nil")))
+
+(defcustom w3m-touch-command (w3m-which-command "touch")
+ "*Name of the executable file of the touch command.
+Note that the command is required to be able to modify file's
+timestamp with the `-t' option."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defcustom w3m-puny-utf-16be
+ (cond
+ ((w3m-find-coding-system 'utf-16-be-no-signature)
+ 'utf-16-be-no-signature)
+ ((w3m-find-coding-system 'utf-16be)
+ 'utf-16be)
+ (t nil))
+ "*Coding system for PUNY coding. if nil, don't use PUNY code."
+ :group 'w3m
+ :type '(radio (coding-system :tag "UTF-16BE without BOM")
+ (const "Don't use" nil)))
+
+(defcustom w3m-uri-replace-alist
+ '(("\\`gg:" w3m-search-uri-replace "google")
+ ("\\`ggg:" w3m-search-uri-replace "google groups")
+ ("\\`ya:" w3m-search-uri-replace "yahoo")
+ ("\\`al:" w3m-search-uri-replace "altavista")
+ ("\\`bts:" w3m-search-uri-replace "debian-bts")
+ ("\\`dpkg:" w3m-search-uri-replace "debian-pkg")
+ ("\\`archie:" w3m-search-uri-replace "iij-archie")
+ ("\\`alc:" w3m-search-uri-replace "alc")
+ ("\\`urn:ietf:rfc:\\([0-9]+\\)" w3m-pattern-uri-replace
+ "http://www.ietf.org/rfc/rfc\\1.txt"))
+ "*Alist of regexps matching URIs, and some types of replacements.
+It can be used universally to replace URI strings in the local rule to
+the valid forms in the Internet.
+
+Each element looks like the `(REGEXP FUNCTION OPTIONS...)' form.
+FUNCTION takes one or more arguments, a uri and OPTIONS. You can use
+the grouping constructs \"\\\\(...\\\\)\" in REGEXP, and they can be
+referred by the \"\\N\" forms in a replacement (which is one of OPTIONS).
+
+Here are some predefined functions which can be used for those ways:
+
+`w3m-pattern-uri-replace'
+ Replace a URI using PATTERN (which is just an OPTION). It is
+ allowed that PATTERN contains the \"\\N\" forms in the same manner
+ of `replace-match'.
+
+`w3m-search-uri-replace'
+ Generate the valid forms to query words to some specified search
+ engines. For example, the element
+
+ (\"\\\\`gg:\" w3m-search-uri-replace \"google\")
+
+ makes it possible to replace the URI \"gg:emacs\" to the form to
+ query the word \"emacs\" to the Google site.\
+"
+ :group 'w3m
+ :type '(repeat
+ :convert-widget w3m-widget-type-convert-widget
+ `((choice
+ :format "%[Value Menu%] %v" :tag "Replacing URI with"
+ (list :indent 4 :tag "Replacement Using Pattern"
+ (regexp :format "%t: %v\n" :size 0)
+ (function-item :format "" w3m-pattern-uri-replace)
+ (string :format "Pattern: %v\n" :size 0))
+ (list :format "%t:\n%v" :indent 4 :tag "Quick Search"
+ (regexp :format "Prefix URI %t: %v\n"
+ :size 0 :value "")
+ (function-item :format "" w3m-search-uri-replace)
+ (string :format "Quick Search Engine: %v\n"
+ :size 0 :value ""))
+ ,@(progn
+ (require 'w3m-search)
+ (mapcar
+ (lambda (elem)
+ (let* ((engine (car elem))
+ (prefix (mapconcat 'identity
+ (split-string (downcase engine))
+ "-")))
+ `(list
+ :format "Quick Search:\n%v"
+ :indent 4
+ :tag ,(concat "Quick Search: " prefix)
+ (regexp :tag "Prefix URL Regexp"
+ ,(concat "\\`" (regexp-quote prefix) ":"))
+ (function-item :format "" w3m-search-uri-replace)
+ (string :tag "Quick Search Engine" ,engine))))
+ w3m-search-engine-alist))
+ (list :indent 4 :tag "User Defined Function"
+ (regexp :format "%t: %v\n" :size 0)
+ (function
+ :format "%t: %v\n" :size 0
+ ;; Fix a bug in Emacs versions prior to 22.
+ :value-to-internal
+ (lambda (widget value)
+ (if (stringp value)
+ (if (string-match "\\`\".*\"\\'" value)
+ (substring value 1 -1)
+ value)
+ (prin1-to-string value))))
+ (repeat :extra-offset 2 :tag "Options"
+ (sexp :format "%t: %v\n" :size 0)))))))
+
+(defcustom w3m-relationship-estimate-rules
+ `((w3m-relationship-simple-estimate
+ "\\`http://\\(?:www\\|blogsearch\\|groups\\|news\\|images\\)\
+\\.google\\.[^/]+/\\(?:\\(?:blog\\|code\\)?search\\|groups\\|news\\|images\
+\\|cse\\?cx=\\|custom\\?\\(?:q\\|hl\\)=\\)"
+ ,(concat "<a[^>]+?href=" w3m-html-string-regexp
+ ">\\(?:\\(?:<img src=[^>]*nav_next\\.gif\\)"
+ "\\|\\(?:<span>Next</span>\\)\\)")
+ ,(concat "<a[^>]+?href=" w3m-html-string-regexp
+ ">\\(?:\\(?:<img src=[^>]*nav_previous\\.gif\\)"
+ "\\|\\(?:<span>Previous</span>\\)\\)")
+ nil nil)
+ (w3m-relationship-simple-estimate
+ "\\`http://www\\.google\\.[^/]+/gwt/n\\?u="
+ ,(concat "<a[^>]+?href=" w3m-html-string-regexp
+ "[ \t\n]+accesskey=\"3\">")
+ ,(concat "<a[^>]+?href=" w3m-html-string-regexp
+ "[ \t\n]+accesskey=\"1\">")
+ nil nil)
+ (w3m-relationship-simple-estimate
+ "\\`http://beta\\.search\\.yahoo\\.co\\.jp/"
+ ,(concat "<a href=" w3m-html-string-regexp
+ "><img src=http://i\\.yimg\\.jp/images/common/ar_next\\.gif")
+ ,(concat "<a href=" w3m-html-string-regexp
+ "><img src=http://i\\.yimg\\.jp/images/common/ar_prev\\.gif")
+ nil nil)
+ (w3m-relationship-simple-estimate
+ "\\`http://www\\.zdnet\\.co\\.jp/news/"
+ ,(concat "<a href=" w3m-html-string-regexp ">$B<!$N%Z!<%8(B</a>")
+ ,(concat "<a href=" w3m-html-string-regexp ">$BA0$N%Z!<%8(B</a>")
+ nil nil)
+ (w3m-relationship-simple-estimate
+ "\\`http://freshmeat\\.net/\\(search\\|browse\\)/"
+ ,(concat "<A HREF=" w3m-html-string-regexp ">\\[&raquo;\\]</A>")
+ ,(concat "<A HREF=" w3m-html-string-regexp ">\\[&laquo;\\]</A>")
+ nil nil)
+ (w3m-relationship-oddmuse-estimate)
+ (w3m-relationship-magicpoint-estimate)
+ (w3m-relationship-slashdot-estimate)
+ (w3m-relationship-alc-estimate))
+ "*Rules to estimate relationships between a retrieved page and others."
+ :group 'w3m
+ :type '(repeat
+ (choice
+ :format "%[Value Menu%] %v"
+ (list :tag "Estimate relationships from anchors matching"
+ :indent 1
+ (const :format "Function: %v\n"
+ w3m-relationship-simple-estimate)
+ (regexp :tag "URL")
+ (regexp :tag "Next")
+ (regexp :tag "Prev")
+ (radio :format "Start: %v"
+ (const :format "%v " nil) regexp)
+ (radio :format "Contents: %v"
+ (const :format "%v " nil) regexp))
+ (list :tag "Estimate with a user defined function"
+ :indent 1
+ function
+ (repeat :tag "Args" :extra-offset 1 (sexp :format "%v"))))))
+
+(defcustom w3m-enable-google-feeling-lucky t
+ "Non-nil enables you to enter any words as well as a url when prompted.
+In that case, emacs-w3m uses Google to search for the words."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-google-feeling-lucky-charset
+ (cond
+ ((or (featurep 'un-define) (fboundp 'utf-translate-cjk-mode))
+ "UTF-8")
+ ((equal "Japanese" w3m-language)
+ "SHIFT_JIS")
+ ((w3m-find-coding-system 'utf-8)
+ "UTF-8")
+ (t "US-ASCII"))
+ "*Character set for \"I'm Feeling Lucky on Google\"."
+ :group 'w3m
+ :type '(string :size 0))
+
+(defconst w3m-entity-table
+ (let ((table (make-hash-table :test 'equal)))
+ (dolist (entity '(("nbsp" . " ")
+ ("gt" . ">")
+ ("lt" . "<")
+ ("amp" . "&")
+ ("quot" . "\"")
+ ("apos" . "'")
+ ("circ" . "^")
+ ("tilde" . "~")))
+ (puthash (car entity) (cdr entity) table))
+ (dolist (entity
+ '(;("nbsp" . 160)
+ ("iexcl" . 161) ("cent" . 162) ("pound" . 163) ("curren" . 164)
+ ("yen" . 165) ("brvbar" . 166) ("sect" . 167) ("uml" . 168)
+ ("copy" . 169) ("ordf" . 170) ("laquo" . 171) ("not" . 172)
+ ("shy" . 173) ("reg" . 174) ("macr" . 175) ("deg" . 176)
+ ("plusmn" . 177) ("sup2" . 178) ("sup3" . 179) ("acute" . 180)
+ ("micro" . 181) ("para" . 182) ("middot" . 183) ("cedil" . 184)
+ ("sup1" . 185) ("ordm" . 186) ("raquo" . 187) ("frac14" . 188)
+ ("frac12" . 189) ("frac34" . 190) ("iquest" . 191)
+ ("Agrave" . 192) ("Aacute" . 193) ("Acirc" . 194)
+ ("Atilde" . 195) ("Auml" . 196) ("Aring" . 197) ("AElig" . 198)
+ ("Ccedil" . 199) ("Egrave" . 200) ("Eacute" . 201)
+ ("Ecirc" . 202) ("Euml" . 203) ("Igrave" . 204) ("Iacute" . 205)
+ ("Icirc" . 206) ("Iuml" . 207) ("ETH" . 208) ("Ntilde" . 209)
+ ("Ograve" . 210) ("Oacute" . 211) ("Ocirc" . 212)
+ ("Otilde" . 213) ("Ouml" . 214) ("times" . 215) ("Oslash" . 216)
+ ("Ugrave" . 217) ("Uacute" . 218) ("Ucirc" . 219) ("Uuml" . 220)
+ ("Yacute" . 221) ("THORN" . 222) ("szlig" . 223) ("agrave" . 224)
+ ("aacute" . 225) ("acirc" . 226) ("atilde" . 227) ("auml" . 228)
+ ("aring" . 229) ("aelig" . 230) ("ccedil" . 231) ("egrave" . 232)
+ ("eacute" . 233) ("ecirc" . 234) ("euml" . 235) ("igrave" . 236)
+ ("iacute" . 237) ("icirc" . 238) ("iuml" . 239) ("eth" . 240)
+ ("ntilde" . 241) ("ograve" . 242) ("oacute" . 243)
+ ("ocirc" . 244) ("otilde" . 245) ("ouml" . 246) ("divide" . 247)
+ ("oslash" . 248) ("ugrave" . 249) ("uacute" . 250)
+ ("ucirc" . 251) ("uuml" . 252) ("yacute" . 253) ("thorn" . 254)
+ ("yuml" . 255)))
+ (puthash (car entity)
+ (char-to-string (make-char 'latin-iso8859-1 (cdr entity)))
+ table))
+ (dolist (entity
+ '(("Alpha" . 65) ("Beta" . 66) ("Gamma" . 67) ("Delta" . 68)
+ ("Epsilon" . 69) ("Zeta" . 70) ("Eta" . 71) ("Theta" . 72)
+ ("Iota" . 73) ("Kappa" . 74) ("Lambda" . 75) ("Mu" . 76)
+ ("Nu" . 77) ("Xi" . 78) ("Omicron" . 79) ("Pi" . 80)
+ ("Rho" . 81) ; No ("Sigmaf" . 82)
+ ("Sigma" . 83) ("Tau" . 84) ("Upsilon" . 85) ("Phi" . 86)
+ ("Chi" . 87) ("Psi" . 88) ("Omega" . 89)
+ ("alpha" . 97) ("beta" . 98) ("gamma" . 99) ("delta" . 100)
+ ("epsilon" . 101) ("zeta" . 102) ("eta" . 103) ("theta" . 104)
+ ("iota" . 105) ("kappa" . 106) ("lambda" . 107) ("mu" . 108)
+ ("nu" . 109) ("xi" . 110) ("omicron" . 111) ("pi" . 112)
+ ("rho" . 113) ("sigmaf" . 114) ("sigma" . 115) ("tau" . 116)
+ ("upsilon" . 117) ("phi" . 118) ("chi" . 119) ("psi" . 120)
+ ("omega" . 121)))
+ (puthash (car entity)
+ (char-to-string (make-char 'greek-iso8859-7 (cdr entity)))
+ table))
+ (when (w3m-mule-unicode-p)
+ (let ((latin-extended-a
+ '((32 . (("OElig" . 114) ("oelig" . 115)))
+ (33 . (("Scaron" . 32) ("scaron" . 33) ("Yuml" . 56)))))
+ (latin-extended-b '((33 . (("fnof" . 82)))))
+ ;;(spacing-modifier-letters '(36 . (("circ" . 120) ("tilde" . 124))))
+ (general-punctuation
+ '((114 .
+ (("ensp" . 98) ("emsp" . 99) ("thinsp" . 105) ("zwnj" . 108)
+ ("zwj" . 109) ("lrm" . 110) ("rlm" . 111) ("ndash" . 115)
+ ("mdash" . 116) ("lsquo" . 120) ("rsquo" . 121)
+ ("sbquo" . 122) ("ldquo" . 124) ("rdquo" . 125)
+ ("bdquo" . 126)))
+ (115 .
+ (("dagger" . 32) ("Dagger" . 33) ("permil" . 48)
+ ("lsaquo" . 57) ("rsaquo" . 58)
+ ("bull" . 34) ("hellip" . 38) ("prime" . 50) ("Prime" . 51)
+ ("oline" . 62) ("frasl" . 68)))
+ (116 .
+ (("euro" . 76)))))
+ (greek '((39 . (("thetasym" . 81) ("upsih" . 82) ("piv" . 86)))))
+ (letterlike-symbols
+ '((117 .
+ (("weierp" . 88) ("image" . 81) ("real" . 92)
+ ("trade" . 98) ("alefsym" . 117)))))
+ (arrows
+ '((118 .
+ (("larr" . 112) ("uarr" . 113) ("rarr" . 114) ("darr" . 115)
+ ("harr" . 116)))
+ (119 .
+ (("crarr" . 53) ("lArr" . 80) ("uArr" . 81) ("rArr" . 81)
+ ("dArr" . 83) ("hArr" . 84)))))
+ (mathematical-operators
+ '((120 .
+ (("forall" . 32) ("part" . 34) ("exist" . 35) ("empty" . 37)
+ ("nabla" . 39) ("isin" . 40) ("notin" . 41) ("ni" . 43)
+ ("prod" . 47) ("sum" . 49) ("minus" . 50) ("lowast" . 55)
+ ("radic" . 58) ("prop" . 61) ("infin" . 62) ("ang" . 64)
+ ("and" . 71) ("or" . 72) ("cap" . 73) ("cup" . 74)
+ ("int" . 75) ("there4" . 84) ("sim" . 92) ("cong" . 101)
+ ("asymp" . 104)))
+ (121 .
+ (("ne" . 32) ("equiv" . 33) ("le" . 36) ("ge" . 37)
+ ("sub" . 66) ("sup" . 67) ("nsub" . 68) ("sube" . 70)
+ ("supe" . 71) ("oplus" . 85) ("otimes" . 87)
+ ("perp" . 101)))
+ (122 . (("sdot" . 37)))))
+ (miscellaneous-technical
+ '((122 . (("lceil" . 104) ("rceil" . 105) ("lfloor" . 106)
+ ("rfloor" . 107)))
+ (123 . (("lang" . 41) ("rang" . 42)))))
+ (suit
+ '(("loz" . (34 . 42)) ("spades" . (35 . 96)) ("clubs" . (35 . 99))
+ ("hearts" . (35 . 101)) ("diams" . (35 . 102)))))
+ (dolist (entities `(,@latin-extended-a
+ ,@latin-extended-b
+ ,@general-punctuation
+ ,@greek ,@letterlike-symbols ,@arrows
+ ,@mathematical-operators
+ ,@miscellaneous-technical))
+ (let ((code1 (car entities)))
+ (dolist (entity (cdr entities))
+ (puthash (car entity)
+ (char-to-string
+ (make-char 'mule-unicode-0100-24ff
+ code1 (cdr entity)))
+ table))))
+ (dolist (entity suit)
+ (puthash (car entity)
+ (char-to-string
+ (make-char 'mule-unicode-2500-33ff
+ (car (cdr entity)) (cdr (cdr entity))))
+ table))))
+ table)
+ "Table of html character entities and values.")
+
+(defconst w3m-entity-reverse-table
+ (let ((table (make-hash-table :test 'equal)))
+ (maphash (lambda (key val) (puthash val key table))
+ w3m-entity-table)
+ table)
+ "Revision table of html character entities and values.")
+
+(defconst w3m-entity-regexp
+ (let (buf)
+ (maphash (lambda (key val) (push key buf))
+ w3m-entity-table)
+ (concat "&\\("
+ (let ((max-specpdl-size (* 1024 1024))) ;; For old Emacsen.
+ (regexp-opt buf))
+ "\\|#\\(?:[xX][0-9a-fA-F]+\\|[0-9]+\\)\\)\\(\\'\\|[^0-9a-zA-Z]\\)"))
+ "Regexp matching html character entities.")
+
+(defconst w3m-encoding-alist
+ (eval-when-compile
+ (apply 'nconc
+ (mapcar (lambda (elem)
+ (mapcar (lambda (x) (cons x (car elem)))
+ (cdr elem)))
+ '((gzip . ("gzip" "x-gzip" "compress" "x-compress"))
+ (bzip . ("x-bzip" "bzip" "bzip2"))
+ (deflate . ("x-deflate" "deflate"))))))
+ "Alist of content encoding types and decoder symbols.
+Decoders are specified by `w3m-decoder-alist' (which see).")
+
+(defconst w3m-emacs-w3m-icon "\
+R0lGODlhUwAOAPIFAP///38AvwAAv1Uq/AC/AL9/Af8AAAAAACH/C05FVFNDQVBFMi4wAwEA
+AAAh+QQEIQD/ACwAAAAAUwAOAEADwgi63P4wykldCBYDIRT33RYOQ0ScU1EAKrs2hqHEswzQ
+ynUte78vnA9DQGKQihIUQNliNGlQXGVKrVqv2Oy06Zr+vpqfcDgqAZDHCvPVVHFxcJsOAAbZ
+RWdkfn9GKSVtbC83NnE1WoiIblyJjY4KXIwSdXQ+GEKYIXtoZnoPa5CDoTUyMaVyOpRimkFC
+ngtHZksntAQKBCstkiyFvYeVGXeZCpzEsgt/EYGjv4aEPHPCIWNEJXppyLQVy6RSzlKP4eIJ
+ACH5BAQhAP8ALAAAAAABAAEAAAMCCAkAIfkEBCEA/wAsAQABAFEACwAAAx0Iutz+MMpJq704
+6827/2AojmRpnmiqrmzrvnBsJgAh+QQEIQD/ACwBAAQAEQAIAAADHAixAb6qMRgfZDbXHaem
+nBOKINmIpnSWqIe+TgIAIfkEBCEA/wAsCQAEABcACAAAAykYAcoNUEgBq1ALAxnp9tXzcFVX
+OtAITmS4fCYsuzHZnqhsg/geb7hKAgAh+QQEIQD/ACwXAAQAFAAIAAADJSgKzDKjAQjbYrXO
+uJ3AnEZZytdJoAZcKuqKIeduchaidjPOQAIAIfkEBCEA/wAsJgAEABUACAAAAyA4OtD+gJAm
+GVAQyodz3s5iRVI5RR/ordTJapP6OuacJQAh+QQEIQD/ACw2AAEAEAALAAADJgi6XO4sAqio
+nGU5ogjH0VZlYFN8VPoARAZZGviSlzpKdmneF5AAADs="
+ "A small image to be displayed in the about: page.
+It is encoded in the optimized interlaced endlessly animated gif format
+and base64. Emacs can display only the 1st frame of an animation, but
+XEmacs can fully display it with the help of the gifsicle program.")
+
+(defcustom w3m-process-modeline-format " loaded: %s"
+ "*Format used when displaying the progress of the external w3m process.
+It shows a percentage of the data loaded from the web server."
+ :group 'w3m
+ :type '(choice (string :tag "Format") function))
+
+(defcustom w3m-ignored-image-url-regexp nil
+ "*Regexp matching image urls which you don't want to view.
+It is effective even if `w3m-display-inline-images' is non-nil.
+For instance, the value \"^http://www\\.google\\.com/\" conceals
+Google's logo and navigation images, but display YouTube's
+thumbnail."
+ :group 'w3m
+ :type '(regexp :format "URL: %v\n" :size 0))
+
+(defcustom w3m-refresh-minimum-interval 60
+ "*Minimum seconds to wait for refresh, when visiting a page by
+history-back or history-next."
+ :group 'w3m
+ :type '(integer :size 0))
+
+(defvar w3m-modeline-process-status-on "<PRC>"
+ "Modeline control for displaying the status when the process is running.
+The value will be modified for displaying the graphic icon.")
+
+(defvar w3m-modeline-image-status-on "[IMG]"
+ "Modeline control to display the status when inline images are turned on.
+The value will be modified for displaying the graphic icon.")
+
+(defvar w3m-modeline-status-off "[ - ]"
+ "Modeline control for displaying the status for the default.
+The value will be modified for displaying the graphic icon.")
+
+(defvar w3m-modeline-ssl-image-status-on "[IMG(SSL)]"
+ "Modeline control for displaying the status when images and SSL are on.
+The value will be modified for displaying the graphic icon.")
+
+(defvar w3m-modeline-ssl-status-off "[SSL]"
+ "Modeline control for displaying the status when SSL is turned on.
+The value will be modified for displaying the graphic icon.")
+
+(defvar w3m-modeline-separator " / "
+ "String used to separate a status and a title in the modeline.")
+
+(defvar w3m-modeline-favicon nil
+ "Modeline control for displaying a favicon.
+This variable will be made buffer-local.")
+
+(defvar w3m-favicon-image nil
+ "Favicon image of the page.
+This variable will be made buffer-local")
+
+(defvar w3m-current-process nil
+ "Flag used to say whether the external process is running in the buffer.
+This variable will be made buffer-local.")
+(make-variable-buffer-local 'w3m-current-process)
+
+(defvar w3m-refresh-timer nil
+ "Variable used to keep a timer object for refreshing a page.
+It will be supplied by the REFRESH attribute in the META tag, and made
+buffer-local in each emacs-w3m buffer.")
+(make-variable-buffer-local 'w3m-refresh-timer)
+
+(defvar w3m-mail-user-agents '(gnus-user-agent
+ message-user-agent
+ mew-user-agent
+ vm-user-agent
+ wl-user-agent)
+ "List of mail user agents that `w3m-mail' supports.
+See also w3m-mail.el.")
+
+(defvar w3m-current-base-url nil
+ "URL specified by <base...> tag in <head> element of the page source.")
+(defvar w3m-current-forms nil
+ "Variable used to keep forms data for the current emacs-w3m buffer.")
+(defvar w3m-current-coding-system nil
+ "Coding system used when decoding the current emacs-w3m buffer.")
+(defvar w3m-current-content-charset nil
+ "Content charset of the page specified by the server or the META tag.")
+(defvar w3m-icon-data nil
+ "Cons of icon data and its image-type for the current emacs-w3m buffer.
+It is used for favicon data. The type is often `ico'.")
+(defvar w3m-next-url nil
+ "URL as the next document in the author-defined sequence.")
+(defvar w3m-previous-url nil
+ "URL as the previous document in the author-defined sequence.")
+(defvar w3m-start-url nil
+ "URL as the first document in the author-defined sequence.")
+(defvar w3m-contents-url nil
+ "URL as the table of contents for the current page.")
+(defvar w3m-max-anchor-sequence nil
+ "Maximum number of the anchor sequence in the current page.")
+(defvar w3m-current-refresh nil
+ "Cons of number of seconds and a url specified by the REFRESH attribute.")
+(defvar w3m-current-ssl nil
+ "SSL certification indicator for the current emacs-w3m buffer.")
+(defvar w3m-name-anchor-from-hist nil
+ "List of the points of where `w3m-search-name-anchor' come from.")
+
+(make-variable-buffer-local 'w3m-current-url)
+(make-variable-buffer-local 'w3m-current-base-url)
+(make-variable-buffer-local 'w3m-current-title)
+(make-variable-buffer-local 'w3m-current-forms)
+(make-variable-buffer-local 'w3m-current-coding-system)
+(make-variable-buffer-local 'w3m-current-content-charset)
+(make-variable-buffer-local 'w3m-icon-data)
+(make-variable-buffer-local 'w3m-next-url)
+(make-variable-buffer-local 'w3m-previous-url)
+(make-variable-buffer-local 'w3m-start-url)
+(make-variable-buffer-local 'w3m-contents-url)
+(make-variable-buffer-local 'w3m-max-anchor-sequence)
+(make-variable-buffer-local 'w3m-current-refresh)
+(make-variable-buffer-local 'w3m-current-ssl)
+(make-variable-buffer-local 'w3m-name-anchor-from-hist)
+
+(defun w3m-clear-local-variables ()
+ (setq w3m-current-url nil
+ w3m-current-base-url nil
+ w3m-current-title nil
+ w3m-current-coding-system nil
+ w3m-current-content-charset nil
+ w3m-icon-data nil
+ w3m-next-url nil
+ w3m-previous-url nil
+ w3m-start-url nil
+ w3m-contents-url nil
+ w3m-max-anchor-sequence nil
+ w3m-current-refresh nil
+ w3m-current-ssl nil
+ w3m-name-anchor-from-hist nil))
+
+(defun w3m-copy-local-variables (from-buffer)
+ (let (url base title cs char icon next prev start toc hseq refresh ssl)
+ (with-current-buffer from-buffer
+ (setq url w3m-current-url
+ base w3m-current-base-url
+ title w3m-current-title
+ cs w3m-current-coding-system
+ char w3m-current-content-charset
+ icon w3m-icon-data
+ next w3m-next-url
+ prev w3m-previous-url
+ start w3m-start-url
+ toc w3m-contents-url
+ hseq w3m-max-anchor-sequence
+ refresh w3m-current-refresh
+ ssl w3m-current-ssl))
+ (setq w3m-current-url url
+ w3m-current-base-url base
+ w3m-current-title title
+ w3m-current-coding-system cs
+ w3m-current-content-charset char
+ w3m-icon-data icon
+ w3m-next-url next
+ w3m-previous-url prev
+ w3m-start-url start
+ w3m-contents-url toc
+ w3m-max-anchor-sequence hseq
+ w3m-current-refresh refresh
+ w3m-current-ssl ssl)))
+
+(defvar w3m-verbose nil
+ "*Flag controls whether to log messages in the *Messages* buffer.
+If it is nil, a lot of messages issued by emacs-w3m will be displayed
+only in the echo area.")
+
+(defvar w3m-safe-url-regexp nil
+ "Regexp matching urls which are considered to be safe.
+The nil value means all urls are considered to be safe.
+
+Note: The value, that might be bound to a certain value while rendering
+contents, will be held by the `w3m-safe-url-regexp' text property that
+is set over the rendered contents in a buffer. So, programs that use
+the value to test whether a url of a link in a buffer is safe should
+use the value of the text property, not the value of this variable.
+See the function definitions of `w3m-toggle-inline-image',
+`w3m-toggle-inline-images', `w3m-safe-view-this-url', and
+`w3m-mouse-safe-view-this-url'.")
+
+(defvar w3m-current-buffer nil)
+(defvar w3m-cache-buffer nil)
+(defvar w3m-cache-articles nil)
+(defvar w3m-cache-hashtb nil)
+(defvar w3m-input-url-history nil)
+
+(defconst w3m-arrived-db-size 1023)
+(defvar w3m-arrived-db nil
+ "Hash table, the arrived URLs database.
+The name of each symbol represents a url, the arrival time in the
+Emacs style (a list of three integers) is stored as the value, and
+informations including a title, a modification time, a content charset
+and a content type are stored as the properties of the symbol. The
+nil value means it has not been initialized.")
+
+(defvar w3m-arrived-setup-functions nil
+ "Hook functions run after setting up the arrived URLs database.")
+(defvar w3m-arrived-shutdown-functions nil
+ "Hook functions run after saving the arrived URLs database.")
+
+(defconst w3m-image-type-alist
+ '(("image/jpeg" . jpeg)
+ ("image/gif" . gif)
+ ("image/png" . png)
+ ("image/x-xbm" . xbm)
+ ("image/x-xpm" . xpm))
+ "Alist of content types and image types defined as the Emacs' features.")
+
+(defconst w3m-toolbar-buttons
+ '("back" "parent" "forward" "reload" "open" "home" "search" "image"
+ "copy" "weather" "antenna" "history" "db-history")
+ "List of prefix strings for the toolbar buttons.")
+
+(defconst w3m-toolbar
+ (if (equal "Japanese" w3m-language)
+ (let ((a (decode-coding-string "\e$B%\"\e(B" 'iso-2022-jp))) ;; $B%"(B
+ `([w3m-toolbar-back-icon w3m-view-previous-page
+ (w3m-history-previous-link-available-p)
+ "$BA0$N%Z!<%8$KLa$k(B"]
+ [w3m-toolbar-parent-icon w3m-view-parent-page
+ (w3m-parent-page-available-p)
+ "$B>e$N%G%#%l%/%H%j$X0\F0$9$k(B"]
+ [w3m-toolbar-forward-icon w3m-view-next-page
+ (w3m-history-next-link-available-p)
+ "$B<!$N%Z!<%8$K?J$`(B"]
+ [w3m-toolbar-reload-icon w3m-reload-this-page
+ w3m-current-url
+ "$B%5!<%P$+$i%Z!<%8$r$b$&0lEYFI$_9~$`(B"]
+ [w3m-toolbar-open-icon w3m-goto-url t "URL $B$rF~NO$7$F%Z!<%8$r3+$/(B"]
+ [w3m-toolbar-home-icon w3m-gohome w3m-home-page
+ "$B%[!<%`%Z!<%8$X%8%c%s%W(B"]
+ [w3m-toolbar-search-icon w3m-search t "$B%$%s%?!<%M%C%H>e$r8!:w(B"]
+ [w3m-toolbar-image-icon w3m-toggle-inline-images t
+ "$B2hA|$NI=<($r%H%0%k$9$k(B"]
+ [w3m-toolbar-copy-icon w3m-copy-buffer t
+ "$B$3$N%;%C%7%g%s$N%3%T!<$r:n$k(B"]
+ [w3m-toolbar-weather-icon w3m-weather t "$BE75$M=Js$r8+$k(B"]
+ [w3m-toolbar-antenna-icon w3m-antenna t
+ ,(concat a "$B%s%F%J$G<u?.$9$k(B")]
+ [w3m-toolbar-history-icon w3m-history t "$B%R%9%H%j!<(B"]
+ [w3m-toolbar-db-history-icon w3m-db-history t
+ "$B2a5n$KK,Ld$7$?(B URL $B$NMzNr$r8+$k(B"]))
+ '([w3m-toolbar-back-icon w3m-view-previous-page
+ (w3m-history-previous-link-available-p)
+ "Back to Previous Page"]
+ [w3m-toolbar-parent-icon w3m-view-parent-page
+ (w3m-parent-page-available-p)
+ "View the parent page"]
+ [w3m-toolbar-forward-icon w3m-view-next-page
+ (w3m-history-next-link-available-p)
+ "Forward to Next Page"]
+ [w3m-toolbar-reload-icon w3m-reload-this-page
+ w3m-current-url
+ "Reload This Page"]
+ [w3m-toolbar-open-icon w3m-goto-url t "Go to..."]
+ [w3m-toolbar-home-icon w3m-gohome w3m-home-page "Go to Home Page"]
+ [w3m-toolbar-search-icon w3m-search t "Search the Internet"]
+ [w3m-toolbar-image-icon w3m-toggle-inline-images t "Toggle Images"]
+ [w3m-toolbar-copy-icon w3m-copy-buffer t "Make a Copy of This Session"]
+ [w3m-toolbar-weather-icon w3m-weather t "Weather Forecast"]
+ [w3m-toolbar-antenna-icon w3m-antenna t "Investigate with Antenna"]
+ [w3m-toolbar-history-icon w3m-history t "Show a History"]
+ [w3m-toolbar-db-history-icon w3m-db-history t "View Arrived URLs"]))
+ "Toolbar definition for emacs-w3m.")
+
+;; "View" is page viewing
+;; "Show" is link list showing
+(defconst w3m-menubar
+ (let ((a (when w3m-use-japanese-menu
+ (decode-coding-string "\e$B%\"\e(B" 'iso-2022-jp)))) ;; $B%"(B
+ `("w3m"
+ [,(w3m-make-menu-item "$B$3$N(B URL $B$r?7$7$$%;%C%7%g%s$G3+$/(B"
+ "Open This URL in a new session")
+ w3m-view-this-url-new-session (or (w3m-anchor) (w3m-image))]
+ [,(w3m-make-menu-item "$B$3$N(B URL $B$r%@%&%s%m!<%I$9$k(B" "Download This URL")
+ w3m-download-this-url (or (w3m-anchor) (w3m-image))]
+ [,(w3m-make-menu-item "$B%@%&%s%m!<%I(B..." "Download to...")
+ w3m-download t]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$BA0$N%Z!<%8$KLa$k(B" "Back to Previous Page")
+ w3m-view-previous-page
+ (w3m-history-previous-link-available-p)]
+ [,(w3m-make-menu-item "$B<!$N%Z!<%8$K0\F0$9$k(B" "Forward to Next Page")
+ w3m-view-next-page
+ (w3m-history-next-link-available-p)]
+ [,(w3m-make-menu-item "$B>e$N3,AX$K0\F0$9$k(B" "Up to Parent Page")
+ w3m-view-parent-page
+ (w3m-parent-page-available-p)]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B$3$N%Z!<%8$r30It%V%i%&%6$G3+$/(B"
+ "Open This Page in an External Browser")
+ w3m-external-view-current-url w3m-current-url]
+ [,(w3m-make-menu-item "$B$3$N(B URL $B$r30It%V%i%&%6$G3+$/(B"
+ "Open This URL in an External Browser")
+ w3m-external-view-this-url (or (w3m-anchor) (w3m-image))]
+ "----" ;; separator
+ (,(w3m-make-menu-item "$B:FI=<((B" "Redisplay")
+ [,(w3m-make-menu-item "$B$3$N%Z!<%8$r:F<hF@$9$k(B" "Reload This Page")
+ w3m-reload-this-page w3m-current-url]
+ [,(w3m-make-menu-item "$B$9$Y$F$N%Z!<%8$r:F<hF@$9$k(B" "Reload All Pages")
+ w3m-reload-all-pages (cdr (w3m-list-buffers))]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B2hA|I=<($N@ZBX(B($BA4It(B)" "Toggle Images")
+ w3m-toggle-inline-images (w3m-display-graphic-p)]
+ [,(w3m-make-menu-item "$B2hA|I=<($N@ZBX(B($B$3$N2hA|(B)" "Toggle This Image")
+ w3m-toggle-inline-image (w3m-image)]
+ [,(w3m-make-menu-item "$B2hA|I=<($r;_$a$k(B" "Turn off Images")
+ w3m-turnoff-inline-images (w3m-display-graphic-p)]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B:FIA2h$9$k(B" "Redisplay This Page")
+ w3m-redisplay-this-page w3m-current-url]
+ [,(w3m-make-menu-item "Charset $B$r;XDj$7$F:FIA2h$9$k(B"
+ "Redisplay This Page with Charset")
+ w3m-redisplay-with-charset w3m-current-url]
+ [,(w3m-make-menu-item "Content-type $B$r;XDj$7$F:FIA2h$9$k(B"
+ "Redisplay This Page with Content-type")
+ w3m-redisplay-with-content-type w3m-current-url]
+ [,(w3m-make-menu-item "$B;XDj$7$?(B Charset $B$H(B Content-type $B$rGK4~$9$k(B"
+ "Reset Charset and Content-type")
+ w3m-redisplay-and-reset w3m-current-url]
+ ) ;; end redisplay
+ [,(w3m-make-menu-item "$B%[!<%`%Z!<%8$X0\F0(B" "Go to Home Page")
+ w3m-gohome w3m-home-page]
+ (,(w3m-make-menu-item "$B%V%C%/%^!<%/(B" "Bookmark")
+ [,(w3m-make-menu-item "$B%V%C%/%^!<%/$rI=<((B" "View Bookmark")
+ w3m-bookmark-view t]
+ [,(w3m-make-menu-item "$B?7$7$$%;%C%7%g%s$G%V%C%/%^!<%/$rI=<((B"
+ "View Bookmark in a New Session")
+ w3m-bookmark-view-new-session t])
+ [,(w3m-make-menu-item "$B0\F0(B..." "Go to...")
+ w3m-goto-url t]
+ "----" ;; separator
+ (,(w3m-make-menu-item "$BMzNr(B" "History")
+ [,(w3m-make-menu-item "$BLZ9=B$$GMzNr$rI=<((B" "Show a Visited URLs Tree")
+ w3m-history t]
+ [,(w3m-make-menu-item "$B%j%9%H$GMzNr$rI=<((B" "Show an Arrived URLs List")
+ w3m-db-history t]
+ ) ;; end history
+ [,(w3m-make-menu-item "$B%$%s%?!<%M%C%H$G$N8!:w(B..."
+ "Search the Internet...")
+ w3m-search t]
+ [,(w3m-make-menu-item "$B?7$7$$%;%C%7%g%s$G8!:w(B..."
+ "Search the Internet in a New Session...")
+ w3m-search-new-session t]
+ [,(w3m-make-menu-item "$BE75$M=Js(B" "Weather Forecast")
+ w3m-weather t]
+ [,(w3m-make-menu-item (concat a "$B%s%F%J$G<hF@(B")
+ "Investigate with Antenna")
+ w3m-antenna t]
+ (,(w3m-make-menu-item "$B%X%k%W(B" "Resource")
+ [,(w3m-make-menu-item "$B%W%m%;%9$rCf;_$9$k(B" "Cancel Process")
+ w3m-process-stop w3m-current-process]
+ [,(w3m-make-menu-item "$B%=!<%9$r8+$k(B" "View Source")
+ w3m-view-source t]
+ [,(w3m-make-menu-item "$B%X%C%@!<$r8+$k(B" "View Header")
+ w3m-view-header t]
+ ) ;; end resource
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B$3$N%Z!<%8$r%a!<%k$GAw$k(B" "Mail this page")
+ w3m-mail (memq mail-user-agent w3m-mail-user-agents)]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B%P%0%l%]!<%H$rAw$k(B" "Send a Bug Report")
+ report-emacs-w3m-bug t]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B$3$N(B URL $B$rI=<($9$k(B" "Print the Current URL")
+ w3m-print-current-url t]
+ [,(w3m-make-menu-item "w3m $B$rJD$8$k(B" "Close w3m")
+ w3m-close-window t]
+ [,(w3m-make-menu-item "w3m $B$r=*N;$9$k(B" "Quit w3m")
+ w3m-quit t]
+ )) ;; end w3m
+ "Menubar definition for emacs-w3m.")
+
+(defvar w3m-rmouse-menubar
+ `("w3m"
+ [,(w3m-make-menu-item "$BA0$N%Z!<%8$KLa$k(B" "Back to Previous Page")
+ w3m-view-previous-page
+ (w3m-history-previous-link-available-p)]
+ [,(w3m-make-menu-item "$B<!$N%Z!<%8$K0\F0$9$k(B" "Forward to Next Page")
+ w3m-view-next-page
+ (w3m-history-next-link-available-p)]
+ [,(w3m-make-menu-item "$B>e$N3,AX$K0\F0$9$k(B" "Up to Parent Page")
+ w3m-view-parent-page
+ (w3m-parent-page-available-p)]
+ "----" ;; separator
+ [,(w3m-make-menu-item "$B$3$N%Z!<%8$r:F<hF@$9$k(B" "Reload This Page")
+ w3m-reload-this-page w3m-current-url]
+ [,(w3m-make-menu-item "$B$9$Y$F$N%Z!<%8$r:F<hF@$9$k(B" "Reload All Pages")
+ w3m-reload-all-pages (cdr (w3m-list-buffers))]
+ [,(w3m-make-menu-item "$B%W%m%;%9$rCf;_$9$k(B" "Cancel Process")
+ w3m-process-stop w3m-current-process])
+ "*Menubar for click the right mouse button.")
+
+(defvar w3m-cid-retrieve-function-alist nil)
+(defvar w3m-force-redisplay t)
+
+(defvar w3m-work-buffer-list nil)
+(defconst w3m-work-buffer-name " *w3m-work*")
+(defconst w3m-select-buffer-name " *w3m buffers*")
+
+(defconst w3m-dump-head-source-command-arguments
+ (cond ((eq w3m-type 'w3mmee)
+ (list "-dump=extra,head,source"))
+ (t
+ (list
+ '(if w3m-accept-languages
+ '("-o"
+ (concat "accept_language="
+ (mapconcat 'identity w3m-accept-languages ","))))
+ "-dump_extra")))
+ "Arguments passed to the w3m command to run \"dump_extra\".")
+
+(defvar w3m-halfdump-command nil
+ "Alternative w3m command used to run \"halfdump\".
+If it is nil, the command specified to `w3m-command' is used.")
+
+(defconst w3m-halfdump-command-arguments
+ (cond ((eq w3m-type 'w3mmee)
+ (list '(if w3m-treat-image-size
+ "-dump=half-buffer,single-row-image"
+ "-dump=half-buffer")
+ '(if (eq w3m-input-coding-system 'ctext)
+ (list "-I" "x-ctext")
+ (when (and (eq w3m-input-coding-system 'binary)
+ charset)
+ (list "-I" 'charset)))
+ "-o" "concurrent=0"))
+ ((eq w3m-type 'w3m-m17n)
+ (list "-halfdump"
+ "-o" "ext_halfdump=1"
+ "-o" "strict_iso2022=0"
+ "-o" "fix_width_conv=1"
+ "-o" "use_jisx0201=0"
+ "-o" "ucs_conv=1"
+ '(if (eq w3m-input-coding-system 'binary)
+ (if charset (list "-I" 'charset))
+ (list "-I" (cond
+ ((eq w3m-input-coding-system 'utf-8)
+ "UTF-8")
+ ((eq w3m-input-coding-system 'iso-8859-1)
+ "ISO-8859-1")
+ (t
+ "ISO-2022-JP-2"))))
+ "-O"
+ '(cond
+ ((eq w3m-output-coding-system 'utf-8)
+ "UTF-8")
+ ((eq w3m-output-coding-system 'iso-8859-1)
+ "ISO-8859-1")
+ (t
+ "ISO-2022-JP-2"))))
+ ((eq w3m-input-coding-system 'w3m-euc-japan)
+ (list "-halfdump" "-I" "e"))
+ (t (list "-halfdump")))
+ "Arguments passed to the w3m command to run \"halfdump\".")
+
+(defconst w3m-halfdump-command-common-arguments
+ (list "-T" "text/html" "-t" tab-width "-cols" '(w3m-display-width)
+ '(cond
+ ((and (eq w3m-display-ins-del 'fontify)
+ (w3m-device-on-window-system-p))
+ (list "-o" "display_ins_del=2"))
+ ((or (eq w3m-display-ins-del 'tag)
+ (and (eq w3m-display-ins-del 'fontify)
+ (not (w3m-device-on-window-system-p))))
+ (list "-o" "display_ins_del=1"))))
+ "Arguments used in common by the w3m command variants to run \"halfdump\".")
+
+(defconst w3m-arrived-ignored-regexp
+ "\\`about:\\(?://\\(?:header\\|source\\|history\\|\
+db-history\\|antenna\\|namazu\\|dtree\\)/.*\\)?\\'\
+\\|\\`about:/*blank/?\\'"
+ "Regexp matching urls which aren't stored in the arrived URLs database.")
+
+(defconst w3m-history-ignored-regexp
+ "\\`about:\\(?://\\(?:header\\|source\\|history\\|\
+db-history\\|antenna\\|namazu\\|dtree\\)/.*\\)?\\'\
+\\|\\`about:/*blank/?\\'"
+ "Regexp matching urls which aren't stored in the history.")
+
+(defvar w3m-mode-map nil "Keymap for emacs-w3m buffers.")
+(defvar w3m-link-map nil "Keymap used on links.")
+(defvar w3m-doc-view-map nil
+ "Keymap used in `doc-view-mode' that emacs-w3m launches.
+`doc-view-mode-map' gets to be its parent keymap.")
+
+(defvar w3m-mode-setup-functions nil
+ "Hook functions run after setting up the `w3m-mode'.")
+(defvar w3m-display-functions nil
+ "Hook functions run after displaying pages in emacs-w3m buffers.
+Each function is called with a url string as the argument. This hook
+is evaluated just before evaluating `w3m-display-hook'.")
+
+(defvar w3m-load-hook nil
+ "*Hook run after loading the w3m.elc module.
+It is not recommended that you use this hook instead of writing into
+`w3m-init-file' for customization.")
+
+
+;; Generic functions:
+(defun w3m-url-to-file-name (url)
+ "Return the file name which is pointed to by URL.
+When URL does not point to any local files, it returns nil. The
+actual performance of this function is to strip off the scheme part
+and the net_loc part from URL. It is meaningless to give an argument
+whose net_loc part is not empty, a null string or the localhost name
+to this function."
+ (cond
+ ((string-match "\\`\\(\\(file:/\\{0,2\\}\\)\\|about://dtree\\)/" url)
+ (setq url (substring url (match-end 1)))
+ (when (and (match-beginning 2) ;; file:
+ (< (match-end 2) 7) ;; file:// or file:/
+ (string-match "\\`\\(/[^/]+[^/:|]\\)/" url))
+ (cond ((file-directory-p (match-string 0 url))
+ ) ;; The directory "/hostname/" exists.
+ ((string-match (concat "\\`/\\(localhost\\|127\\.0\\.0\\.1\\|"
+ (regexp-quote (system-name)) "\\)/")
+ url)
+ ;; Strip the localhost name.
+ (setq url (substring url (match-end 1))))
+ (t
+ ;; Make it a Tramp url: /hostname:/...
+ ;; See `tramp-default-method' and `tramp-default-method-alist'.
+ (setq url (concat (substring url 0 (match-end 1))
+ ":"
+ (substring url (match-end 1)))))))
+ ;; Process abs_path part in Windows.
+ (when (and w3m-treat-drive-letter
+ (string-match
+ "\\`/\\(?:\\([a-zA-Z]\\)[|:]?\\|cygdrive/\\([a-zA-Z]\\)\\)/"
+ url))
+ (setq url (concat (or (match-string 1 url) (match-string 2 url))
+ ":/"
+ (substring url (match-end 0)))))
+ (if (string-match "\\`/[^/:]\\{2,\\}:/" url)
+ ;; Don't check for a Tramp url.
+ url
+ (if (file-exists-p url)
+ url
+ (let ((x (w3m-url-decode-string url w3m-file-name-coding-system)))
+ (if (file-exists-p x) x url)))))
+ ((string-match "\\`\\(?:[~/]\\|[a-zA-Z]:/\\|\\.\\.?/\\)" url) url)
+ (t
+ (catch 'found-file
+ (dolist (pair w3m-url-local-directory-alist)
+ (and (string-match (concat "\\`"
+ (regexp-quote
+ (file-name-as-directory (car pair))))
+ url)
+ (let ((file (expand-file-name (substring url (match-end 0))
+ (cdr pair))))
+ (when (or (file-exists-p file)
+ (file-exists-p
+ (setq file (w3m-url-decode-string
+ file w3m-file-name-coding-system))))
+ (throw 'found-file file)))))))))
+
+(defun w3m-expand-file-name-as-url (file &optional directory)
+ "Return a url string which points to the FILE.
+Optional DIRECTORY is a directory to start with if FILE is relative
+\(i.e., FILE doesn't start with slash). It defaults to the current
+directory."
+ (setq file (expand-file-name file directory))
+ (concat "file://"
+ (if (string-match "\\`\\([a-zA-Z]\\):" file)
+ (format (if w3m-use-cygdrive "/cygdrive/%s%s" "/%s|%s")
+ (match-string 1 file)
+ (substring file (match-end 0)))
+ file)))
+
+
+;;; Managing the arrived URLs database:
+(defmacro w3m-arrived-intern (url &optional soft)
+ "Normalize URL by stripping last / and intern it into `w3m-arrived-db'.
+If SOFT is non-nil, use `intern-soft' instead."
+ (let ((fn (if soft 'intern-soft 'intern))
+ (str (if (consp url)
+ `(let* ((url ,url)
+ (len (length url)))
+ (if (and (not (zerop len))
+ (eq (aref url (1- len)) ?/))
+ (substring url 0 -1)
+ url))
+ `(if (let ((len (length ,url)))
+ (and (not (zerop len))
+ (eq (aref ,url (1- len)) ?/)))
+ (substring ,url 0 -1)
+ ,url))))
+ `(,fn ,str w3m-arrived-db)))
+
+(defun w3m-arrived-add (url &optional title modification-time
+ arrival-time content-charset content-type)
+ "Add URL to the arrived URLs database.
+Optional TITLE, MODIFICATION-TIME, ARRIVAL-TIME, CONTENT-CHARSET and
+CONTENT-TYPE are also be added."
+ (unless (string-match w3m-arrived-ignored-regexp url)
+ (let ((ident (w3m-arrived-intern url)))
+ (if (string-match "\\`\\([^#]+\\)#" url)
+ (w3m-arrived-add (substring url 0 (match-end 1))
+ title modification-time arrival-time
+ content-charset content-type)
+ (when title
+ (put ident 'title title))
+ (when modification-time
+ (put ident 'last-modified modification-time))
+ (when content-charset
+ (put ident 'content-charset content-charset))
+ (when content-type
+ (put ident 'content-type content-type)))
+ (set ident arrival-time))))
+
+(defun w3m-arrived-p (url)
+ "Return non-nil if a page of URL has arrived."
+ (or (string-match w3m-arrived-ignored-regexp url)
+ (w3m-arrived-intern url t)))
+
+(defun w3m-arrived-time (url)
+ "Return the arrival time of a page of URL if it has arrived.
+Otherwise return nil."
+ (let ((v (w3m-arrived-intern url t)))
+ (and v (boundp v) (symbol-value v))))
+(defsetf w3m-arrived-time (url) (value)
+ (list 'w3m-arrived-add url nil nil value))
+
+(defun w3m-arrived-put (url property value)
+ "Store VALUE in the arrived URLs database as the PROPERTY of URL.
+Return VALUE if a page of URL has arrived. Otherwise, VALUE is
+ignored and return nil."
+ (let ((symbol (w3m-arrived-intern url t)))
+ (and symbol (put symbol property value))))
+
+(defun w3m-arrived-get (url property)
+ "Return the value of URL's PROPERTY stored in the arrived URLs database.
+If a page of URL has not arrived, return nil."
+ (let ((symbol (w3m-arrived-intern url t)))
+ (and symbol (get symbol property))))
+
+(defsetf w3m-arrived-get w3m-arrived-put)
+
+(defmacro w3m-arrived-title (url)
+ "Return the title of URL having stored in the arrived URLs database."
+ `(w3m-arrived-get ,url 'title))
+
+(defmacro w3m-arrived-last-modified (url)
+ "Return the mod time of URL having stored in the arrived URLs database.
+If a page of URL has not arrived yet, return nil."
+ `(w3m-arrived-get ,url 'last-modified))
+
+(defmacro w3m-arrived-content-charset (url)
+ "Return the content charset of URL stored in the arrived URLs database.
+If it has not been specified or a page of URL has not arrived yet,
+return nil."
+ `(w3m-arrived-get ,url 'content-charset))
+
+(defmacro w3m-arrived-content-type (url)
+ "Return the content type of URL stored in the arrived URLs database.
+If it has not been specified or a page of URL has not arrived yet,
+return nil."
+ `(w3m-arrived-get ,url 'content-type))
+
+(defun w3m-arrived-load-list ()
+ "Load the arrived URLs database file.
+The file is specified by `w3m-arrived-file'. If the data is in old
+format, they will simply be ignored."
+ (let ((list (w3m-load-list w3m-arrived-file)))
+ (when (or
+ ;; Before the revision 1.120, every element of the list was
+ ;; a string that represented an arrived URL.
+ (stringp (car list))
+ ;; Before the revision 1.135, every element was a cons
+ ;; cell: its car kept a URL, and its cdr kept a time when
+ ;; the URL was arrived.
+ ;; Before the revision 1.178, every element was a 4-tuple
+ ;; that consisted of a URL, a title, a modification time,
+ ;; and an arrival time.
+ ;; An element of the modern database is a 6-tuple that
+ ;; consisted of a URL, a title, a modification time, an
+ ;; arrival time, a charset, and a content type.
+ ;; Thus, the following condition eliminates the revision
+ ;; 1.177 and olders.
+ (<= (length (car list)) 4))
+ (setq list nil)
+ (when (file-exists-p w3m-arrived-file)
+ (delete-file w3m-arrived-file)))
+ list))
+
+(defun w3m-arrived-setup ()
+ "Load the arrived URLs database file and set up the hashed database.
+It is performed only when `w3m-arrived-db' has not been initialize yet.
+The file is specified by `w3m-arrived-file'."
+ (unless w3m-arrived-db
+ (setq w3m-arrived-db (make-vector w3m-arrived-db-size 0))
+ (let ((list (w3m-arrived-load-list)))
+ (dolist (elem list)
+ ;; Ignore an element that lacks an arrival time information.
+ (when (nth 3 elem)
+ (w3m-arrived-add (if (string-match "\\`/" (car elem))
+ (w3m-expand-file-name-as-url (car elem))
+ (car elem))
+ (nth 1 elem)
+ (nth 2 elem)
+ (nth 3 elem)
+ (when (stringp (nth 4 elem)) (nth 4 elem))
+ (nth 5 elem))))
+ (unless w3m-input-url-history
+ (setq w3m-input-url-history (mapcar (function car) list))))
+ (run-hooks 'w3m-arrived-setup-functions)))
+
+(defun w3m-arrived-shutdown ()
+ "Save the arrived URLs database in the file.
+The database `w3m-arrived-db' will be cleared after saving. The file
+is specified by `w3m-arrived-file'."
+ (when w3m-arrived-db
+ ;; Re-read the database file, and if there are data which another
+ ;; Emacs process registered, merge them to the current database.
+ (dolist (elem (w3m-arrived-load-list))
+ (when (w3m-time-newer-p (nth 3 elem) (w3m-arrived-time (car elem)))
+ (w3m-arrived-add (if (string-match "\\`/" (car elem))
+ (w3m-expand-file-name-as-url (car elem))
+ (car elem))
+ (nth 1 elem)
+ (nth 2 elem)
+ (nth 3 elem)
+ (when (stringp (nth 4 elem)) (nth 4 elem))
+ (nth 5 elem))))
+ ;; Convert current database to a list.
+ (let (list)
+ (mapatoms
+ (lambda (sym)
+ (and sym
+ (boundp sym)
+ (symbol-value sym) ; Ignore an entry lacks an arrival time.
+ (push (list (symbol-name sym)
+ (get sym 'title)
+ (get sym 'last-modified)
+ (symbol-value sym)
+ (get sym 'content-charset)
+ (get sym 'content-type))
+ list)))
+ w3m-arrived-db)
+ (w3m-save-list w3m-arrived-file
+ (w3m-sub-list
+ (sort list
+ (lambda (a b)
+ (if (equal (nth 3 a) (nth 3 b))
+ (string< (car a) (car b))
+ (w3m-time-newer-p (nth 3 a) (nth 3 b)))))
+ w3m-keep-arrived-urls)
+ nil t))
+ (setq w3m-arrived-db nil)
+ (run-hooks 'w3m-arrived-shutdown-functions)))
+
+(add-hook 'kill-emacs-hook 'w3m-arrived-shutdown)
+(add-hook 'kill-emacs-hook 'w3m-cookie-shutdown)
+(add-hook 'w3m-arrived-shutdown-functions 'w3m-session-automatic-save)
+(add-hook 'w3m-arrived-shutdown-functions 'w3m-session-crash-recovery-remove)
+(add-hook 'w3m-arrived-shutdown-functions 'w3m-cleanup-temp-files)
+
+;;; Generic macros and inline functions:
+(defun w3m-attributes (url &optional no-cache handler)
+ "Return a list of attributes corresponding to URL.
+Return nil if it failed in retrieving of the header.
+Otherwise, return a list which includes the following elements:
+
+ 0. Type of contents.
+ 1. Charset of contents.
+ 2. Size in bytes.
+ 3. Encoding of contents.
+ 4. Last modification time.
+ 5. Real URL.
+
+If the optional argument NO-CACHE is non-nil, cache is not used."
+ (if (not handler)
+ (condition-case nil
+ (w3m-process-with-wait-handler
+ (w3m-attributes url no-cache handler))
+ (w3m-process-timeout nil))
+ (setq url (w3m-url-strip-fragment url))
+ (cond
+ ((string= "about://emacs-w3m.gif" url)
+ (list "image/gif" nil nil nil nil url url))
+ ((string-match "\\`about://source/" url)
+ (lexical-let ((src (substring url (match-end 0))))
+ (w3m-process-do
+ (attrs (w3m-attributes src no-cache handler))
+ (list "text/plain"
+ (or (w3m-arrived-content-charset (w3m-url-strip-authinfo src))
+ (cadr attrs))
+ (nth 2 attrs)
+ (nth 3 attrs)
+ (nth 4 attrs)
+ (concat "about://source/" (nth 5 attrs))))))
+ ((string-match "\\`about:" url)
+ (list "text/html" w3m-coding-system nil nil nil url))
+ ((string-match "\\`cid:" url)
+ (let ((w3m-current-buffer (current-buffer)))
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-cid-retrieve url nil nil))
+ (list type nil nil nil nil url url))))
+ ((string-match "\\`data:" url)
+ (let ((w3m-current-buffer (current-buffer)))
+ (w3m-process-do-with-temp-buffer
+ (type (w3m-data-retrieve url nil nil))
+ (list type nil nil nil nil url url))))
+ ((w3m-url-local-p url)
+ (w3m-local-attributes url))
+ (t
+ (w3m-w3m-attributes url no-cache handler)))))
+
+(defmacro w3m-content-type (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (car attrs)))
+ `(car (w3m-attributes ,url ,no-cache))))
+(defmacro w3m-content-charset (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (nth 1 attrs)))
+ `(nth 1 (w3m-attributes ,url ,no-cache))))
+(defmacro w3m-content-length (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (nth 2 attrs)))
+ `(nth 2 (w3m-attributes ,url ,no-cache))))
+(defmacro w3m-content-encoding (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (nth 3 attrs)))
+ `(nth 3 (w3m-attributes ,url ,no-cache))))
+(defmacro w3m-last-modified (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (nth 4 attrs)))
+ `(nth 4 (w3m-attributes ,url ,no-cache))))
+(defmacro w3m-real-url (url &optional no-cache handler)
+ (if handler
+ `(let ((handler ,handler))
+ (w3m-process-do
+ (attrs (w3m-attributes ,url ,no-cache handler))
+ (nth 5 attrs)))
+ `(nth 5 (w3m-attributes ,url ,no-cache))))
+
+(defmacro w3m-make-help-echo (property)
+ "Make a function returning a string used for the `help-echo' message.
+PROPERTY is a symbol (which doesn't need to be quoted) of a text
+property (in XEmacs, it is an extent) with the value of a string which
+should be in the place where having to show a help message. If you
+need to know what function will be made, use `macroexpand'."
+ (if (featurep 'xemacs)
+ (let ((str `(get-text-property (extent-start-position extent)
+ ',property)))
+ `(lambda (extent)
+ (if (and w3m-track-mouse
+ (eq (extent-object extent) (current-buffer)))
+ (w3m-url-readable-string ,str))))
+ `(lambda (window object pos)
+ (if w3m-track-mouse
+ (let ((deactivate-mark nil))
+ (message nil) ; Clear the echo area.
+ (w3m-url-readable-string
+ (get-text-property pos ',property
+ (window-buffer window))))))))
+
+(defmacro w3m-make-balloon-help (property)
+ "Make a function returning a string used for the `balloon-help' message.
+Functions made are used only when emacs-w3m is running under XEmacs.
+It returns an interned symbol of a function. PROPERTY is a symbol
+\(which doesn't need to be quoted) of an extent with the value of a
+string which should be in the place where having to show a help
+message."
+ (when (featurep 'xemacs)
+ (let ((str `(get-text-property (extent-start-position extent)
+ ',property)))
+ `(let ((fn (intern (format "w3m-balloon-help-for-%s"
+ ',property))))
+ (prog1
+ fn
+ (unless (fboundp fn)
+ (defalias fn
+ (lambda (extent)
+ (if (and w3m-track-mouse
+ (eq (extent-object extent) (current-buffer)))
+ (w3m-url-readable-string ,str)))))
+ (when (and (featurep 'bytecomp)
+ (not (compiled-function-p (symbol-function fn))))
+ (byte-compile fn)))))))
+
+(defvar w3m-current-message nil
+ "The string currently displayed by `w3m-message' in the echo area.")
+(defvar w3m-message-silent nil
+ "When set to `t', w3m-message is just ignored.")
+
+(defun w3m-message (&rest args)
+ "Print a one-line message at the bottom of the screen.
+It displays a given message without logging, when the cursor is
+neither in the minibuffer or in the echo area and `w3m-verbose' is
+nil. When the cursor is either in the minibuffer or in the echo area
+and `w3m-verbose' is nil, it behaves as `format' and simply returns a
+string. When `w3m-verbose' is non-nil, it behaves identically as
+`message', that displays a given message with logging."
+ ;; Always clear previous message in order to shrink the window height
+ ;; for the echo area.
+ (unless (or (featurep 'xemacs)
+ (< emacs-major-version 22)
+ (< (string-width (or (current-message) "")) (window-width)))
+ (message nil))
+ (unless w3m-message-silent
+ (if w3m-verbose
+ (apply (function message) args)
+ (if (when w3m-process-background
+ (or (window-minibuffer-p (selected-window))
+ (when (current-message)
+ (not (equal (current-message) w3m-current-message)))))
+ (apply (function format) args)
+ (w3m-static-if (featurep 'xemacs)
+ (progn
+ (setq w3m-current-message (apply (function format) args))
+ (display-message 'no-log w3m-current-message))
+ (let (message-log-max)
+ (setq w3m-current-message (apply (function message) args))))))))
+
+(defun w3m-time-parse-string (string)
+ "Parse the time-string STRING into a time in the Emacs style."
+ (ignore-errors
+ (let ((x (timezone-fix-time string nil nil)))
+ (encode-time (aref x 5) (aref x 4) (aref x 3)
+ (aref x 2) (aref x 1) (aref x 0)
+ (aref x 6)))))
+
+;; When a buggy timezone.el is loaded, we use parse-time.el instead.
+(unless (equal (w3m-time-parse-string "Thursday, 01-Jan-1970 00:00:00 GMT")
+ '(0 0))
+ (ignore-errors
+ (require 'parse-time))
+ (defun w3m-time-parse-string (string)
+ "Parse the time-string STRING and return its time as Emacs style."
+ (ignore-errors
+ (let ((fn (when (fboundp 'parse-time-string)
+ 'parse-time-string)))
+ (when fn
+ (apply (function encode-time) (funcall fn string)))))))
+
+(defun w3m-sub-list (list n)
+ "Return a list of the first N elements of LIST.
+If N is negative, return a list of the last N elements of LIST."
+ (if (integerp n)
+ (if (< n 0)
+ ;; N is negative, extract the last items
+ (if (>= (- n) (length list))
+ (copy-sequence list)
+ (nthcdr (+ (length list) n) (copy-sequence list)))
+ ;; N is positive, extract the first items
+ (if (>= n (length list))
+ (copy-sequence list)
+ (nreverse (nthcdr (- (length list) n) (reverse list)))))
+ (copy-sequence list)))
+
+(defun w3m-load-list (file &optional coding-system)
+ "Read an emacs-w3m data file FILE and return contents as a list.
+It is used for loading `w3m-arrived-file', `w3m-cookie-file',
+`w3m-favicon-cache-file' and `w3m-antenna-file' (which see).
+CODING-SYSTEM is used to read FILE which defaults to the value of
+`w3m-file-coding-system-for-read'."
+ (when (and (file-readable-p file)
+ ;; XEmacs 21.4 might crash when inserting a directory.
+ (not (file-directory-p file)))
+ (with-temp-buffer
+ (when (condition-case nil
+ (let ((coding-system-for-read
+ (or coding-system w3m-file-coding-system-for-read)))
+ (insert-file-contents file))
+ (error
+ (message "Error while loading %s" file)
+ nil))
+ ;; point is not always moved to the beginning of the buffer
+ ;; after `insert-file-contents' is done.
+ (goto-char (point-min))
+ (condition-case err
+ (read (current-buffer))
+ (error
+ (message "Error while reading %s; %s"
+ file (error-message-string err))
+ nil))))))
+
+(defun w3m-save-list (file list &optional coding-system escape-ctl-chars)
+ "Save a LIST form into the emacs-w3m data file FILE.
+Contents will be encoded with CODING-SYSTEM which defaults to the
+value of `w3m-file-coding-system'. Optional ESCAPE-CTL-CHARS if it is
+non-nil, control chars will be represented with ^ as `cat -v' does."
+ (when (and list (file-writable-p file))
+ (with-temp-buffer
+ (let ((coding-system-for-write (or coding-system w3m-file-coding-system))
+ (standard-output (current-buffer))
+ (print-fn (if escape-ctl-chars
+ 'w3m-prin1
+ 'prin1))
+ element print-length print-level)
+ (insert (format "\
+;;; %s -*- mode: emacs-lisp%s -*-
+;; This file is generated automatically by emacs-w3m v%s.
+
+"
+ (file-name-nondirectory file)
+ (if coding-system-for-write
+ (format "; coding: %s" coding-system-for-write)
+ "")
+ emacs-w3m-version))
+ (insert "(")
+ (while list
+ (setq element (car list)
+ list (cdr list))
+ (if (consp element)
+ (progn
+ (insert "(")
+ (funcall print-fn (car element))
+ (insert "\n")
+ (while (setq element (cdr element))
+ (insert " ")
+ (funcall print-fn (car element))
+ (insert "\n"))
+ (backward-delete-char 1)
+ (insert ")\n "))
+ (funcall print-fn element)
+ (insert "\n")))
+ (skip-chars-backward "\n ")
+ (delete-region (point) (point-max))
+ (insert ")\n")
+ (let ((mode (and (file-exists-p file)
+ (file-modes file))))
+ (write-region (point-min) (point-max) file nil 'nomsg)
+ (when mode (set-file-modes file mode)))))))
+
+(defun w3m-url-encode-string (str &optional coding encode-space)
+ (apply (function concat)
+ (mapcar
+ (lambda (ch)
+ (cond
+ ((eq ch ?\n) ; newline
+ "%0D%0A")
+ ((string-match "[-a-zA-Z0-9_:/.]" (char-to-string ch)) ; xxx?
+ (char-to-string ch)) ; printable
+ ((and (char-equal ch ?\x20); space
+ encode-space)
+ "+")
+ (t
+ (format "%%%02X" ch)))) ; escape
+ ;; Coerce a string into a list of chars.
+ (append (encode-coding-string (or str "")
+ (or coding
+ w3m-default-coding-system
+ w3m-coding-system
+ 'iso-2022-7bit))
+ nil))))
+
+(defun w3m-url-decode-string (str &optional coding)
+ (let ((start 0)
+ (buf)
+ (case-fold-search t))
+ (while (string-match "%\\(?:\\([0-9a-f][0-9a-f]\\)\\|0d%0a\\)" str start)
+ (push (substring str start (match-beginning 0)) buf)
+ (push (if (match-beginning 1)
+ (vector (string-to-number (match-string 1 str) 16))
+ "\n")
+ buf)
+ (setq start (match-end 0)))
+ (setq str (apply 'concat (nreverse (cons (substring str start) buf))))
+ (w3m-decode-coding-string-with-priority str coding)))
+
+(defun w3m-url-readable-string (url)
+ "Return a readable string for a given encoded URL.
+If `w3m-show-decoded-url' has a non-nil value, it is referred to to
+decide a decoding scheme."
+ (when (stringp url)
+ (setq url (w3m-puny-decode-url url))
+ (let ((rule
+ (cond ((string-match "[^\000-\177]" url)
+ ;; It looks not to have been encoded.
+ nil)
+ ((and (listp w3m-show-decoded-url)
+ (consp (car w3m-show-decoded-url)))
+ (catch 'found-rule
+ (save-match-data
+ (dolist (elem w3m-show-decoded-url)
+ (when (if (stringp (car elem))
+ (string-match (car elem) url)
+ (if (functionp (car elem))
+ (funcall (car elem) url)
+ (eval (car elem))))
+ (throw 'found-rule (cdr elem)))))))
+ (t w3m-show-decoded-url))))
+ (if rule
+ (w3m-url-decode-string url
+ (if (eq t rule)
+ w3m-coding-system-priority-list
+ rule))
+ url))))
+
+(defun w3m-url-transfer-encode-string (url &optional coding)
+ "Encode non-ascii characters in URL into the sequence of escaped octets.
+CODING which defaults to `w3m-current-coding-system' (which see) is a
+coding system used when encoding non-ascii characters.
+
+This function is designed for conversion for safe transmission of URL,
+i.e., it handles only non-ASCII characters that can not be transmitted
+safely through the network. For the other general purpose, you should
+use `w3m-url-encode-string' instead."
+ (setq url (w3m-puny-encode-url url))
+ (let ((start 0)
+ (buf))
+ (while (string-match "[^\x21-\x7e]+" url start)
+ (setq buf
+ (cons (apply 'concat
+ (mapcar
+ (lambda (c) (format "%%%02X" c))
+ (append (encode-coding-string
+ (match-string 0 url)
+ (or coding
+ w3m-current-coding-system)))))
+ (cons (substring url start (match-beginning 0))
+ buf))
+ start (match-end 0)))
+ (apply 'concat
+ (nreverse (cons (substring url start) buf)))))
+
+
+;;; HTML character entity handling:
+(defun w3m-entity-value (name)
+ "Get a char corresponding to NAME from the html char entities database.
+The database is kept in `w3m-entity-table'."
+ ;; Return a value of the specified entity, or nil if it is unknown.
+ (if (eq (aref name 0) ?#)
+ (char-to-string (w3m-ucs-to-char
+ (if (or (eq (aref name 1) ?x)
+ (eq (aref name 1) ?X))
+ (string-to-number (substring name 2) 16)
+ (string-to-number (substring name 1)))))
+ (gethash name w3m-entity-table)))
+
+(defun w3m-fontify-bold ()
+ "Fontify bold text in the buffer containing halfdump."
+ (goto-char (point-min))
+ (while (search-forward "<b>" nil t)
+ (let ((start (match-beginning 0)))
+ (delete-region start (match-end 0))
+ (when (re-search-forward "</b[ \t\r\f\n]*>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (w3m-add-face-property start (match-beginning 0) 'w3m-bold)))))
+
+(defun w3m-fontify-italic ()
+ "Fontify italic text in the buffer containing halfdump."
+ (goto-char (point-min))
+ (while (search-forward "<i>" nil t)
+ (let ((start (match-beginning 0)))
+ (delete-region start (match-end 0))
+ (when (re-search-forward "</i[ \t\r\f\n]*>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (w3m-add-face-property start (match-beginning 0) 'w3m-italic)))))
+
+(defun w3m-fontify-underline ()
+ "Fontify underline text in the buffer containing halfdump."
+ (goto-char (point-min))
+ (while (search-forward "<u>" nil t)
+ (let ((start (match-beginning 0)))
+ (delete-region start (match-end 0))
+ (when (re-search-forward "</u[ \t\r\f\n]*>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (w3m-add-face-property start (match-beginning 0) 'w3m-underline)))))
+
+(defun w3m-fontify-strike-through ()
+ "Fontify strike-through text in the buffer containing halfdump."
+ (goto-char (point-min))
+ (cond
+ ((and (eq w3m-display-ins-del 'fontify)
+ (w3m-device-on-window-system-p))
+ (while (search-forward "<s>" nil t)
+ (let ((start (match-beginning 0)))
+ (delete-region start (match-end 0))
+ (when (re-search-forward "</s[ \t\r\f\n]*>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (w3m-add-face-property start (match-beginning 0)
+ 'w3m-strike-through)))))
+ ((w3m-device-on-window-system-p)
+ (while (re-search-forward
+ (concat "<U>\\(?:\\(?::\\(?:\\(?:DEL\\|S\\)]\\)\\|"
+ "\\[\\(?:\\(?:DEL\\|S\\):\\)\\)</U>\\)")
+ nil t)
+ (w3m-add-face-property (match-beginning 0) (match-end 0)
+ 'w3m-strike-through)))))
+
+(defun w3m-fontify-insert ()
+ "Fontify insert text in the buffer containing halfdump."
+ (goto-char (point-min))
+ (cond
+ ((and (eq w3m-display-ins-del 'fontify)
+ (w3m-device-on-window-system-p))
+ (while (search-forward "<ins>" nil t)
+ (let ((start (match-beginning 0)))
+ (delete-region start (match-end 0))
+ (when (re-search-forward "</ins[ \t\r\f\n]*>" nil t)
+ (delete-region (match-beginning 0) (match-end 0))
+ (w3m-add-face-property start (match-beginning 0) 'w3m-insert)))))
+ ((w3m-device-on-window-system-p)
+ (while (re-search-forward "<U>\\(?:\\(?::INS]\\|\\[INS:\\)</U>\\)"
+ nil t)
+ (w3m-add-face-property (match-beginning 0) (match-end 0) 'w3m-insert)))))
+
+(defun w3m-decode-anchor-string (str)
+ ;; FIXME: This is a quite ad-hoc function to process encoded url string.
+ ;; More discussion about timing &-sequence decode is required. The
+ ;; following article (written in Japanese) is the origin of this issue:
+ ;;
+ ;; [emacs-w3m:00150] <URL:http://emacs-w3m.namazu.org/ml/msg00149.html>
+ ;;
+ ;; Takaaki MORIYAMA wrote in the article that the string "&amp;" which
+ ;; is replaced from "&" and embedded in the w3m's halfdump should be
+ ;; restored into "&" some time.
+ (let ((start 0) (buf))
+ (while (string-match "\\(&amp;\\)\\|\\([\t\r\f\n]+\\)" str start)
+ (setq buf (cons (if (match-beginning 1) "&" " ")
+ (cons (substring str start (match-beginning 0)) buf))
+ start (match-end 0)))
+ (apply (function concat)
+ (nreverse (cons (substring str start) buf)))))
+
+(defun w3m-image-type (content-type)
+ "Return an image type which corresponds to CONTENT-TYPE."
+ (cdr (assoc content-type w3m-image-type-alist)))
+
+(defun w3m-imitate-widget-button ()
+ "Return a boolean value corresponding to the variable of the same name."
+ (if (listp w3m-imitate-widget-button)
+ (condition-case nil
+ (eval w3m-imitate-widget-button)
+ (error nil))
+ (and w3m-imitate-widget-button t)))
+
+(defun w3m-fontify-anchors ()
+ "Fontify anchor tags in the buffer which contains halfdump."
+ (let ((help (w3m-make-help-echo w3m-balloon-help))
+ (balloon (w3m-make-balloon-help w3m-balloon-help))
+ prenames start end)
+ (goto-char (point-min))
+ (setq w3m-max-anchor-sequence 0) ;; reset max-hseq
+ (while (re-search-forward "<_id[ \t\r\f\n]+" nil t)
+ (setq start (match-beginning 0))
+ (setq prenames (get-text-property start 'w3m-name-anchor))
+ (w3m-parse-attributes (id)
+ (delete-region start (point))
+ (w3m-add-text-properties start (point-max)
+ (list 'w3m-name-anchor
+ (cons
+ (w3m-decode-entities-string
+ (w3m-url-transfer-encode-string
+ id))
+ prenames)))))
+ (goto-char (point-min))
+ (while (re-search-forward "<a[ \t\r\f\n]+" nil t)
+ (setq start (match-beginning 0))
+ (setq prenames (get-text-property start 'w3m-name-anchor2))
+ (w3m-parse-attributes (href name id charset
+ (rel :case-ignore) (hseq :integer))
+ (unless name
+ (setq name id))
+ (when rel
+ (setq rel (split-string rel))
+ (cond
+ ((member "next" rel) (setq w3m-next-url href))
+ ((or (member "prev" rel) (member "previous" rel))
+ (setq w3m-previous-url href))
+ ((member "start" rel) (setq w3m-start-url href))
+ ((member "contents" rel) (setq w3m-contents-url href))))
+ (delete-region start (point))
+ (cond
+ (href
+ (when (re-search-forward "[ \t\r\f\n]*\\(</a>\\)" nil t)
+ (setq end (match-beginning 0))
+ (delete-region (match-beginning 1) (match-end 1))
+ (setq href (w3m-expand-url (w3m-decode-anchor-string href)))
+ (unless (w3m-url-local-p href)
+ (w3m-string-match-url-components href)
+ (setq href (if (match-beginning 8)
+ (let ((tmp (match-string 9 href)))
+ (concat (w3m-url-transfer-encode-string
+ (substring href 0 (match-beginning 8))
+ (w3m-charset-to-coding-system charset))
+ "#" tmp))
+ (w3m-url-transfer-encode-string
+ href
+ (w3m-charset-to-coding-system charset)))))
+ (setq hseq (or (and (null hseq) 0) (abs hseq)))
+ (setq w3m-max-anchor-sequence (max hseq w3m-max-anchor-sequence))
+ (w3m-add-face-property start end (if (w3m-arrived-p href)
+ 'w3m-arrived-anchor
+ 'w3m-anchor))
+ (w3m-add-text-properties start end
+ (list 'w3m-href-anchor href
+ 'w3m-balloon-help href
+ 'mouse-face 'highlight
+ 'w3m-anchor-sequence hseq
+ 'help-echo help
+ 'balloon-help balloon
+ 'keymap w3m-link-map))
+ (when (w3m-imitate-widget-button)
+ (require 'wid-edit)
+ (let ((widget-button-face (if (w3m-arrived-p href)
+ 'w3m-arrived-anchor
+ 'w3m-anchor))
+ (widget-mouse-face 'highlight)
+ w)
+ (setq w (widget-convert-button 'default start end
+ :button-keymap nil
+ :help-echo href))
+ (w3m-static-unless (featurep 'xemacs)
+ (overlay-put (widget-get w :button-overlay) 'evaporate t))))
+ (when name
+ (w3m-add-text-properties start (point-max)
+ (list 'w3m-name-anchor2
+ (cons
+ (w3m-decode-entities-string
+ (w3m-url-transfer-encode-string
+ name))
+ prenames))))))
+ (name
+ (w3m-add-text-properties start (point-max)
+ (list 'w3m-name-anchor2
+ (cons
+ (w3m-decode-entities-string
+ (w3m-url-transfer-encode-string
+ name))
+ prenames)))))))
+ (when w3m-icon-data
+ (setq w3m-icon-data (cons (and (car w3m-icon-data)
+ (w3m-expand-url (car w3m-icon-data)))
+ (or (w3m-image-type (cdr w3m-icon-data))
+ 'ico))))
+ (when w3m-next-url
+ (setq w3m-next-url (w3m-expand-url w3m-next-url)))
+ (when w3m-previous-url
+ (setq w3m-previous-url (w3m-expand-url w3m-previous-url)))
+ (when w3m-start-url
+ (setq w3m-start-url (w3m-expand-url w3m-start-url)))
+ (when w3m-contents-url
+ (setq w3m-contents-url (w3m-expand-url w3m-contents-url)))))
+
+(eval-and-compile
+ (unless (featurep 'xemacs)
+ (defun w3m-setup-menu ()
+ "Define menubar buttons for Emacsen."
+ (w3m-menu-on-forefront w3m-menu-on-forefront t)
+ (unless (keymapp (lookup-key w3m-mode-map [menu-bar w3m]))
+ (let ((map (make-sparse-keymap (car w3m-menubar))))
+ (define-key w3m-mode-map [menu-bar] (make-sparse-keymap))
+ (w3m-setup-session-menu)
+ (when w3m-use-tab-menubar (w3m-setup-tab-menu))
+ (w3m-setup-bookmark-menu)
+ (define-key w3m-mode-map [menu-bar w3m] (cons (car w3m-menubar) map))
+ (require 'easymenu)
+ (easy-menu-define
+ w3m-mode-menu w3m-mode-map
+ "w3m menu item" w3m-menubar)
+ (easy-menu-add w3m-mode-menu))
+ (let ((map (make-sparse-keymap)))
+ (easy-menu-define
+ w3m-rmouse-menu map
+ "w3m rmouse menu item" w3m-rmouse-menubar))))))
+
+(defun w3m-fontify-images ()
+ "Fontify img_alt strings of images in the buffer containing halfdump."
+ (goto-char (point-min))
+ (let ((help (w3m-make-help-echo w3m-balloon-help))
+ (balloon (w3m-make-balloon-help w3m-balloon-help))
+ upper start end help)
+ (while (re-search-forward "<\\(img_alt\\)[^>]+>" nil t)
+ (setq upper (string= (match-string 1) "IMG_ALT")
+ start (match-beginning 0)
+ end (match-end 0))
+ (goto-char (match-end 1))
+ (w3m-parse-attributes (src
+ (width :integer)
+ (height :integer)
+ title
+ usemap)
+ (delete-region start end)
+ (setq src (w3m-expand-url (w3m-decode-anchor-string src)))
+ (when (search-forward "</img_alt>" nil t)
+ (delete-region (setq end (match-beginning 0)) (match-end 0))
+ (setq help (get-text-property start 'w3m-balloon-help))
+ (cond
+ ((and help title)
+ (setq help (format "%s\nalt: %s\nimg: %s" help title src)))
+ (help
+ (setq help (format "%s\nimg: %s" help src)))
+ (title
+ (setq help (format "alt: %s\nimg: %s" title src)))
+ (t
+ (setq help (format "img: %s" src))))
+ (w3m-add-text-properties start end
+ (list 'w3m-image src
+ 'w3m-image-size
+ (when (or width height)
+ (cons width height))
+ 'w3m-image-alt title
+ 'w3m-balloon-help help
+ 'w3m-image-usemap usemap
+ 'w3m-image-status 'off
+ 'w3m-image-redundant upper
+ 'keymap w3m-link-map))
+ (unless (w3m-action start)
+ ;; No need to use `w3m-add-text-properties' here.
+ (w3m-add-face-property start end
+ (if (w3m-anchor start)
+ 'w3m-image-anchor
+ 'w3m-image))
+ (unless (w3m-anchor start)
+ (add-text-properties start end (list 'mouse-face 'highlight
+ 'help-echo help
+ 'balloon-help balloon)))))))))
+
+(defvar w3m-idle-images-show-timer nil)
+(defvar w3m-idle-images-show-list nil)
+(defvar w3m-idle-images-show-interval 1)
+
+(defun w3m-idle-images-show ()
+ (let ((repeat t)
+ (onbuffer (member (current-buffer) (w3m-list-buffers))))
+ (while (and repeat w3m-idle-images-show-list)
+ (let* ((item (or (and onbuffer
+ (or (get-text-property (point) 'w3m-idle-image-item)
+ (let* ((prev (previous-single-property-change
+ (point) 'w3m-idle-image-item))
+ (next (next-single-property-change
+ (point) 'w3m-idle-image-item))
+ (prev-diff (and prev (abs (- (point) prev))))
+ (next-diff (and next (abs (- (point) next)))))
+ (cond
+ ((and prev next)
+ (get-text-property
+ (if (< prev-diff next-diff) prev next)
+ 'w3m-idle-image-item))
+ (prev
+ (get-text-property prev
+ 'w3m-idle-image-item))
+ (next
+ (get-text-property next
+ 'w3m-idle-image-item))
+ (t nil)))))
+ (car (last w3m-idle-images-show-list))))
+ (start (nth 0 item))
+ (end (nth 1 item))
+ (iurl (nth 2 item))
+ (url (nth 3 item))
+ (no-cache (nth 4 item))
+ (size (nth 5 item)))
+ (setq w3m-idle-images-show-list
+ (delete item w3m-idle-images-show-list))
+ (if (buffer-live-p (marker-buffer start))
+ (with-current-buffer (marker-buffer start)
+ (save-restriction
+ (widen)
+ (let (buffer-read-only)
+ (remove-text-properties start end '(w3m-idle-image-item))
+ (set-buffer-modified-p nil))
+ (w3m-process-with-null-handler
+ (lexical-let ((start start)
+ (end end)
+ (iurl iurl)
+ (url url))
+ (w3m-process-do
+ (image (let ((w3m-current-buffer (current-buffer))
+ (w3m-message-silent t))
+ (w3m-create-image
+ iurl no-cache
+ url
+ size handler)))
+ (when (buffer-live-p (marker-buffer start))
+ (with-current-buffer (marker-buffer start)
+ (save-restriction
+ (widen)
+ (if image
+ (when (equal url w3m-current-url)
+ (let (buffer-read-only)
+ (w3m-insert-image start end image iurl))
+ ;; Redisplay
+ (when w3m-force-redisplay
+ (sit-for 0)))
+ (let (buffer-read-only)
+ (w3m-add-text-properties
+ start end '(w3m-image-status off))))
+ (set-buffer-modified-p nil))
+ (set-marker start nil)
+ (set-marker end nil))))))))
+ (set-marker start nil)
+ (set-marker end nil)
+ (w3m-idle-images-show-unqueue (marker-buffer start))))
+ (setq repeat (sit-for 0.1 t)))
+ (if w3m-idle-images-show-list
+ (when (input-pending-p)
+ (cancel-timer w3m-idle-images-show-timer)
+ (setq w3m-idle-images-show-timer
+ (run-with-idle-timer w3m-idle-images-show-interval
+ t
+ 'w3m-idle-images-show)))
+ (cancel-timer w3m-idle-images-show-timer)
+ (setq w3m-idle-images-show-timer nil))))
+
+(defun w3m-idle-images-show-unqueue (buffer)
+ (when w3m-idle-images-show-timer
+ (cancel-timer w3m-idle-images-show-timer)
+ (setq w3m-idle-images-show-timer nil)
+ (setq w3m-idle-images-show-list
+ (delq nil
+ (mapcar (lambda (x)
+ (and (not (eq buffer (marker-buffer (nth 0 x))))
+ x))
+ w3m-idle-images-show-list)))
+ (when w3m-idle-images-show-list
+ (setq w3m-idle-images-show-timer
+ (run-with-idle-timer w3m-idle-images-show-interval
+ t
+ 'w3m-idle-images-show)))))
+
+(defvar w3m-image-no-idle-timer nil)
+(defun w3m-toggle-inline-images-internal (status
+ &optional no-cache url
+ begin-pos end-pos
+ safe-regexp)
+ "Toggle displaying of inline images on current buffer.
+STATUS is current image status.
+If NO-CACHE is non-nil, cache is not used.
+If URL is specified, only the image with URL is toggled."
+ (let ((cur-point (point))
+ (buffer-read-only)
+ (end (or begin-pos (point-min)))
+ (allow-non-secure-images (not w3m-confirm-leaving-secure-page))
+ start iurl image size)
+ (unless end-pos (setq end-pos (point-max)))
+ (save-excursion
+ (if (equal status 'off)
+ (while (< (setq start
+ (if (w3m-image end)
+ end
+ (next-single-property-change end 'w3m-image
+ nil end-pos)))
+ end-pos)
+ (setq end (or (next-single-property-change start 'w3m-image)
+ (point-max))
+ iurl (w3m-image start)
+ size (get-text-property start 'w3m-image-size))
+ (when (and (or (and (not url)
+ (or (not w3m-ignored-image-url-regexp)
+ (not (string-match
+ w3m-ignored-image-url-regexp
+ iurl))))
+ ;; URL is specified and is same as the image URL.
+ (string= url iurl))
+ (not (eq (get-text-property start 'w3m-image-status)
+ 'on)))
+ (w3m-add-text-properties start end '(w3m-image-status on))
+ (if (get-text-property start 'w3m-image-redundant)
+ (progn
+ ;; Insert a dummy string instead of a redundant image.
+ (setq image (make-string
+ (string-width (buffer-substring start end))
+ ? ))
+ (w3m-add-text-properties start end '(invisible t))
+ (goto-char end)
+ (w3m-add-text-properties
+ end (progn (insert image) (point))
+ '(w3m-image-dummy t w3m-image "dummy"))
+ (setq end (point)))
+ (goto-char cur-point)
+ (when (and (w3m-url-valid iurl)
+ (or (null safe-regexp)
+ (string-match safe-regexp iurl))
+ (not (and (not (w3m-url-local-p w3m-current-url))
+ (w3m-url-local-p iurl)))
+ (or (not w3m-current-ssl)
+ (string-match "\\`\\(?:ht\\|f\\)tps://" iurl)
+ allow-non-secure-images
+ (and (prog1
+ (y-or-n-p "\
+You are retrieving non-secure image(s). Continue? ")
+ (message nil))
+ (setq allow-non-secure-images t))))
+ (if (or w3m-image-no-idle-timer
+ (and (null (and size w3m-resize-images))
+ (or (string-match "\\`\\(?:cid\\|data\\):" iurl)
+ (w3m-url-local-p iurl)
+ (w3m-cache-available-p iurl))))
+ (w3m-process-with-null-handler
+ (lexical-let ((start (set-marker (make-marker) start))
+ (end (set-marker (make-marker) end))
+ (iurl iurl)
+ (url w3m-current-url))
+ (w3m-process-do
+ (image (let ((w3m-current-buffer (current-buffer)))
+ (w3m-create-image
+ iurl no-cache
+ w3m-current-url
+ size handler)))
+ (when (buffer-live-p (marker-buffer start))
+ (with-current-buffer (marker-buffer start)
+ (if image
+ (when (equal url w3m-current-url)
+ (let (buffer-read-only)
+ (w3m-insert-image start end image iurl))
+ ;; Redisplay
+ (when w3m-force-redisplay
+ (sit-for 0)))
+ (let (buffer-read-only)
+ (w3m-add-text-properties
+ start end '(w3m-image-status off))))
+ (set-buffer-modified-p nil)))
+ (set-marker start nil)
+ (set-marker end nil))))
+ (let ((item (list (set-marker (make-marker) start)
+ (set-marker (make-marker) end)
+ (w3m-url-transfer-encode-string iurl)
+ w3m-current-url
+ no-cache
+ size)))
+ (setq w3m-idle-images-show-list
+ (cons item w3m-idle-images-show-list))
+ (w3m-add-text-properties
+ start end
+ `(w3m-idle-image-item ,item))
+ (unless w3m-idle-images-show-timer
+ (setq w3m-idle-images-show-timer
+ (run-with-idle-timer w3m-idle-images-show-interval
+ t
+ 'w3m-idle-images-show)))))))))
+ ;; Remove.
+ (while (< (setq start (if (w3m-image end)
+ end
+ (next-single-property-change end 'w3m-image
+ nil end-pos)))
+ end-pos)
+ (setq end (or (next-single-property-change start 'w3m-image)
+ (point-max))
+ iurl (w3m-image start))
+ ;; IMAGE-ALT-STRING DUMMY-STRING
+ ;; <--------w3m-image---------->
+ ;; <---redundant--><---dummy--->
+ ;; <---invisible-->
+ (when (and (or (not url)
+ ;; URL is specified and is not same as the image URL.
+ (string= url iurl))
+ (not (eq (get-text-property start 'w3m-image-status)
+ 'off)))
+ (cond
+ ((get-text-property start 'w3m-image-redundant)
+ ;; Remove invisible property.
+ (put-text-property start end 'invisible nil))
+ ((get-text-property start 'w3m-image-dummy)
+ ;; Remove dummy string.
+ (delete-region start end)
+ (setq end start))
+ (t (w3m-remove-image start end)))
+ (w3m-add-text-properties start end
+ '(w3m-image-status off
+ w3m-idle-image-item nil))))
+ (set-buffer-modified-p nil)))))
+
+(defun w3m-toggle-inline-image (&optional force no-cache)
+ "Toggle the visibility of an image under point or images in the region.
+If FORCE is non-nil, displaying an image is forced. If NO-CACHE is
+non-nil, cached data will not be used."
+ (interactive "P")
+ (unless (w3m-display-graphic-p)
+ (error "Can't display images in this environment"))
+ (let (toggle-list begin end)
+ (if (w3m-region-active-p)
+ (let ((p (region-beginning))
+ iurl)
+ (setq begin (region-beginning)
+ end (region-end))
+ (w3m-deactivate-region)
+ (while (< p end)
+ (setq p (next-single-property-change p 'w3m-image nil end))
+ (when (and (< p end)
+ (setq iurl (w3m-image p))
+ (not (assoc iurl toggle-list)))
+ (setq toggle-list (cons (cons iurl p) toggle-list)))))
+ (setq toggle-list (and (w3m-image)
+ `(,(cons (w3m-image) (point))))))
+ (if toggle-list
+ (dolist (x toggle-list)
+ (let* ((url (car x))
+ (pos (cdr x))
+ (status (get-text-property pos 'w3m-image-status))
+ safe-regexp)
+ (if (and (get-text-property pos 'w3m-image-scale)
+ (equal status 'off))
+ (w3m-zoom-in-image 0)
+ (if (w3m-url-valid url)
+ (if (eq status 'on)
+ (progn
+ (if force (setq status 'off))
+ (w3m-toggle-inline-images-internal
+ status no-cache url
+ (or begin (point-min))
+ (or end (point-max))))
+ (setq safe-regexp
+ (get-text-property (point) 'w3m-safe-url-regexp))
+ (if (or (not safe-regexp)
+ (string-match safe-regexp url)
+ (and force
+ (or (not (interactive-p))
+ (yes-or-no-p "\
+Are you sure you really want to show this image (maybe insecure)? "))))
+ (w3m-toggle-inline-images-internal
+ status no-cache url
+ (or begin (point-min))
+ (or end (point-max)))
+ (when (interactive-p)
+ (w3m-message "This image is considered to be unsafe;\
+ use the prefix arg to force display"))))))))
+ (if begin
+ (w3m-message "No images in region")
+ (w3m-message "No image at point")))))
+
+(defun w3m-turnoff-inline-images ()
+ "Turn off to display all images in the buffer or in the region."
+ (interactive)
+ (w3m-toggle-inline-images 'turnoff))
+
+(defun w3m-toggle-inline-images (&optional force no-cache)
+ "Toggle the visibility of all images in the buffer or in the region.
+If FORCE is neither nil nor `turnoff', displaying images is forced.
+The value `turnoff' is special; it turns displaying images off anyway.
+If NO-CACHE is non-nil, cached data will not be used.
+
+Note that the status of whether images are visible is kept hereafter
+even in new sessions if the `w3m-toggle-inline-images-permanently'
+variable is non-nil (default=t)."
+ (interactive "P")
+ (unless (w3m-display-graphic-p)
+ (error "Can't display images in this environment"))
+ (let ((status (cond ((eq force 'turnoff) t)
+ (force nil)
+ (t w3m-display-inline-images)))
+ (safe-p t)
+ beg end safe-regexp pos url)
+ (if (w3m-region-active-p)
+ (progn
+ (setq beg (region-beginning)
+ end (region-end))
+ (w3m-deactivate-region))
+ (setq beg (point-min)
+ end (point-max)))
+ (unless status
+ (when (setq safe-regexp (get-text-property (point) 'w3m-safe-url-regexp))
+ ;; Scan the buffer for searching for an insecure image url.
+ (setq pos beg)
+ (setq
+ safe-p
+ (catch 'done
+ (when (setq url (get-text-property pos 'w3m-image))
+ (unless (string-match safe-regexp url)
+ (throw 'done nil))
+ (setq pos (next-single-property-change pos 'w3m-image)))
+ (while (< pos end)
+ (when (and
+ (setq pos (next-single-property-change pos 'w3m-image
+ nil end))
+ (setq url (get-text-property pos 'w3m-image)))
+ (unless (string-match safe-regexp url)
+ (throw 'done nil)))
+ (setq pos (next-single-property-change pos 'w3m-image
+ nil end)))
+ t))))
+ (if (or status
+ (not safe-regexp)
+ safe-p
+ (and force
+ (or (not (interactive-p))
+ (yes-or-no-p "\
+Are you sure you really want to show all images (maybe insecure)? "))))
+ (progn
+ (unwind-protect
+ (w3m-toggle-inline-images-internal (if status 'on 'off)
+ no-cache nil beg end
+ (unless (interactive-p)
+ safe-regexp))
+ (setq w3m-display-inline-images (not status))
+ (when status
+ (w3m-process-stop (current-buffer))
+ (w3m-idle-images-show-unqueue (current-buffer)))
+ (force-mode-line-update)))
+ (w3m-message "There are some images considered unsafe;\
+ use the prefix arg to force display"))))
+
+(defun w3m-resize-inline-image-internal (url rate)
+ "Resize an inline image on the cursor position.
+URL is a url of an image. RATE is a number of percent used when
+resizing an image."
+ (let* ((buffer-read-only)
+ (start (point))
+ (end (or (next-single-property-change start 'w3m-image)
+ (point-max)))
+ (iurl (w3m-image start))
+ (size (get-text-property start 'w3m-image-size))
+ (iscale (or (get-text-property start 'w3m-image-scale) '100))
+ (allow-non-secure-images (not w3m-confirm-leaving-secure-page))
+ scale image)
+ (w3m-add-text-properties start end '(w3m-image-status on))
+ (setq scale (truncate (* iscale rate 0.01)))
+ (w3m-add-text-properties start end (list 'w3m-image-scale scale))
+ (if (get-text-property start 'w3m-image-redundant)
+ (progn
+ ;; Insert a dummy string instead of a redundant image.
+ (setq image (make-string
+ (string-width (buffer-substring start end))
+ ? ))
+ (w3m-add-text-properties start end '(invisible t))
+ (w3m-add-text-properties (point)
+ (progn (insert image) (point))
+ '(w3m-image-dummy t
+ w3m-image "dummy")))
+ (when (and (w3m-url-valid iurl)
+ (or (not w3m-current-ssl)
+ (string-match "\\`\\(?:ht\\|f\\)tps://" iurl)
+ allow-non-secure-images
+ (and (prog1
+ (y-or-n-p "\
+You are retrieving non-secure image(s). Continue? ")
+ (message nil))
+ (setq allow-non-secure-images t))))
+ (w3m-process-with-null-handler
+ (lexical-let ((start (set-marker (make-marker) start))
+ (end (set-marker (make-marker) end))
+ (iurl iurl)
+ (rate scale)
+ (url w3m-current-url))
+ (w3m-process-do
+ (image (let ((w3m-current-buffer (current-buffer)))
+ (w3m-create-resized-image
+ iurl
+ rate
+ w3m-current-url
+ size handler)))
+ (when (buffer-live-p (marker-buffer start))
+ (with-current-buffer (marker-buffer start)
+ (if image
+ (when (equal url w3m-current-url)
+ (let (buffer-read-only)
+ (w3m-static-when (featurep 'xemacs)
+ (w3m-remove-image start end))
+ (w3m-insert-image start end image iurl))
+ ;; Redisplay
+ (when w3m-force-redisplay
+ (sit-for 0)))
+ (let (buffer-read-only)
+ (w3m-add-text-properties
+ start end '(w3m-image-status off))))
+ (set-buffer-modified-p nil))
+ (set-marker start nil)
+ (set-marker end nil)))))))))
+
+(defun w3m-zoom-in-image (&optional rate)
+ "Zoom in an image on the point.
+Numeric prefix specifies how many percent the image is enlarged by
+\(30 means enlarging the image by 130%). The default is the value of
+the `w3m-resize-image-scale' variable."
+ (interactive "P")
+ (unless (w3m-display-graphic-p)
+ (error "Can't display images in this environment"))
+ (unless (w3m-imagick-convert-program-available-p)
+ (error "ImageMagick's `convert' program is required"))
+ (let ((url (w3m-image)))
+ (if url
+ (w3m-resize-inline-image-internal
+ url
+ (+ 100 (or rate w3m-resize-image-scale)))
+ (w3m-message "No image at point"))))
+
+(defun w3m-zoom-out-image (&optional rate)
+ "Zoom out an image on the point.
+Numeric prefix specifies how many percent the image is shrunk by
+\(30 means shrinking the image by 70%). The default is the value of
+the `w3m-resize-image-scale' variable."
+ (interactive "P")
+ (unless (w3m-display-graphic-p)
+ (error "Can't display images in this environment"))
+ (unless (w3m-imagick-convert-program-available-p)
+ (error "ImageMagick's `convert' program is required"))
+ (let ((url (w3m-image)))
+ (if url
+ (w3m-resize-inline-image-internal
+ url
+ (- 100 (or rate w3m-resize-image-scale)))
+ (w3m-message "No image at point"))))
+
+(defun w3m-decode-entities (&optional keep-properties)
+ "Decode entities in the current buffer.
+If optional KEEP-PROPERTIES is non-nil, text property is reserved."
+ (save-excursion
+ (goto-char (point-min))
+ ;; Character entity references are case-sensitive.
+ ;; Cf. http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.3.2
+ (let (case-fold-search start fid prop value)
+ (while (re-search-forward w3m-entity-regexp nil t)
+ (setq start (match-beginning 0)
+ fid (get-text-property start 'w3m-form-field-id))
+ (unless (and fid
+ (save-match-data
+ (string-match "/type=\\(?:text\\|select\\)/name=[^/]+/"
+ fid)))
+ (when keep-properties
+ (setq prop (text-properties-at start)))
+ (unless (eq (char-after (match-end 1)) ?\;)
+ (goto-char (match-end 1)))
+ ;; Note that `w3m-entity-value' breaks `match-data' at the 1st
+ ;; time in XEmacs because of the autoloading unicode.elc for
+ ;; the `ucs-to-char' function.
+ (when (setq value (w3m-entity-value (match-string 1)))
+ (delete-region start (point))
+ (insert value))
+ (when prop
+ (w3m-add-text-properties start (point) prop)))))))
+
+(defun w3m-decode-entities-string (str)
+ "Decode entities in the string STR."
+ (save-match-data
+ ;; Character entity references are case-sensitive.
+ ;; Cf. http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.3.2
+ (let ((case-fold-search) (pos 0) (buf))
+ (while (string-match w3m-entity-regexp str pos)
+ (setq buf (cons (or (w3m-entity-value (match-string 1 str))
+ (match-string 1 str))
+ (cons (substring str pos (match-beginning 0))
+ buf))
+ pos (if (eq (aref str (match-end 1)) ?\;)
+ (match-end 0)
+ (match-end 1))))
+ (if buf
+ (apply 'concat (nreverse (cons (substring str pos) buf)))
+ str))))
+
+(defun w3m-encode-specials-string (str)
+ "Encode special characters in the string STR."
+ (let ((pos 0)
+ (buf))
+ (while (string-match "[<>&]" str pos)
+ (setq buf
+ (cons ";"
+ (cons (gethash (match-string 0 str) w3m-entity-reverse-table)
+ (cons "&"
+ (cons (substring str pos (match-beginning 0))
+ buf))))
+ pos (match-end 0)))
+ (if buf
+ (apply 'concat (nreverse (cons (substring str pos) buf)))
+ str)))
+
+(defun w3m-fontify ()
+ "Fontify the current buffer."
+ (let ((case-fold-search t)
+ (buffer-read-only))
+ (w3m-message "Fontifying...")
+ (run-hooks 'w3m-fontify-before-hook)
+ ;; Remove hidden anchors like "<a href=url> </a>".
+ (goto-char (point-min))
+ (while (re-search-forward "<a[\t\n ]+[^>]+>[\t\n ]*</a>" nil t)
+ (delete-region (match-beginning 0) (match-end 0)))
+ ;; Delete <?xml ... ?> tag
+ (goto-char (point-min))
+ (if (search-forward "<?xml" nil t)
+ (let ((start (match-beginning 0)))
+ (search-forward "?>" nil t)
+ (delete-region start (match-end 0))
+ (goto-char (point-min))))
+ ;; Delete extra title tag.
+ (let (start)
+ (and (search-forward "<title>" nil t)
+ (setq start (match-beginning 0))
+ (search-forward "</title>" nil t)
+ (delete-region start (match-end 0))))
+ (w3m-fontify-bold)
+ (w3m-fontify-italic)
+ (w3m-fontify-strike-through)
+ (w3m-fontify-insert)
+ (w3m-fontify-underline)
+ (when w3m-use-symbol
+ (w3m-replace-symbol))
+ (w3m-fontify-anchors)
+ (when w3m-use-form
+ (w3m-fontify-forms))
+ (w3m-fontify-images)
+ ;; Remove other markups.
+ (goto-char (point-min))
+ (while (re-search-forward "</?[A-Za-z_][^>]*>" nil t)
+ (let* ((start (match-beginning 0))
+ (fid (get-text-property start 'w3m-form-field-id)))
+ (if (and fid (string-match "/type=text\\(?:area\\)?/" fid))
+ (goto-char (1+ start))
+ (delete-region start (match-end 0)))))
+ ;; Decode escaped characters (entities).
+ (w3m-decode-entities 'reserve-prop)
+ (when w3m-use-form
+ (w3m-fontify-textareas))
+ (goto-char (point-min))
+ (when w3m-delete-duplicated-empty-lines
+ (while (re-search-forward "^[ \t]*\n\\(?:[ \t]*\n\\)+" nil t)
+ (delete-region (match-beginning 0) (1- (match-end 0)))))
+
+ ;; FIXME: The code above reduces number of empty lines but one line
+ ;; remains. While such empty lines might have been inserted for
+ ;; making sure of rooms for displaying images, they all should be
+ ;; removed since they are useless for emacs-w3m. However, currently
+ ;; we don't have a proper way to identify whether they were inserted
+ ;; intentionally by the author or not. So, we decided to remove only
+ ;; that one at the beginning of the buffer though it is unwillingness.
+ (goto-char (point-min))
+ (skip-chars-forward "\t\n $B!!(B")
+ (delete-region (point-min) (point-at-bol))
+
+ (w3m-header-line-insert)
+ (put-text-property (point-min) (point-max)
+ 'w3m-safe-url-regexp w3m-safe-url-regexp)
+ (w3m-message "Fontifying...done")
+ (run-hooks 'w3m-fontify-after-hook)))
+
+(defun w3m-refontify-anchor (&optional buff)
+ "Refontify anchors as they have already arrived.
+It replaces the faces on the arrived anchors from `w3m-anchor' to
+`w3m-arrived-anchor'."
+ (with-current-buffer (or buff (current-buffer))
+ (let (prop)
+ (when (and (eq major-mode 'w3m-mode)
+ (get-text-property (point) 'w3m-anchor-sequence)
+ (setq prop (get-text-property (point) 'face))
+ (listp prop)
+ (member 'w3m-anchor prop))
+ (let* ((start)
+ (end (next-single-property-change (point) 'w3m-anchor-sequence))
+ (buffer-read-only))
+ (when (and end
+ (setq start (previous-single-property-change
+ end 'w3m-anchor-sequence))
+ (w3m-arrived-p (get-text-property (point)
+ 'w3m-href-anchor)))
+ (w3m-remove-face-property start end 'w3m-anchor)
+ (w3m-remove-face-property start end 'w3m-arrived-anchor)
+ (w3m-add-face-property start end 'w3m-arrived-anchor))
+ (set-buffer-modified-p nil))))))
+
+(defun w3m-url-completion (url predicate flag)
+ "Completion function for URL."
+ (if (string-match "\\`\\(?:file:\\|[/~]\\|\\.\\.?/\\|[a-zA-Z]:\\)" url)
+ (if (eq flag 'lambda)
+ (file-exists-p (w3m-url-to-file-name url))
+ (let* ((partial
+ (expand-file-name
+ (cond
+ ((string-match "\\`file:[^/]" url)
+ (substring url 5))
+ ((string-match "/\\(~\\)" url)
+ (substring url (match-beginning 1)))
+ (t (w3m-url-to-file-name url)))))
+ (collection
+ (let ((dir (file-name-directory partial)))
+ (mapcar
+ (lambda (f)
+ (list (w3m-expand-file-name-as-url f dir)))
+ (file-name-all-completions (file-name-nondirectory partial)
+ dir)))))
+ (setq partial
+ (if (string-match "/\\.\\'" url)
+ (concat (file-name-as-directory
+ (w3m-expand-file-name-as-url partial))
+ ".")
+ (w3m-expand-file-name-as-url partial)))
+ (cond
+ ((not flag)
+ (try-completion partial collection predicate))
+ ((eq flag t)
+ (all-completions partial collection predicate)))))
+ (cond
+ ((not flag)
+ (try-completion url w3m-arrived-db))
+ ((eq flag t)
+ (all-completions url w3m-arrived-db))
+ ((eq flag 'lambda)
+ (if (w3m-arrived-p url) t nil)))))
+
+(defun w3m-gmane-url-at-point ()
+ "Return a url that indicates the thread page in Gmane.
+This function works only when the cursor stays in the References
+header or the Message-ID header, otherwise returns nil.
+
+On the Message-ID header, the url that asks Gmane for the thread
+beginning with the current article will be generated.
+On the References header, the url that asks Gmane for the whole thread
+\(namely it begins with the article of the first ID in the header) will
+be generated. In that case, Gmane might fail to find the thread since
+it is possible that the root article has been posted to another group.
+
+That it returns an invalid url for the article of the group which is
+not being archived in Gmane cannot be helped."
+ (save-excursion
+ (let ((fmt "http://news.gmane.org/group/thread=%s/force_load=t")
+ (start (point))
+ (inhibit-point-motion-hooks t)
+ case-fold-search)
+ (goto-char (point-min))
+ (re-search-forward (concat "^\\(?:"
+ (regexp-quote mail-header-separator)
+ "\\)?$")
+ nil 'move)
+ (when (< start (point))
+ (setq case-fold-search t)
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (goto-char start)
+ (beginning-of-line)
+ (while (and (memq (char-after) '(?\t ? ))
+ (zerop (forward-line -1))))
+ (when (looking-at
+ "\\(?:Message-ID\\|References\\):[\t\n ]*<\\([^\t\n <>]+\\)>")
+ (format
+ fmt
+ (w3m-url-encode-string (match-string-no-properties 1)
+ nil t))))))))
+
+(defun w3m-header-line-url ()
+ "Return w3m-current-url if point on header line."
+ (let ((faces (get-text-property (point) 'face)))
+ (when (and (eq major-mode 'w3m-mode)
+ (listp faces)
+ (or (memq 'w3m-header-line-location-title faces)
+ (memq 'w3m-header-line-location-content faces))
+ w3m-current-url)
+ w3m-current-url)))
+
+(eval-and-compile
+ (autoload 'ffap-url-at-point "ffap")
+ (defalias 'w3m-url-at-point
+ (cond ((and (featurep 'xemacs) (featurep 'mule))
+ (lambda nil "\
+Like `ffap-url-at-point', except that text props will be stripped and
+iso646 characters are unified into ascii characters."
+ (or (w3m-gmane-url-at-point)
+ (w3m-header-line-url)
+ (let ((left (buffer-substring-no-properties (point-at-bol)
+ (point)))
+ (right (buffer-substring-no-properties (point)
+ (point-at-eol)))
+ (regexp (format "[%c-%c]"
+ (make-char 'latin-jisx0201 33)
+ (make-char 'latin-jisx0201 126)))
+ (diff (- (char-to-int (make-char 'latin-jisx0201 33))
+ 33))
+ index)
+ (while (setq index (string-match regexp left))
+ (aset left index (- (aref left index) diff)))
+ (while (setq index (string-match regexp right))
+ (aset right index (- (aref right index) diff)))
+ (with-temp-buffer
+ (insert right)
+ (goto-char (point-min))
+ (insert left)
+ (ffap-url-at-point))))))
+ ((featurep 'xemacs)
+ (lambda nil "\
+Like `ffap-url-at-point', except that text props will be stripped."
+ (or (w3m-gmane-url-at-point)
+ (w3m-header-line-url)
+ (unless (fboundp 'ffap-url-at-point)
+ ;; It is necessary to bind `ffap-xemacs'.
+ (load "ffap" nil t))
+ (let (ffap-xemacs)
+ (ffap-url-at-point)))))
+ (t
+ (lambda nil
+ (or (w3m-gmane-url-at-point)
+ (w3m-header-line-url)
+ (ffap-url-at-point)))))))
+
+(eval-after-load "ffap"
+ '(progn
+ ;; Under XEmacs, `ffap-url-regexp' won't match to https urls.
+ (if (and ffap-url-regexp
+ (not (string-match ffap-url-regexp "https://foo"))
+ (string-match "\\((\\|\\\\|\\)\\(http\\)\\(\\\\|\\|\\\\)\\)"
+ ffap-url-regexp))
+ (setq ffap-url-regexp (replace-match "\\1\\2s?\\3"
+ nil nil ffap-url-regexp)))
+ ;; Add nntp:.
+ (if (and ffap-url-regexp
+ (not (string-match ffap-url-regexp "nntp://bar"))
+ (string-match "\\(\\\\(news\\\\(post\\\\)\\?:\\)\\(\\\\|\\)"
+ ffap-url-regexp))
+ (setq ffap-url-regexp (replace-match "\\1\\\\|nntp:\\2"
+ nil nil ffap-url-regexp)))))
+
+(defun w3m-active-region-or-url-at-point (&optional default=current)
+ "Return an active region or a url around the cursor.
+In Transient Mark mode, deactivate the mark. If DEFAULT=CURRENT is
+non-nil, return the url of the current page by default."
+ (if (w3m-region-active-p)
+ (prog1
+ (w3m-replace-in-string (buffer-substring-no-properties
+ (region-beginning) (region-end))
+ "[\t\r\f\n $B!!(B]+" "")
+ (w3m-deactivate-region))
+ (or (w3m-url-at-point)
+ (w3m-anchor)
+ (unless w3m-display-inline-images
+ (w3m-image))
+ (and default=current
+ (stringp w3m-current-url)
+ (if (string-match "\\`about://\\(?:header\\|source\\)/"
+ w3m-current-url)
+ (substring w3m-current-url (match-end 0))
+ w3m-current-url)))))
+
+(defun w3m-canonicalize-url (url &optional feeling-lucky)
+ "Add a scheme part to an URL or make an URL for \"I'm Feeling Lucky on Google\"
+if it has no scheme part."
+ (w3m-string-match-url-components url)
+ (cond
+ ((match-beginning 1)
+ url)
+ ((and (file-name-absolute-p url) (file-exists-p url))
+ (concat "file://" url))
+ (feeling-lucky
+ (let* ((charset w3m-google-feeling-lucky-charset)
+ (cs (w3m-charset-to-coding-system charset))
+ (str (w3m-url-encode-string url cs t)))
+ (format (concat "http://www.google.com/search"
+ "?btnI=I%%27m+Feeling+Lucky&ie=%s&oe=%s&q=%s")
+ charset charset str)))
+ (t
+ (concat "http://" url))))
+
+(defun w3m-input-url (&optional prompt initial default quick-start
+ feeling-lucky)
+ "Read a url from the minibuffer, prompting with string PROMPT."
+ (let (url)
+ (w3m-arrived-setup)
+ (unless default
+ (setq default w3m-home-page))
+ (unless (or initial
+ (not (setq initial (w3m-active-region-or-url-at-point t)))
+ (string-match "[^\000-\177]" initial))
+ (setq initial (w3m-url-decode-string initial w3m-current-coding-system)))
+ (when initial
+ (setq initial (w3m-puny-decode-url initial)))
+ (if (and quick-start
+ default
+ (not initial))
+ default
+ (unless w3m-enable-google-feeling-lucky
+ (setq feeling-lucky nil))
+ (setq url (let ((minibuffer-setup-hook
+ (append minibuffer-setup-hook '(beginning-of-line)))
+ (ofunc (lookup-key minibuffer-local-completion-map " ")))
+ (when feeling-lucky
+ (define-key minibuffer-local-completion-map " "
+ 'self-insert-command))
+ (unwind-protect
+ (completing-read
+ (if prompt
+ (if (or initial (not default))
+ prompt
+ (when (string-match " *: *\\'" prompt)
+ (setq prompt (substring prompt 0
+ (match-beginning 0))))
+ (concat prompt " (default "
+ (if (equal default w3m-home-page)
+ "HOME"
+ default)
+ "): "))
+ (if (or initial (not default))
+ (if feeling-lucky "URL or Keyword: " "URL: ")
+ (format "URL %s(default %s): "
+ (if feeling-lucky "or Keyword " "")
+ (if (stringp default)
+ (if (eq default w3m-home-page)
+ "HOME" default)
+ (prin1-to-string default)))))
+ 'w3m-url-completion nil nil initial
+ 'w3m-input-url-history)
+ (define-key minibuffer-local-completion-map " " ofunc))))
+ (when (string= "" url)
+ (setq url default))
+ (if (stringp url)
+ (progn
+ ;; remove duplication
+ (setq w3m-input-url-history
+ (cons url (delete url w3m-input-url-history)))
+ (w3m-canonicalize-url url feeling-lucky))
+ ;; It may be `popup'.
+ url))))
+
+;;; Cache:
+(defun w3m-cache-setup ()
+ "Initialize the variables for managing the cache."
+ (unless (and (bufferp w3m-cache-buffer)
+ (buffer-live-p w3m-cache-buffer))
+ (with-current-buffer (w3m-get-buffer-create " *w3m cache*")
+ (buffer-disable-undo)
+ (set-buffer-multibyte nil)
+ (setq buffer-read-only t
+ w3m-cache-buffer (current-buffer)
+ w3m-cache-hashtb (make-vector 1021 0)))))
+
+(defun w3m-cache-shutdown ()
+ "Clear all the variables managing the cache, and the cache itself."
+ (when (buffer-live-p w3m-cache-buffer)
+ (kill-buffer w3m-cache-buffer))
+ (setq w3m-cache-hashtb nil
+ w3m-cache-articles nil))
+
+(defun w3m-cache-header-delete-variable-part (header)
+ (let (buf flag)
+ (dolist (line (split-string header "\n+"))
+ (if (string-match "\\`\\(?:Date\\|Server\\|W3m-[^:]+\\):" line)
+ (setq flag t)
+ (unless (and flag (string-match "\\`[ \t]" line))
+ (setq flag nil)
+ (push line buf))))
+ (mapconcat (function identity) (nreverse buf) "\n")))
+
+(defun w3m-cache-header (url header &optional overwrite)
+ "Store HEADER into the cache so that it corresponds to URL.
+If OVERWRITE is non-nil, it forces the storing even if there has
+already been the data corresponding to URL in the cache."
+ (w3m-cache-setup)
+ (let ((ident (intern url w3m-cache-hashtb)))
+ (if (boundp ident)
+ (if (and
+ (not overwrite)
+ (string=
+ (w3m-cache-header-delete-variable-part header)
+ (w3m-cache-header-delete-variable-part (symbol-value ident))))
+ (symbol-value ident)
+ (w3m-cache-remove url)
+ (set ident header))
+ (set ident header))))
+
+(defun w3m-cache-request-header (url)
+ "Return the header string of URL when it is stored in the cache."
+ (w3m-cache-setup)
+ (let ((ident (intern url w3m-cache-hashtb)))
+ (and (boundp ident)
+ (symbol-value ident))))
+
+(defun w3m-cache-remove-oldest ()
+ (with-current-buffer w3m-cache-buffer
+ (goto-char (point-min))
+ (unless (zerop (buffer-size))
+ (let ((ident (get-text-property (point) 'w3m-cache))
+ buffer-read-only)
+ ;; Remove the ident from the list of articles.
+ (when ident
+ (setq w3m-cache-articles (delq ident w3m-cache-articles)))
+ ;; Delete the article itself.
+ (delete-region (point)
+ (next-single-property-change
+ (1+ (point)) 'w3m-cache nil (point-max)))))))
+
+(defun w3m-cache-remove (url)
+ "Remove the data coresponding to URL from the cache."
+ (w3m-cache-setup)
+ (let ((ident (intern url w3m-cache-hashtb))
+ beg end)
+ (when (memq ident w3m-cache-articles)
+ ;; It was in the cache.
+ (with-current-buffer w3m-cache-buffer
+ (let (buffer-read-only)
+ (when (setq beg (text-property-any
+ (point-min) (point-max) 'w3m-cache ident))
+ ;; Find the end (i. e., the beginning of the next article).
+ (setq end (next-single-property-change
+ (1+ beg) 'w3m-cache (current-buffer) (point-max)))
+ (delete-region beg end)))
+ (setq w3m-cache-articles (delq ident w3m-cache-articles))))))
+
+(defun w3m-cache-contents (url buffer)
+ "Store the contents of URL into the cache.
+The contents are assumed to be in BUFFER. Return a symbol which
+identifies the data in the cache."
+ (w3m-cache-setup)
+ (let ((ident (intern url w3m-cache-hashtb)))
+ (w3m-cache-remove url)
+ ;; Remove the oldest article, if necessary.
+ (and (numberp w3m-keep-cache-size)
+ (>= (length w3m-cache-articles) w3m-keep-cache-size)
+ (w3m-cache-remove-oldest))
+ ;; Insert the new article.
+ (with-current-buffer w3m-cache-buffer
+ (let (buffer-read-only)
+ (goto-char (point-max))
+ (let ((b (point)))
+ (insert-buffer-substring buffer)
+ ;; Tag the beginning of the article with the ident.
+ (when (> (point-max) b)
+ (w3m-add-text-properties b (1+ b) (list 'w3m-cache ident))
+ (setq w3m-cache-articles (cons ident w3m-cache-articles))
+ ident))))))
+
+(defun w3m-cache-request-contents (url &optional buffer)
+ "Insert contents of URL into BUFFER.
+Return t if the contents are found in the cache, otherwise nil. When
+BUFFER is nil, all contents will be inserted in the current buffer."
+ (w3m-cache-setup)
+ (let ((ident (intern url w3m-cache-hashtb)))
+ (when (memq ident w3m-cache-articles)
+ ;; It was in the cache.
+ (let (beg end)
+ (with-current-buffer w3m-cache-buffer
+ (if (setq beg (text-property-any
+ (point-min) (point-max) 'w3m-cache ident))
+ ;; Find the end (i.e., the beginning of the next article).
+ (setq end (next-single-property-change
+ (1+ beg) 'w3m-cache (current-buffer) (point-max)))
+ ;; It wasn't in the cache after all.
+ (setq w3m-cache-articles (delq ident w3m-cache-articles))))
+ (and beg
+ end
+ (with-current-buffer (or buffer (current-buffer))
+ (let (buffer-read-only)
+ (insert-buffer-substring w3m-cache-buffer beg end))
+ t))))))
+
+;; FIXME: we need to check whether contents were updated in remote servers.
+(defun w3m-cache-available-p (url)
+ "Return non-nil if a content of URL has already been cached."
+ (w3m-cache-setup)
+ (when (stringp url)
+ (let ((ident (intern url w3m-cache-hashtb)))
+ (and
+ (memq ident w3m-cache-articles)
+ (or
+ w3m-prefer-cache
+ (save-match-data
+ (let ((case-fold-search t)
+ (head (and (boundp ident) (symbol-value ident)))
+ time expire)
+ (cond
+ ((and (string-match "^\\(?:date\\|etag\\):[ \t]" head)
+ (or (string-match "^pragma:[ \t]+no-cache\n" head)
+ (string-match
+ "^cache-control:\\(?:[^\n]+\\)?[ \t,]\\(?:no-cache\\|max-age=0\\)[,\n]"
+ head)))
+ nil)
+ ((and
+ (string-match "^date:[ \t]\\([^\n]+\\)\n" head)
+ (setq time (match-string 1 head))
+ (setq time (w3m-time-parse-string time))
+ (string-match "^cache-control:\\(?:[^\n]+\\)?[ \t,]max-age=\\([1-9][0-9]*\\)"
+ head)
+ (setq expire (string-to-number (match-string 1 head))))
+ (setq time (decode-time time))
+ (setcar time (+ (car time) expire))
+ ;; Work around too large integer.
+ (when (floatp (car time))
+ (setcar time (eval '(lsh -1 -1))))
+ (setq expire (apply 'encode-time time))
+ (w3m-time-newer-p expire (current-time)))
+ ((and
+ (string-match "^expires:[ \t]+\\([^\n]+\\)\n" head)
+ (setq expire (match-string 1 head))
+ (setq expire (w3m-time-parse-string expire)))
+ (w3m-time-newer-p expire (current-time)))
+ (t
+ ;; Adhoc heuristic rule: pages with neither
+ ;; Last-Modified header and ETag header are treated as
+ ;; dynamically-generated pages.
+ (string-match "^\\(?:last-modified\\|etag\\):" head))))))
+ ident))))
+
+(defun w3m-read-file-name (&optional prompt dir default existing)
+ (when default
+ (setq default (file-name-nondirectory (w3m-url-strip-query default))))
+ (unless prompt
+ (setq prompt (if (and default (not (string-equal default "")))
+ (format "Save to (%s): " default)
+ "Save to: ")))
+ (setq dir (file-name-as-directory (or dir w3m-default-save-directory)))
+ (let ((default-directory dir)
+ (file (read-file-name prompt dir nil existing default)))
+ (if (not (file-directory-p file))
+ (setq w3m-default-save-directory
+ (or (file-name-directory file) w3m-default-save-directory))
+ (setq w3m-default-save-directory file)
+ (if default
+ (setq file (expand-file-name default file))))
+ (expand-file-name file)))
+
+;;; Handling character sets:
+(defun w3m-charset-to-coding-system (charset)
+ "Return a coding system which is most suitable to CHARSET.
+CHARSET is a symbol whose name is MIME charset.
+This function is imported from mcharset.el."
+ (if (stringp charset)
+ (setq charset (intern (downcase charset))))
+ (let ((cs (assq charset w3m-charset-coding-system-alist)))
+ (w3m-find-coding-system (if cs (cdr cs) charset))))
+
+(defun w3m-coding-system-to-charset (coding-system)
+ "Return the MIME charset corresponding to CODING-SYSTEM."
+ (when coding-system
+ (w3m-static-if (featurep 'xemacs)
+ (when (or (fboundp 'coding-system-to-mime-charset)
+ (progn
+ (require 'mcharset)
+ (fboundp 'coding-system-to-mime-charset)))
+ (defalias 'w3m-coding-system-to-charset
+ 'coding-system-to-mime-charset)
+ (w3m-coding-system-to-charset coding-system))
+ (or (coding-system-get coding-system :mime-charset)
+ (coding-system-get coding-system 'mime-charset)))))
+
+;; FIXME: we need to investigate the kind of Content-Charsets being
+;; actually possible.
+(defun w3m-read-content-charset (prompt &optional default)
+ "Read a content charset from the minibuffer, prompting with string PROMPT.
+The second argument DEFAULT is the default value, which is used as the
+value to return if the user enters the empty string."
+ (let ((charset (completing-read
+ prompt
+ (nconc
+ (mapcar (lambda (c) (cons (symbol-name c) c))
+ (coding-system-list))
+ (mapcar (lambda (c) (cons (symbol-name (car c)) c))
+ w3m-charset-coding-system-alist))
+ nil t)))
+ (if (string= "" charset)
+ default
+ charset)))
+
+
+;;; Handling encoding of contents:
+(defun w3m-decode-encoded-contents (encoding)
+ "Decode encoded contents in the current buffer.
+It supports the encoding types of gzip, bzip2, deflate, etc."
+ (let ((x (and (stringp encoding)
+ (assoc (downcase encoding) w3m-encoding-alist))))
+ (or (not (and x (setq x (cdr (assq (cdr x) w3m-decoder-alist)))))
+ (let ((coding-system-for-write 'binary)
+ (coding-system-for-read 'binary)
+ (default-process-coding-system (cons 'binary 'binary)))
+ (w3m-process-with-environment w3m-command-environment
+ (zerop (apply 'call-process-region
+ (point-min) (point-max)
+ (w3m-which-command (car x))
+ t '(t nil) nil (cadr x))))))))
+
+(defmacro w3m-correct-charset (charset)
+ `(or (and ,charset (stringp ,charset)
+ (cdr (assoc (downcase ,charset) w3m-correct-charset-alist)))
+ ,charset))
+
+(defun w3m-detect-meta-charset ()
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (catch 'found
+ (while (re-search-forward "<meta[ \t\r\f\n]+" nil t)
+ (w3m-parse-attributes ((http-equiv :case-ignore)
+ (content :case-ignore))
+ (when (and (string= http-equiv "content-type")
+ content
+ (string-match ";[ \t\n]*charset=\\([^\";]+\\)" content))
+ (throw 'found (match-string 1 content))))))))
+
+(defun w3m-detect-xml-charset ()
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (when (looking-at "[ \t\r\f\n]*<\\?xml[ \t\r\f\n]+")
+ (goto-char (match-end 0))
+ (or (w3m-parse-attributes ((encoding :case-ignore))
+ encoding)
+ "utf-8"))))
+
+(defvar w3m-compatible-encoding-alist
+ '((gb2312 . gbk)
+ (iso-8859-1 . windows-1252)
+ (iso-8859-8 . windows-1255)
+ (iso-8859-9 . windows-1254))
+ "Alist of encodings and those supersets.
+The cdr of each element is used to decode data if it is available when
+the car is what the data specify as the encoding. Or, the car is used
+for decoding when the cdr that the data specify is not available.")
+
+(defvar w3m-view-source-decode-level 0
+ "Say whether `w3m-view-source' decodes html sources.
+Users should never modify the value. See also `w3m-view-source'.")
+
+(defun w3m-decode-buffer (url &optional content-charset content-type)
+ (let* ((sourcep (string-match "\\`about://source/" url))
+ (level (if sourcep w3m-view-source-decode-level 0))
+ cs)
+ (unless (>= level 4)
+ (unless content-type
+ (setq content-type (w3m-content-type url)))
+ (unless content-charset
+ (setq content-charset
+ (or (w3m-content-charset url)
+ (when (or (string= "text/html" content-type) sourcep)
+ (w3m-detect-meta-charset))
+ (w3m-detect-xml-charset))))
+ (cond
+ ((or (and (stringp content-charset)
+ (string= "x-moe-internal" (downcase content-charset)))
+ (eq content-charset 'x-moe-internal))
+ (setq cs (w3m-x-moe-decode-buffer))
+ (setq content-charset (symbol-name cs)))
+ (content-charset
+ (setq content-charset (w3m-correct-charset content-charset))
+ (setq cs (w3m-charset-to-coding-system content-charset))))
+ (setq w3m-current-content-charset content-charset)
+ (unless cs
+ (setq cs (w3m-detect-coding-region
+ (point-min) (point-max) (if (w3m-url-local-p url)
+ nil
+ w3m-coding-system-priority-list))))
+ (setq w3m-current-coding-system
+ (or (w3m-find-coding-system
+ (cdr (assq cs w3m-compatible-encoding-alist)))
+ (w3m-find-coding-system cs)
+ (w3m-find-coding-system
+ (car (rassq cs w3m-compatible-encoding-alist)))))
+ ;; Decode `&#nnn;' entities in 128..159 and 160.
+ (when (and (<= level 1)
+ (rassq w3m-current-coding-system
+ w3m-compatible-encoding-alist))
+ (goto-char (point-min))
+ (let ((case-fold-search t))
+ (while (re-search-forward "\
+\\(?:&#\\(12[89]\\|1[3-5][0-9]\\)\;\\)\\|\\(?:&#x\\([89][0-9a-f]\\)\;\\)"
+ nil t)
+ (insert (prog1
+ (if (match-beginning 1)
+ (string-to-number (match-string 1))
+ (string-to-number (match-string 2) 16))
+ (delete-region (match-beginning 0) (match-end 0)))))
+ (goto-char (point-min))
+ (while (re-search-forward "\240\\|&#160;\\|&#xa0;" nil t)
+ (replace-match "&nbsp;"))))
+ (insert
+ (prog1
+ (decode-coding-string (buffer-string) w3m-current-coding-system)
+ (erase-buffer)
+ (set-buffer-multibyte t))))))
+
+(defun w3m-x-moe-decode-buffer ()
+ (let ((args '("-i" "-cs" "x-moe-internal"))
+ (coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ (default-process-coding-system (cons 'binary 'binary))
+ charset)
+ (if (w3m-find-coding-system 'utf-8)
+ (setq args (append args '("-o" "-cs" "utf-8"))
+ charset 'utf-8)
+ (setq args
+ (append args (list "-o" "-cs" (symbol-name w3m-coding-system))))
+ (setq charset w3m-coding-system))
+ (w3m-process-with-environment w3m-command-environment
+ (apply 'call-process-region (point-min) (point-max)
+ w3m-mbconv-command t t nil args))
+ charset))
+
+(defun w3m-safe-decode-buffer (url &optional content-charset content-type)
+ (and (not w3m-current-coding-system)
+ (stringp content-type)
+ (string-match "\\`text/" content-type)
+ (w3m-decode-buffer url content-charset content-type)))
+
+;;; Retrieving local data:
+(defun w3m-local-file-type (url)
+ "Return the content type and the content encoding of URL."
+ (setq url (or (w3m-url-to-file-name url)
+ (file-name-nondirectory url)))
+ (if (or (and (file-name-absolute-p url)
+ (file-directory-p url))
+ (string-match "\\`news:" url)) ;; FIXME: isn't this a kludge?
+ (cons "text/html" nil)
+ (let ((encoding
+ (catch 'encoding-detected
+ (dolist (elem w3m-encoding-type-alist)
+ (when (string-match (car elem) url)
+ (setq url (substring url 0 (match-beginning 0)))
+ (throw 'encoding-detected (cdr elem)))))))
+ (cons (catch 'type-detected
+ (dolist (elem w3m-content-type-alist)
+ (when (and (cadr elem) (string-match (cadr elem) url))
+ (throw 'type-detected (car elem))))
+ "unknown")
+ encoding))))
+
+(defmacro w3m-local-content-type (url)
+ `(car (w3m-local-file-type ,url)))
+
+(defun w3m-local-attributes (url &rest args)
+ "Return a list of attributes corresponding to URL.
+Return nil if it failed in retrieving of the header.
+Otherwise, return a list which includes the following elements:
+
+ 0. Type of contents.
+ 1. Charset of contents.
+ 2. Size in bytes.
+ 3. Encoding of contents.
+ 4. Last modification time.
+ 5. Real URL.
+"
+ (let* ((file (w3m-url-to-file-name url))
+ (attr (when (file-exists-p file)
+ (file-attributes file)))
+ (type (w3m-local-file-type url)))
+ (list (or (w3m-arrived-content-type url) (car type))
+ nil
+ (nth 7 attr)
+ (cdr type)
+ (nth 5 attr)
+ (w3m-expand-file-name-as-url (file-truename file)))))
+
+(defun w3m-local-retrieve (url &optional no-uncompress &rest args)
+ "Retrieve contents of local URL and put it into the current buffer.
+This function will return the content-type of URL as a string when
+retrieval is successful."
+ (let ((file (w3m-url-to-file-name url)))
+ (when (file-readable-p file)
+ (if (file-directory-p file)
+ (w3m-local-dirlist-cgi url)
+ (let ((coding-system-for-read 'binary))
+ (if no-uncompress
+ (let (jka-compr-compression-info-list
+ format-alist)
+ (insert-file-contents file))
+ (insert-file-contents file))))
+ (or (w3m-arrived-content-type url)
+ (w3m-local-content-type file)))))
+
+(defun w3m-local-dirlist-cgi (url)
+ (w3m-message "Reading %s..." (w3m-url-readable-string url))
+ (if w3m-dirlist-cgi-program
+ (if (file-executable-p w3m-dirlist-cgi-program)
+ (let ((coding-system-for-read 'binary)
+ (default-process-coding-system
+ (cons 'binary 'binary))
+ (lcookie (make-temp-name
+ (format "%s.%d." (user-login-name) (emacs-pid))))
+ (cfile (make-temp-name
+ (expand-file-name "w3melck" w3m-profile-directory)))
+ (env (copy-sequence w3m-command-environment))
+ file)
+ (with-temp-buffer
+ (insert lcookie)
+ (write-region (point-min) (point-max) cfile 'nomsg))
+ (w3m-process-with-environment
+ (append
+ (list
+ (cons "LOCAL_COOKIE" lcookie)
+ (cons "LOCAL_COOKIE_FILE" cfile)
+ (cons "QUERY_STRING"
+ (format
+ "dir=%s&cookie=%s"
+ (encode-coding-string (w3m-url-to-file-name url)
+ w3m-file-name-coding-system)
+ lcookie)))
+ (delq (assoc "LOCAL_COOKIE" env)
+ (delq (assoc "LOCAL_COOKIE_FILE" env)
+ (delq (assoc "QUERY_STRING" env) env))))
+ (call-process w3m-dirlist-cgi-program nil t nil))
+ ;; delete local cookie file
+ (when (and (file-exists-p cfile) (file-writable-p cfile))
+ (delete-file cfile))
+ (goto-char (point-min))
+ (when (re-search-forward "^<html>" nil t)
+ (delete-region (point-min) (match-beginning 0))
+ (while (re-search-forward "<a href=\"\\([^\"]+\\)\"\\(?:>\\| \\)"
+ nil t)
+ (setq file (match-string 1))
+ (delete-region (goto-char (match-beginning 1)) (match-end 1))
+ (if (file-directory-p file)
+ (setq file (w3m-expand-file-name-as-url
+ (file-name-as-directory file)))
+ (setq file (w3m-expand-file-name-as-url file)))
+ (insert (encode-coding-string
+ (w3m-url-decode-string file
+ w3m-file-name-coding-system)
+ w3m-file-name-coding-system)))))
+ (error "Can't execute: %s" w3m-dirlist-cgi-program))
+ ;; execute w3m internal CGI
+ (w3m-process-with-wait-handler
+ (setq w3m-current-url url)
+ (w3m-process-start handler
+ w3m-command
+ (append w3m-command-arguments
+ (list "-dump_source" url)))))
+ ;; bind charset to w3m-file-name-coding-system
+ (let ((charset (or (car (rassq w3m-file-name-coding-system
+ w3m-charset-coding-system-alist))
+ w3m-file-name-coding-system))
+ beg)
+ (goto-char (point-min))
+ (when (search-forward "<head>" nil t)
+ (insert "\n<meta http-equiv=\"CONTENT-TYPE\" "
+ "content=\"text/html; charset="
+ (symbol-name charset)
+ "\">"))
+ (goto-char (point-min))
+ ;; Remove <form>...</form>
+ (when (search-forward "<form " nil t)
+ (setq beg (match-beginning 0))
+ (when (search-forward "</form>" nil t)
+ (delete-region beg (match-end 0)))))
+ (w3m-message "Reading %s...done" (w3m-url-readable-string url)))
+
+;;; Retrieving data via HTTP:
+(defun w3m-remove-redundant-spaces (str)
+ "Remove leading and trailing whitespace from STR."
+ (save-match-data
+ (when (string-match "\\`[ \t\r\f\n]+" str)
+ (setq str (substring str (match-end 0))))
+ (if (string-match "[ \t\r\f\n]+\\'" str)
+ (substring str 0 (match-beginning 0))
+ str)))
+
+(defun w3m-w3m-parse-header (url header)
+ "Parse a given string HEADER as a MIME header of URL.
+Return a list which includes:
+
+ 0. Status code.
+ 1. Type of contents.
+ 2. Charset of contents.
+ 3. Size in bytes.
+ 4. Encoding of contents.
+ 5. Last modification time.
+ 6. Real URL.
+"
+ (let ((case-fold-search t)
+ (headers)
+ (status))
+ (dolist (line (split-string header "[ \f\t\r]*\n"))
+ (cond
+ ((string-match "\\`HTTP/1\\.[0-9] \\([0-9][0-9][0-9]\\)\\b" line)
+ (setq status (string-to-number (match-string 1 line))))
+ ((string-match (eval-when-compile
+ (concat "\\`\\("
+ (regexp-opt
+ '(;; MEMO: $B%U%!%$%k$r%@%&%s%m!<%I$9$k(B
+ ;; $B$H$-$N(B $BE,@Z$J%G%U%)%k%HL>$r7hDj(B
+ ;; $B$9$k$?$a$K$O(B content-disposition
+ ;; $B$N2r<a$,I,MW!%(B
+ "content-disposition"
+ "content-encoding"
+ "content-length"
+ ;; MEMO: See [emacs-w3m:02341].
+ "content-transfer-encoding"
+ "content-type"
+ "last-modified"
+ "location"
+ "w3m-current-url"
+ "w3m-document-charset"
+ "w3m-ssl-certificate"
+ "x-w3m-content-encoding"
+ "alternates"))
+ "\\):[ \t]*"))
+ line)
+ (push (cons (downcase (match-string 1 line))
+ (substring line (match-end 0)))
+ headers))))
+ (let (alt real-url type charset xmoe)
+ (when (and (setq alt (cdr (assoc "alternates" headers)))
+ (string-match "\\`{[\t ]*\"\\(.+\\)\"" alt))
+ (setq real-url (w3m-expand-url (match-string 1 alt) url))
+ (when (string-match "{[\t ]*type[\t ]+\\([^\t }]+\\)" alt)
+ (setq type (downcase (match-string 1 alt))))
+ (when (string-match "{[\t ]*charset[\t ]+\\([^\t }]+\\)" alt)
+ (setq charset (downcase (match-string 1 alt)))))
+ (when (and (not type)
+ (setq type (cdr (assoc "content-type" headers))))
+ (if (string-match ";[ \t]*charset=\"?\\([^\"]+\\)\"?" type)
+ (setq charset (w3m-remove-redundant-spaces
+ (match-string 1 type))
+ type (w3m-remove-redundant-spaces
+ (substring type 0 (match-beginning 0))))
+ (setq type (w3m-remove-redundant-spaces type)))
+ (when (string-match ";" type)
+ (setq type (substring type 0 (match-beginning 0))))
+ (setq type (downcase type)))
+ (setq w3m-current-ssl (cdr (assoc "w3m-ssl-certificate" headers)))
+ (when (string-match "\\`ftps?:" url)
+ (setq url (or (cdr (assoc "w3m-current-url" headers))
+ url)))
+ (when (and (setq xmoe (cdr (assoc "w3m-document-charset" headers)))
+ (string= xmoe "x-moe-internal"))
+ (setq charset xmoe))
+ (list status
+ (if (string-match "\\`ftps?:.*/\\'" url)
+ "text/html"
+ (or type (w3m-local-content-type url)))
+ (if (string-match "\\`ftps?:.*/\\'" url)
+ (if w3m-accept-japanese-characters
+ "w3m-euc-japan" "w3m-iso-latin-1")
+ charset)
+ (let ((v (cdr (assoc "content-length" headers))))
+ (and v (setq v (string-to-number v)) (> v 0) v))
+ (cdr (or (assoc "content-encoding" headers)
+ (assoc "x-w3m-content-encoding" headers)))
+ (let ((v (cdr (assoc "last-modified" headers))))
+ (and v (w3m-time-parse-string v)))
+ (or real-url
+ (let ((v (cdr (assoc "location" headers))))
+ ;; RFC2616 says that the field value of the Location
+ ;; response-header consists of a single absolute
+ ;; URI. However, some broken servers return
+ ;; relative URIs.
+ (and v (w3m-expand-url v url)))
+ url)))))
+
+(defun w3m-w3m-dump-head (url handler)
+ "Return the header string of URL."
+ (lexical-let ((url url)
+ (silent w3m-message-silent))
+ (w3m-message "Request sent, waiting for response...")
+ (w3m-process-do-with-temp-buffer
+ (success (progn
+ (setq w3m-current-url url
+ url (w3m-url-strip-authinfo url))
+ (w3m-process-start handler
+ w3m-command
+ (append w3m-command-arguments
+ (list "-o" "follow_redirection=0"
+ "-dump_head" url)))))
+ (let ((w3m-message-silent silent))
+ (w3m-message "Request sent, waiting for response...done")
+ (when success
+ (buffer-string))))))
+
+(defun w3m-w3m-canonicalize-url (url)
+ "Add a slash to an URL, when its server part is not ended with a slash."
+ ;; Because URLs encountered in WEB documents are no less reliable
+ ;; than URLs given by users, a minimum canonicalization may be
+ ;; required in the backend side. For more detail, please see
+ ;; [emacs-w3m:07000].
+ (if (string-match "\\`\\(?:ht\\|f\\)tps?://[^/]+\\'" url)
+ (concat url "/")
+ url))
+
+(defun w3m-w3m-attributes (url no-cache handler)
+ "Return a list of attributes corresponding to URL.
+Return nil if it failed in retrieving of the header.
+Otherwise, return a list which includes the following elements:
+
+ 0. Type of contents.
+ 1. Charset of contents.
+ 2. Size in bytes.
+ 3. Encoding of contents.
+ 4. Last modification time.
+ 5. Real URL.
+
+If the optional argument NO-CACHE is non-nil, cache is not used."
+ (w3m-w3m-attributes-1 (w3m-w3m-canonicalize-url url)
+ no-cache
+ (or w3m-follow-redirection 0)
+ handler))
+
+(defun w3m-w3m-attributes-1 (url no-cache counter handler)
+ "A subroutine for `w3m-w3m-attributes'."
+ (lexical-let ((url url)
+ (no-cache no-cache)
+ (counter counter))
+ (w3m-process-do
+ (header (or (unless no-cache
+ (w3m-cache-request-header url))
+ (w3m-w3m-dump-head url handler)))
+ (when header
+ (let ((attr (w3m-w3m-parse-header url header)))
+ (w3m-cache-header url header)
+ (if (memq (car attr) '(301 302 303 304 305 306 307))
+ (if (zerop counter)
+ ;; Redirect counter exceeds `w3m-follow-redirection'.
+ (list "text/html" "us-ascii" nil nil nil url)
+ ;; Follow redirection.
+ (w3m-w3m-attributes-1 (nth 6 attr) no-cache
+ (1- counter) handler))
+ (cdr attr)))))))
+
+(defun w3m-w3m-expand-arguments (arguments)
+ (apply 'append
+ (mapcar
+ (lambda (x)
+ (cond
+ ((stringp x) (list x))
+ ((setq x (eval x))
+ (cond ((stringp x)
+ (list x))
+ ((listp x)
+ (w3m-w3m-expand-arguments x))
+ (t
+ (let (print-level print-length)
+ (list (prin1-to-string x))))))))
+ arguments)))
+
+(defun w3m-w3m-dump-extra (url handler)
+ "Retrive headers and contents pointed to by URL"
+ (lexical-let ((url url)
+ (silent w3m-message-silent))
+ (setq w3m-current-url url
+ url (w3m-url-strip-authinfo url))
+ (w3m-message "Reading %s...%s"
+ (w3m-url-readable-string url)
+ (if (and w3m-async-exec (not w3m-process-waited))
+ (substitute-command-keys "\
+ (Type `\\<w3m-mode-map>\\[w3m-process-stop]' to stop asynchronous process)")
+ ""))
+ (w3m-process-do
+ (success
+ (w3m-process-start handler
+ w3m-command
+ (append w3m-command-arguments
+ (w3m-w3m-expand-arguments
+ w3m-dump-head-source-command-arguments)
+ (list url))))
+ (let ((w3m-message-silent silent))
+ (w3m-message "Reading %s...done" (w3m-url-readable-string url))
+ (when success
+ (goto-char (point-min))
+ (let ((case-fold-search t))
+ (when (and (re-search-forward "^w3m-current-url:" nil t)
+ (progn
+ (delete-region (point-min) (match-beginning 0))
+ (search-forward "\n\n" nil t)))
+ (let ((header (buffer-substring (point-min) (point))))
+ (when w3m-use-cookies
+ (w3m-cookie-set url (point-min) (point)))
+ (delete-region (point-min) (point))
+ (w3m-cache-header url header)
+ (w3m-cache-contents url (current-buffer))
+ (w3m-w3m-parse-header url header)))))))))
+
+(defun w3m-additional-command-arguments (url)
+ "Return a list of additional arguments passed to the w3m command.
+You may specify additional arguments for the particular urls using the
+option `w3m-command-arguments-alist', or using `w3m-no-proxy-domains'
+to add the option \"-no-proxy\"."
+ (let ((defs w3m-command-arguments-alist)
+ def args host)
+ (while (and defs
+ (null args))
+ (setq def (car defs)
+ defs (cdr defs))
+ (when (string-match (car def) url)
+ (setq args (cdr def))))
+ (when (and w3m-no-proxy-domains
+ (not (member "-no-proxy" args))
+ (string-match "^[a-z]+://\\([^/:]+\\)" url)
+ (catch 'domain-match
+ (setq host (match-string 1 url))
+ (dolist (domain w3m-no-proxy-domains)
+ (when (string-match (concat "\\(?:^\\|\\.\\)"
+ (regexp-quote domain)
+ "$")
+ host)
+ (throw 'domain-match t)))))
+ (push "-no-proxy" args))
+ args))
+
+(defun w3m-add-referer-p (url referer)
+ "Return non-nil when URL and REFERER satisfies the condition
+specified by `w3m-add-referer'."
+ (when (stringp referer)
+ (cond
+ ((eq w3m-add-referer 'lambda)
+ (let (host)
+ (w3m-string-match-url-components url)
+ (when (match-beginning 4)
+ (setq host (match-string 4 url))
+ (w3m-string-match-url-components referer)
+ (when (match-beginning 4)
+ (string= host (match-string 4 referer))))))
+ ((consp w3m-add-referer)
+ (and (not (and (cdr w3m-add-referer)
+ (string-match (cdr w3m-add-referer) referer)))
+ (car w3m-add-referer)
+ (string-match (car w3m-add-referer) referer)))
+ ((functionp w3m-add-referer)
+ (funcall w3m-add-referer url referer))
+ (t w3m-add-referer))))
+
+;; Currently, -request argument is supported only by w3mmee.
+(defun w3m-request-arguments (method url temp-file
+ &optional body referer content-type)
+ "Make the arguments for `-request' or `-header' option passed to w3m.
+METHOD is an HTTP method name.
+TEMP-FILE is a name of temporal file to write request content to.
+Optional BODY is the body content string.
+Second optional REFERER is the Referer: field content.
+Third optional CONTENT-TYPE is the Content-Type: field content."
+ (with-temp-buffer
+ (let ((modes (default-file-modes))
+ (cookie (and w3m-use-cookies (w3m-cookie-get url))))
+ (if (and (null cookie)(null body)
+ (null content-type))
+ (append
+ (when w3m-add-user-agent
+ (list "-header" (concat "User-Agent:" w3m-user-agent)))
+ (when (w3m-add-referer-p url referer)
+ (list "-header" (concat "Referer: " referer)))
+ (when w3m-accept-languages
+ (list "-header" (concat
+ "Accept-Language: "
+ (mapconcat 'identity w3m-accept-languages
+ " ")))))
+ (when w3m-add-user-agent (insert "User-Agent: " w3m-user-agent "\n"))
+ (when (w3m-add-referer-p url referer)
+ (insert "Referer: " referer "\n"))
+ (when w3m-accept-languages
+ (insert "Accept-Language: "
+ (mapconcat 'identity w3m-accept-languages " ") "\n"))
+ (when cookie
+ (insert "Cookie: " cookie "\n"))
+ (when content-type
+ (insert "Content-Type: " content-type "\n"))
+ (insert "\n")
+ (when body
+ (insert body))
+ (unwind-protect
+ (let ((coding-system-for-write 'binary))
+ (set-default-file-modes (* 64 6))
+ (write-region (point-min) (point-max) temp-file nil 'silent))
+ (set-default-file-modes modes))
+ (list "-request" (concat method ":" temp-file))))))
+
+;; Currently, w3m uses this function.
+(defun w3m-header-arguments (method url temp-file
+ &optional body referer content-type)
+ "Make the arguments for the `-header' option passed to the w3m command.
+METHOD is an HTTP method name.
+TEMP-FILE is a name of temporal file to write post body to.
+Optional BODY is the post body content string.
+Optional second REFERER is the Referer: field content.
+Third optional CONTENT-TYPE is the Content-Type: field content."
+ (let ((modes (default-file-modes))
+ (cookie (and w3m-use-cookies (w3m-cookie-get url)))
+ args)
+ (when w3m-add-user-agent
+ (setq args (nconc args
+ (list "-o" (concat "user_agent=" w3m-user-agent)))))
+ (when cookie
+ (setq args (nconc args
+ (list "-header" (concat "Cookie: " cookie)))))
+ (when (and (string= method "post") temp-file)
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (when body (insert body))
+ (unwind-protect
+ (let ((coding-system-for-write 'binary))
+ (set-default-file-modes (* 64 6))
+ (write-region (point-min) (point-max) temp-file nil 'silent))
+ (set-default-file-modes modes)))
+ (setq args (nconc args
+ (when content-type
+ (list "-header" (concat "Content-Type: "
+ content-type)))
+ (list "-post" temp-file))))
+ (when (w3m-add-referer-p url referer)
+ (setq args (nconc args (list "-header" (concat "Referer: " referer)))))
+ args))
+
+(defun w3m-w3m-retrieve (url no-uncompress no-cache post-data referer handler)
+ "Retrieve web contents pointed to by URL using the external w3m command.
+It will put the retrieved contents into the current buffer. See
+`w3m-retrieve' for how does it work asynchronously with the arguments."
+ (lexical-let ((url (w3m-w3m-canonicalize-url url))
+ (no-uncompress no-uncompress)
+ (current-buffer (current-buffer))
+ (silent w3m-message-silent))
+ (w3m-process-do-with-temp-buffer
+ (attr (progn
+ (set-buffer-multibyte nil)
+ (w3m-w3m-retrieve-1 url post-data referer no-cache
+ (or w3m-follow-redirection 0) handler)))
+ (let ((w3m-message-silent silent))
+ (when attr
+ (cond
+ ((eq attr 'redirection-exceeded)
+ "X-w3m-error/redirection")
+ ((or (not (string-match "\\`https?:" url))
+ (memq (car attr) '(200 300)))
+ (if (or no-uncompress
+ (w3m-decode-encoded-contents (nth 4 attr)))
+ (let ((temp-buffer (current-buffer)))
+ (with-current-buffer current-buffer
+ (insert-buffer-substring temp-buffer))
+ (goto-char (point-min))
+ (cadr attr))
+ (ding)
+ (w3m-message "Can't decode encoded contents: %s" url)
+ nil))
+ (t nil)))))))
+
+(defun w3m-w3m-retrieve-1 (url post-data referer no-cache counter handler)
+ "A subroutine for `w3m-w3m-retrieve'."
+ (let ((w3m-command-arguments
+ (append w3m-command-arguments
+ (when (member "cookie" w3m-compile-options)
+ (list "-no-cookie"))
+ (list "-o" "follow_redirection=0")
+ (w3m-additional-command-arguments url)))
+ (cachep (w3m-cache-available-p url))
+ temp-file)
+ (when (and w3m-broken-proxy-cache
+ (or no-cache (not cachep)))
+ (setq w3m-command-arguments
+ (append w3m-command-arguments '("-o" "no_cache=1"))))
+ (setq temp-file
+ (when (or (eq w3m-type 'w3mmee) post-data)
+ (make-temp-name
+ (expand-file-name "w3mel" w3m-profile-directory))))
+ (setq w3m-command-arguments
+ (append w3m-command-arguments
+ (apply (if (eq w3m-type 'w3mmee)
+ 'w3m-request-arguments
+ 'w3m-header-arguments)
+ (list (if post-data "post" "get")
+ url
+ temp-file
+ (if (consp post-data)
+ (cdr post-data)
+ post-data)
+ referer
+ (if (consp post-data) (car post-data))))))
+ (lexical-let ((url url)
+ (post-data post-data)
+ (referer referer)
+ (no-cache no-cache)
+ (counter counter)
+ (temp-file temp-file))
+ (w3m-process-do
+ (attr (or (unless no-cache
+ (and cachep
+ (w3m-cache-request-contents url)
+ (w3m-w3m-parse-header
+ url (w3m-cache-request-header url))))
+ (w3m-w3m-dump-extra url handler)))
+ (and temp-file
+ (file-exists-p temp-file)
+ (delete-file temp-file))
+ (if (memq (car attr) '(301 302 303 304 305 306 307))
+ (if (zerop counter)
+ ;; Redirect counter exceeds `w3m-follow-redirection'.
+ 'redirection-exceeded
+ ;; Follow redirection.
+ (erase-buffer)
+ (unless (and post-data
+ (cond
+ ((memq (car attr) '(301 302))
+ (if w3m-redirect-with-get
+ (setq post-data nil)
+ (not (y-or-n-p
+ (format "Send POST data to `%s'?" url)))))
+ ((eq (car attr) 303) ; => See Other
+ (setq post-data nil))
+ ((eq (car attr) 307) ; => Temporally Redirect
+ (not (y-or-n-p
+ (format "Send POST data to `%s'?" url))))))
+ (w3m-w3m-retrieve-1 (nth 6 attr)
+ post-data referer no-cache
+ (1- counter) handler)))
+ (if (and (eq (car attr) 406)
+ (not (equal url (nth 6 attr))))
+ ;; Attempt to retrieve an alternative url.
+ (progn
+ (erase-buffer)
+ (w3m-w3m-retrieve-1 (nth 6 attr) post-data referer no-cache
+ counter handler))
+ attr))))))
+
+(defun w3m-about-retrieve (url &optional no-uncompress no-cache
+ post-data referer handler)
+ "Retrieve the about: page which is pointed to by URL.
+It will put the retrieved contents into the current buffer. See
+`w3m-retrieve' for how does it work asynchronously with the arguments."
+ (cond
+ ((string= "about://emacs-w3m.gif" url)
+ (let ((icon (base64-decode-string w3m-emacs-w3m-icon)))
+ (if (featurep 'xemacs)
+ (insert icon)
+ (set-buffer-multibyte (multibyte-string-p icon))
+ (insert icon)
+ (set-buffer-multibyte nil)))
+ "image/gif")
+ ((string-match "\\`about://source/" url)
+ (lexical-let ((url (substring url (match-end 0))))
+ (w3m-process-do
+ (type (w3m-retrieve url
+ no-uncompress no-cache post-data referer handler))
+ (cond
+ (type "text/plain")
+ ((w3m-cache-request-contents url)
+ (w3m-decode-encoded-contents (w3m-content-encoding url))
+ "text/plain")
+ (t nil)))))
+ ((string-match "\\`about:/*blank/?\\'" url)
+ "text/plain")
+ (t
+ (lexical-let ((output-buffer (current-buffer)))
+ (w3m-process-do-with-temp-buffer
+ (type (let (func)
+ (setq w3m-current-url url)
+ (set-buffer-multibyte t)
+ (if (and (string-match "\\`about://\\([^/]+\\)/" url)
+ (setq func
+ (intern-soft (concat "w3m-about-"
+ (match-string 1 url))))
+ (fboundp func))
+ (funcall func url no-uncompress no-cache
+ post-data referer handler)
+ (w3m-about url no-uncompress no-cache))))
+ (when type
+ (when (string-match "\\`text/" type)
+ (encode-coding-region (point-min) (point-max) w3m-coding-system))
+ (set-buffer-multibyte nil)
+ (when (buffer-name output-buffer)
+ (let ((temp-buffer (current-buffer)))
+ (with-current-buffer output-buffer
+ (insert-buffer-substring temp-buffer))))
+ type))))))
+
+(defun w3m-cid-retrieve (url &optional no-uncompress no-cache)
+ "Retrieve contents pointed to by URL prefixed with the cid: scheme.
+This function is mainly used when displaying text/html MIME parts in
+message user agents, e.g., Gnus, Mew, T-gnus, Wanderlust, and possibly
+VM.
+
+It calls a function according to the `major-mode' of the buffer
+specified by `w3m-current-buffer'. Functions to be called are
+specified by the `w3m-cid-retrieve-function-alist' variable.
+
+Each function in that variable should take three arguments passed
+through this function, extract and insert contents specified by URL
+\(which can be found in the raw message itself) into the current buffer,
+and return the content type of the data.
+
+The optional two arguments can be omitted by functions; NO-UNCOMPRESS
+specifies whether functions should not uncompress extracted contents;
+NO-CACHE specifies whether functions should not use cached contents."
+ (let ((func (cdr (assq (with-current-buffer w3m-current-buffer major-mode)
+ w3m-cid-retrieve-function-alist))))
+ (when func (funcall func url no-uncompress no-cache))))
+
+(defun w3m-data-retrieve (url &optional no-uncompress no-cache)
+ "Retrieve contents pointed to by URL prefixed with the data: scheme.
+See RFC2397."
+ (let ((case-fold-search t) (mime-type "text/plain")
+ (coding nil) (encode nil) (param "")
+ data-string)
+ (when (string-match
+ "data:\\(\\([^/;,]+\\(/[^;,]+\\)?\\)\\(;[^;,]+\\)*\\)?,\\(.*\\)"
+ url)
+ (setq mime-type (or (match-string-no-properties 2 url)
+ mime-type)
+ param (or (match-string-no-properties 4 url)
+ param)
+ data-string (match-string-no-properties 5 url))
+ (when (string-match "^.*\\(;[ \t]*base64\\)$" param)
+ (setq param (substring param 0 (match-beginning 1)))
+ (setq encode 'base64))
+ (when (string-match "charset=\\([^;]+\\)" param)
+ (setq coding (w3m-charset-to-coding-system
+ (match-string-no-properties 1 param))))
+ (when data-string
+ (erase-buffer)
+ (let (decode-string)
+ (setq decode-string
+ (cond
+ ((eq encode 'base64)
+ (base64-decode-string data-string))
+ (t
+ (w3m-url-decode-string
+ data-string coding))))
+ (set-buffer-multibyte nil)
+ (if (featurep 'xemacs)
+ (insert decode-string)
+ (set-buffer-multibyte (multibyte-string-p decode-string))
+ (insert decode-string)
+ (set-buffer-multibyte nil)))))
+ mime-type))
+
+;;;###autoload
+(defun w3m-retrieve (url &optional no-uncompress no-cache
+ post-data referer handler)
+ "Retrieve web contents pointed to by URL.
+It will put the retrieved contents into the current buffer.
+
+If HANDLER is nil, this function will retrieve web contents, return
+the content type of the retrieved data, and then come to an end. This
+behavior is what is called a synchronous operation. You have to
+specify HANDLER in order to make this function show its real ability,
+which is called an asynchronous operation.
+
+If HANDLER is a function, this function will come to an end in no time.
+In this case, contents will be retrieved by the asynchronous process
+after a while. And after finishing retrieving contents successfully,
+HANDLER will be called on the buffer where this function starts. The
+content type of the retrieved data will be passed to HANDLER as a
+string argument.
+
+NO-UNCOMPRESS specifies whether this function should not uncompress contents.
+NO-CACHE specifies whether this function should not use cached contents.
+POST-DATA and REFERER will be sent to the web server with a request."
+ (if (not handler)
+ (condition-case nil
+ (w3m-process-with-wait-handler
+ (w3m-retrieve url
+ no-uncompress no-cache post-data referer handler))
+ (w3m-process-timeout nil))
+ (unless (and w3m-safe-url-regexp
+ (not (string-match w3m-safe-url-regexp url)))
+ (setq url (w3m-url-strip-fragment url))
+ (set-buffer-multibyte nil)
+ (cond
+ ((string-match "\\`about:" url)
+ (w3m-about-retrieve url
+ no-uncompress no-cache post-data referer handler))
+ ((string-match "\\`cid:" url)
+ (w3m-cid-retrieve url no-uncompress no-cache))
+ ((string-match "\\`data:" url)
+ (w3m-data-retrieve url no-uncompress no-cache))
+ ((w3m-url-local-p url)
+ (w3m-local-retrieve url no-uncompress))
+ (t
+ (w3m-w3m-retrieve url
+ no-uncompress no-cache post-data referer handler))))))
+
+(defvar w3m-touch-file-available-p 'undecided)
+
+(eval-and-compile
+ (if (fboundp 'set-file-times)
+ (defalias 'w3m-touch-file 'set-file-times)
+ (defun w3m-touch-file (file time)
+ "Change the access and/or modification TIME of the specified FILE."
+ ;; Check the validity of `touch' command.
+ (when (eq w3m-touch-file-available-p 'undecided)
+ (let ((file (make-temp-name
+ (expand-file-name "w3mel" w3m-profile-directory)))
+ time timefile)
+ (while (progn
+ (setq time (list (abs (% (random) 8192))
+ (abs (% (random) 65536)))
+ timefile (expand-file-name
+ (format-time-string "%Y%m%d%H%M.%S" time)
+ w3m-profile-directory))
+ (file-exists-p timefile)))
+ (unwind-protect
+ (setq w3m-touch-file-available-p
+ (when (w3m-which-command w3m-touch-command)
+ (with-temp-buffer
+ (insert "touch check")
+ (write-region (point-min) (point-max) file nil 'nomsg))
+ (and (let ((default-directory w3m-profile-directory)
+ (w3m-touch-file-available-p t))
+ (w3m-touch-file file time))
+ (zerop (w3m-time-lapse-seconds
+ time (nth 5 (file-attributes file)))))))
+ (when (file-exists-p file)
+ (ignore-errors (delete-file file)))
+ (when (file-exists-p timefile)
+ (ignore-errors (delete-file timefile))))))
+ (and w3m-touch-file-available-p
+ time
+ (w3m-which-command w3m-touch-command)
+ (file-exists-p file)
+ (zerop (let ((default-directory (file-name-directory file))
+ (coding-system-for-write
+ (or
+ (and (boundp 'file-name-coding-system)
+ (symbol-value 'file-name-coding-system))
+ (and (boundp 'default-file-name-coding-system)
+ (symbol-value 'default-file-name-coding-system))
+ ;; Some versions of X*macsen seem touched.
+ (and (boundp 'coding-system-for-write)
+ (symbol-value 'coding-system-for-write)))))
+ (call-process w3m-touch-command nil nil nil
+ "-t"
+ (format-time-string "%Y%m%d%H%M.%S" time)
+ file)))))))
+
+;;;###autoload
+(defun w3m-download (url &optional filename no-cache handler post-data)
+ "Download contents of URL to a file named FILENAME.
+NO-CHACHE (which the prefix argument gives when called interactively)
+specifies not using the cached data."
+ (interactive
+ (let* ((url (w3m-input-url "Download URL: "))
+ (basename (file-name-nondirectory (w3m-url-strip-query url))))
+ (if (string-match "^[\t ]*$" basename)
+ (list url
+ (w3m-read-file-name (format "Download %s to: " url)
+ w3m-default-save-directory "index.html")
+ current-prefix-arg)
+ (list url
+ (w3m-read-file-name (format "Download %s to: " basename)
+ w3m-default-save-directory basename)
+ current-prefix-arg))))
+ (if (and w3m-use-ange-ftp (string-match "\\`ftp://" url))
+ (w3m-goto-ftp-url url filename)
+ (lexical-let ((url url)
+ (filename (or filename (w3m-read-file-name nil nil url))))
+ (w3m-process-do-with-temp-buffer
+ (type (progn
+ (w3m-clear-local-variables)
+ (setq w3m-current-url url)
+ (w3m-retrieve url t no-cache post-data nil handler)))
+ (if type
+ (let ((buffer-file-coding-system 'binary)
+ (coding-system-for-write 'binary)
+ jka-compr-compression-info-list
+ format-alist)
+ (when (or (not (file-exists-p filename))
+ (prog1 (y-or-n-p
+ (format "File(%s) already exists. Overwrite? "
+ filename))
+ (message nil)))
+ (write-region (point-min) (point-max) filename)
+ (w3m-touch-file filename (w3m-last-modified url))
+ t))
+ (ding)
+ (message "Cannot retrieve URL: %s%s"
+ url
+ (if w3m-process-exit-status
+ (format " (exit status: %s)" w3m-process-exit-status)
+ ""))
+ nil)))))
+
+;;; Retrieve data:
+(w3m-make-ccl-coding-system
+ 'w3m-euc-japan ?E
+ "ISO 2022 based EUC encoding for Japanese with w3m internal characters.
+ (generated by `w3m')"
+ 'w3m-euc-japan-decoder
+ 'w3m-euc-japan-encoder)
+
+(w3m-make-ccl-coding-system
+ 'w3m-iso-latin-1 ?1
+ "ISO 2022 based 8-bit encoding for Latin-1 with w3m internal characters.
+ (generated by `w3m')"
+ 'w3m-iso-latin-1-decoder
+ 'w3m-iso-latin-1-encoder)
+
+(defun w3m-remove-comments ()
+ "Remove HTML comments in the current buffer."
+ (goto-char (point-min))
+ (let (beg)
+ (while (search-forward "<!--" nil t)
+ (setq beg (match-beginning 0))
+ (if (search-forward "-->" nil t)
+ (delete-region beg (point))))))
+
+(defun w3m-remove-invisible-image-alt ()
+ "Remove alt=\"whitespace\" attributes in img tags.
+Such attributes not only obscure them but also might make images not
+be displayed especially in shimbun articles."
+ (goto-char (point-min))
+ (let ((case-fold-search t)
+ start end)
+ (while (and (re-search-forward "\\(<img\\)[\t\n\f\r ]+" nil t)
+ (progn
+ (setq start (match-end 1))
+ (search-forward ">" nil t))
+ (progn
+ (setq end (match-beginning 0))
+ (goto-char start)
+ (re-search-forward "[\t\n\f\r ]+alt=\"[\t\n\f\r ]*\""
+ end t)))
+ (delete-region (match-beginning 0) (match-end 0)))))
+
+(defun w3m-check-header-tags ()
+ "Process header tags (<LINK>,<BASE>) in the current buffer."
+ (let ((case-fold-search t)
+ tag)
+ (goto-char (point-min))
+ (when (re-search-forward "</head\\(?:[ \t\r\f\n][^>]*\\)?>" nil t)
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (goto-char (point-min))
+ (while (re-search-forward "<\\(link\\|base\\)[ \t\r\f\n]+" nil t)
+ (setq tag (downcase (match-string 1)))
+ (cond
+ ((string= tag "link")
+ (w3m-parse-attributes ((rel :case-ignore) href type)
+ (when rel
+ (setq rel (split-string rel))
+ (cond
+ ((member "icon" rel) (setq w3m-icon-data (cons href type)))
+ ((member "next" rel) (setq w3m-next-url href))
+ ((or (member "prev" rel) (member "previous" rel))
+ (setq w3m-previous-url href))
+ ((member "start" rel) (setq w3m-start-url href))
+ ((member "contents" rel) (setq w3m-contents-url href))))))
+ ((string= tag "base")
+ (w3m-parse-attributes (href)
+ (when (< 0 (length href))
+ (setq w3m-current-base-url href))))))))))
+
+(defun w3m-check-refresh-attribute ()
+ "Get REFRESH attribute in META tags."
+ (setq w3m-current-refresh nil)
+ (when w3m-use-refresh
+ (let ((case-fold-search t)
+ (refurl w3m-current-url)
+ sec)
+ (goto-char (point-min))
+ (catch 'found
+ (while (re-search-forward "<meta[ \t\r\f\n]+" nil t)
+ (w3m-parse-attributes ((http-equiv :case-ignore) content)
+ (when (string= http-equiv "refresh")
+ (cond
+ ((string-match "\\`[0-9]+\\'" content)
+ (setq sec (match-string-no-properties 0 content)))
+ ((string-match
+ "\\([^;]+\\);[ \t\n]*url=[\"']?\\([^\"']+\\)"
+ content)
+ (setq sec (match-string-no-properties 1 content))
+ (setq refurl (w3m-decode-entities-string
+ (match-string-no-properties 2 content)))
+ (when (string-match "\\`[\"']\\(.*\\)[\"']\\'" refurl)
+ (setq refurl (match-string 1 refurl)))))
+ (when (and sec (string-match "\\`[0-9]+\\'" sec))
+ (when (and (eq w3m-use-refresh 'wait-minimum)
+ (< (string-to-number sec) w3m-refresh-minimum-interval))
+ (setq sec (number-to-string w3m-refresh-minimum-interval)))
+ (throw 'found
+ (setq w3m-current-refresh
+ (cons (string-to-number sec)
+ (w3m-expand-url refurl))))))))))))
+
+(defun w3m-remove-meta-charset-tags ()
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (catch 'found
+ (when (re-search-forward "<meta[ \t\r\f\n]+" nil t)
+ (let ((start (match-beginning 0)))
+ (w3m-parse-attributes ((http-equiv :case-ignore)
+ (content :case-ignore))
+ (when (and (string= http-equiv "content-type")
+ content
+ (string-match ";[ \t\n]*charset=" content))
+ (delete-region start (point))
+ (throw 'found nil))))))))
+
+(defun w3m-rendering-extract-title ()
+ "Extract the title from the halfdump and put it into the current buffer."
+ (goto-char (point-min))
+ (or (when (re-search-forward "<title_alt[ \t\n]+title=\"\\([^\"]+\\)\">"
+ nil t)
+ (prog1 (w3m-decode-entities-string
+ (mapconcat 'identity
+ (save-match-data (split-string (match-string 1)))
+ " "))
+ (delete-region (match-beginning 0) (match-end 0))))
+ (when (and (stringp w3m-current-url)
+ (string-match "/\\([^/]+\\)/?\\'" w3m-current-url))
+ (match-string 1 w3m-current-url))
+ "<no-title>"))
+
+(defun w3m-set-display-ins-del ()
+ (when (eq w3m-display-ins-del 'auto)
+ (with-temp-buffer
+ (let* ((coding-system-for-read w3m-output-coding-system)
+ (coding-system-for-write (if (eq 'binary w3m-input-coding-system)
+ w3m-current-coding-system
+ w3m-input-coding-system))
+ (default-process-coding-system
+ (cons coding-system-for-read coding-system-for-write))
+ (env (copy-sequence w3m-command-environment))
+ type)
+ (setq w3m-display-ins-del nil)
+ (w3m-process-with-environment (cons '("LANG" . "C")
+ (delq (assoc "LANG" env) env))
+ (call-process (or w3m-halfdump-command w3m-command) nil t nil "-o")
+ (goto-char (point-min))
+ (when (re-search-forward "display_ins_del=<\\([^>]+\\)>" nil t)
+ (setq type (match-string 1))
+ (cond
+ ((string= type "number")
+ (setq w3m-display-ins-del 'fontify))
+ ((string= type "bool")
+ (setq w3m-display-ins-del 'tag)))))))))
+
+(defun w3m-rendering-half-dump (charset)
+ ;; `charset' is used by `w3m-w3m-expand-arguments' to generate
+ ;; arguments for w3mmee and w3m-m17n from `w3m-halfdump-command-arguments'.
+ (w3m-set-display-ins-del)
+ (let* ((coding-system-for-read w3m-output-coding-system)
+ (coding-system-for-write (if (eq 'binary w3m-input-coding-system)
+ w3m-current-coding-system
+ w3m-input-coding-system))
+ (default-process-coding-system
+ (cons coding-system-for-read coding-system-for-write)))
+ (w3m-process-with-environment w3m-command-environment
+ (apply 'call-process-region
+ (point-min)
+ (point-max)
+ (or w3m-halfdump-command w3m-command)
+ t t nil
+ (w3m-w3m-expand-arguments
+ (append w3m-halfdump-command-arguments
+ w3m-halfdump-command-common-arguments
+ ;; Image size conscious rendering
+ (when (member "image" w3m-compile-options)
+ (if (and w3m-treat-image-size
+ (or (w3m-display-graphic-p)
+ (and w3m-pixels-per-line
+ w3m-pixels-per-character)))
+ (list "-o" "display_image=on"
+ "-ppl" (number-to-string
+ (or w3m-pixels-per-line
+ (w3m-static-if
+ (featurep 'xemacs)
+ (font-height
+ (face-font 'default))
+ (frame-char-height))))
+ "-ppc" (number-to-string
+ (or w3m-pixels-per-character
+ (w3m-static-if
+ (featurep 'xemacs)
+ (font-width
+ (face-font 'default))
+ (frame-char-width)))))
+ (list "-o" "display_image=off")))))))))
+
+(defun w3m-rendering-buffer (&optional charset)
+ "Do rendering of contents in the currenr buffer as HTML and return title."
+ (w3m-message "Rendering...")
+ (w3m-remove-comments)
+ (w3m-remove-invisible-image-alt)
+ (w3m-check-header-tags)
+ (w3m-check-refresh-attribute)
+ (unless (eq w3m-type 'w3m-m17n)
+ (w3m-remove-meta-charset-tags))
+ (w3m-rendering-half-dump charset)
+ (w3m-message "Rendering...done")
+ (w3m-rendering-extract-title))
+
+(defcustom w3m-confirm-leaving-secure-page t
+ "If non-nil, you'll be asked for confirmation when leaving secure pages.
+This option controls whether the confirmation is made also when
+retrieving data (typically images) in a secure page from non-secure
+pages. It is STRONGLY recommended to set non-nil value to this option.
+You MUST understand what you want to do completely before
+switching off this option."
+ :group 'w3m
+ :type 'boolean)
+
+(defun w3m-retrieve-and-render (url &optional no-cache charset
+ post-data referer handler)
+ "Retrieve contents of URL and render them in the current buffer.
+It returns a `w3m-process' object and comes to an end immediately.
+The HANDLER function will be called when rendering is complete. When
+a new content is retrieved in the buffer, the HANDLER function will be
+called with t as an argument. Otherwise, it will be called with nil."
+ (unless (and w3m-current-ssl
+ w3m-confirm-leaving-secure-page
+ ;; Permit leaving safe pages without confirmation for
+ ;; several safe commands. For more detail of
+ ;; definition of safe commands, see the thread
+ ;; beginning at [emacs-w3m:09767].
+ (not
+ (or (memq this-command
+ '(w3m
+ w3m-goto-url w3m-redisplay-this-page
+ w3m-reload-this-page w3m-history
+ w3m-view-next-page w3m-view-previous-page
+ w3m-view-header w3m-view-source))
+ (string-match "\\`\\(?:ht\\|f\\)tps://" url)
+ (prog1
+ (y-or-n-p "You are leaving secure page. Continue? ")
+ (message nil)))))
+ (lexical-let ((url (w3m-url-strip-fragment url))
+ (charset charset)
+ (page-buffer (current-buffer))
+ (arrival-time (current-time))
+ (silent w3m-message-silent))
+ (w3m-process-do-with-temp-buffer
+ (type (progn
+ (w3m-clear-local-variables)
+ (w3m-retrieve url nil no-cache post-data referer handler)))
+ (let ((w3m-message-silent silent))
+ (when (buffer-live-p page-buffer)
+ (setq url (w3m-url-strip-authinfo url))
+ (if type
+ (if (string= type "X-w3m-error/redirection")
+ (when (w3m-show-redirection-error-information url page-buffer)
+ (w3m-message (w3m-message "Cannot retrieve URL: %s"
+ url)))
+ (let ((modified-time (w3m-last-modified url)))
+ (w3m-arrived-add url nil modified-time arrival-time)
+ (unless modified-time
+ (setf (w3m-arrived-last-modified url) nil))
+ (let ((real (w3m-real-url url)))
+ (unless (string= url real)
+ (w3m-arrived-add url nil nil arrival-time)
+ (setf (w3m-arrived-title real)
+ (w3m-arrived-title url))
+ (setf (w3m-arrived-last-modified real)
+ (w3m-arrived-last-modified url))
+ (setq url real)))
+ (prog1 (w3m-create-page url
+ (or (w3m-arrived-content-type url)
+ type)
+ (or charset
+ (w3m-arrived-content-charset url)
+ (w3m-content-charset url))
+ page-buffer)
+ (w3m-force-window-update-later page-buffer)
+ (unless (get-buffer-window page-buffer)
+ (w3m-message "The content (%s) has been retrieved in %s"
+ url (buffer-name page-buffer))))))
+ (ding)
+ (when (eq (car w3m-current-forms) t)
+ (setq w3m-current-forms (cdr w3m-current-forms)))
+ (prog1 (when (and w3m-show-error-information
+ (not (or (w3m-url-local-p url)
+ (string-match "\\`about:" url))))
+ (w3m-show-error-information url charset page-buffer))
+ (w3m-message "Cannot retrieve URL: %s%s"
+ url
+ (if w3m-process-exit-status
+ (format " (exit status: %s)"
+ w3m-process-exit-status)
+ ""))))))))))
+
+(defun w3m-show-error-information (url charset page-buffer)
+ "Create and prepare the error information."
+ (or (when (w3m-cache-request-contents url)
+ (w3m-decode-encoded-contents (w3m-content-encoding url))
+ t) ; Even if decoding is failed, use the cached contents.
+ (let ((case-fold-search t)
+ (header (w3m-cache-request-header url))
+ (errmsg (format "\n<br><h1>Cannot retrieve URL: %s%s</h1>"
+ (format "<a href=\"%s\">%s</a>" url url)
+ (when w3m-process-exit-status
+ (format " (exit status: %s)"
+ w3m-process-exit-status)))))
+ (if (or (null header)
+ (string-match "\\`w3m: Can't load " header))
+ (progn
+ (erase-buffer)
+ (setq charset "us-ascii")
+ (insert
+ errmsg
+ (format "<br><br><b>%s</b> could not be found; "
+ (w3m-get-server-hostname url))
+ (if (string-match "\\`news:" url)
+ "check the name of the <b>URL</b>\
+ and the value of the <b>NNTPSERVER</b> environment variable\
+ (that should be the address of the <b>NNTP</b> server)."
+ "check the name of the <b>URL</b>.")))
+ (goto-char (point-min))
+ (when (or (re-search-forward "<body>" nil t)
+ (re-search-forward "<html>" nil t))
+ (goto-char (match-end 0)))
+ (insert errmsg "<br><br><hr><br><br>")
+ (when (or (re-search-forward "</body>" nil t)
+ (re-search-forward "</html>" nil 'max))
+ (goto-char (match-end 0)))
+ (insert "\n<br><br><hr><br><br><h2>Header information</h2><br>\n<pre>"
+ header "</pre>\n"))))
+ (w3m-create-page url "text/html" charset page-buffer)
+ nil)
+
+(defun w3m-show-redirection-error-information (url page-buffer)
+ (erase-buffer)
+ (insert
+ (format "\n<br><h1>Cannot retrieve URL: %s</h1><br><br>%s"
+ (format "<a href=\"%s\">%s</a>" url url)
+ "The number of redirections has exceeded a limit. This may have<br>\n
+happened due to the server side miss-configuration. Otherwise,<br>\n
+try increasing the limit, the value of <b>`w3m-follow-redirection'</b>.<br>\n"))
+ (w3m-create-page url "text/html" "us-ascii" page-buffer))
+
+(defun w3m-prepare-content (url type charset)
+ "Prepare contents in the current buffer according to TYPE.
+URL is assumed to be a place where the contents come from. CHARSET is
+passed to the filter function corresponding to TYPE if it is
+specified in the `w3m-content-type-alist' variable."
+ (let ((filter (nth 3 (assoc type w3m-content-type-alist))))
+ (cond
+ ; Filter function is specified.
+ ((functionp filter) (funcall filter url type charset))
+ ; Equivalent type is specified.
+ ((stringp filter) filter)
+ ; No filter is specified.
+ ((not filter) type)
+ ; Failed.
+ (t ""))))
+
+(defun w3m-detect-xml-type (url type charset)
+ "Check if the type of xml contents of URL is xhtml+xml.
+If so return \"text/html\", otherwise \"text/plain\"."
+ (with-temp-buffer
+ (w3m-retrieve url)
+ (w3m-decode-buffer url charset type)
+ (goto-char (point-min))
+ (setq case-fold-search t)
+ (if (re-search-forward
+ "<[\t\n ]*html\\(?:\\(?:[\t\n ]+[^>]+\\)?>\\|[\t\n ]*>\\)"
+ nil t)
+ "text/html"
+ "text/plain")))
+
+(defun w3m-create-text-page (url type charset page-buffer)
+ (w3m-safe-decode-buffer url charset type)
+ (setq w3m-current-url (if (w3m-arrived-p url)
+ (w3m-real-url url)
+ url)
+ w3m-current-title
+ (if (string= "text/html" type)
+ (let ((title (w3m-rendering-buffer charset)))
+ (setf (w3m-arrived-title url) title)
+ title)
+ (or (when (string-match "\\`about://\\(?:source\\|header\\)/" url)
+ (w3m-arrived-title (substring url (match-end 0))))
+ (file-name-nondirectory (if (string-match "/\\'" url)
+ (directory-file-name url)
+ url)))))
+ (let ((result-buffer (current-buffer)))
+ (with-current-buffer page-buffer
+ (let (buffer-read-only)
+ (widen)
+ (delete-region (point-min) (point-max))
+ (insert-buffer-substring result-buffer)
+ (w3m-copy-local-variables result-buffer)
+ (set-buffer-file-coding-system w3m-current-coding-system)
+ (when (string= "text/html" type) (w3m-fontify))
+ 'text-page))))
+
+(defun w3m-create-image-page (url type charset page-buffer)
+ (when (w3m-image-type-available-p (w3m-image-type type))
+ (with-current-buffer page-buffer
+ (let (buffer-read-only)
+ (w3m-clear-local-variables)
+ (setq w3m-current-url (w3m-real-url url)
+ w3m-current-title (file-name-nondirectory url))
+ (widen)
+ (delete-region (point-min) (point-max))
+ (insert w3m-current-title)
+ (w3m-add-face-property (point-min) (point-max) 'w3m-image)
+ (w3m-add-text-properties (point-min) (point-max)
+ (list 'w3m-image url
+ 'mouse-face 'highlight))
+ 'image-page))))
+
+(defun w3m-create-page (url type charset page-buffer)
+ ;; Select a content type.
+ (unless (and (stringp type)
+ (assoc type w3m-content-type-alist))
+ (save-window-excursion
+ (pop-to-buffer (current-buffer))
+ (delete-other-windows)
+ (ding)
+ (setq type
+ (completing-read
+ (format "Input %s's content type (default Download): "
+ (file-name-nondirectory url))
+ w3m-content-type-alist nil t))
+ (setf (w3m-arrived-content-type url) type)))
+ (setq w3m-current-coding-system nil) ; Reset decoding status of this buffer.
+ (setq type (w3m-prepare-content url type charset))
+ (w3m-safe-decode-buffer url charset type)
+ (setq charset (or charset w3m-current-content-charset))
+ (when w3m-use-filter (w3m-filter url))
+ (w3m-relationship-estimate url)
+ ;; Create pages.
+ (cond
+ ((string-match "\\`text/" type)
+ (w3m-create-text-page url type charset page-buffer))
+ ((string-match "\\`image/" type)
+ (w3m-create-image-page url type charset page-buffer))
+ ((member type w3m-doc-view-content-types)
+ (w3m-doc-view url))
+ (t
+ (with-current-buffer page-buffer
+ (w3m-external-view url)
+ 'external-view))))
+
+(defun w3m-relationship-estimate (url)
+ "Estimate relationships between a page and others."
+ (save-excursion
+ (save-match-data
+ (catch 'estimated
+ (dolist (rule w3m-relationship-estimate-rules)
+ (when (apply (car rule) url (cdr rule))
+ (throw 'estimated t)))))))
+
+(defun w3m-relationship-simple-estimate (url regexp &optional next previous
+ start contents)
+ "Search relationships with given patterns
+when the URL of the retrieved page matches the REGEXP."
+ (when (string-match regexp url)
+ (w3m-relationship-search-patterns url next previous start contents)))
+
+(defun w3m-relationship-magicpoint-estimate (url)
+ "Search relationships for pages generated by MagicPoint."
+ (goto-char (point-max))
+ (when (search-backward
+ "Generated by <A HREF=\"http://www.mew.org/mgp/\">MagicPoint</A>"
+ nil t)
+ (goto-char (point-min))
+ (w3m-relationship-search-patterns
+ url
+ (eval-when-compile
+ (concat "<A HREF=" w3m-html-string-regexp ">\\[next&gt;\\]</A>"))
+ (eval-when-compile
+ (concat "<A HREF=" w3m-html-string-regexp ">\\[&lt;prev\\]</A>"))
+ (eval-when-compile
+ (concat "<A HREF=" w3m-html-string-regexp ">\\[&lt;&lt;start\\]</A>"))
+ (eval-when-compile
+ (concat "<A HREF=" w3m-html-string-regexp ">\\[index\\]</A>")))))
+
+(defun w3m-relationship-oddmuse-estimate (url)
+ (when (string-match "/wiki\\?search=.*" url)
+ (goto-char (point-min))
+ (and (re-search-forward "href=\"\\([^\"]+\\)\">Previous</a>" nil t)
+ (setq w3m-previous-url (match-string 1)))
+ (and (re-search-forward "href=\"\\([^\"]+\\)\">Next</a>" nil t)
+ (setq w3m-next-url (match-string 1)))))
+
+(defun w3m-relationship-slashdot-estimate (url)
+ (goto-char (point-min))
+ (when (and (string-match
+ "slashdot\\.org/\\(article\\|comments\\)\\.pl\\?"
+ url)
+ (search-forward "<div class=\"linkCommentPage\">" nil t))
+ (let ((min (point)) (max (save-excursion (search-forward "</div>" nil t))))
+ ;; move to the position of the current page indicator and then search
+ ;; for the next and previous link within the current <div>
+ (when (and max (re-search-forward "<b>\\(([0-9]+)\\)</b>" max t))
+ (let ((re (concat "<a href=" w3m-html-string-regexp ">")))
+ (when (save-excursion (re-search-backward re min t))
+ (setq w3m-previous-url
+ (w3m-expand-url (w3m-decode-anchor-string
+ (or (match-string 2)
+ (match-string 3)
+ (match-string 1))))))
+ (when (re-search-forward re max t)
+ (setq w3m-next-url
+ (w3m-expand-url (w3m-decode-anchor-string
+ (or (match-string 2)
+ (match-string 3)
+ (match-string 1)))))))))))
+
+(defun w3m-relationship-alc-estimate (url)
+ ;; use filter
+ (when (string-match "\\`http://eow\\.alc\\.co\\.jp/[^/]+/UTF-8/" url)
+ (when (re-search-forward
+ (concat "<a href=\\\"http://eow\\.alc\\.co\\.jp/[^/]+/UTF-8/"
+ "\\(\\?pg=[0-9]+\\)\\\">$BA0$X(B</a>")
+ nil t)
+ (setq w3m-previous-url
+ (w3m-expand-url (match-string 1) url)))
+ (when (re-search-forward
+ (concat "<a href=\\\"http://eow\\.alc\\.co\\.jp/[^/]+/UTF-8/"
+ "\\(\\?pg=[0-9]+\\)\\\">$B<!$X(B</a>")
+ nil t)
+ (setq w3m-next-url
+ (w3m-expand-url (match-string 1) url)))
+ (unless (or w3m-previous-url w3m-next-url)
+ ;; no use filter
+ (goto-char (point-min))
+ (when (re-search-forward
+ "<a href='javascript:goPage(\"\\([0-9+]\\)\")'>$BA0$X(B</a>"
+ nil t)
+ (setq w3m-previous-url
+ (w3m-expand-url (format "?pg=%s" (match-string 1)) url)))
+ (when (re-search-forward
+ "<a href='javascript:goPage(\"\\([0-9+]\\)\")'>$B<!$X(B</a>"
+ nil t)
+ (setq w3m-next-url
+ (w3m-expand-url (format "?pg=%s" (match-string 1)) url))))))
+
+(defun w3m-relationship-search-patterns (url next previous
+ &optional start contents)
+ "Search relationships with given patterns."
+ (goto-char (point-min))
+ (and next
+ (re-search-forward next nil t)
+ (setq w3m-next-url
+ (w3m-expand-url (w3m-decode-anchor-string (or (match-string 2)
+ (match-string 3)
+ (match-string 1)))
+ url))
+ (goto-char (point-min)))
+ (and previous
+ (re-search-forward previous nil t)
+ (setq w3m-previous-url
+ (w3m-expand-url (w3m-decode-anchor-string (or (match-string 2)
+ (match-string 3)
+ (match-string 1)))
+ url))
+ (goto-char (point-min)))
+ (and start
+ (re-search-forward start nil t)
+ (setq w3m-start-url
+ (w3m-expand-url (w3m-decode-anchor-string (or (match-string 2)
+ (match-string 3)
+ (match-string 1)))
+ url))
+ (goto-char (point-min)))
+ (and contents
+ (re-search-forward contents nil t)
+ (setq w3m-contents-url
+ (w3m-expand-url (w3m-decode-anchor-string (or (match-string 2)
+ (match-string 3)
+ (match-string 1)))
+ url))))
+
+(defun w3m-search-name-anchor (name &optional quiet no-record)
+ (interactive "sName: ")
+ (let ((pos (point-min))
+ (cur-pos (point))
+ found)
+ (catch 'found
+ (while (setq pos (next-single-property-change pos 'w3m-name-anchor))
+ (when (member name (get-text-property pos 'w3m-name-anchor))
+ (goto-char pos)
+ (when (eolp) (forward-line))
+ (w3m-horizontal-on-screen)
+ (throw 'found (setq found t))))
+ (setq pos (point-min))
+ (while (setq pos (next-single-property-change pos 'w3m-name-anchor2))
+ (when (member name (get-text-property pos 'w3m-name-anchor2))
+ (goto-char pos)
+ (when (eolp) (forward-line))
+ (w3m-horizontal-on-screen)
+ (throw 'found (setq found t))))
+ (unless quiet
+ (message "No such anchor: %s" name)))
+
+ (when (and found
+ (not no-record)
+ (/= (point) cur-pos))
+ (setq w3m-name-anchor-from-hist
+ (append (list 1 nil (point) cur-pos)
+ (and (integerp (car w3m-name-anchor-from-hist))
+ (nthcdr (1+ (car w3m-name-anchor-from-hist))
+ w3m-name-anchor-from-hist)))))
+ (when found
+ (w3m-recenter))
+ found))
+
+(defun w3m-parent-page-available-p ()
+ (if (null w3m-current-url)
+ nil
+ (save-match-data
+ (string-match "\\`[a-z]+://?[^/]+/." w3m-current-url))))
+
+(defun w3m-view-parent-page (&optional count)
+ "Attempt to move to the parent directory of the page currently displayed.
+For instance, it will let you visit \"http://foo/bar/\" if you are currently
+viewing \"http://foo/bar/baz\".
+If COUNT is a integer, you will visit the parent directory to step up the COUNT.
+If COUNT is zero, you will visit the top of this site."
+ (interactive "p")
+ (unless (integerp count)
+ (setq count 1))
+ (setq count (abs count))
+ (cond
+ ((and w3m-current-url
+ (eq count 0)
+ (string-match "\\`[a-z]+:///?[^/]+/" w3m-current-url))
+ (w3m-goto-url (match-string 0 w3m-current-url)))
+ (w3m-start-url (w3m-goto-url w3m-start-url))
+ (w3m-contents-url (w3m-goto-url w3m-contents-url))
+ (w3m-current-url
+ (let ((parent-url w3m-current-url))
+ (catch 'loop
+ (while (not (zerop count))
+ (setq count (1- count))
+ ;; Check whether http://foo/bar/ or http://foo/bar
+ (if (string-match "/$" parent-url)
+ (if (string-match "\\(.*\\)/[^/]+/$" parent-url)
+ ;; http://foo/bar/ -> http://foo/
+ (setq parent-url (concat (match-string 1 parent-url) "/")))
+ (if (string-match "\\(.*\\)/.+$" parent-url)
+ ;; http://foo/bar -> http://foo/
+ (setq parent-url (concat (match-string 1 parent-url) "/"))))
+ ;; Ignore "http:/"
+ (cond
+ ((string-match "\\`[a-z]+:///?[^/]+/\\'" parent-url)
+ (throw 'loop t))
+ ((and parent-url
+ (string-match "\\`[a-z]+:/+\\'" parent-url))
+ (setq parent-url nil)
+ (throw 'loop nil)))))
+ (if parent-url
+ (w3m-goto-url parent-url)
+ (error "No parent page for: %s" w3m-current-url))))
+ (t (error "w3m-current-url is not set"))))
+
+(defun w3m-view-previous-page (&optional count)
+ "Move back COUNT pages in the history.
+If COUNT is a positive integer, move backward COUNT times in the
+history. If COUNT is a negative integer, moving forward is performed.
+COUNT is treated as 1 by default if it is omitted."
+ (interactive "p")
+ (unless w3m-current-url
+ ;; This page may have not been registered in the history since an
+ ;; accident has probably occurred, so we should skip the page.
+ (if (integerp count)
+ (when (> count 0)
+ (decf count))
+ (setq count 0)))
+ (let ((index (car w3m-name-anchor-from-hist))
+ pos)
+ (if (and (integerp count)
+ (integerp index)
+ (< 0 (setq index (+ index count)))
+ (setq pos (nth index w3m-name-anchor-from-hist)))
+ (progn
+ (when (and (= (point) pos)
+ (nth (1+ index) w3m-name-anchor-from-hist))
+ (setq index (1+ index)))
+ (goto-char (nth index w3m-name-anchor-from-hist))
+ (setcar w3m-name-anchor-from-hist index)
+ ;; Restore last position.
+ (w3m-history-restore-position))
+ (let ((hist ;; Cons of a new history element and position pointers.
+ (if (integerp count)
+ (w3m-history-backward count)
+ (w3m-history-backward)))
+ ;; Inhibit sprouting of a new history.
+ (w3m-history-reuse-history-elements t)
+ (w3m-use-refresh 'wait-minimum))
+ (if hist
+ (let ((w3m-prefer-cache t))
+ (w3m-goto-url (caar hist) nil nil
+ (w3m-history-plist-get :post-data)
+ (w3m-history-plist-get :referer)
+ nil
+ (w3m-history-element (caddr hist) t))
+ ;; Set the position pointers in the history.
+ (setcar w3m-history (cdr hist))
+ ;; Restore last position.
+ (w3m-history-restore-position))
+ (message "There's no more history"))))))
+
+(defun w3m-view-next-page (&optional count)
+ "Move forward COUNT pages in history.
+If COUNT is a positive integer, move forward COUNT times in the
+history. If COUNT is a negative integer, moving backward is performed.
+COUNT is treated as 1 by default if it is omitted."
+ (interactive "p")
+ (w3m-view-previous-page (if (integerp count) (- count) -1)))
+
+(defun w3m-expand-path-name (file base)
+ (let ((input (if (eq (elt file 0) ?/)
+ file
+ (concat base file)))
+ (output ""))
+ (save-match-data
+ (while (string-match "^\\(?:\\.\\.?/\\)+" input)
+ (setq input (substring input (match-end 0))))
+ (while (not (zerop (length input)))
+ (cond
+ ((string-match "^/\\.\\(?:/\\|$\\)" input)
+ (setq input (concat "/" (substring input (match-end 0)))))
+ ((string-match "^/\\.\\.\\(?:/\\|$\\)" input)
+ (setq input (concat "/" (substring input (match-end 0))))
+ (when (string-match "/?[^/]+$" output)
+ (setq output (substring output 0 (match-beginning 0)))))
+ ((string-match "^\\.\\.?$" input)
+ (setq input ""))
+ (t
+ (let ((end (and (string-match "^/[^/]*" input)
+ (match-end 0))))
+ (setq output
+ (concat output (substring input 0 end)))
+ (setq input
+ (substring input end))))))
+ output)))
+
+(defconst w3m-url-hierarchical-schemes
+ '("http" "https" "ftp" "ftps" "file")
+ "List of schemes which may have hierarchical parts.
+This list is refered to by `w3m-expand-url' to keep backward
+compatibility which is described in Section 5.2 of RFC 2396.")
+
+(defun w3m-expand-url (url &optional base)
+ "Convert URL to the absolute address, and canonicalize it."
+ (save-match-data
+ (if base
+ (if (progn
+ (w3m-string-match-url-components base)
+ (match-beginning 1))
+ (and (not (match-beginning 3))
+ (member (match-string 2 base) w3m-url-hierarchical-schemes)
+ (setq base (concat
+ (substring base 0 (match-end 1))
+ "//"
+ (substring base (match-beginning 5)))))
+ (error "BASE must have a scheme part: %s" base))
+ (setq base (or w3m-current-base-url
+ w3m-current-url
+ w3m-url-fallback-base)))
+ (w3m-string-match-url-components url)
+ ;; Remove an empty fragment part.
+ (when (and (match-beginning 8)
+ (= (match-beginning 9) (length url)))
+ (setq url (substring url 0 (match-beginning 8)))
+ (w3m-string-match-url-components url))
+ ;; Remove an empty query part.
+ (when (and (match-beginning 6)
+ (= (match-beginning 7) (or (match-beginning 8)
+ (length url))))
+ (setq url (concat (substring url 0 (match-beginning 6))
+ (if (match-beginning 8)
+ (substring url (match-beginning 8))
+ ""))
+ base (progn (w3m-string-match-url-components base)
+ (substring base 0 (match-beginning 6))))
+ (w3m-string-match-url-components url))
+ (cond
+ ((match-beginning 1)
+ ;; URL has a scheme part. => URL may have an absolute spec.
+ (if (or (match-beginning 3)
+ (and (< (match-beginning 5) (length url))
+ (eq ?/ (aref url (match-beginning 5)))))
+ ;; URL has a net-location part or an absolute hierarchical
+ ;; part. => URL has an absolute spec.
+ url
+ (let ((scheme (match-string 2 url)))
+ (if (and (member scheme w3m-url-hierarchical-schemes)
+ (progn
+ (w3m-string-match-url-components base)
+ (equal scheme (match-string 2 base))))
+ (w3m-expand-url (substring url (match-end 1)) base)
+ url))))
+ ((match-beginning 3)
+ ;; URL has a net-location part. => The hierarchical part of URL
+ ;; has an absolute spec.
+ (w3m-string-match-url-components base)
+ (concat (substring base 0 (match-end 1)) url))
+ ((> (match-end 5) (match-beginning 5))
+ (let ((path-end (match-end 5))
+ expanded-path
+ ;; See the following thread about a problem related to
+ ;; the use of file-name-* functions for url string:
+ ;; http://news.gmane.org/group/gmane.emacs.w3m/thread=4210
+ file-name-handler-alist)
+ (w3m-string-match-url-components base)
+ (setq expanded-path
+ (w3m-expand-path-name
+ (substring url 0 path-end)
+ (or (file-name-directory (match-string 5 base))
+ "/")))
+ (concat
+ (substring base 0 (match-beginning 5))
+ (if (member (match-string 2 base) w3m-url-hierarchical-schemes)
+ expanded-path
+ (substring url 0 path-end))
+ (substring url path-end))))
+ ((match-beginning 6)
+ ;; URL has a query part.
+ (w3m-string-match-url-components base)
+ (concat (substring base 0 (match-end 5)) url))
+ (t
+ ;; URL has only a fragment part.
+ (w3m-string-match-url-components base)
+ (concat (substring base 0 (match-beginning 8))
+ url)))))
+
+(defun w3m-display-progress-message (url)
+ "Show \"Reading URL...\" message in the middle of a buffer."
+ (insert (make-string (max 0 (/ (1- (window-height)) 2)) ?\n)
+ "Reading " (w3m-url-readable-string (w3m-url-strip-authinfo url))
+ "...")
+ (beginning-of-line)
+ (let ((fill-column (window-width)))
+ (center-region (point) (point-max)))
+ (goto-char (point-min))
+ (put-text-property (point) (point-max) 'w3m-progress-message t)
+ (sit-for 0))
+
+(defun w3m-view-this-url-1 (url reload new-session)
+ (lexical-let ((url url)
+ (obuffer (current-buffer))
+ (wconfig (current-window-configuration))
+ pos buffer)
+ (if new-session
+ (let ((empty
+ ;; If a new url has the #name portion, we simply copy
+ ;; the buffer's contents to the new session, otherwise
+ ;; creating an empty buffer.
+ (not (and (progn
+ (w3m-string-match-url-components url)
+ (match-beginning 8))
+ (string-equal w3m-current-url
+ (substring url
+ 0 (match-beginning 8)))))))
+ (setq pos (point-marker)
+ buffer (w3m-copy-buffer
+ nil nil nil empty w3m-new-session-in-background))
+ (when w3m-new-session-in-background
+ (set-buffer buffer))
+ (when empty
+ (w3m-display-progress-message url)))
+ (setq buffer (current-buffer)))
+ (let (handler)
+ (w3m-process-do
+ (success (w3m-goto-url url reload nil nil w3m-current-url handler))
+ (set-window-hscroll (selected-window) 0)
+ ;; Delete the newly created buffer if it's been made empty.
+ (when (and pos
+ (buffer-name buffer))
+ (w3m-delete-buffer-if-empty buffer))
+ (when pos ;; the new session is created.
+ ;; FIXME: what we should actually do is to modify the `w3m-goto-url'
+ ;; function so that it may return a proper value, and checking it.
+ (when (and (marker-buffer pos) (buffer-name (marker-buffer pos)))
+ (with-current-buffer (marker-buffer pos)
+ (save-excursion
+ (goto-char pos)
+ (w3m-refontify-anchor)))))
+ ;; We need to restore the window configuration to the former
+ ;; one if `w3m-new-session-in-background' is non-nil unless
+ ;; the buffer's major mode has changed from the w3m-mode to
+ ;; another by visiting the new url (possibly a local file,
+ ;; a mailto url, doc-view-mode, etc.).
+ (if (and w3m-new-session-in-background
+ (not (eq obuffer (current-buffer)))
+ (or (buffer-name buffer)
+ ;; Clear "...has been retrieved in..." message.
+ (progn (w3m-message "") nil))
+ (or (eq major-mode 'w3m-mode)
+ (not (eq (with-current-buffer buffer major-mode)
+ 'w3m-mode))))
+ (set-window-configuration wconfig)
+ (w3m-recenter))))))
+
+(defun w3m-view-this-url (&optional arg new-session)
+ "Display the page pointed to by the link under point.
+If ARG is the number 2 or the list of the number 16 (you may produce
+this by typing `C-u' twice) or NEW-SESSION is non-nil and the link is
+an anchor, this function makes a copy of the current session in
+advance. Otherwise, if ARG is non-nil, it forces to reload the url at
+point."
+ (interactive (if (member current-prefix-arg '(2 (16)))
+ (list nil t)
+ (list current-prefix-arg nil)))
+ ;; Store the current position in the history structure.
+ (w3m-history-store-position)
+ (let ((w3m-prefer-cache
+ (or w3m-prefer-cache
+ (and (stringp w3m-current-url)
+ (string-match "\\`about://\\(?:db-\\)?history/"
+ w3m-current-url))))
+ act url)
+ (cond
+ ((setq act (w3m-action))
+ (let ((w3m-form-new-session new-session)
+ (w3m-form-download nil))
+ (eval act)))
+ ((setq url (w3m-url-valid (w3m-anchor)))
+ (w3m-view-this-url-1 url arg new-session))
+ ((w3m-url-valid (w3m-image))
+ (if (w3m-display-graphic-p)
+ (w3m-toggle-inline-image)
+ (w3m-view-image)))
+ ((setq url (w3m-active-region-or-url-at-point t))
+ (unless (eq 'quit (setq url (w3m-input-url nil url 'quit nil
+ 'feeling-lucky)))
+ (w3m-view-this-url-1 url arg new-session)))
+ (t (w3m-message "No URL at point")))))
+
+(eval-and-compile
+ (autoload 'mouse-set-point "mouse"))
+
+(defun w3m-mouse-view-this-url (event &optional arg)
+ "Follow the link under the mouse pointer."
+ (interactive "e\nP")
+ (mouse-set-point event)
+ (w3m-view-this-url arg))
+
+(defun w3m-open-all-links-in-new-session (start end &optional arg)
+ "Open all http links between START and END as new sessions.
+If the page looks like Google's search result and the START point is
+the beginning of a line, only the links displayed in the beginning of
+lines are picked up. If ARG is non-nil, it forces to reload all links.
+If Transient Mark mode, deactivate the mark."
+ (interactive "r\nP")
+ (when (w3m-region-active-p)
+ (w3m-deactivate-region))
+ (let ((buffer (current-buffer))
+ (prev start)
+ (url (w3m-url-valid (w3m-anchor start)))
+ urls all)
+ (when url
+ (setq urls (list url)))
+ (save-excursion
+ (goto-char start)
+ (setq all (not (and (bolp)
+ w3m-current-url
+ (string-match "\\`http://\\(?:[^/]+\\.\\)*google\\."
+ w3m-current-url))))
+ (while (progn
+ (w3m-next-anchor)
+ (and (> (point) prev)
+ (< (point) end)))
+ (setq prev (point))
+ (when (and (setq url (w3m-url-valid (w3m-anchor)))
+ (string-match "\\`https?:" url)
+ (or all
+ (bolp)))
+ (push url urls))))
+ (setq urls (nreverse urls))
+ (while urls
+ (setq url (car urls)
+ urls (cdr urls))
+ (set-buffer buffer)
+ (w3m-view-this-url-1 url arg t))))
+
+(defun w3m-view-this-url-new-session ()
+ "Display the page of the link under point in a new session.
+If the region is active, use the `w3m-open-all-links-in-new-session'
+command instead."
+ (interactive)
+ (if (w3m-region-active-p)
+ (call-interactively 'w3m-open-all-links-in-new-session)
+ (w3m-view-this-url nil t)))
+
+(defun w3m-mouse-view-this-url-new-session (event)
+ "Follow the link under the mouse pointer in a new session."
+ (interactive "e")
+ (mouse-set-point event)
+ (w3m-view-this-url nil t))
+
+(defun w3m-submit-form (&optional new-session)
+ "Submit the form at point."
+ (interactive "P")
+ (let ((submit (w3m-submit)))
+ (if (and submit
+ w3m-current-url
+ (w3m-url-valid w3m-current-url)
+ (if w3m-submit-form-safety-check
+ (prog1 (y-or-n-p "Submit? ") (message nil))
+ t))
+ (let ((w3m-form-new-session new-session)
+ (w3m-form-download nil))
+ (eval submit))
+ (w3m-message "Can't submit form at this point"))))
+
+(defun w3m-external-view (url &optional no-cache handler)
+ (when (w3m-url-valid url)
+ (lexical-let ((url url)
+ (no-cache no-cache))
+ (w3m-process-do
+ (type (w3m-content-type url no-cache handler))
+ (when type
+ (lexical-let ((method
+ (or (nth 2 (assoc type w3m-content-type-alist))
+ (nth 2 (assoc (w3m-prepare-content url type nil)
+ w3m-content-type-alist)))))
+ (cond
+ ((not method)
+ (if (w3m-url-local-p url)
+ (error "\
+No method to view `%s' is registered. Use `w3m-edit-this-url'"
+ (file-name-nondirectory (w3m-url-to-file-name url)))
+ (w3m-download url nil no-cache handler)))
+ ((functionp method)
+ (funcall method url))
+ ((consp method)
+ (lexical-let
+ ((command (w3m-which-command (car method)))
+ (arguments (cdr method))
+ (file (make-temp-name
+ (expand-file-name "w3mel" w3m-profile-directory)))
+ suffix)
+ (setq suffix (file-name-nondirectory url))
+ (when (string-match "\\.[a-zA-Z0-9]+$" suffix)
+ (setq suffix (match-string 0 suffix))
+ (when (< (length suffix) 5)
+ (setq file (concat file suffix))))
+ (cond
+ ((and command (memq 'file arguments))
+ (let ((w3m-current-buffer (current-buffer)))
+ (w3m-process-do
+ (success (w3m-download url file no-cache handler))
+ (when success
+ (w3m-external-view-file command file url arguments)))))
+ (command
+ (w3m-external-view-file command nil url arguments))
+ (t
+ (w3m-download url nil no-cache handler))))))))))))
+
+(defun w3m-external-view-file (command file url arguments)
+ ;; The 3rd argument `url' is necessary to handle the constant `url'
+ ;; included in the 4th argument `arguments' which is provided by
+ ;; `w3m-content-type-alist'.
+ (lexical-let ((file file))
+ (let (proc)
+ (unwind-protect
+ (with-current-buffer
+ (generate-new-buffer " *w3m-external-view*")
+ (setq proc
+ (apply 'start-process
+ "w3m-external-view"
+ (current-buffer)
+ command
+ (mapcar (function eval) arguments)))
+ (w3m-message "Start %s..." (file-name-nondirectory command))
+ (set-process-sentinel
+ proc
+ (lambda (proc event)
+ (let ((buffer (process-buffer proc)))
+ (when (and (string-match "^\\(?:finished\\|exited\\)" event)
+ (buffer-name buffer))
+ (with-current-buffer buffer
+ (and (stringp file)
+ (file-exists-p file)
+ (delete-file file)))
+ (kill-buffer buffer))))))
+ (and (stringp file)
+ (file-exists-p file)
+ (unless (and (processp proc)
+ (memq (process-status proc) '(run stop)))
+ (delete-file file)))))))
+
+(defun w3m-view-image ()
+ "Display the image under point in the external viewer.
+The viewer is defined in `w3m-content-type-alist' for every type of an
+image."
+ (interactive)
+ (let ((url (w3m-url-valid (w3m-image))))
+ (if url
+ (w3m-external-view url)
+ (w3m-message "No image at point"))))
+
+(defun w3m-save-image ()
+ "Save the image under point to a file.
+The default name will be the original name of the image."
+ (interactive)
+ (let ((url (w3m-url-valid (w3m-image))))
+ (if url
+ (w3m-download url)
+ (w3m-message "No image at point"))))
+
+(defun w3m-external-view-this-url ()
+ "Launch the external browser and display the link an point."
+ (interactive)
+ (let ((url (w3m-url-valid (or (w3m-anchor) (w3m-image)))))
+ (if url
+ (w3m-external-view url)
+ (w3m-message "No URL at point"))))
+
+(defun w3m-external-view-current-url ()
+ "Launch the external browser and display the current URL."
+ (interactive)
+ (if w3m-current-url
+ (w3m-external-view w3m-current-url)
+ (w3m-message "No URL at this page")))
+
+(defun w3m-view-url-with-external-browser (&optional url)
+ "Launch the external browser and display the same web page.
+If the cursor points to a link, it visits the url of the link instead
+of the url currently displayed. The browser is defined in
+`w3m-content-type-alist' for every type of a url."
+ (interactive)
+ (unless url
+ (setq url (or url
+ (w3m-anchor)
+ (unless w3m-display-inline-images
+ (w3m-image))
+ (when (y-or-n-p (format "Browse <%s> ? " w3m-current-url))
+ w3m-current-url))))
+ (if (w3m-url-valid url)
+ (progn
+ (message "Browsing <%s>..." url)
+ (w3m-external-view url))
+ (w3m-message "No URL at point")))
+
+(defun w3m-download-this-url ()
+ "Download the file or the page pointed to by the link under point."
+ (interactive)
+ (let ((url (or (w3m-anchor) (w3m-image))) act)
+ (cond
+ ((w3m-url-valid url)
+ (lexical-let ((pos (point-marker))
+ (curl w3m-current-url))
+ (w3m-process-with-null-handler
+ (w3m-process-do
+ (success (w3m-download url nil nil handler))
+ (and success
+ (buffer-name (marker-buffer pos))
+ (with-current-buffer (marker-buffer pos)
+ (when (equal curl w3m-current-url)
+ (goto-char pos)
+ (w3m-refontify-anchor))))))))
+ ((setq act (w3m-action))
+ (let ((w3m-form-download t))
+ (eval act)))
+ (t
+ (w3m-message "No URL at point")))))
+
+(defun w3m-download-this-image ()
+ "Download the image under point."
+ (interactive)
+ (let ((url (w3m-image)) act)
+ (cond
+ ((w3m-url-valid url)
+ (lexical-let ((pos (point-marker))
+ (curl w3m-current-url))
+ (w3m-process-with-null-handler
+ (w3m-process-do
+ (success (w3m-download url nil nil handler))
+ (and success
+ (buffer-name (marker-buffer pos))
+ (with-current-buffer (marker-buffer pos)
+ (when (equal curl w3m-current-url)
+ (goto-char pos)
+ (w3m-refontify-anchor))))))))
+ ((setq act (w3m-action))
+ (let ((w3m-form-download t))
+ (eval act)))
+ (t
+ (w3m-message "No image at point")))))
+
+(defun w3m-print-current-url ()
+ "Display the current url in the echo area and put it into `kill-ring'."
+ (interactive)
+ (when w3m-current-url
+ (let ((deactivate-mark nil))
+ (kill-new w3m-current-url)
+ (w3m-message "%s" (w3m-url-readable-string w3m-current-url)))))
+
+(defun w3m-print-this-url (&optional interactive-p)
+ "Display the url under point in the echo area and put it into `kill-ring'."
+ (interactive (list t))
+ (let ((deactivate-mark nil)
+ (url (if interactive-p
+ (or (w3m-anchor) (w3m-image))
+ (or (w3m-anchor (point)) (w3m-image (point)))))
+ (alt (if interactive-p
+ (w3m-image-alt)
+ (w3m-image-alt (point)))))
+ (when (or url interactive-p)
+ (and url interactive-p (kill-new url))
+ (w3m-message "%s%s"
+ (if (zerop (length alt))
+ ""
+ (concat alt ": "))
+ (or (w3m-url-readable-string url)
+ (and (w3m-action) "There is a form")
+ "There is no url")))))
+
+(defun w3m-print-this-image-url (&optional interactive-p)
+ "Display image url under point in echo area and put it into `kill-ring'."
+ (interactive (list t))
+ (let ((deactivate-mark nil)
+ (url (if interactive-p
+ (w3m-image)
+ (w3m-image (point))))
+ (alt (if interactive-p
+ (w3m-image-alt)
+ (w3m-image-alt (point)))))
+ (when (or url interactive-p)
+ (and url interactive-p (kill-new url))
+ (w3m-message "%s%s"
+ (if (zerop (length alt))
+ ""
+ (concat alt ": "))
+ (or (w3m-url-readable-string url)
+ (and (w3m-action) "There is a form")
+ "There is no image url")))))
+
+(defmacro w3m-delete-all-overlays ()
+ "Delete all momentary overlays."
+ '(dolist (overlay (overlays-in (point-min) (point-max)))
+ (if (overlay-get overlay 'w3m-momentary-overlay)
+ (delete-overlay overlay))))
+
+(defun w3m-highlight-current-anchor-1 (seq)
+ "Highlight an anchor in the line if the anchor sequence is the same as SEQ.
+Return t if highlighting is successful."
+ (let ((limit (point-at-eol))
+ ov beg pos pseq)
+ (save-excursion
+ (beginning-of-line)
+ (setq pos (point))
+ (while (and pos
+ (< pos limit)
+ (not (eq seq (setq pseq (w3m-anchor-sequence pos)))))
+ (setq pos (next-single-property-change pos 'w3m-anchor-sequence)))
+ (when (and pos (< pos limit) (eq seq pseq))
+ (setq beg pos)
+ (setq pos (next-single-property-change pos 'w3m-anchor-sequence))
+ (setq ov (make-overlay beg pos))
+ (overlay-put ov 'face 'w3m-current-anchor)
+ (overlay-put ov 'w3m-momentary-overlay t)
+ (overlay-put ov 'evaporate t)
+ t))))
+
+(defun w3m-highlight-current-anchor ()
+ "Highlight an anchor under point."
+ (when (let ((ovs (overlays-at (point))) ov)
+ ;; If the anchor is already highlighted, it does nothing.
+ (or (null ovs)
+ (null (progn (while ovs
+ (if (overlay-get (car ovs) 'w3m-momentary-overlay)
+ (setq ov (car ovs)
+ ovs nil))
+ (setq ovs (cdr ovs)))
+ ov))))
+ (w3m-delete-all-overlays)
+ (save-excursion
+ (let ((seq (w3m-anchor-sequence))
+ (pos (point)))
+ (when (and seq
+ (w3m-highlight-current-anchor-1 seq)
+ (zerop (forward-line 1)))
+ (while (and (w3m-highlight-current-anchor-1 seq)
+ (zerop (forward-line 1))))
+ (goto-char pos)
+ (while (and (zerop (forward-line -1))
+ (w3m-highlight-current-anchor-1 seq))))))))
+
+(defun w3m-edit-url (url)
+ "Edit the page pointed by URL."
+ (interactive (list (w3m-input-url)))
+ (when (string-match "\\`about://\\(?:header\\|source\\)/" url)
+ (setq url (substring url (match-end 0))))
+ (catch 'found
+ (dolist (pair w3m-edit-function-alist)
+ (when (and (string-match (car pair) url)
+ (fboundp (cdr pair)))
+ (throw 'found (funcall (cdr pair) url))))
+ (funcall w3m-edit-function
+ (or (w3m-url-to-file-name url)
+ (error "URL:%s is not a local file" url)))))
+
+(defun w3m-edit-current-url ()
+ "Edit this viewing page."
+ (interactive)
+ (if w3m-current-url
+ (w3m-edit-url w3m-current-url)
+ (w3m-message "No URL")))
+
+(defun w3m-edit-this-url ()
+ "Edit the page linked from the anchor under the cursor."
+ (interactive)
+ (let ((url (w3m-url-valid (w3m-anchor))))
+ (if url
+ (w3m-edit-url url)
+ (w3m-message "No URL at point"))))
+
+(defvar w3m-goto-anchor-hist nil)
+(make-variable-buffer-local 'w3m-goto-anchor-hist)
+
+(defun w3m-goto-next-anchor ()
+ (let ((hseq (w3m-anchor-sequence))
+ (pos (next-single-property-change (point) 'w3m-anchor-sequence)))
+ (if (or (not hseq) (< hseq 1))
+ (and pos (goto-char pos))
+ (setq pos
+ ;; hseq is not sequence in form.
+ (catch 'loop
+ (setq hseq (1+ hseq))
+ (while (<= hseq w3m-max-anchor-sequence)
+ (setq pos (text-property-any
+ (point-min) (point-max) 'w3m-anchor-sequence hseq))
+ (when pos (throw 'loop pos))
+ (setq hseq (1+ hseq)))))
+ (and pos (goto-char pos)))))
+
+(defun w3m-next-anchor (&optional arg)
+ "Move the point to the next anchor."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command '(w3m-next-anchor w3m-previous-anchor)))
+ (when (setq w3m-goto-anchor-hist (w3m-anchor-sequence))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-previous-anchor) w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-previous-anchor (- arg))
+ (let (pos)
+ (while (> arg 0)
+ (unless (w3m-goto-next-anchor)
+ (setq w3m-goto-anchor-hist nil)
+ (if (w3m-imitate-widget-button)
+ (widget-forward 1)
+ (when (setq pos (text-property-any
+ (point-min) (point-max) 'w3m-anchor-sequence 1))
+ (goto-char pos))))
+ (setq arg (1- arg))
+ (if (member (w3m-anchor-sequence) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-anchor-sequence) w3m-goto-anchor-hist))))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-goto-previous-anchor ()
+ (let ((hseq (w3m-anchor-sequence))
+ (pos (previous-single-property-change (point) 'w3m-anchor-sequence)))
+ (cond
+ ((and (not hseq) pos)
+ (if (w3m-anchor-sequence pos)
+ (goto-char pos)
+ (setq pos (previous-single-property-change pos 'w3m-anchor-sequence))
+ (and pos (goto-char pos))))
+ ((or (not pos) (< hseq 2)) nil)
+ (t
+ (setq pos
+ ;; hseq is not sequence in form.
+ (catch 'loop
+ (setq hseq (1- hseq))
+ (while (> hseq 0)
+ (setq pos (text-property-any
+ (point-min) (point-max) 'w3m-anchor-sequence hseq))
+ (when pos (throw 'loop pos))
+ (setq hseq (1- hseq)))))
+ (and pos (goto-char pos))))))
+
+(defun w3m-previous-anchor (&optional arg)
+ "Move the point to the previous anchor."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command '(w3m-next-anchor w3m-previous-anchor)))
+ (when (setq w3m-goto-anchor-hist (w3m-anchor-sequence))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-next-anchor) w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-next-anchor (- arg))
+ (let (pos)
+ (while (> arg 0)
+ (unless (w3m-goto-previous-anchor)
+ (setq w3m-goto-anchor-hist nil)
+ (if (w3m-imitate-widget-button)
+ (widget-forward -1)
+ (when (setq pos (and w3m-max-anchor-sequence
+ (text-property-any
+ (point-min) (point-max)
+ 'w3m-anchor-sequence
+ w3m-max-anchor-sequence)))
+ (goto-char pos))))
+ (setq arg (1- arg))
+ (if (member (w3m-anchor-sequence) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-anchor-sequence) w3m-goto-anchor-hist))))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-goto-next-form ()
+ ;; Move the point to the end of the current form.
+ (when (w3m-action (point))
+ (goto-char (next-single-property-change (point) 'w3m-action)))
+ ;; Find the next form.
+ (or (w3m-action (point))
+ (let ((pos (next-single-property-change (point) 'w3m-action)))
+ (when pos
+ (goto-char pos)
+ t))))
+
+(defun w3m-next-form (&optional arg)
+ "Move the point to the next form."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command '(w3m-next-form w3m-previous-form)))
+ (when (setq w3m-goto-anchor-hist (w3m-action (point)))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-previous-form) w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-previous-form (- arg))
+ (while (> arg 0)
+ (unless (w3m-goto-next-form)
+ ;; Make a search from the beginning of the buffer.
+ (setq w3m-goto-anchor-hist nil)
+ (goto-char (point-min))
+ (w3m-goto-next-form))
+ (setq arg (1- arg))
+ (if (member (w3m-action (point)) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-action (point)) w3m-goto-anchor-hist)))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-goto-previous-form ()
+ ;; Move the point to the beginning of the current form.
+ (when (w3m-action (point))
+ (goto-char (previous-single-property-change (1+ (point))
+ 'w3m-action)))
+ ;; Find the previous form.
+ (let ((pos (previous-single-property-change (point) 'w3m-action)))
+ (if pos
+ (goto-char
+ (if (w3m-action pos)
+ pos
+ (previous-single-property-change pos 'w3m-action))))))
+
+(defun w3m-previous-form (&optional arg)
+ "Move the point to the previous form."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command '(w3m-next-form w3m-previous-form)))
+ (when (setq w3m-goto-anchor-hist (w3m-action (point)))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-next-form) w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-next-form (- arg))
+ (while (> arg 0)
+ (unless (w3m-goto-previous-form)
+ ;; search from the end of the buffer
+ (setq w3m-goto-anchor-hist nil)
+ (goto-char (point-max))
+ (w3m-goto-previous-form))
+ (setq arg (1- arg))
+ (if (member (w3m-action (point)) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-action (point)) w3m-goto-anchor-hist)))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-goto-next-image ()
+ ;; Move the point to the end of the current image.
+ (when (w3m-image (point))
+ (goto-char (next-single-property-change (point) 'w3m-image)))
+ ;; Find the next form or image.
+ (or (w3m-image (point))
+ (let ((pos (next-single-property-change (point) 'w3m-image)))
+ (when pos
+ (goto-char pos)
+ t))))
+
+(defun w3m-next-image (&optional arg)
+ "Move the point to the next image."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command
+ '(w3m-next-image w3m-previous-image)))
+ (when (setq w3m-goto-anchor-hist (w3m-image (point)))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-previous-image)
+ w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-previous-image (- arg))
+ (while (> arg 0)
+ (unless (w3m-goto-next-image)
+ ;; Make a search for an image from the beginning of the buffer.
+ (setq w3m-goto-anchor-hist nil)
+ (goto-char (point-min))
+ (w3m-goto-next-image))
+ (setq arg (1- arg))
+ (if (member (w3m-image (point)) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-image (point)) w3m-goto-anchor-hist)))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-goto-previous-image ()
+ ;; Move the point to the beginning of the current image.
+ (when (w3m-image (point))
+ (goto-char (previous-single-property-change (1+ (point))
+ 'w3m-image)))
+ ;; Find the previous form or image.
+ (let ((pos (previous-single-property-change (point) 'w3m-image)))
+ (if pos
+ (goto-char
+ (if (w3m-image pos) pos
+ (previous-single-property-change pos 'w3m-image))))))
+
+(defun w3m-previous-image (&optional arg)
+ "Move the point to the previous image."
+ (interactive "p")
+ (w3m-keep-region-active)
+ (unless arg (setq arg 1))
+ (if (null (memq last-command '(w3m-next-image w3m-previous-image)))
+ (when (setq w3m-goto-anchor-hist (w3m-image (point)))
+ (setq w3m-goto-anchor-hist (list w3m-goto-anchor-hist)))
+ (when (and (eq last-command 'w3m-next-image)
+ w3m-goto-anchor-hist)
+ (setcdr w3m-goto-anchor-hist nil)))
+ (if (< arg 0)
+ (w3m-next-image (- arg))
+ (while (> arg 0)
+ (unless (w3m-goto-previous-image)
+ ;; Make a search from the end of the buffer.
+ (setq w3m-goto-anchor-hist nil)
+ (goto-char (point-max))
+ (w3m-goto-previous-image))
+ (setq arg (1- arg))
+ (if (member (w3m-image (point)) w3m-goto-anchor-hist)
+ (setq arg (1+ arg))
+ (push (w3m-image (point)) w3m-goto-anchor-hist)))
+ (w3m-horizontal-on-screen)
+ (w3m-print-this-url)))
+
+(defun w3m-copy-buffer (&optional buffer newname just-copy empty background)
+ "Create a copy of the BUFFER in which emacs-w3m is working.
+Return a new buffer.
+
+If BUFFER is nil, the current buffer is assumed. If NEWNAME is nil,
+it defaults to the name of the current buffer. If JUST-COPY is nil,
+this function lets a new buffer be the current buffer and pop up as a
+new window or a new frame according to `w3m-pop-up-windows' and
+`w3m-pop-up-frames' (which see), otherwise just creates BUFFER's copy.
+If EMPTY is nil, a page of the same url will be re-rendered in a new
+buffer, otherwise an empty buffer is created. If BACKGROUND is non-nil,
+this function stays on the current buffer.
+
+Note that this function should be called on the window displaying the
+original buffer BUFFER even if JUST-COPY is non-nil in order to render
+a page in a new buffer with the correct width."
+ (interactive (list (current-buffer)
+ (if current-prefix-arg (read-string "Name: "))
+ t))
+ (unless buffer
+ (setq buffer (current-buffer)))
+ (unless newname
+ (setq newname (buffer-name buffer)))
+ (when (string-match "<[0-9]+>\\'" newname)
+ (setq newname (substring newname 0 (match-beginning 0))))
+ (let (url coding images init-frames new)
+ (save-current-buffer
+ (set-buffer buffer)
+ (setq url (or w3m-current-url
+ (car (w3m-history-element (cadar w3m-history))))
+ coding w3m-current-coding-system
+ images w3m-display-inline-images
+ init-frames (when (w3m-popup-frame-p)
+ (copy-sequence w3m-initial-frames)))
+ (unless url
+ (setq empty t))
+ ;;
+ (set-buffer (setq new (w3m-generate-new-buffer newname)))
+ (w3m-mode)
+ ;; Make copies of `w3m-history' and `w3m-history-flat'.
+ (w3m-history-copy buffer)
+ (setq w3m-current-coding-system coding
+ w3m-initial-frames init-frames
+ w3m-display-inline-images
+ (if w3m-toggle-inline-images-permanently
+ images
+ w3m-default-display-inline-images)))
+ (cond
+ ((and empty (not background))
+ ;; Pop to a window or a frame up because `w3m-goto-url' is not called.
+ (w3m-popup-buffer new))
+ (empty
+ ;; When empty and just-copy, stay origianl buffer.
+ )
+ (t
+ ;; Need to change to the `new' buffer in which `w3m-goto-url' runs.
+ (set-buffer new)
+ ;; Render a page.
+ (let ((positions (copy-sequence (car w3m-history)))
+ (w3m-history-reuse-history-elements t)
+ (w3m-prefer-cache t))
+ (w3m-process-with-wait-handler
+ (w3m-goto-url url 'redisplay nil nil nil handler
+ ;; Pass the properties of the history elements,
+ ;; although it is currently always nil.
+ (w3m-history-element (cadr positions))))
+ (setcar w3m-history positions))
+ (when (and w3m-new-session-in-background
+ just-copy
+ (not (get-buffer-window buffer)))
+ (set-window-buffer (selected-window) buffer))))
+ new))
+
+(defun w3m-next-buffer (arg)
+ "Turn ARG pages of emacs-w3m buffers ahead."
+ (interactive "p")
+ (unless arg (setq arg 1))
+ (when (and (/= arg 0) (eq major-mode 'w3m-mode))
+ (w3m-history-store-position)
+ (let* ((buffers (w3m-list-buffers))
+ (len (length buffers)))
+ (switch-to-buffer
+ (nth (mod (+ arg (- len (length (memq (current-buffer) buffers))))
+ len)
+ buffers)))
+ (w3m-history-restore-position)
+ (run-hooks 'w3m-select-buffer-hook)
+ (w3m-select-buffer-update)))
+
+(defun w3m-previous-buffer (arg)
+ "Turn ARG pages of emacs-w3m buffers behind."
+ (interactive "p")
+ (w3m-next-buffer (- arg)))
+
+(defun w3m-delete-buffer (&optional force)
+ "Delete the current emacs-w3m buffer and switch to the previous one.
+If there is the sole emacs-w3m buffer, it is assumed to be called for
+terminating the emacs-w3m session; the prefix argument FORCE will be
+passed to the `w3m-quit' function (which see)."
+ (interactive "P")
+ ;; Bind `w3m-fb-mode' to nil so that this function might not call
+ ;; `w3m-quit' when there is only one buffer belonging to the selected
+ ;; frame, but there are emacs-w3m buffers in other frames.
+ (let* ((w3m-fb-mode nil)
+ (buffers (w3m-list-buffers t))
+ (num (length buffers))
+ cur buf bufs)
+ (if (= 1 num)
+ (w3m-quit force)
+ (setq cur (current-buffer))
+ (if (w3m-use-tab-p)
+ (save-window-excursion
+ (select-window (or (get-buffer-window cur t) (selected-window)))
+ (w3m-next-buffer -1))
+ ;; List buffers being shown in the other windows of the current frame.
+ (save-current-buffer
+ (walk-windows (lambda (window)
+ (set-buffer (setq buf (window-buffer window)))
+ (when (and (eq major-mode 'w3m-mode)
+ (not (eq buf cur)))
+ (push buf bufs)))
+ 'no-minibuf))
+ (cond ((= (1- num) (length bufs))
+ ;; All the other buffers are shown in the current frame.
+ (select-window (get-buffer-window (prog2
+ (w3m-next-buffer -1)
+ (current-buffer)
+ (delete-window)))))
+ (bufs
+ ;; Look for the buffer which is not shown in the current frame.
+ (setq buf nil)
+ (while (progn
+ (w3m-next-buffer -1)
+ (unless buf
+ (setq buf (current-buffer)))
+ (memq (current-buffer) bufs)))
+ (when (memq buf bufs)
+ ;; Go to the buffer which is most suitable to be called
+ ;; the *previous* buffer.
+ (select-window (get-buffer-window buf))))
+ ((progn ;; List buffers being not shown anywhere.
+ (setq bufs nil)
+ (while buffers
+ (unless (get-buffer-window (setq buf (pop buffers)) t)
+ (push buf bufs)))
+ bufs)
+ (while (progn
+ (w3m-next-buffer -1)
+ (not (memq (current-buffer) bufs)))))
+ ((memq (selected-frame) w3m-initial-frames)
+ ;; Assume that this frame was created to show this buffer.
+ (if (one-window-p t)
+ (delete-frame)
+ (delete-window)))
+ (t
+ (if (>= num 2)
+ (w3m-next-buffer -1)
+ (unless (one-window-p t)
+ (delete-window))))))
+ (w3m-session-deleted-save (list cur))
+ (w3m-process-stop cur)
+ (w3m-idle-images-show-unqueue cur)
+ (kill-buffer cur)
+ (when w3m-use-form
+ (w3m-form-kill-buffer cur))
+ (w3m-history-restore-position)
+ (run-hooks 'w3m-delete-buffer-hook)
+ (w3m-session-crash-recovery-save)))
+ (w3m-select-buffer-update)
+ (unless w3m-fb-inhibit-buffer-selection
+ (w3m-fb-select-buffer)))
+
+(defun w3m-delete-buffer-if-empty (buffer)
+ "Delete a newly created emacs-w3m buffer BUFFER if it seems unnecessary.
+Some emacs-w3m commands create a buffer for the new session first, but
+it may be useless if the command is invoked for visiting a local file
+or a mail buffer. This command will delete BUFFER if it is empty or
+there is only a progress message. It also deletes windows and frames
+related to BUFFER."
+ (with-current-buffer buffer
+ (unless (or w3m-current-process
+ w3m-current-url
+ (not (or (zerop (buffer-size))
+ (and (get-text-property (point-min)
+ 'w3m-progress-message)
+ (get-text-property (1- (point-max))
+ 'w3m-progress-message)))))
+ (w3m-delete-buffer t))))
+
+(defun w3m-pack-buffer-numbers ()
+ "Renumber suffixes of names of emacs-w3m buffers.
+It aligns emacs-w3m buffers in order of *w3m*, *w3m<2>, *w3m*<3>,...
+as if the folder command of MH performs with the -pack option."
+ (interactive)
+ (let ((count 1) number newname)
+ (dolist (buffer (w3m-list-buffers))
+ (setq number (w3m-buffer-number buffer))
+ (when number
+ (unless (eq number count)
+ (when (and (setq newname (w3m-buffer-set-number buffer count))
+ w3m-use-form)
+ (w3m-form-set-number buffer newname)))
+ (incf count)))))
+
+(defun w3m-delete-other-buffers (&optional buffer)
+ "Delete emacs-w3m buffers except for BUFFER or the current buffer."
+ (interactive)
+ (unless buffer
+ (setq buffer (current-buffer)))
+ (w3m-delete-frames-and-windows buffer)
+ (let ((buffers (delq buffer (w3m-list-buffers t))))
+ (w3m-delete-buffers buffers)))
+
+(defun w3m-delete-left-tabs ()
+ "Delete tabs on the left side of the current tab."
+ (interactive)
+ (let ((cbuf (current-buffer))
+ bufs)
+ (setq bufs (catch 'done
+ (dolist (buf (w3m-list-buffers))
+ (if (eq cbuf buf)
+ (throw 'done bufs)
+ (setq bufs (cons buf bufs))))))
+ (when bufs
+ (w3m-delete-buffers bufs))))
+
+(defun w3m-delete-right-tabs ()
+ "Delete tabs on the right side of the current tab."
+ (interactive)
+ (let ((bufs (w3m-righttab-exist-p)))
+ (when bufs
+ (w3m-delete-buffers bufs))))
+
+(defun w3m-delete-buffers (buffers)
+ "Delete emacs-w3m buffers."
+ (let (buffer)
+ (when buffers
+ (w3m-session-deleted-save buffers))
+ (while buffers
+ (setq buffer (pop buffers))
+ (w3m-process-stop buffer)
+ (w3m-idle-images-show-unqueue buffer)
+ (kill-buffer buffer)
+ (when w3m-use-form
+ (w3m-form-kill-buffer buffer))))
+ (run-hooks 'w3m-delete-buffer-hook)
+ (w3m-session-crash-recovery-save)
+ (w3m-select-buffer-update)
+ (w3m-force-window-update))
+
+(defvar w3m-lynx-like-map nil
+ "Lynx-like keymap used in emacs-w3m buffers.")
+;; `C-t' is a prefix key reserved to commands that do something in all
+;; emacs-w3m buffers. 2006-05-18
+(unless w3m-lynx-like-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map)
+ (define-key map " " 'w3m-scroll-up-or-next-url)
+ (define-key map "b" 'w3m-scroll-down-or-previous-url)
+ (define-key map [backspace] 'w3m-scroll-down-or-previous-url)
+ (define-key map [delete] 'w3m-scroll-down-or-previous-url)
+ (if (featurep 'xemacs)
+ (define-key map [(shift space)] 'w3m-scroll-down-or-previous-url)
+ (define-key map [?\S-\ ] 'w3m-scroll-down-or-previous-url))
+ (define-key map "h" 'backward-char)
+ (define-key map "j" 'next-line)
+ (define-key map "k" 'previous-line)
+ (define-key map "l" 'forward-char)
+ (define-key map "J" 'w3m-scroll-up-1)
+ (define-key map "K" (lambda () (interactive) (scroll-down 1)))
+ (define-key map "\C-?" 'w3m-scroll-down-or-previous-url)
+ (define-key map "\t" 'w3m-next-anchor)
+ (define-key map [tab] 'w3m-next-anchor)
+ (define-key map [(shift tab)] 'w3m-previous-anchor)
+ (define-key map [(shift iso-lefttab)] 'w3m-previous-anchor)
+ (define-key map [backtab] 'w3m-previous-anchor)
+ (define-key map [down] 'w3m-next-anchor)
+ (define-key map "\M-\t" 'w3m-previous-anchor)
+ (define-key map [up] 'w3m-previous-anchor)
+ (define-key map "\C-m" 'w3m-view-this-url)
+ (define-key map [(shift return)] 'w3m-view-this-url-new-session)
+ (define-key map [(shift kp-enter)] 'w3m-view-this-url-new-session)
+ (define-key map [right] 'w3m-view-this-url)
+ (cond ((featurep 'xemacs)
+ (define-key map [(button3)] 'w3m-mouse-major-mode-menu))
+ ;; Don't use [mouse-3], which gets submenus not working in GTK Emacs.
+ ((featurep 'gtk)
+ (define-key map [down-mouse-3] 'w3m-mouse-major-mode-menu)
+ (define-key map [drag-mouse-3] 'undefined)
+ (define-key map [mouse-3] 'undefined))
+ (t
+ (define-key map [mouse-3] 'w3m-mouse-major-mode-menu)))
+ (if (featurep 'xemacs)
+ (progn
+ (define-key map [(button2)] 'w3m-mouse-view-this-url)
+ (define-key map [(shift button2)]
+ 'w3m-mouse-view-this-url-new-session))
+ (define-key map [mouse-2] 'w3m-mouse-view-this-url)
+ ;; Support for mouse-1 on Emacs 22 and greater.
+ (define-key map [follow-link] 'mouse-face)
+ (define-key map [S-mouse-2] 'w3m-mouse-view-this-url-new-session))
+ (define-key map "\C-c\C-@" 'w3m-history-store-position)
+ (if (featurep 'xemacs)
+ (define-key map [?\C-c (control space)] 'w3m-history-store-position)
+ ;; `C- ' doesn't mean `C-SPC' in XEmacs.
+ (define-key map [?\C-c ?\C-\ ] 'w3m-history-store-position))
+ (define-key map "\C-c\C-v" 'w3m-history-restore-position)
+ (define-key map [left] 'w3m-view-previous-page)
+ (define-key map "B" 'w3m-view-previous-page)
+ (define-key map "N" 'w3m-view-next-page)
+ (define-key map "^" 'w3m-view-parent-page)
+ (define-key map "\M-d" 'w3m-download)
+ (define-key map "d" 'w3m-download-this-url)
+ (define-key map "u" 'w3m-print-this-url)
+ (define-key map "I" 'w3m-view-image)
+ (define-key map "\M-i" 'w3m-save-image)
+ (define-key map "c" 'w3m-print-current-url)
+ (define-key map "M" 'w3m-view-url-with-external-browser)
+ (define-key map "G" 'w3m-goto-url-new-session)
+ (define-key map "g" 'w3m-goto-url)
+ (define-key map "T" 'w3m-toggle-inline-images)
+ (define-key map "\M-T" 'w3m-turnoff-inline-images)
+ (define-key map "t" 'w3m-toggle-inline-image)
+ (when (w3m-display-graphic-p)
+ (define-key map "\M-[" 'w3m-zoom-out-image)
+ (define-key map "\M-]" 'w3m-zoom-in-image))
+ (define-key map "U" 'w3m-goto-url)
+ (define-key map "v" 'w3m-bookmark-view)
+ (define-key map "V" 'w3m-bookmark-view-new-session)
+ (define-key map "q" 'w3m-close-window)
+ (define-key map "Q" 'w3m-quit)
+ (define-key map "\M-n" 'w3m-copy-buffer)
+ (define-key map "\C-c\C-t" 'w3m-copy-buffer)
+ (define-key map "\C-c\C-p" 'w3m-previous-buffer)
+ (define-key map "\C-c\C-n" 'w3m-next-buffer)
+ (when (featurep 'w3m-ems)
+ (define-key map [?\C-c ?\C-,] 'w3m-tab-move-left)
+ (define-key map [?\C-c ?\C-<] 'w3m-tab-move-left)
+ (define-key map [?\C-c ?\C-.] 'w3m-tab-move-right)
+ (define-key map [?\C-c ?\C->] 'w3m-tab-move-right))
+ (define-key map "\C-c\C-w" 'w3m-delete-buffer)
+ (define-key map "\C-c\M-w" 'w3m-delete-other-buffers)
+ (define-key map "\C-c\M-l" 'w3m-delete-left-tabs)
+ (define-key map "\C-c\M-r" 'w3m-delete-right-tabs)
+ (define-key map "\C-c\C-s" 'w3m-select-buffer)
+ (define-key map "\C-c\C-a" 'w3m-switch-buffer)
+ (define-key map "\M-s" 'w3m-session-select)
+ (define-key map "\M-S" 'w3m-session-save)
+ (define-key map "r" 'w3m-redisplay-this-page)
+ (define-key map "R" 'w3m-reload-this-page)
+ (define-key map "\C-tR" 'w3m-reload-all-pages)
+ (define-key map "?" 'describe-mode)
+ (define-key map "\M-a" 'w3m-bookmark-add-this-url)
+ (define-key map "\M-k" 'w3m-cookie)
+ (define-key map "a" 'w3m-bookmark-add-current-url)
+ (define-key map "\C-ta" 'w3m-bookmark-add-all-urls)
+ (define-key map "+" 'w3m-antenna-add-current-url)
+ (define-key map "]" 'w3m-next-form)
+ (define-key map "[" 'w3m-previous-form)
+ (define-key map "}" 'w3m-next-image)
+ (define-key map "{" 'w3m-previous-image)
+ (define-key map "H" 'w3m-gohome)
+ (define-key map "A" 'w3m-antenna)
+ (define-key map "W" 'w3m-weather)
+ (define-key map "S" 'w3m-search)
+ (define-key map "D" 'w3m-dtree)
+ (define-key map ">" 'w3m-scroll-left)
+ (define-key map "<" 'w3m-scroll-right)
+ (define-key map "." 'w3m-shift-left)
+ (define-key map "," 'w3m-shift-right)
+ (define-key map "\M-l" 'w3m-horizontal-recenter)
+ (define-key map "\C-a" 'w3m-beginning-of-line)
+ (define-key map "\C-e" 'w3m-end-of-line)
+ (define-key map "\\" 'w3m-view-source)
+ (define-key map "=" 'w3m-view-header)
+ (define-key map "s" 'w3m-history)
+ (define-key map "E" 'w3m-edit-current-url)
+ (define-key map "e" 'w3m-edit-this-url)
+ (define-key map "C" (make-sparse-keymap))
+ (define-key map "Ct" 'w3m-redisplay-with-content-type)
+ (define-key map "Cc" 'w3m-redisplay-with-charset)
+ (define-key map "CC" 'w3m-redisplay-and-reset)
+ (define-key map "\C-c\C-b" 'report-emacs-w3m-bug)
+ (define-key map "\C-c\C-c" 'w3m-submit-form)
+ (define-key map "\C-c\C-k" 'w3m-process-stop)
+ (define-key map "\C-c\C-m" 'w3m-move-unseen-buffer)
+ (define-key map "\C-c\C-l" 'w3m-go-to-linknum)
+ (setq w3m-lynx-like-map map)))
+
+(defvar w3m-info-like-map nil
+ "Info-like keymap used in emacs-w3m buffers.")
+;; `C-t' is a prefix key reserved to commands that do something in all
+;; emacs-w3m buffers. 2006-05-18
+(unless w3m-info-like-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map)
+ (define-key map [backspace] 'w3m-scroll-down-or-previous-url)
+ (define-key map [delete] 'w3m-scroll-down-or-previous-url)
+ (define-key map "\C-?" 'w3m-scroll-down-or-previous-url)
+ (if (featurep 'xemacs)
+ (define-key map [(shift space)] 'w3m-scroll-down-or-previous-url)
+ (define-key map [?\S-\ ] 'w3m-scroll-down-or-previous-url))
+ (define-key map "\t" 'w3m-next-anchor)
+ (define-key map [tab] 'w3m-next-anchor)
+ (define-key map [(shift tab)] 'w3m-previous-anchor)
+ (define-key map [(shift iso-lefttab)] 'w3m-previous-anchor)
+ (define-key map [backtab] 'w3m-previous-anchor)
+ (define-key map "\M-\t" 'w3m-previous-anchor)
+ (define-key map "\C-m" 'w3m-view-this-url)
+ (define-key map [(shift return)] 'w3m-view-this-url-new-session)
+ (define-key map [(shift kp-enter)] 'w3m-view-this-url-new-session)
+ (if (featurep 'xemacs)
+ (progn
+ (define-key map [(button2)] 'w3m-mouse-view-this-url)
+ (define-key map [(shift button2)]
+ 'w3m-mouse-view-this-url-new-session))
+ (define-key map [mouse-2] 'w3m-mouse-view-this-url)
+ ;; Support for mouse-1 on Emacs 22 and greater.
+ (define-key map [follow-link] 'mouse-face)
+ (define-key map [S-mouse-2] 'w3m-mouse-view-this-url-new-session))
+ (cond ((featurep 'xemacs)
+ (define-key map [(button3)] 'w3m-mouse-major-mode-menu))
+ ;; Don't use [mouse-3], which gets submenus not working in GTK Emacs.
+ ((featurep 'gtk)
+ (define-key map [down-mouse-3] 'w3m-mouse-major-mode-menu)
+ (define-key map [drag-mouse-3] 'undefined)
+ (define-key map [mouse-3] 'undefined))
+ (t
+ (define-key map [mouse-3] 'w3m-mouse-major-mode-menu)))
+ (define-key map "\C-c\C-@" 'w3m-history-store-position)
+ (define-key map [?\C-c?\C- ] 'w3m-history-store-position)
+ (define-key map "\C-c\C-v" 'w3m-history-restore-position)
+ (define-key map " " 'w3m-scroll-up-or-next-url)
+ (define-key map "a" 'w3m-bookmark-add-current-url)
+ (define-key map "\C-ta" 'w3m-bookmark-add-all-urls)
+ (define-key map "\M-a" 'w3m-bookmark-add-this-url)
+ (define-key map "+" 'w3m-antenna-add-current-url)
+ (define-key map "A" 'w3m-antenna)
+ (define-key map "b" 'w3m-scroll-down-or-previous-url)
+ (define-key map "!" 'w3m-redisplay-with-content-type)
+ (define-key map "d" 'w3m-download)
+ (define-key map "D" 'w3m-download-this-url)
+ (define-key map "e" 'w3m-edit-current-url)
+ (define-key map "E" 'w3m-edit-this-url)
+ (define-key map "f" 'undefined) ;; reserved.
+ (define-key map "g" 'w3m-goto-url)
+ (define-key map "G" 'w3m-goto-url-new-session)
+ (define-key map "h" 'describe-mode)
+ (define-key map "H" 'w3m-gohome)
+ (define-key map "i" (if (w3m-display-graphic-p)
+ 'w3m-toggle-inline-image
+ 'w3m-view-image))
+ (define-key map "I" 'w3m-toggle-inline-images)
+ (define-key map "\M-I" 'w3m-turnoff-inline-images)
+ (when (w3m-display-graphic-p)
+ (define-key map "\M-[" 'w3m-zoom-out-image)
+ (define-key map "\M-]" 'w3m-zoom-in-image))
+ (define-key map "\M-i" 'w3m-save-image)
+ (define-key map "l" 'w3m-view-previous-page)
+ (define-key map "\C-l" 'recenter)
+ (define-key map [(control L)] 'w3m-reload-this-page)
+ (define-key map [(control t) (control L)] 'w3m-reload-all-pages)
+ (define-key map "M" 'w3m-view-url-with-external-browser)
+ (define-key map "n" 'w3m-view-next-page)
+ (define-key map "N" 'w3m-namazu)
+ (define-key map "\M-n" 'w3m-copy-buffer)
+ (define-key map "\M-k" 'w3m-cookie)
+ (define-key map "\C-c\C-t" 'w3m-copy-buffer)
+ (define-key map "\C-c\C-p" 'w3m-previous-buffer)
+ (define-key map "\C-c\C-n" 'w3m-next-buffer)
+ (when (featurep 'w3m-ems)
+ (define-key map [?\C-c ?\C-,] 'w3m-tab-move-left)
+ (define-key map [?\C-c ?\C-<] 'w3m-tab-move-left)
+ (define-key map [?\C-c ?\C-.] 'w3m-tab-move-right)
+ (define-key map [?\C-c ?\C->] 'w3m-tab-move-right))
+ (define-key map "\C-c\C-w" 'w3m-delete-buffer)
+ (define-key map "\C-c\M-w" 'w3m-delete-other-buffers)
+ (define-key map "\C-c\M-l" 'w3m-delete-left-tabs)
+ (define-key map "\C-c\M-r" 'w3m-delete-right-tabs)
+ (define-key map "\C-c\C-s" 'w3m-select-buffer)
+ (define-key map "\C-c\C-a" 'w3m-switch-buffer)
+ (define-key map "\M-s" 'w3m-session-select)
+ (define-key map "\M-S" 'w3m-session-save)
+ (define-key map "o" 'w3m-history)
+ (define-key map "O" 'w3m-db-history)
+ (define-key map "p" 'w3m-view-previous-page)
+ (define-key map "P" 'undecided) ;; reserved for print-this-buffer.
+ (define-key map "q" 'w3m-close-window)
+ (define-key map "Q" 'w3m-quit)
+ (define-key map "r" 'w3m-redisplay-this-page)
+ (define-key map "R" 'w3m-reload-this-page)
+ (define-key map "\C-tR" 'w3m-reload-all-pages)
+ (define-key map "s" 'w3m-search)
+ (define-key map "S" 'w3m-search-new-session)
+ (define-key map "T" 'w3m-dtree)
+ (define-key map "u" 'w3m-view-parent-page)
+ (define-key map "v" 'w3m-bookmark-view)
+ (define-key map "V" 'w3m-bookmark-view-new-session)
+ (define-key map "W" 'w3m-weather)
+ (define-key map "y" 'w3m-print-current-url)
+ (define-key map "Y" 'w3m-print-this-url)
+ (define-key map "=" 'w3m-view-header)
+ (define-key map "\\" 'w3m-view-source)
+ (define-key map "?" 'describe-mode)
+ (define-key map ">" 'w3m-scroll-left)
+ (define-key map "<" 'w3m-scroll-right)
+ (define-key map [(shift right)] 'w3m-shift-left)
+ (define-key map [(shift left)] 'w3m-shift-right)
+ (define-key map "\M-l" 'w3m-horizontal-recenter)
+ (define-key map "\C-a" 'w3m-beginning-of-line)
+ (define-key map "\C-e" 'w3m-end-of-line)
+ (define-key map "." 'beginning-of-buffer)
+ (define-key map "^" 'w3m-view-parent-page)
+ (define-key map "]" 'w3m-next-form)
+ (define-key map "[" 'w3m-previous-form)
+ (define-key map "}" 'w3m-next-image)
+ (define-key map "{" 'w3m-previous-image)
+ (define-key map "C" (make-sparse-keymap))
+ (define-key map "Ct" 'w3m-redisplay-with-content-type)
+ (define-key map "Cc" 'w3m-redisplay-with-charset)
+ (define-key map "CC" 'w3m-redisplay-and-reset)
+ (define-key map "\C-c\C-b" 'report-emacs-w3m-bug)
+ (define-key map "\C-c\C-c" 'w3m-submit-form)
+ (define-key map "\C-c\C-k" 'w3m-process-stop)
+ (define-key map "\C-c\C-m" 'w3m-move-unseen-buffer)
+ (define-key map "\C-c\C-l" 'w3m-go-to-linknum)
+ (setq w3m-info-like-map map)))
+
+(defun w3m-alive-p (&optional visible)
+ "Return a buffer in which emacs-w3m is running.
+If there is no emacs-w3m session, return nil. If the optional VISIBLE
+is non-nil, a visible emacs-w3m buffer is preferred. The last visited
+emacs-w3m buffer is likely to return if VISIBLE is omitted or there is
+no visible buffer."
+ (let* ((buffers (w3m-list-buffers t))
+ (buf (car buffers)))
+ (if visible
+ (progn
+ (setq visible nil)
+ (while (and (not visible)
+ buffers)
+ (when (get-buffer-window (car buffers) t)
+ (setq visible (car buffers)))
+ (setq buffers (cdr buffers)))
+ (or visible buf))
+ buf)))
+
+(defun w3m-quit (&optional force)
+ "Return to a peaceful life (exiting all emacs-w3m sessions).
+This command lets you quit browsing web after updating the arrived
+URLs database. Quit browsing immediately if the prefix argument FORCE
+is specified, otherwise prompt you for the confirmation. See also
+`w3m-close-window'."
+ (interactive "P")
+ (let ((buffers (w3m-list-buffers t))
+ (all-buffers (let ((w3m-fb-mode nil))
+ (w3m-list-buffers t))))
+ (if (or (= (length buffers) (length all-buffers))
+ (prog1 (y-or-n-p "Kill emacs-w3m buffers on other frames? ")
+ (message nil)))
+ (let ((w3m-fb-mode nil))
+ (when (or force
+ (prog1 (y-or-n-p "Do you want to exit emacs-w3m? ")
+ (message nil)))
+ (w3m-session-automatic-save)
+ (w3m-delete-frames-and-windows)
+ (sit-for 0) ;; Delete frames seemingly fast.
+ (dolist (buffer all-buffers)
+ (w3m-cancel-refresh-timer buffer)
+ (kill-buffer buffer)
+ (when w3m-use-form
+ (w3m-form-kill-buffer buffer)))
+ (when w3m-use-form
+ (w3m-form-textarea-file-cleanup))
+ (w3m-select-buffer-close-window)
+ (w3m-cache-shutdown)
+ (w3m-arrived-shutdown)
+ (w3m-process-shutdown)
+ (when w3m-use-cookies
+ (w3m-cookie-shutdown))
+ (w3m-kill-all-buffer)))
+ (w3m-session-automatic-save)
+ (w3m-fb-delete-frame-buffers)
+ (w3m-fb-select-buffer))))
+
+(defun w3m-close-window ()
+ "Return to a restless life (quitting all emacs-w3m sessions).
+This command closes all emacs-w3m windows, but all the emacs-w3m
+buffers remain. Frames created for emacs-w3m sessions will also be
+closed. See also `w3m-quit'."
+ (interactive)
+ (w3m-history-store-position)
+ ;; `w3m-list-buffers' won't return all the emacs-w3m buffers if
+ ;; `w3m-fb-mode' is turned on.
+ (let* ((buffers (w3m-list-buffers t))
+ (bufs buffers)
+ buf windows window)
+ (w3m-delete-frames-and-windows)
+ (while bufs
+ (setq buf (pop bufs))
+ (w3m-cancel-refresh-timer buf)
+ (bury-buffer buf))
+ (while buffers
+ (setq buf (pop buffers)
+ windows (get-buffer-window-list buf 'no-minibuf t))
+ (while windows
+ (setq window (pop windows))
+ (set-window-buffer
+ window
+ (w3m-static-if (featurep 'xemacs)
+ (other-buffer buf (window-frame window) nil)
+ (other-buffer buf nil (window-frame window)))))))
+ (w3m-select-buffer-close-window)
+ ;; The current-buffer and displayed buffer are not necessarily the
+ ;; same at this point; if they aren't bury-buffer will be a nop, and
+ ;; we will infloop.
+ (set-buffer (window-buffer (selected-window)))
+ (while (eq major-mode 'w3m-mode)
+ (bury-buffer)))
+
+(unless w3m-mode-map
+ (setq w3m-mode-map
+ (if (eq w3m-key-binding 'info)
+ w3m-info-like-map
+ w3m-lynx-like-map)))
+
+(defun w3m-mouse-major-mode-menu (event)
+ "Pop up a W3M mode-specific menu of mouse commands."
+ (interactive "e")
+ (mouse-set-point event)
+ (let* ((bmkitems (if w3m-bookmark-mode
+ (cdr w3m-bookmark-menu-items)
+ (car w3m-bookmark-menu-items)))
+ (bmkmenu (if w3m-bookmark-menu-items-pre
+ `(,@bmkitems
+ "----"
+ ,@w3m-bookmark-menu-items-pre)
+ bmkitems)))
+ (w3m-static-if (featurep 'xemacs)
+ (let (menubar)
+ (when current-menubar
+ (run-hooks 'activate-menubar-hook))
+ (setq menubar
+ (cons "w3m"
+ (delq nil
+ `(,@(cdr w3m-rmouse-menubar)
+ "----"
+ "----"
+ ,(assoc "w3m" current-menubar)
+ "----"
+ ,(assoc "Bookmark" current-menubar)
+ ,(assoc "Tab" current-menubar)
+ ,(assoc "Session" current-menubar)))))
+ (popup-menu menubar event))
+ (run-hooks 'menu-bar-update-hook)
+ (popup-menu (delete nil
+ `(,@w3m-rmouse-menubar
+ "----"
+ "----"
+ ,w3m-menubar
+ "----"
+ ,(cons "Bookmark" bmkmenu)
+ ,(when w3m-tab-menubar-make-items-preitems
+ (cons "Tab" w3m-tab-menubar-make-items-preitems))
+ ,(cons "Session" (if w3m-session-menu-items-pre
+ (append w3m-session-menu-items
+ '("----")
+ w3m-session-menu-items-pre)
+ w3m-session-menu-items))))
+ event))))
+
+(defvar w3m-tab-button-menu-current-buffer nil
+ "Internal variable used by `w3m-tab-button-menu'.")
+
+(defvar w3m-tab-button-menu-commands
+ (let ((manyp '(cdr (w3m-list-buffers)))
+ (currentp 'w3m-tab-button-menu-current-buffer)
+ (leftp '(and w3m-tab-button-menu-current-buffer
+ (w3m-lefttab-exist-p w3m-tab-button-menu-current-buffer)))
+ (rightp '(and w3m-tab-button-menu-current-buffer
+ (w3m-righttab-exist-p
+ w3m-tab-button-menu-current-buffer)))
+ (many2p '(and w3m-tab-button-menu-current-buffer
+ (cdr (w3m-list-buffers)))))
+ `((w3m-goto-url-new-session
+ ,(w3m-make-menu-item "$B?7$7$$%?%V(B" "New Tab")
+ t ,w3m-new-session-in-background w3m-new-session-url)
+ (w3m-copy-buffer
+ ,(w3m-make-menu-item "$B%?%V$rJ#@=(B" "Copy Tab")
+ ,currentp ,w3m-new-session-in-background)
+ -
+ (w3m-reload-this-page
+ ,(w3m-make-menu-item "$B%?%V$r:FFI$_9~$_(B" "Reload Tab")
+ ,currentp)
+ (w3m-reload-all-pages
+ ,(w3m-make-menu-item "$B$9$Y$F$N%?%V$r:FFI$_9~$_(B" "Reload All Tabs")
+ ,manyp)
+ -
+ (w3m-delete-buffer
+ ,(w3m-make-menu-item "$B$3$N%?%V$rJD$8$k(B" "Close This Tab")
+ ,currentp)
+ -
+ (w3m-delete-other-buffers
+ ,(w3m-make-menu-item "$BB>$N%?%V$r$9$Y$FJD$8$k(B" "Close Other Tabs")
+ ,many2p)
+ (w3m-delete-left-tabs
+ ,(w3m-make-menu-item "$B:8B&$N%?%V$r$9$Y$FJD$8$k(B" "Close Left Tabs")
+ ,leftp)
+ (w3m-delete-right-tabs
+ ,(w3m-make-menu-item "$B1&B&$N%?%V$r$9$Y$FJD$8$k(B" "Close Right Tabs")
+ ,rightp)
+ -
+ (w3m-view-url-with-external-browser
+ ,(w3m-make-menu-item "$B30It%V%i%&%6$G3+$/(B" "View with external browser")
+ ,currentp ,w3m-new-session-in-background w3m-current-url)
+ -
+ (w3m-session-save
+ ,(w3m-make-menu-item "$B$9$Y$F$N%?%V$rJ]B8$9$k(B" "Save All Tabs...")
+ t)
+ (w3m-session-select
+ ,(w3m-make-menu-item "$B%?%V%j%9%H$rA*Br$9$k(B" "Select List of Tabs...")
+ t)
+ (w3m-bookmark-add-current-url
+ ,(w3m-make-menu-item "$B$3$N%?%V$r%V%C%/%^!<%/(B" "Bookmark This Tab...")
+ ,currentp ,w3m-new-session-in-background)
+ (w3m-bookmark-add-all-urls
+ ,(w3m-make-menu-item
+ "$B$9$Y$F$N%?%V$r%V%C%/%^!<%/(B" "Bookmark All Tabs..." )
+ ,manyp)))
+ "List of commands invoked by the tab button menu.
+Each item is the symbol `-' which is a separator,
+or a list which consists of the following elements:
+
+0: a function.
+1: a function description.
+2: a Lisp form which returns non-nil if the item is active.
+3: a flag specifying whether the buffer should be selected.
+&rest: arguments passed to the function.")
+
+(w3m-static-unless (featurep 'xemacs)
+ (easy-menu-define
+ w3m-tab-button-menu w3m-tab-map "w3m tab button menu."
+ (cons nil (w3m-make-menu-commands w3m-tab-button-menu-commands)))
+
+ ;; This function must be placed after `easy-menu-define'.
+ (defun w3m-tab-button-menu (event buffer)
+ (select-window (posn-window (event-start event)))
+ (setq w3m-tab-button-menu-current-buffer buffer)
+ (popup-menu w3m-tab-button-menu))
+
+ (defun w3m-tab-button-menu2 (event buffer)
+ (select-window (posn-window (event-start event)))
+ (setq w3m-tab-button-menu-current-buffer nil)
+ (popup-menu w3m-tab-button-menu)))
+
+(unless w3m-link-map
+ (setq w3m-link-map (make-sparse-keymap))
+ (cond ((featurep 'xemacs)
+ (define-key w3m-link-map [(button3)] 'w3m-link-menu))
+ ;; Don't use [mouse-3], which gets submenus not working in GTK Emacs.
+ ((featurep 'gtk)
+ (define-key w3m-link-map [down-mouse-3] 'w3m-link-menu)
+ (define-key w3m-link-map [drag-mouse-3] 'undefined)
+ (define-key w3m-link-map [mouse-3] 'undefined))
+ (t
+ (define-key w3m-link-map [mouse-3] 'w3m-link-menu))))
+
+(easy-menu-define w3m-link-menu w3m-link-map "w3m link menu."
+ `("Link" ;; This cannot be omitted for at least MacOS.
+ [,(w3m-make-menu-item "$B%j%s%/$r$3$N%;%C%7%g%s$G3+$/(B"
+ "Open Link in This Session")
+ w3m-view-this-url (w3m-anchor (point))]
+ [,(w3m-make-menu-item "$B%j%s%/$r?7$7$$%;%C%7%g%s$G3+$/(B"
+ "Open Link in New Session")
+ w3m-view-this-url-new-session (w3m-anchor (point))]
+ [,(w3m-make-menu-item "$B%j%s%/$r30It%V%i%&%6$G3+$/(B"
+ "Open Link in an External Browser")
+ w3m-external-view-this-url (w3m-anchor (point))]
+ "-"
+ [,(w3m-make-menu-item "$B$3$N%j%s%/$r%V%C%/%^!<%/(B..."
+ "Bookmark This Link...")
+ w3m-bookmark-add-this-url (w3m-anchor (point))]
+ [,(w3m-make-menu-item "$BL>A0$rIU$1$F%j%s%/@h$rJ]B8(B..."
+ "Save Link As...")
+ w3m-download-this-url (w3m-anchor (point))]
+ [,(w3m-make-menu-item "$BL>A0$rIU$1$F2hA|$rJ]B8(B..."
+ "Save Image As...")
+ w3m-download-this-image (w3m-image (point))]
+ [,(w3m-make-menu-item "$B%j%s%/$N(B URL $B$r%3%T!<(B"
+ "Copy Link Location")
+ w3m-print-this-url (w3m-anchor (point))]
+ [,(w3m-make-menu-item "$B2hA|$N(B URL $B$r%3%T!<(B"
+ "Copy Image Location")
+ w3m-print-this-image-url (w3m-image (point))]))
+
+(defun w3m-link-menu (event)
+ "Pop up a link menu."
+ (interactive "e")
+ (mouse-set-point event)
+ (popup-menu w3m-link-menu))
+
+(defvar w3m-buffer-unseen nil)
+(make-variable-buffer-local 'w3m-buffer-unseen)
+
+(defun w3m-set-buffer-unseen (&optional url)
+ (setq w3m-buffer-unseen t)
+ (w3m-add-local-hook 'pre-command-hook 'w3m-set-buffer-seen))
+
+(defun w3m-set-buffer-seen ()
+ (setq w3m-buffer-unseen nil)
+ (w3m-remove-local-hook 'pre-command-hook 'w3m-set-buffer-seen))
+
+(defun w3m-move-unseen-buffer ()
+ "Move to the next unseen buffer."
+ (interactive)
+ (when (eq major-mode 'w3m-mode)
+ (let* ((bufs (w3m-list-buffers))
+ (right (memq (current-buffer) bufs))
+ unseen)
+ (setq unseen
+ (catch 'unseen
+ (dolist (buf (append right bufs))
+ (when (w3m-unseen-buffer-p buf)
+ (throw 'unseen buf)))))
+ (if (not unseen)
+ (message "No unseen buffer.")
+ (switch-to-buffer unseen)
+ (run-hooks 'w3m-select-buffer-hook)
+ (w3m-select-buffer-update)))))
+
+(defun w3m-mode ()
+ "Major mode for browsing web.
+
+\\<w3m-mode-map>\
+\\[w3m-view-this-url] Display the page pointed to by the link under point.
+ You may use the prefix arg `2' or\
+ `\\[universal-argument] \\<universal-argument-map>\
+\\[universal-argument-more]\\<w3m-mode-map>' to make a new session.
+\\[w3m-mouse-view-this-url] Follow the link under the mouse pointer.
+ If w3m-use-form is t, `\\[w3m-view-this-url]' and\
+ `\\[w3m-mouse-view-this-url]' enable you to enter forms.
+ You may use the prefix arg `2' or\
+ `\\[universal-argument] \\<universal-argument-map>\
+\\[universal-argument-more]\\<w3m-mode-map>' to make a new session.
+\\[w3m-view-this-url-new-session] Display the page of the link\
+ in a new session.
+ If the region is active, visit all the links within the region.
+\\[w3m-mouse-view-this-url-new-session] Display the page of the link\
+ in a new session by mouse.
+
+\\[w3m-submit-form] Submit the form at point.
+
+\\[w3m-reload-this-page] Reload the current page.
+\\[w3m-reload-all-pages] Reload all the pages.
+\\[w3m-redisplay-this-page] Redisplay the current page.
+\\[w3m-redisplay-with-content-type] Redisplay the page, specifying\
+ a content type.
+\\[w3m-redisplay-with-charset] Redisplay the current page, specifying\
+ a charset.
+\\[w3m-redisplay-and-reset] Redisplay the current page and reset\
+ the user-specified charset and\n\tcontent type.
+
+\\[w3m-next-anchor] Move the point to the next anchor.
+\\[w3m-previous-anchor] Move the point to the previous anchor.
+\\[w3m-go-to-linknum] Move the point to the numbered anchor.
+\\[w3m-next-form] Move the point to the next form.
+\\[w3m-previous-form] Move the point to the previous form.
+\\[w3m-next-image] Move the point to the next image.
+\\[w3m-previous-image] Move the point to the previous image.
+
+\\[w3m-view-previous-page] Move back to the previous page in the history.
+\\[w3m-view-next-page] Move forward to the next page in the history.
+\\[w3m-view-parent-page] Attempt to move to the parent directory of\
+ the page.
+
+\\[w3m-goto-url] Visit the web page.
+\\[w3m-goto-url-new-session] Visit the web page in a new session.
+\\[w3m-gohome] Go to the Home page.
+\\[w3m-view-url-with-external-browser] Display the current page using the\
+ external browser.
+
+\\[w3m-download] Download the URL.
+\\[w3m-download-this-url] Download the URL under point.
+
+\\[w3m-view-image] Display the image under point in the external viewer.
+\\[w3m-save-image] Save the image under point to a file.
+\\[w3m-toggle-inline-images] Toggle the visibility of all images.
+\\[w3m-turnoff-inline-images] Turn off to display all images.
+\\[w3m-zoom-out-image] Zoom in an image on the point.
+\\[w3m-zoom-in-image] Zoom out an image on the point.
+
+\\[w3m-print-this-url] Display the url under point and put it into\
+ `kill-ring'.
+\\[w3m-print-current-url] Display the url of the current page and put\
+ it into `kill-ring'.
+
+\\[w3m-view-source] Display the html source of the current page.
+\\[w3m-view-header] Display the header of the current page.
+\\[w3m-edit-current-url] Edit the local file displayed as the current\
+ page.
+\\[w3m-edit-this-url] Edit the local file which is pointed to by URL under\
+ point.
+
+\\[w3m-scroll-up-or-next-url] Scroll up the current window, or go to the\
+ next page.
+\\[w3m-scroll-down-or-previous-url] Scroll down the current window, or\
+ go to the previous page.
+\\[w3m-scroll-left] Scroll to the left.
+\\[w3m-scroll-right] Scroll to the right.
+\\[w3m-shift-left] Shift to the left.
+\\[w3m-shift-right] Shift to the right.
+\\[w3m-horizontal-recenter] Recenter horizontally.
+\\[w3m-beginning-of-line] Go to the entire beginning of line, may be\
+ accompanied by scrolling.
+\\[w3m-end-of-line] Go to the entire end of line, may be accompanied\
+ by scrolling.
+
+\\[next-line] Next line.
+\\[previous-line] Previous line.
+\\[forward-char] Forward char.
+\\[backward-char] Backward char.
+
+\\[goto-line] Go to the line, specifying the line number (beginning with 1).
+\\[w3m-history-store-position] Mark the current position.
+\\[w3m-history-restore-position] Go to the last marked position.
+
+\\[w3m-history] Display the history of pages you have visited in the\
+ session.
+ If it is called with the prefix arg, it displays the arrived URLs.
+\\[w3m-antenna] Display the report of changes in web pages.
+ If it is called with the prefix arg, it updates the report.
+\\[w3m-antenna-add-current-url] Add the current url to the antenna database.
+\\[w3m-search] Query to the search engine a word.
+ To change the server, give any prefix argument to the command.
+\\[w3m-search-new-session] Query to the search engine a word in a new session.
+ To change the server, give any prefix argument to the command.
+\\[w3m-weather] Display a weather report.
+ To change the local area, give any prefix argument to the command.
+\\[w3m-dtree] Display a directory tree.
+ If the prefix arg is given, display files in addition to directories.
+\\[w3m-namazu] Search files with Namazu.
+ To change the index, give any prefix argument to the command.
+
+\\[w3m-bookmark-view] Display the bookmark.
+\\[w3m-bookmark-view-new-session] Display the bookmark on a new session.
+\\[w3m-bookmark-add-current-url] Add a url of the current page to\
+ the bookmark.
+ If the prefix arg is given, the user will be prompted for the url.
+\\[w3m-bookmark-add-all-urls] Add urls of all pages being visited to\
+ the bookmark.
+\\[w3m-bookmark-add-this-url] Add the url under point to the bookmark.
+
+\\[w3m-copy-buffer] Create a copy of the current page as a new session.
+\\[w3m-next-buffer] Turn the page of emacs-w3m buffers ahead.
+\\[w3m-previous-buffer] Turn the page of emacs-w3m buffers behind.
+\\[w3m-select-buffer] Pop to the emacs-w3m buffers selection window up.
+\\[w3m-switch-buffer] Select one of emacs-w3m buffers at the current window.
+\\[w3m-delete-buffer] Delete the current emacs-w3m buffer.
+\\[w3m-delete-other-buffers] Delete emacs-w3m buffers except for the\
+ current buffer.
+
+\\[w3m] Start browsing web with emacs-w3m.
+\\[w3m-close-window] Close all emacs-w3m windows, without deleteing\
+ buffers.
+\\[w3m-quit] Exit browsing web. All emacs-w3m buffers will be deleted.
+
+\\[describe-mode] describe-mode.
+
+\\[report-emacs-w3m-bug] Send a bug report to the emacs-w3m team.
+"
+ (kill-all-local-variables)
+ (buffer-disable-undo)
+ (setq major-mode 'w3m-mode)
+ (setq mode-name "w3m")
+ (use-local-map w3m-mode-map)
+ (setq truncate-lines t
+ w3m-display-inline-images w3m-default-display-inline-images)
+ (when w3m-auto-show
+ (when (boundp 'auto-hscroll-mode)
+ (set (make-local-variable 'auto-hscroll-mode) nil))
+ (when (boundp 'automatic-hscrolling)
+ (set (make-local-variable 'automatic-hscrolling) nil))
+ (when (boundp 'auto-show-mode)
+ (set (make-local-variable 'auto-show-mode) nil))
+ (when (boundp 'hscroll-mode)
+ (set (make-local-variable 'hscroll-mode) nil)))
+ (make-local-variable 'list-buffers-directory)
+ (w3m-static-unless (featurep 'xemacs)
+ (setq show-trailing-whitespace nil))
+ (w3m-setup-toolbar)
+ (w3m-setup-menu)
+ (run-hooks 'w3m-mode-setup-functions)
+ (w3m-run-mode-hooks 'w3m-mode-hook))
+
+(defun w3m-scroll-up-1 (&optional arg)
+ "Scroll the current window up ARG line.
+ARG will be fixed into 1 when this function is called interactively.
+This function avoids the bug that Emacs 21.x hangs up when scrolling
+up for too many number of lines if `scroll-margin' is set as two or
+greater."
+ (interactive '(1))
+ (w3m-static-unless (featurep 'xemacs)
+ (when (and (numberp arg)
+ (> arg 0)
+ (numberp scroll-margin)
+ (> scroll-margin 0))
+ (setq arg (min arg
+ (max 0 (- (count-lines (window-start) (point-max))
+ scroll-margin))))))
+ (scroll-up arg))
+
+(defun w3m-scroll-up-or-next-url (arg)
+ "Scroll the current window up ARG lines, or go to the next page."
+ (interactive "P")
+ (w3m-keep-region-active)
+ (if (pos-visible-in-window-p (point-max))
+ (if w3m-next-url
+ (let ((w3m-prefer-cache t))
+ (w3m-goto-url w3m-next-url))
+ (signal 'end-of-buffer nil))
+ (w3m-scroll-up-1 arg)))
+
+(defun w3m-scroll-down-or-previous-url (arg)
+ "Scroll the current window down ARG lines, or go to the previous page."
+ (interactive "P")
+ (w3m-keep-region-active)
+ (if (pos-visible-in-window-p (point-min))
+ (if w3m-previous-url
+ (let ((w3m-prefer-cache t))
+ (w3m-goto-url w3m-previous-url))
+ (signal 'beginning-of-buffer nil))
+ (scroll-down arg)))
+
+(defvar w3m-current-longest-line nil
+ "The length of the longest line in the window.")
+
+(defun w3m-set-current-longest-line ()
+ "Set the value of `w3m-current-longest-line'."
+ (save-excursion
+ (goto-char (window-start))
+ (end-of-line)
+ (setq w3m-current-longest-line 0)
+ ;; The XEmacs version of `window-end' returns the point beyond
+ ;; `point-max' if it is visible in the window.
+ (let ((end (min (window-end) (point-max))))
+ (while (progn
+ (skip-chars-backward " ")
+ (setq w3m-current-longest-line
+ (max w3m-current-longest-line (current-column)))
+ (end-of-line 2)
+ (< (point) end))))))
+
+(defun w3m-scroll-left (arg)
+ "Scroll to the left.
+If ARG (the prefix) is a number, scroll the window ARG columns.
+Otherwise, it defaults to `w3m-horizontal-scroll-columns'."
+ (interactive "P")
+ (when (if (memq last-command '(w3m-scroll-left w3m-shift-left))
+ (or (< (window-hscroll) w3m-current-longest-line)
+ (progn (ding) nil))
+ (w3m-set-current-longest-line)
+ (< (window-hscroll) w3m-current-longest-line))
+ (w3m-horizontal-scroll 'left (if arg
+ (prefix-numeric-value arg)
+ w3m-horizontal-scroll-columns))))
+
+(defun w3m-scroll-right (arg)
+ "Scroll to the right.
+If ARG (the prefix) is a number, scroll the window ARG columns.
+Otherwise, it defaults to `w3m-horizontal-scroll-columns'."
+ (interactive "P")
+ (if (zerop (window-hscroll))
+ (when (memq last-command '(w3m-scroll-right w3m-shift-right))
+ (ding))
+ (w3m-horizontal-scroll 'right (if arg
+ (prefix-numeric-value arg)
+ w3m-horizontal-scroll-columns))))
+
+(defun w3m-shift-left (arg)
+ "Shift to the left. Shift means a fine level horizontal scrolling.
+If ARG (the prefix) is a number, scroll the window ARG columns.
+Otherwise, it defaults to `w3m-horizontal-shift-columns'."
+ (interactive "P")
+ (when (if (memq last-command '(w3m-scroll-left w3m-shift-left))
+ (or (< (window-hscroll) w3m-current-longest-line)
+ (progn (ding) nil))
+ (w3m-set-current-longest-line)
+ (< (window-hscroll) w3m-current-longest-line))
+ (w3m-horizontal-scroll 'left (if arg
+ (prefix-numeric-value arg)
+ w3m-horizontal-shift-columns))))
+
+(defun w3m-shift-right (arg)
+ "Shift to the right. Shift means a fine level horizontal scrolling.
+If ARG (the prefix) is a number, scroll the window ARG columns.
+Otherwise, it defaults to `w3m-horizontal-shift-columns'."
+ (interactive "P")
+ (if (zerop (window-hscroll))
+ (when (memq last-command '(w3m-scroll-right w3m-shift-right))
+ (ding))
+ (w3m-horizontal-scroll 'right (if arg
+ (prefix-numeric-value arg)
+ w3m-horizontal-shift-columns))))
+
+(defvar w3m-horizontal-scroll-done nil)
+(make-variable-buffer-local 'w3m-horizontal-scroll-done)
+(defvar w3m-current-position '(-1 0 0))
+(make-variable-buffer-local 'w3m-current-position)
+
+(defun w3m-auto-show ()
+ "Scroll horizontally so that the point is visible."
+ (when (and truncate-lines
+ w3m-auto-show
+ (not w3m-horizontal-scroll-done)
+ (not (and (eq last-command this-command)
+ (or (eq (point) (point-min))
+ (eq (point) (point-max)))))
+ (or (memq this-command '(beginning-of-buffer end-of-buffer))
+ (string-match "\\`i?search-" (symbol-name this-command))
+ (and (markerp (nth 1 w3m-current-position))
+ (markerp (nth 2 w3m-current-position))
+ (>= (point)
+ (marker-position (nth 1 w3m-current-position)))
+ (<= (point)
+ (marker-position (nth 2 w3m-current-position))))))
+ (w3m-horizontal-on-screen))
+ (setq w3m-horizontal-scroll-done nil))
+
+;; Ailiases to meet XEmacs bugs?
+(eval-and-compile
+ (unless (fboundp 'w3m-window-hscroll)
+ (defalias 'w3m-window-hscroll 'window-hscroll))
+ (unless (fboundp 'w3m-current-column)
+ (defalias 'w3m-current-column 'current-column))
+ (unless (fboundp 'w3m-set-window-hscroll)
+ (defalias 'w3m-set-window-hscroll 'set-window-hscroll)))
+
+(defun w3m-horizontal-scroll (direction ncol)
+ "Scroll the window NCOL columns horizontally to DIRECTION.
+DIRECTON should be the symbol `left' which specifies to scroll to the
+left, or any other Lisp object meaning to scroll to the right. NCOL
+should be a number. This function is a subroutine called by the
+commands `w3m-scroll-left', `w3m-scroll-right', `w3m-shift-left' and
+`w3m-shift-right'."
+ (setq w3m-horizontal-scroll-done t)
+ (let ((inhibit-point-motion-hooks t))
+ (w3m-set-window-hscroll (selected-window)
+ (max 0
+ (+ (w3m-window-hscroll)
+ (if (eq direction 'left) ncol (- ncol)))))
+ (let ((hs (w3m-window-hscroll)))
+ (unless (and (>= (- (current-column) hs) 0)
+ (< (- (current-column) hs) (window-width)))
+ (move-to-column (if (eq direction 'left) hs
+ (+ hs (window-width)
+ (w3m-static-if (featurep 'xemacs) -3 -2))))))))
+
+(defun w3m-horizontal-on-screen ()
+ "Scroll the window horizontally so that the current position is visible.
+See the documentation for the `w3m-horizontal-scroll-division' variable
+for details."
+ (when w3m-auto-show
+ (setq w3m-horizontal-scroll-done t)
+ (let ((cc (w3m-current-column))
+ (hs (w3m-window-hscroll))
+ (ww (window-width))
+ (inhibit-point-motion-hooks t))
+ (unless (and (>= (- cc hs) 0)
+ (< (+ (- cc hs) (if (eolp)
+ 0
+ (w3m-static-if (featurep 'xemacs)
+ 3 2))) ;; '$$'
+ ww))
+ (w3m-set-window-hscroll
+ (selected-window)
+ (max 0 (- cc (if (> hs cc)
+ (/ ww w3m-horizontal-scroll-division)
+ (* (/ ww w3m-horizontal-scroll-division)
+ (1- w3m-horizontal-scroll-division))))))))))
+
+(defun w3m-horizontal-recenter (&optional arg)
+ "Recenter horizontally. With ARG, put the point on the column ARG.
+If `truncate-lines' is nil, it does nothing besides resetting the
+window's hscroll."
+ (interactive "P")
+ (if truncate-lines
+ (progn
+ (cond ((< (w3m-current-column) (window-hscroll))
+ (move-to-column (w3m-window-hscroll))
+ (setq arg 0))
+ ((>= (w3m-current-column) (+ (window-hscroll) (window-width)))
+ (move-to-column (+ (w3m-window-hscroll) (window-width) -2))
+ (setq arg -1))
+ ((listp arg)
+ (setq arg (car arg))))
+ (w3m-set-window-hscroll
+ (selected-window)
+ (if (numberp arg)
+ (if (>= arg 0)
+ (max (- (current-column) arg) 0)
+ (let* ((home (point))
+ (inhibit-point-motion-hooks t)
+ (maxcolumn (prog2
+ (end-of-line)
+ (1- (current-column))
+ (goto-char home))))
+ (max (min (- (current-column)
+ (window-width)
+ arg
+ -2)
+ maxcolumn)
+ 0)))
+ (max (- (current-column) (/ (window-width) 2) -1)
+ 0))))
+ (set-window-hscroll (selected-window) 0)))
+
+(defun w3m-recenter ()
+ "Recenter according to `w3m-view-recenter'."
+ (when (and w3m-view-recenter
+ (eq (window-buffer) (current-buffer)))
+ (recenter (if (eq t w3m-view-recenter)
+ '(4) ;; per "C-u C-l" to recenter in middle
+ w3m-view-recenter)))) ;; otherwise an integer
+
+(defun w3m-beginning-of-line (&optional arg)
+ "Make the beginning of the line visible and move the point to there."
+ (interactive "P")
+ (w3m-keep-region-active)
+ (when (listp arg)
+ (setq arg (car arg)))
+ (set-window-hscroll (selected-window) 0)
+ (beginning-of-line arg))
+
+(defun w3m-end-of-line (&optional arg)
+ "Move the point to the end of the line and scroll the window left.
+It makes the ends of upper and lower three lines visible. If
+`truncate-lines' is nil, it works identically as `end-of-line'."
+ (interactive "P")
+ (w3m-keep-region-active)
+ (if truncate-lines
+ (progn
+ (when (listp arg)
+ (setq arg (car arg)))
+ (forward-line (1- (or arg 1)))
+ (let ((inhibit-point-motion-hooks t)
+ home)
+ (end-of-line)
+ (setq home (point)
+ arg (current-column))
+ (dolist (n '(-3 -2 -1 1 2 3))
+ (forward-line n)
+ (end-of-line)
+ (setq arg (max (current-column) arg))
+ (goto-char home)))
+ (setq temporary-goal-column arg
+ this-command 'next-line)
+ (w3m-set-window-hscroll (selected-window)
+ (max (- arg (window-width) -2) 0)))
+ (set-window-hscroll (selected-window) 0)
+ (end-of-line arg)))
+
+(defun w3m-pattern-uri-replace (uri format)
+ "Create a new uri from URI matched by last search according to FORMAT."
+ (replace-match format nil nil uri))
+
+(defun w3m-uri-replace (uri)
+ "Return the converted URI according to `w3m-uri-replace-alist'."
+ (catch 'found-replacement
+ (dolist (elem w3m-uri-replace-alist uri)
+ (when (string-match (car elem) uri)
+ (if (setq uri
+ (cond
+ ((consp (cdr elem))
+ (apply (cadr elem) uri (cddr elem)))
+ ;; Rest conditions are inserted in order to keep
+ ;; backward compatibility.
+ ((functionp (cdr elem))
+ (funcall (cdr elem) uri))
+ ((stringp (cdr elem))
+ (w3m-pattern-uri-replace uri (cdr elem)))))
+ (throw 'found-replacement uri)
+ (error "Invalid replacement: %s" elem))))))
+
+(defun w3m-goto-mailto-url (url &optional post-data)
+ (let ((before (nreverse (buffer-list)))
+ comp info buffers buffer function)
+ (save-window-excursion
+ (if (and (symbolp w3m-mailto-url-function)
+ (fboundp w3m-mailto-url-function))
+ (funcall w3m-mailto-url-function url)
+ ;; Require `mail-user-agent' setting
+ (unless (and (boundp 'mail-user-agent)
+ (symbol-value 'mail-user-agent))
+ (error "You must specify the valid value to `mail-user-agent'"))
+ (unless (and (setq comp (get (symbol-value 'mail-user-agent)
+ 'composefunc))
+ (fboundp comp))
+ (error "No function to compose a mail in `%s'"
+ (symbol-value 'mail-user-agent)))
+ ;; Use rfc2368.el if exist.
+ ;; rfc2368.el is written by Sen Nagata.
+ ;; You can find it in "contrib" directory of Mew package
+ ;; or in "utils" directory of Wanderlust package.
+ (if (or (featurep 'rfc2368)
+ (condition-case nil (require 'rfc2368) (error nil)))
+ (progn
+ (setq info (rfc2368-parse-mailto-url url))
+ (apply comp
+ (append (mapcar (lambda (x)
+ (cdr (assoc x info)))
+ '("To" "Subject"))
+ (if post-data
+ (list
+ (list (cons
+ "body"
+ (or (and
+ (consp post-data)
+ (concat (car post-data) "\n"))
+ (concat post-data "\n")))))))))
+ ;; without rfc2368.el.
+ (string-match ":\\([^?]+\\)" url)
+ (funcall comp (match-string 1 url)))))
+ (setq buffers (nreverse (buffer-list)))
+ (save-current-buffer
+ (while buffers
+ (setq buffer (car buffers)
+ buffers (cdr buffers))
+ (unless (memq buffer before)
+ (set-buffer buffer)
+ (when (setq function
+ (cdr (assq major-mode
+ w3m-mailto-url-popup-function-alist)))
+ (setq buffers nil)))))
+ (when function
+ (let (special-display-buffer-names
+ special-display-regexps
+ same-window-buffer-names
+ same-window-regexps)
+ (funcall function buffer)))))
+
+(defun w3m-convert-ftp-url-for-emacsen (url)
+ (or (and (string-match "^ftp://?\\([^/@]+@\\)?\\([^/]+\\)\\(?:/~/\\)?" url)
+ (concat "/"
+ (if (match-beginning 1)
+ (substring url (match-beginning 1) (match-end 1))
+ "anonymous@")
+ (substring url (match-beginning 2) (match-end 2))
+ ":"
+ (substring url (match-end 2))))
+ (error "URL is strange")))
+
+(defun w3m-file-directory-p (file)
+ "Emulate the `file-directory-p' function for the remote file FILE."
+ (when (file-exists-p file)
+ (let (dirp (i 10))
+ (catch 'loop
+ (while (> i 0)
+ (setq dirp (car (file-attributes file)))
+ (if (stringp dirp)
+ (setq file (expand-file-name
+ dirp
+ (file-name-directory (directory-file-name file)))
+ i (1- i))
+ (throw 'loop dirp)))))))
+
+(defun w3m-goto-ftp-url (url &optional filename)
+ "Copy a remote file to the local system or run dired for ftp URLs.
+If URL looks like a file, it will perform the copy. Otherwise, it
+will run `dired-other-window' using `ange-ftp' or `efs'. Optional
+FILENAME specifies the name of a local file. If FILENAME is omitted,
+this function will prompt user for it."
+ (let ((ftp (w3m-convert-ftp-url-for-emacsen url))
+ file)
+ (if (or (string-equal "/" (substring ftp -1))
+ ;; `file-directory-p' takes a long time for remote files.
+ ;; `file-directory-p' returns t in Emacsen, anytime.
+ (w3m-file-directory-p ftp))
+ (dired-other-window ftp)
+ (setq file (file-name-nondirectory ftp))
+ (unless filename
+ (setq filename (w3m-read-file-name nil nil file)))
+ (unless (file-writable-p (file-name-directory filename))
+ (error "Permission denied, %s" (file-name-directory filename)))
+ (when (or (not (file-exists-p filename))
+ (if (file-writable-p filename)
+ (and (prog1
+ (y-or-n-p
+ (format "File(%s) already exists. Overwrite? "
+ filename))
+ (message nil))
+ (progn
+ (delete-file filename)
+ t))
+ (error "Permission denied, %s" filename)))
+ (copy-file ftp filename)
+ (message "Wrote %s" filename)))))
+
+(unless w3m-doc-view-map
+ (setq w3m-doc-view-map (make-sparse-keymap))
+ (define-key w3m-doc-view-map "q" 'w3m-doc-view-quit))
+
+(defun w3m-doc-view (url)
+ "View PDF/PostScript/DVI files using `doc-view-mode'.
+`w3m-pop-up-windows' and `w3m-pop-up-frames' control how the document
+window turns up."
+ (let* ((basename (file-name-nondirectory (w3m-url-strip-query url)))
+ (regexp (concat "\\`" (regexp-quote basename) "\\(?:<[0-9]+>\\)?\\'"))
+ (buffers (buffer-list))
+ buffer data case-fold-search)
+ (save-current-buffer
+ (while buffers
+ (setq buffer (pop buffers))
+ (if (and (string-match regexp (buffer-name buffer))
+ (progn
+ (set-buffer buffer)
+ (eq major-mode 'doc-view-mode))
+ (equal buffer-file-name url))
+ (setq buffers nil)
+ (setq buffer nil))))
+ (unless (prog1
+ buffer
+ (unless buffer
+ (setq buffer (generate-new-buffer basename)
+ data (buffer-string)))
+ (let ((pop-up-windows w3m-pop-up-windows)
+ (pop-up-frames w3m-pop-up-frames))
+ (pop-to-buffer buffer)))
+ (set-buffer-multibyte nil)
+ (insert data)
+ (set-buffer-modified-p nil)
+ (setq buffer-file-name url)
+ (doc-view-mode)
+ (use-local-map w3m-doc-view-map)
+ (set-keymap-parent w3m-doc-view-map doc-view-mode-map)
+ 'internal-view)))
+
+(defun w3m-doc-view-quit (&optional kill)
+ "Quit the `doc-view-mode' window that emacs-w3m launches.
+With the prefix argument KILL, kill the buffer."
+ (interactive "P")
+ (cond (w3m-pop-up-frames
+ (when (prog1 (one-window-p t) (quit-window kill))
+ (delete-frame (selected-frame))))
+ (w3m-pop-up-windows
+ (if (fboundp 'quit-window)
+ (quit-window kill)
+ (if kill
+ (progn
+ (set-buffer-modified-p nil)
+ (kill-buffer (current-buffer)))
+ (bury-buffer)))
+ (unless (eq (next-window nil 'no-mini) (selected-window))
+ (delete-window)))))
+
+(eval-and-compile
+ (unless (fboundp 'w3m-add-local-hook)
+ ;; Silence the byte compiler; `w3m-add-local-hook' will be defined
+ ;; in w3m-ems.el for GNU Emacs.
+ (eval-when-compile
+ (when (eq 'byte-compile-obsolete (get 'make-local-hook 'byte-compile))
+ (put 'make-local-hook 'byte-compile nil)
+ (put 'make-local-hook 'byte-obsolete-info nil)))
+ (defun w3m-add-local-hook (hook function &optional append)
+ "Add to the buffer-local value of HOOK the function FUNCTION.
+This function is designed for XEmacs."
+ (make-local-hook hook)
+ (add-hook hook function append t))
+ (defun w3m-remove-local-hook (hook function)
+ "Remove to the buffer-local value of HOOK the function FUNCTION.
+This function is designed for XEmacs."
+ (remove-hook hook function t))))
+
+(defun w3m-store-current-position ()
+ "Memorize the current positions whenever every command starts.
+The value will be held in the `w3m-current-position' variable. This
+function is designed as the hook function which is registered to
+`pre-command-hook' by `w3m-buffer-setup'."
+ (setq w3m-current-position (list (point)
+ (copy-marker (point-at-bol))
+ (copy-marker (point-at-eol)))))
+
+(defun w3m-check-current-position ()
+ "Run `w3m-after-cursor-move-hook' if the point gets away from the window.
+This function is designed as the hook function which is registered to
+`post-command-hook' by `w3m-buffer-setup'."
+ (when (/= (point) (car w3m-current-position))
+ ;; To bind `deactivate-mark' to nil protects the mark from being
+ ;; deactivated. `deactivate-mark' is set when any function modifies
+ ;; a buffer, and it causes the deactivation of the mark.
+ (let ((deactivate-mark nil))
+ (run-hooks 'w3m-after-cursor-move-hook))))
+
+(defun w3m-buffer-setup ()
+ "Generate a new buffer, select it and set it up for emacs-w3m.
+When the current buffer has already been prepared, it won't bother to
+generate a new buffer."
+ (unless (eq major-mode 'w3m-mode)
+ (let ((buffer (w3m-alive-p t)))
+ (if buffer
+ (set-buffer buffer)
+ (set-buffer (w3m-generate-new-buffer "*w3m*"))
+ (w3m-mode))))
+ ;; It may have been set to nil for viewing a page source or a header.
+ (setq truncate-lines t)
+ (w3m-add-local-hook 'pre-command-hook 'w3m-store-current-position)
+ (w3m-add-local-hook 'post-command-hook 'w3m-check-current-position)
+ (w3m-initialize-graphic-icons)
+ (setq mode-line-buffer-identification
+ `(,@(w3m-static-if (featurep 'xemacs)
+ (list (cons modeline-buffer-id-right-extent "%b") " ")
+ (nconc (propertized-buffer-identification "%b") '(" ")))
+ (w3m-current-process
+ w3m-modeline-process-status-on
+ (w3m-current-ssl
+ (w3m-display-inline-images
+ w3m-modeline-ssl-image-status-on
+ w3m-modeline-ssl-status-off)
+ (w3m-display-inline-images
+ w3m-modeline-image-status-on
+ w3m-modeline-status-off)))
+ (w3m-show-graphic-icons-in-mode-line
+ (w3m-use-favicon
+ (w3m-favicon-image
+ w3m-modeline-favicon
+ w3m-modeline-separator)
+ w3m-modeline-separator)
+ w3m-modeline-separator)
+ (w3m-current-process
+ "Loading..." ,(if (fboundp 'format-mode-line)
+ '(:eval (w3m-modeline-title))
+ (if w3m-use-title-buffer-name
+ ""
+ 'w3m-current-title)))))
+ (unless (assq 'w3m-current-process mode-line-process)
+ (setq mode-line-process
+ (cons (list 'w3m-current-process 'w3m-process-modeline-string)
+ mode-line-process))))
+
+(defvar w3m-modeline-title-string nil
+ "Internal variable used to keep contents to be shown in the mode line.
+This is a buffer-local variable.")
+(make-variable-buffer-local 'w3m-modeline-title-string)
+
+(defvar w3m-modeline-title-timer nil
+ "Say time has not gone by after the mode line was updated last time.
+It is used to control the `w3m-modeline-title' function running too
+frequently, set by the function itself and cleared by a timer.")
+(make-variable-buffer-local 'w3m-modeline-title-timer)
+
+(eval-when-compile
+ (unless (fboundp 'format-mode-line)
+ (defalias 'format-mode-line 'ignore)))
+
+(defun w3m-modeline-title ()
+ "Return a truncated title not to cut the right end of the mode line.
+It currently works only with Emacs 22 and newer."
+ (if w3m-use-title-buffer-name
+ ""
+ (when w3m-current-title
+ (or (and w3m-modeline-title-timer w3m-modeline-title-string)
+ (prog2
+ (setq w3m-modeline-title-string w3m-current-title
+ w3m-modeline-title-timer t)
+ (let ((excess (- (string-width
+ (condition-case nil
+ (format-mode-line mode-line-format 1)
+ (error "")))
+ (window-width)))
+ (tlen (string-width w3m-current-title)))
+ (when (and (> excess 0)
+ (> tlen 3))
+ (setq w3m-modeline-title-string
+ (concat (w3m-replace-in-string
+ (w3m-truncate-string
+ w3m-current-title (max (- tlen excess 3) 2))
+ "[\t ]+\\'" "")
+ "...")))
+ w3m-modeline-title-string)
+ (run-at-time 0.5 nil
+ (lambda (buffer)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (setq w3m-modeline-title-timer nil))))
+ (current-buffer)))))))
+
+(defconst w3m-buffer-local-url "buffer://")
+(defun w3m-buffer-local-url-p (url)
+ (save-match-data
+ (string-match (concat "^" w3m-buffer-local-url) url)))
+
+;;;###autoload
+(defun w3m-goto-url (url &optional reload charset post-data referer handler
+ element no-popup)
+ "Visit World Wide Web pages. This is the primitive function of `w3m'.
+If the second argument RELOAD is non-nil, reload a content of URL.
+Except that if it is 'redisplay, re-display the page without reloading.
+The third argument CHARSET specifies a charset to be used for decoding
+a content.
+The fourth argument POST-DATA should be a string or a cons cell. If
+it is a string, it makes this function request a body as if the
+content-type is \"x-www-form-urlencoded\". If it is a cons cell, the
+car of a cell is used as the content-type and the cdr of a cell is
+used as the body.
+If the fifth argument REFERER is specified, it is used for a Referer:
+field for this request.
+The remaining HANDLER, ELEMENT[1], and NO-POPUP are for the
+internal operations of emacs-w3m.
+You can also use \"quicksearch\" url schemes such as \"gg:emacs\" which
+would search for the term \"emacs\" with the Google search engine. See
+the `w3m-search' function and the variable `w3m-uri-replace-alist'.
+
+\[1] A note for the developers: ELEMENT is a history element which has
+already been registered in the `w3m-history-flat' variable. It is
+corresponding to URL to be retrieved at this time, not for the url of
+the current page."
+ (interactive
+ (list (w3m-input-url nil nil nil nil 'feeling-lucky)
+ current-prefix-arg
+ (w3m-static-if (fboundp 'universal-coding-system-argument)
+ coding-system-for-read)))
+ (when (and (stringp url)
+ (not (interactive-p)))
+ (setq url (w3m-canonicalize-url url)))
+ (set-text-properties 0 (length url) nil url)
+ (setq url (w3m-uri-replace url))
+ (unless (or (w3m-url-local-p url)
+ (string-match "\\`about:" url))
+ (w3m-string-match-url-components url)
+ (setq url (concat (w3m-url-transfer-encode-string (substring url 0 (match-beginning 8))
+ (or w3m-current-coding-system
+ w3m-default-coding-system))
+ (if (match-beginning 8)
+ (concat "#" (match-string 9 url))
+ ""))))
+ (cond
+ ;; process mailto: protocol
+ ((string-match "\\`mailto:" url)
+ (w3m-goto-mailto-url url post-data))
+ ;; process ftp: protocol
+ ((and w3m-use-ange-ftp
+ (string-match "\\`ftps?://" url)
+ (not (string= "text/html" (w3m-local-content-type url))))
+ (w3m-goto-ftp-url url))
+ ;; find-file directly
+ ((condition-case nil
+ (and (w3m-url-local-p url)
+ w3m-local-find-file-function
+ (let ((base-url (w3m-url-strip-fragment url))
+ (match (car w3m-local-find-file-regexps))
+ nomatch file)
+ (and (or (not match)
+ (string-match match base-url))
+ (not (and (setq nomatch (cdr w3m-local-find-file-regexps))
+ (string-match nomatch base-url)))
+ (setq file (w3m-url-to-file-name base-url))
+ (file-exists-p file)
+ (not (file-directory-p file))
+ (prog1
+ t
+ (funcall (if (functionp w3m-local-find-file-function)
+ w3m-local-find-file-function
+ (eval w3m-local-find-file-function))
+ file)))))
+ (error nil)))
+ ;; process buffer-local url
+ ((w3m-buffer-local-url-p url)
+ (let (file-part fragment-part)
+ (w3m-string-match-url-components url)
+ (setq file-part (concat (match-string 4 url)
+ (match-string 5 url))
+ fragment-part (match-string 9 url))
+ (cond
+ ((and (string= file-part "")
+ fragment-part)
+ (w3m-search-name-anchor fragment-part))
+ ((not (string= file-part ""))
+ (w3m-goto-url (w3m-expand-url (substring url (match-beginning 4))
+ (concat "file://" default-directory))
+ reload charset post-data referer handler element))
+ (t (w3m-message "No URL at point")))))
+ ((w3m-url-valid url)
+ (w3m-buffer-setup) ; Setup buffer.
+ (w3m-arrived-setup) ; Setup arrived database.
+ (unless no-popup
+ (w3m-popup-buffer (current-buffer)))
+ (w3m-cancel-refresh-timer (current-buffer))
+ (when w3m-current-process
+ (error "%s"
+ (substitute-command-keys "
+Cannot run two w3m processes simultaneously \
+\(Type `\\<w3m-mode-map>\\[w3m-process-stop]' to stop asynchronous process)")))
+ (w3m-process-stop (current-buffer)) ; Stop all processes retrieving images.
+ (w3m-idle-images-show-unqueue (current-buffer))
+ ;; Access url group
+ (if (string-match "\\`group:" url)
+ (let ((urls (mapcar 'w3m-url-decode-string
+ (split-string (substring url (match-end 0)) "&")))
+ (w3m-async-exec (and w3m-async-exec-with-many-urls
+ w3m-async-exec)))
+ (w3m-process-do
+ (type (prog1
+ (w3m-goto-url (car urls))
+ (dolist (url (cdr urls))
+ (save-window-excursion
+ (with-current-buffer (w3m-copy-buffer nil nil nil
+ 'empty)
+ (w3m-goto-url url))))))
+ type))
+ ;; Retrieve the page.
+ (lexical-let ((orig url)
+ (url (w3m-url-strip-authinfo url))
+ (reload (and (not (eq reload 'redisplay)) reload))
+ (redisplay (eq reload 'redisplay))
+ (charset charset)
+ (post-data post-data)
+ (referer referer)
+ (name)
+ (history-position (get-text-property (point)
+ 'history-position))
+ (reuse-history w3m-history-reuse-history-elements))
+ (when w3m-current-forms
+ ;; Store the current forms in the history structure.
+ (w3m-history-plist-put :forms w3m-current-forms))
+ (let ((w3m-current-buffer (current-buffer)))
+ (unless element
+ (setq element
+ (if (and (equal referer "about://history/")
+ history-position)
+ (w3m-history-element history-position t)
+ (if w3m-history-reuse-history-elements
+ (w3m-history-assoc url)))))
+ ;; Set current forms using the history structure.
+ (when (setq w3m-current-forms
+ (when (and (not reload) ; If reloading, ignore history.
+ (null post-data) ; If post, ignore history.
+ (or (w3m-cache-available-p url)
+ (w3m-url-local-p url)))
+ ;; Don't use `w3m-history-plist-get' here.
+ (plist-get (nthcdr 3 element) :forms)))
+ ;; Mark that the form is from history structure.
+ (setq w3m-current-forms (cons t w3m-current-forms)))
+ (when (and post-data element)
+ ;; Remove processing url's forms from the history structure.
+ (w3m-history-set-plist (cadr element) :forms nil))
+ ;; local directory URL check
+ (when (and (w3m-url-local-p url)
+ (file-directory-p (w3m-url-to-file-name url))
+ (setq url (file-name-as-directory url))
+ (eq w3m-local-directory-view-method 'w3m-dtree)
+ (string-match "\\`file:///" url))
+ (setq url (replace-match "about://dtree/" nil nil url)
+ orig url))
+ ;; Split body and fragments.
+ (w3m-string-match-url-components url)
+ (and (match-beginning 8)
+ (setq name (match-string 9 url)
+ url (substring url 0 (match-beginning 8))))
+ (when (w3m-url-local-p url)
+ (unless (string-match "[^\000-\177]" url)
+ (setq url (w3m-url-decode-string url))))
+ (w3m-process-do
+ (action
+ (if (and (not reload)
+ (not redisplay)
+ (stringp w3m-current-url)
+ (string= url w3m-current-url))
+ (progn
+ (w3m-refontify-anchor)
+ 'cursor-moved)
+ (when w3m-name-anchor-from-hist
+ (w3m-history-plist-put
+ :name-anchor-hist
+ (append (list 1 nil)
+ (and (integerp (car w3m-name-anchor-from-hist))
+ (nthcdr (1+ (car w3m-name-anchor-from-hist))
+ w3m-name-anchor-from-hist)))))
+ (setq w3m-name-anchor-from-hist
+ (plist-get (nthcdr 3 element) :name-anchor-hist))
+ (setq w3m-current-process
+ (w3m-retrieve-and-render orig reload charset
+ post-data referer handler))))
+ (with-current-buffer w3m-current-buffer
+ (setq w3m-current-process nil)
+ (if (not action)
+ (progn
+ (w3m-history-push w3m-current-url
+ (list :title (or w3m-current-title
+ "<no-title>")))
+ (goto-char (point-min)))
+ (if (and name
+ (progn
+ ;; Redisplay to search an anchor sure.
+ (sit-for 0)
+ (w3m-search-name-anchor
+ (w3m-url-transfer-encode-string name
+ (or w3m-current-coding-system
+ w3m-default-coding-system))
+ nil (not (eq action 'cursor-moved)))))
+ (setf (w3m-arrived-time (w3m-url-strip-authinfo orig))
+ (w3m-arrived-time url))
+ (goto-char (point-min)))
+ (unless (eq action 'cursor-moved)
+ (if (equal referer "about://history/")
+ ;; Don't sprout a new branch for the existing history
+ ;; element.
+ (let ((w3m-history-reuse-history-elements t))
+ (w3m-history-push w3m-current-url
+ (list :title w3m-current-title))
+ ;; Fix the history position pointers.
+ (when history-position
+ (setcar w3m-history
+ (w3m-history-regenerate-pointers
+ history-position))))
+ (let ((w3m-history-reuse-history-elements reuse-history)
+ (position (when (eq 'reload reuse-history)
+ (cadar w3m-history))))
+ (w3m-history-push w3m-current-url
+ (list :title w3m-current-title))
+ (when position
+ (w3m-history-set-current position))))
+ (w3m-history-add-properties (list :referer referer
+ :post-data post-data))
+ (unless w3m-toggle-inline-images-permanently
+ (setq w3m-display-inline-images
+ w3m-default-display-inline-images))
+ (when (and w3m-use-form reload)
+ (w3m-form-textarea-files-remove))
+ (cond ((w3m-display-inline-images-p)
+ (and w3m-force-redisplay (sit-for 0))
+ (w3m-toggle-inline-images 'force reload))
+ ((and (w3m-display-graphic-p)
+ (eq action 'image-page))
+ (and w3m-force-redisplay (sit-for 0))
+ (w3m-toggle-inline-image 'force reload)))))
+ (setq buffer-read-only t)
+ (set-buffer-modified-p nil)
+ (setq list-buffers-directory w3m-current-title)
+ ;; must be `w3m-current-url'
+ (setq default-directory (w3m-current-directory w3m-current-url))
+ (w3m-buffer-name-add-title)
+ (w3m-update-toolbar)
+ (w3m-select-buffer-update)
+ (let ((real-url (if (w3m-arrived-p url)
+ (or (w3m-real-url url) url)
+ url)))
+ (run-hook-with-args 'w3m-display-functions real-url)
+ (run-hook-with-args 'w3m-display-hook real-url))
+ (w3m-session-crash-recovery-save)
+ (when (and w3m-current-url
+ (stringp w3m-current-url)
+ (or (string-match
+ "\\`about://\\(?:header\\|source\\)/"
+ w3m-current-url)
+ (equal (w3m-content-type w3m-current-url)
+ "text/plain")))
+ (setq truncate-lines nil))
+ ;; restore position must call after hooks for localcgi.
+ (when (or reload redisplay)
+ (w3m-history-restore-position))
+ (w3m-set-buffer-unseen)
+ (w3m-refresh-at-time)))))))
+ (t (w3m-message "Invalid URL: %s" url))))
+
+(defun w3m-current-directory (url)
+ "Return a directory used as the current directory in a page visiting URL.
+See `w3m-default-directory'."
+ (or (and url
+ (stringp url)
+ (let (file)
+ (if (string-match "\\`ftp://" url)
+ (progn
+ (setq file (w3m-convert-ftp-url-for-emacsen url))
+ (file-name-as-directory
+ (if (string-match "/\\`" file)
+ file
+ (file-name-directory file))))
+ (and (setq file (w3m-url-to-file-name url))
+ (file-exists-p file)
+ (file-name-as-directory
+ (if (file-directory-p file)
+ file
+ (file-name-directory file)))))))
+ (let (directory)
+ (file-name-as-directory
+ (or (and (stringp w3m-default-directory)
+ (file-directory-p w3m-default-directory)
+ (expand-file-name w3m-default-directory))
+ (and (symbolp w3m-default-directory)
+ (boundp w3m-default-directory)
+ (setq directory (symbol-value w3m-default-directory))
+ (stringp directory)
+ (file-directory-p directory)
+ (expand-file-name directory))
+ (and (functionp w3m-default-directory)
+ (stringp (setq directory
+ (condition-case nil
+ (funcall w3m-default-directory url)
+ (error nil))))
+ (file-directory-p directory)
+ (expand-file-name directory))
+ w3m-profile-directory)))))
+
+(defun w3m-refresh-at-time ()
+ (when (and w3m-use-refresh w3m-current-refresh)
+ (if (= (car w3m-current-refresh) 0)
+ (w3m-goto-url-with-timer (cdr w3m-current-refresh) (current-buffer))
+ (setq w3m-refresh-timer
+ (run-at-time (car w3m-current-refresh)
+ nil
+ 'w3m-goto-url-with-timer
+ (cdr w3m-current-refresh)
+ (current-buffer))))))
+
+(defun w3m-goto-url-with-timer (url buffer)
+ "Run the `w3m-goto-url' function by the refresh timer."
+ (when (and (w3m-url-valid url) buffer (get-buffer buffer))
+ (cond
+ ((get-buffer-window buffer)
+ (save-selected-window
+ (pop-to-buffer buffer)
+ (with-current-buffer buffer
+ (w3m-cancel-refresh-timer buffer)
+ (if (and w3m-current-url
+ (string= url w3m-current-url))
+ (w3m-reload-this-page t)
+ (w3m-goto-url url)))))
+ ((buffer-live-p buffer)
+ (let* ((cwin (selected-window))
+ (cbuf (window-buffer cwin)))
+ (with-current-buffer buffer
+ (w3m-cancel-refresh-timer buffer)
+ (if (and w3m-current-url
+ (string= url w3m-current-url))
+ (w3m-reload-this-page t t)
+ (w3m-goto-url url nil
+ nil nil nil nil nil t)))
+ (set-window-buffer cwin cbuf)))
+ (t
+ (with-current-buffer buffer
+ (w3m-cancel-refresh-timer buffer))))))
+
+(defun w3m-goto-new-session-url (&optional reload)
+ "Open `w3m-new-session-url' in a new session."
+ (interactive "P")
+ (if (not (eq major-mode 'w3m-mode))
+ (message "This command can be used in w3m mode only")
+ (w3m-view-this-url-1 w3m-new-session-url reload 'new-session)))
+
+;;;###autoload
+(defun w3m-goto-url-new-session (url &optional reload charset post-data
+ referer)
+ "Visit World Wide Web pages in a new session.
+If you invoke this command in the emacs-w3m buffer, the new session
+will be created by copying the current session. Otherwise, the new
+session will start afresh."
+ (interactive
+ (list (w3m-input-url nil nil nil nil 'feeling-lucky)
+ current-prefix-arg
+ (w3m-static-if (fboundp 'universal-coding-system-argument)
+ coding-system-for-read)
+ nil ;; post-data
+ nil)) ;; referer
+ (let (buffer)
+ (if (or (eq 'w3m-mode major-mode)
+ (and (setq buffer (w3m-alive-p))
+ (progn
+ (w3m-popup-buffer buffer)
+ t)))
+ (progn
+ (switch-to-buffer (setq buffer
+ (w3m-copy-buffer nil nil
+ w3m-new-session-in-background
+ 'empty)))
+ (w3m-display-progress-message url)
+ (w3m-goto-url url
+ (or reload
+ ;; When new URL has `name' portion, we have to
+ ;; goto the base url because generated buffer
+ ;; has no content at this moment.
+ (and (progn
+ (w3m-string-match-url-components url)
+ (match-beginning 8))
+ 'redisplay))
+ charset post-data referer)
+ ;; Delete useless newly created buffer if it is empty.
+ (w3m-delete-buffer-if-empty buffer))
+ (w3m-goto-url url))))
+
+(defun w3m-move-point-for-localcgi (url)
+ (when (and (w3m-url-local-p url)
+ (file-directory-p (w3m-url-to-file-name url))
+ (not (eq w3m-local-directory-view-method 'w3m-dtree))
+ (= (point-min) (point))
+ (w3m-search-name-anchor "current" 'quiet))
+ (recenter (/ (window-height) 5))))
+
+;;;###autoload
+(defun w3m-gohome ()
+ "Go to the Home page."
+ (interactive)
+ (unless w3m-home-page
+ (error "You have to specify the value of `w3m-home-page'"))
+ (w3m-goto-url w3m-home-page))
+
+(defun w3m-reload-this-page (&optional arg no-popup)
+ "Reload the current page, disregarding the cached contents.
+If the prefix arg ARG is given, it also clears forms and post data."
+ (interactive "P")
+ (if w3m-current-url
+ (let ((w3m-history-reuse-history-elements
+ ;; Don't move the history position.
+ 'reload)
+ post-data)
+ (if arg
+ (progn
+ (w3m-history-remove-properties '(:forms nil :post-data nil))
+ (setq w3m-current-forms nil))
+ (when (and (setq post-data (w3m-history-plist-get :post-data))
+ (not (y-or-n-p "Repost form data? ")))
+ (setq post-data nil)))
+ (w3m-history-store-position)
+ (w3m-goto-url w3m-current-url 'reload nil post-data
+ (w3m-history-plist-get :referer)
+ nil
+ (w3m-history-element (cadar w3m-history) t)
+ no-popup)
+ (w3m-history-restore-position))
+ (w3m-message "Can't reload this page")))
+
+(defun w3m-reload-all-pages (&optional arg)
+ "Reload all pages, disregarding the cached contents.
+If the prefix arg ARG is given, it also clears forms and post data."
+ (interactive "P")
+ (if arg
+ (save-window-excursion
+ (dolist (buffer (w3m-list-buffers))
+ (switch-to-buffer buffer)
+ (w3m-reload-this-page)))
+ (dolist (buffer (w3m-list-buffers))
+ (save-window-excursion
+ (switch-to-buffer buffer)
+ (w3m-reload-this-page)))))
+
+(defun w3m-redisplay-this-page (&optional arg)
+ "Redisplay the current page.
+If the prefix arg ARG is given, it toggles the visibility of images."
+ (interactive "P")
+ (if (null w3m-current-url)
+ (w3m-message "Can't redisplay this page")
+ (when arg
+ (setq w3m-display-inline-images (not w3m-display-inline-images)))
+ (let ((w3m-prefer-cache t)
+ (w3m-history-reuse-history-elements
+ ;; Don't move the history position.
+ 'reload))
+ (w3m-history-store-position)
+ (w3m-goto-url w3m-current-url 'redisplay)
+ (w3m-history-restore-position))))
+
+(defun w3m-redisplay-and-reset (&optional arg)
+ "Redisplay the current page and reset the user-specified values.
+This function clears the charset and the content type which the user
+specified for overriding the values of what the page requires. The
+prefix argument ARG is passed to the `w3m-redisplay-this-page'
+function (which see)."
+ (interactive "P")
+ (if (null w3m-current-url)
+ (w3m-message "Can't execute this page")
+ (setf (w3m-arrived-content-type w3m-current-url) nil)
+ (setf (w3m-arrived-content-charset
+ (if (string-match "\\`about://source/" w3m-current-url)
+ (substring w3m-current-url (match-end 0))
+ w3m-current-url))
+ nil)
+ (w3m-redisplay-this-page arg)))
+
+(defun w3m-redisplay-with-charset (&optional arg)
+ "Redisplay the current page, specifying a charset.
+If the user enters the empty string, the value which once was used for
+decoding the page is used. The prefix argument ARG is passed to the
+`w3m-redisplay-this-page' function (which see)."
+ (interactive "P")
+ (if (null w3m-current-url)
+ (w3m-message "Can't execute the command")
+ (setf (w3m-arrived-content-charset
+ (if (string-match "\\`about://source/" w3m-current-url)
+ (substring w3m-current-url (match-end 0))
+ w3m-current-url))
+ (w3m-read-content-charset
+ (format "Content-charset (current %s, default reset): "
+ w3m-current-coding-system)))
+ (w3m-redisplay-this-page arg)))
+
+(defun w3m-redisplay-with-content-type (&optional arg)
+ "Redisplay the current page, specifying a content type.
+If the user enters the empty string, it uses the value which was
+specified by the page's contents itself. The prefix argument ARG is
+passed to the `w3m-redisplay-this-page' function (which see)."
+ (interactive "P")
+ (if (null w3m-current-url)
+ (w3m-message "Can't execute this page")
+ (setf (w3m-arrived-content-type w3m-current-url)
+ (let ((type (completing-read
+ (format "Content-type (current %s, default reset): "
+ (or (w3m-arrived-content-type w3m-current-url)
+ (w3m-content-type w3m-current-url)))
+ w3m-content-type-alist nil t)))
+ (unless (string= type "") type)))
+ (w3m-redisplay-this-page arg)))
+
+(defun w3m-examine-command-line-args ()
+ "Return a url when the `w3m' command is invoked from the command line.
+The `w3m' Lisp command can be invoked even in the batch mode, e.g.,
+``emacs -f w3m'' or ``emacs -f w3m url''. This function is used in
+the very case, it extracts a url string from the command line
+arguments and passes it to the `w3m' command. If a url is omitted, it
+defaults to the value of `w3m-home-page' or \"about:\"."
+ (let ((url (car command-line-args-left))
+ (directives '("-f" "-funcall" "--funcall" "-e"))
+ args)
+ (if (and url (not (string-match "\\`-" url)))
+ (progn
+ (setq command-line-args-left (cdr command-line-args-left))
+ (when (string-match "\\`[\t ]*\\'" url)
+ ;; emacs -f w3m '' ...
+ (setq url (or w3m-home-page "about:"))))
+ (setq args (nthcdr (max (- (length command-line-args)
+ (length command-line-args-left)
+ 2)
+ 1)
+ command-line-args))
+ (when (and (equal (cadr args) "w3m")
+ (member (car args) directives))
+ (setq url (or w3m-home-page "about:"))))
+ (unless
+ (and command-line-args-left
+ (progn
+ (setq args (reverse command-line-args-left))
+ (while (and args
+ (not (and (setq args (cdr (member "w3m" args)))
+ (member (car args) directives)))))
+ args))
+ (defalias 'w3m-examine-command-line-args (lambda nil)))
+ ;; Inhibit the startup screen.
+ (when (and url
+ ;; Since XEmacs provides `inhibit-startup-message' as
+ ;; a constant, we don't modify the value.
+ (not (featurep 'xemacs)))
+ (let ((var (cond ((boundp 'inhibit-startup-screen)
+ 'inhibit-startup-screen)
+ ((boundp 'inhibit-startup-message)
+ 'inhibit-startup-message)))
+ fn)
+ (when (and var
+ (not (symbol-value var)))
+ (set var t)
+ (setq fn (make-symbol "w3m-inhibit-startup-screen"))
+ (fset fn `(lambda nil
+ (set ',var nil)
+ (remove-hook 'window-setup-hook ',fn)
+ (fmakunbound ',fn)))
+ (add-hook 'window-setup-hook fn))))
+ url))
+
+;;;###autoload
+(defun w3m (&optional url new-session interactive-p)
+ "Visit World Wide Web pages using the external w3m command.
+
+When you invoke this command interactively for the first time, it will
+visit a page which is pointed to by a string like url around the
+cursor position or the home page specified by the `w3m-home-page'
+variable, but you will be prompted for a URL if `w3m-quick-start' is
+nil (default t) or `w3m-home-page' is nil.
+
+The variables `w3m-pop-up-windows' and `w3m-pop-up-frames' control
+whether this command should pop to a window or a frame up for the
+session.
+
+When emacs-w3m sessions have already been opened, this command will
+pop to the existing window or frame up, but if `w3m-quick-start' is
+nil, \(default t), you will be prompted for a URL (which defaults to
+`popup' meaning to pop to an existing emacs-w3m buffer up).
+
+In addition, if the prefix argument is given or you enter the empty
+string for the prompt, it will visit the home page specified by the
+`w3m-home-page' variable or the \"about:\" page.
+
+You can also run this command in the batch mode as follows:
+
+ emacs -f w3m http://emacs-w3m.namazu.org/ &
+
+In that case, or if this command is called non-interactively, the
+variables `w3m-pop-up-windows' and `w3m-pop-up-frames' will be ignored
+\(treated as nil) and it will run emacs-w3m at the current (or the
+initial) window.
+
+If the optional NEW-SESSION is non-nil, this function makes a new
+emacs-w3m buffer. Besides that, it also makes a new emacs-w3m buffer
+if `w3m-make-new-session' is non-nil and a user specifies a url string.
+
+The optional INTERACTIVE-P is for the internal use; it is mainly used
+to check whether Emacs 22 or later calls this function as an
+interactive command in the batch mode."
+ (interactive
+ (let ((url
+ ;; Emacs 22 or later calls a Lisp command interactively even
+ ;; if it is in the batch mode. If the following function
+ ;; returns non-nil value, it means this function is called in
+ ;; the batch mode, and we don't treat it as what it is called
+ ;; to interactively.
+ (w3m-examine-command-line-args))
+ new)
+ (list
+ ;; url
+ (or url
+ (let ((default (if (w3m-alive-p) 'popup w3m-home-page)))
+ (setq new (if current-prefix-arg
+ default
+ (w3m-input-url nil nil default w3m-quick-start
+ 'feeling-lucky)))))
+ ;; new-session
+ (and w3m-make-new-session
+ (w3m-alive-p)
+ (not (eq new 'popup)))
+ ;; interactive-p
+ (not url))))
+ (let ((nofetch (eq url 'popup))
+ (alived (w3m-alive-p))
+ (buffer (unless new-session (w3m-alive-p t)))
+ (w3m-pop-up-frames (and interactive-p w3m-pop-up-frames))
+ (w3m-pop-up-windows (and interactive-p w3m-pop-up-windows)))
+ (unless (and (stringp url)
+ (> (length url) 0))
+ (if buffer
+ (setq nofetch t)
+ ;; This command was possibly be called non-interactively or as
+ ;; the batch mode.
+ (setq url (or (w3m-examine-command-line-args)
+ ;; Unlikely but this function was called with no url.
+ "about:")
+ nofetch nil)))
+ (unless buffer
+ ;; It means `new-session' is non-nil or there's no emacs-w3m buffer.
+ ;; At any rate, we create a new emacs-w3m buffer in this case.
+ (with-current-buffer (setq buffer (w3m-generate-new-buffer "*w3m*"))
+ (w3m-mode)))
+ (w3m-popup-buffer buffer)
+ (unless nofetch
+ ;; `unwind-protect' is needed since a process may be terminated by C-g.
+ (unwind-protect
+ (let* ((crash (and (not alived)
+ (w3m-session-last-crashed-session)))
+ (last (and (not alived)
+ (not crash)
+ (w3m-session-last-autosave-session))))
+ (w3m-goto-url url)
+ (when (or crash last)
+ (w3m-session-goto-session (or crash last))))
+ ;; Delete useless newly created buffer if it is empty.
+ (w3m-delete-buffer-if-empty buffer)))))
+
+(eval-when-compile
+ (autoload 'browse-url-interactive-arg "browse-url"))
+
+;;;###autoload
+(defun w3m-browse-url (url &optional new-session)
+ "Ask emacs-w3m to browse URL.
+NEW-SESSION specifies whether to create a new emacs-w3m session. URL
+defaults to the string looking like a url around the cursor position.
+Pop to a window or a frame up according to `w3m-pop-up-windows' and
+`w3m-pop-up-frames'."
+ (interactive (progn
+ (require 'browse-url)
+ (browse-url-interactive-arg "Emacs-w3m URL: ")))
+ (when (stringp url)
+ (setq url (w3m-canonicalize-url url))
+ (if new-session
+ (w3m-goto-url-new-session url)
+ (w3m-goto-url url))))
+
+;;;###autoload
+(defun w3m-find-file (file)
+ "Function used to open FILE whose name is expressed in ordinary format.
+The file name will be converted into the file: scheme."
+ (interactive "fFilename: ")
+ (w3m-goto-url (w3m-expand-file-name-as-url file)
+ nil
+ (w3m-static-if (fboundp 'universal-coding-system-argument)
+ coding-system-for-read)))
+
+(defun w3m-cygwin-path (path)
+ "Convert PATH in the win32 style into the cygwin format.
+ex. c:/dir/file => //c/dir/file"
+ (if (string-match "^\\([A-Za-z]\\):" path)
+ (replace-match "//\\1" nil nil path)
+ path))
+
+;;;###autoload
+(defun w3m-region (start end &optional url charset)
+ "Render the region of the current buffer between START and END.
+URL specifies the address where the contents come from. It can be
+omitted or nil when the address is not identified. CHARSET is used
+for decoding the contents. If it is nil, this function attempts to
+parse the meta tag to extract the charset."
+ (interactive
+ (list (region-beginning)
+ (region-end)
+ (w3m-expand-file-name-as-url
+ (or (buffer-file-name) default-directory))))
+ (save-restriction
+ (w3m-process-stop (current-buffer))
+ (narrow-to-region start end)
+ (w3m-clear-local-variables)
+ (let ((w3m-current-buffer (current-buffer)))
+ (unless charset
+ (setq charset (w3m-correct-charset (w3m-detect-meta-charset))))
+ (setq url (or url
+ w3m-buffer-local-url)
+ w3m-current-url url
+ w3m-current-base-url url
+ w3m-current-coding-system
+ (if charset
+ (w3m-charset-to-coding-system charset)
+ w3m-coding-system)
+ w3m-current-title
+ (let (w3m-use-refresh)
+ (w3m-rendering-buffer charset)))
+ (w3m-fontify)
+ (when (w3m-display-inline-images-p)
+ (and w3m-force-redisplay (sit-for 0))
+ (w3m-toggle-inline-images 'force)))))
+
+;;;###autoload
+(defun w3m-buffer (&optional url charset)
+ "Render the current buffer.
+See `w3m-region' for the optional arguments."
+ (interactive (list (w3m-expand-file-name-as-url (or (buffer-file-name)
+ default-directory))))
+ (w3m-region (point-min) (point-max) url charset))
+
+;;; About:
+(defun w3m-about (url &rest args)
+ (insert "<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">
+<html>
+<head><title>About emacs-w3m</title></head>
+<body>
+<center>
+Welcome to <a href=\"http://emacs-w3m.namazu.org/\">\
+<img src=\"about://emacs-w3m.gif\" alt=\"emacs-w3m\" width=\"83\"
+height=\"14\"></a>!<br><br>
+emacs-w3m is an interface program of
+<a href=\"http://w3m.sourceforge.net/\">w3m</a>,
+works on Emacs.
+</center>
+</body>
+</html>")
+ "text/html")
+
+(defun w3m-view-source (&optional arg)
+ "Display an html source of a page visited in the current buffer.
+ARG should be a number (a non-numeric value is treated as `1') which
+controls how much to decode a source. A number larger than or equal
+to 4 (which the `C-u' prefix produces) means don't decode. The number
+2 or 3 means decode normal text. The number 1 means decodes `&#nnn;'
+entities in 128..159 and 160 in addition to normal text (the default).
+A number less than or equal to zero means also encode urls containing
+non-ASCII characters."
+ (interactive "p")
+ (if w3m-current-url
+ (let ((w3m-prefer-cache t)
+ (w3m-view-source-decode-level (if (numberp arg) arg 0))
+ (w3m-history-reuse-history-elements t))
+ (w3m-history-store-position)
+ (cond
+ ((string-match "\\`about://source/" w3m-current-url)
+ (w3m-goto-url (substring w3m-current-url (match-end 0))))
+ ((string-match "\\`about://header/" w3m-current-url)
+ (w3m-goto-url (concat "about://source/"
+ (substring w3m-current-url (match-end 0)))))
+ (t
+ (w3m-goto-url (concat "about://source/" w3m-current-url))))
+ (w3m-history-restore-position))
+ (w3m-message "Can't view page source")))
+
+(defun w3m-make-separator ()
+ (if (string= w3m-language "Japanese")
+ (make-string (/ (w3m-display-width) 2)
+ (make-char 'japanese-jisx0208 40 44))
+ (make-string (w3m-display-width) ?-)))
+
+(defun w3m-about-header (url &optional no-uncompress no-cache &rest args)
+ (when (string-match "\\`about://header/" url)
+ (setq url (substring url (match-end 0)))
+ (insert "Page Information\n"
+ "\nTitle: " (or (w3m-arrived-title
+ (w3m-url-strip-authinfo url))
+ "")
+ "\nURL: " url
+ "\nDocument Type: " (or (w3m-content-type url) "")
+ "\nLast Modified: "
+ (let ((time (w3m-last-modified url)))
+ (if time (current-time-string time) ""))
+ (let ((anchor (with-current-buffer w3m-current-buffer
+ (and (equal url w3m-current-url) (w3m-anchor)))))
+ (if anchor
+ (concat "\nCurrent Anchor: " anchor)
+ "")))
+ (let ((ct (w3m-arrived-content-type url))
+ (charset (w3m-arrived-content-charset url))
+ (separator (w3m-make-separator))
+ (case-fold-search t)
+ header ssl beg)
+ (when (or ct charset)
+ (insert "\n\n" separator "\n\nModifier Information\n")
+ (insert "\nDocument Content-Type: " (or ct ""))
+ (insert "\nDocument Charset: " (or charset "")))
+ (when (and (not (w3m-url-local-p url))
+ (setq header (condition-case nil
+ (or (unless no-cache
+ (w3m-cache-request-header url))
+ (w3m-process-with-wait-handler
+ (w3m-w3m-dump-head url handler)))
+ (w3m-process-timeout nil))))
+ (insert "\n\n" separator "\n\nHeader Information\n\n" header)
+ (goto-char (point-min))
+ (when (re-search-forward "^w3m-ssl-certificate: " nil t)
+ (setq beg (match-end 0))
+ (forward-line)
+ (while (and (not (eobp)) (looking-at "^[ \t]"))
+ (forward-line))
+ (setq ssl (buffer-substring beg (point)))
+ (delete-region beg (point))
+ (goto-char beg)
+ (insert "SSL\n")
+ (goto-char (point-max))
+ (insert separator "\n\nSSL Information\n\n")
+ (setq beg (point))
+ (insert ssl)
+ (goto-char beg)
+ (while (re-search-forward "^\t" nil t)
+ (delete-char -1)
+ (when (looking-at "Certificate:")
+ (insert "\n"))))))
+ "text/plain"))
+
+(defun w3m-view-header ()
+ "Display the header of the current page."
+ (interactive)
+ (if w3m-current-url
+ (let ((w3m-prefer-cache t)
+ (w3m-history-reuse-history-elements t)
+ (url (cond
+ ((string-match "\\`about://header/" w3m-current-url)
+ (substring w3m-current-url (match-end 0)))
+ ((string-match "\\`about://source/" w3m-current-url)
+ (let ((real-url (substring w3m-current-url (match-end 0))))
+ (unless (string-match "\\`about:" real-url)
+ (concat "about://header/" real-url))))
+ ((string-match "\\`about:" w3m-current-url)
+ nil)
+ (t
+ (concat "about://header/" w3m-current-url)))))
+ (if url
+ (progn
+ (w3m-history-store-position)
+ (w3m-goto-url url)
+ (w3m-history-restore-position))
+ (w3m-message "Can't load a header for %s" w3m-current-url)))
+ (w3m-message "Can't view page header")))
+
+(defvar w3m-about-history-max-indentation '(/ (* (window-width) 2) 3)
+ "*Number used to limit the identation level when showing a history.
+This value is evaluated whenever a history page is displayed by the
+`w3m-about-history' command. So, it can be any s-expression returning
+a number.")
+
+(defvar w3m-about-history-indent-level 4
+ "*Number used to specify the indentation level when showing a history.
+A history page is invoked by the `w3m-about-history' command.")
+
+(defun w3m-about-history (&rest args)
+ "Show a tree-structured history."
+ (let (start history current)
+ (with-current-buffer w3m-current-buffer
+ (setq history w3m-history-flat
+ current (cadar w3m-history)))
+ (insert "\
+<head><title>URL history</title></head><body>
+<h1>List of all the links you have visited in this session.</h1><pre>\n")
+ (setq start (point))
+ (when history
+ (let ((form
+ (format
+ "%%0%dd"
+ (length
+ (number-to-string
+ (apply 'max
+ (apply 'append
+ (mapcar
+ ;; Don't use `caddr' here, since it won't
+ ;; be substituted by the compiler macro.
+ (lambda (e)
+ (car (cdr (cdr e))))
+ history)))))))
+ (cur (current-buffer))
+ (margin (if (> w3m-about-history-indent-level 1)
+ 1
+ 0))
+ (max-indent (condition-case nil
+ ;; Force the value to be a number or nil.
+ (+ 0 (eval w3m-about-history-max-indentation))
+ (error nil)))
+ (last-indent -1)
+ (sub-indent 0)
+ element url about title position bol indent)
+ (while history
+ (setq element (pop history)
+ url (car element)
+ ;; FIXME: an ad-hoc workaround to avoid illegal-type errors.
+ about (or (not (stringp url))
+ (string-match w3m-history-ignored-regexp url))
+ title (plist-get (cadr element) :title)
+ position (caddr element))
+ (when url
+ (insert (format "h%s %d %d <a href=\"%s\">%s%s%s %s</a>\n"
+ (mapconcat (lambda (d) (format form d))
+ position
+ "-")
+ (/ (1- (length position)) 2)
+ (if (equal current position) 1 0)
+ url
+ (if about "&lt;" "")
+ (if (or (not title)
+ (string-equal "<no-title>" title)
+ (string-match "^[\t $B!!(B]*$" title))
+ url
+ (w3m-encode-specials-string title))
+ (if about "&gt;" "")
+ position))))
+ (sort-fields 0 start (point-max))
+ (goto-char start)
+ (while (not (eobp))
+ (setq bol (point))
+ (skip-chars-forward "^ ")
+ (setq indent (read cur)
+ sub-indent (if (= indent last-indent)
+ (1+ sub-indent)
+ 0)
+ last-indent indent
+ indent (+ (* w3m-about-history-indent-level indent)
+ sub-indent))
+ (when (prog1
+ (= (read cur) 1)
+ (delete-region bol (point))
+ (insert-char ?\ (+ margin (if max-indent
+ (min max-indent indent)
+ indent))))
+ (beginning-of-line)
+ (delete-char 1)
+ (insert "&gt;"))
+ (forward-line 1))))
+ (insert "</pre></body>")
+ "text/html"))
+
+(defun w3m-about-db-history (url &rest args)
+ (let ((start 0)
+ (size nil)
+ (width (- (w3m-display-width) 18))
+ (now (current-time))
+ title time alist prev next page total)
+ (when (string-match "\\`about://db-history/\\?" url)
+ (dolist (s (split-string (substring url (match-end 0)) "&"))
+ (when (string-match "\\`\\(?:start\\|\\(size\\)\\)=" s)
+ (set (if (match-beginning 1) 'size 'start)
+ (string-to-number (substring s (match-end 0)))))))
+ (when w3m-arrived-db
+ (mapatoms
+ (lambda (sym)
+ (and sym
+ (setq url (symbol-name sym))
+ (not (string-match "#" url))
+ (not (string-match w3m-history-ignored-regexp url))
+ (push (cons url (w3m-arrived-time url)) alist)))
+ w3m-arrived-db)
+ (setq alist (sort alist
+ (lambda (a b)
+ (w3m-time-newer-p (cdr a) (cdr b))))))
+ (setq total (length alist))
+ (setq alist (nthcdr start alist))
+ (when size
+ (when (> start 0)
+ (setq prev
+ (format "about://db-history/?start=%d&size=%d"
+ (max 0 (- start size)) size)))
+ (when (> (length alist) size)
+ (setq next
+ (format "about://db-history/?start=%d&size=%d"
+ (+ start size) size)))
+ (when (> total 0)
+ (setq total (+ (/ total size) (if (> (% total size) 0) 1 0)))
+ (setq page (1+ (/ start size)))))
+ (insert "<html><head><title>URL history in DataBase</title>"
+ (if prev (format "<link rel=\"prev\" href=\"%s\">\n" prev) "")
+ (if next (format "<link rel=\"next\" href=\"%s\">\n" next) "")
+ (format
+ "</head>\n<body>\n<h1>Arrived URL history in DataBase%s</h1>\n"
+ (if (and page total)
+ (format " (%d/%d)" page total) "")))
+ (setq prev
+ (if (or prev next)
+ (setq next
+ (concat
+ "<p align=\"left\">"
+ (if prev
+ (format "[<a href=\"%s\">Prev History</a>]" prev)
+ "")
+ (if next
+ (format "[<a href=\"%s\">Next History</a>]" next)
+ "")
+ "</p>\n"))
+ ""))
+ (if (null alist)
+ (insert "<em>Nothing in DataBase.</em>\n")
+ (insert prev "<table cellpadding=0>
+<tr><td><h2> Title/URL </h2></td><td><h2>Time/Date</h2></td></tr>\n")
+ (while (and alist
+ (or (not size)
+ (>= (decf size) 0)))
+ (setq url (car (car alist))
+ time (cdr (car alist))
+ alist (cdr alist)
+ title (w3m-arrived-title url))
+ (if (or (null title)
+ (string= "<no-title>" title))
+ (setq title (concat "<" (w3m-truncate-string url width) ">"))
+ (when (>= (string-width title) width)
+ (setq title (concat (w3m-truncate-string title width) "..."))))
+ (insert (format "<tr><td><a href=\"%s\">%s</a></td>"
+ url
+ (w3m-encode-specials-string title)))
+ (when time
+ (insert "<td>"
+ (if (<= (w3m-time-lapse-seconds time now)
+ 64800) ;; = (* 60 60 18) 18hours.
+ (format-time-string "%H:%M:%S" time)
+ (format-time-string "%Y-%m-%d" time))
+ "</td>"))
+ (insert "</tr>\n"))
+ (insert "</table>"
+ (if next "\n<br>\n<hr>\n" "")
+ prev))
+ (insert "</body></html>\n"))
+ "text/html")
+
+(defun w3m-history-highlight-current-url (url)
+ "Highlight the current url if it is a page for the history.
+It does manage history position data as well."
+ (when (string-equal "about://history/" url)
+ (let ((inhibit-read-only t)
+ (buffer (current-buffer))
+ start)
+ ;; Make history position data invisible.
+ (goto-char (point-min))
+ (w3m-next-anchor)
+ (while (progn
+ (setq start (point))
+ (re-search-forward " (\\(?:[0-9]+ \\)*[0-9]+)$" nil t))
+ (goto-char (match-beginning 0))
+ (put-text-property start (match-beginning 0)
+ 'history-position (read buffer))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ '(invisible t intangible t))
+ (forward-char 2)
+ (skip-chars-forward "\t "))
+ ;; Highlight the current url.
+ (goto-char (point-min))
+ (when (search-forward "\n>" nil t)
+ (w3m-next-anchor)
+ (setq start (point))
+ (end-of-line)
+ (w3m-add-face-property start (point) 'w3m-history-current-url)
+ (goto-char start)))
+ (set-buffer-modified-p nil)))
+
+(defcustom w3m-db-history-display-size
+ (and (> w3m-keep-arrived-urls 500) 500)
+ "*Maximum number of arrived URLs which are displayed per page."
+ :group 'w3m
+ :type '(radio (const :tag "All entries are displayed in single page." nil)
+ (integer :format "%t: %v\n" :size 0)))
+
+(defun w3m-db-history (&optional start size)
+ "Display arrived URLs."
+ (interactive
+ (list nil w3m-db-history-display-size))
+ (w3m-goto-url (concat
+ (format "about://db-history/?start=%d" (or start 0))
+ (if size (format "&size=%d" size) ""))))
+
+(defun w3m-history (&optional arg)
+ "Display the history of all the links you have visited in the session.
+If it is called with the prefix argument, display the arrived URLs."
+ (interactive "P")
+ (if (null arg)
+ (w3m-goto-url "about://history/")
+ (w3m-db-history nil w3m-db-history-display-size)))
+
+(defun w3m-w32-browser-with-fiber (url)
+ (let ((proc (start-process "w3m-w32-browser-with-fiber"
+ (current-buffer)
+ "fiber.exe" "-s"
+ (if (w3m-url-local-p url)
+ (w3m-url-to-file-name url)
+ url))))
+ (set-process-filter proc 'ignore)
+ (set-process-sentinel proc 'ignore)))
+
+;;; Interactive select buffer.
+(defcustom w3m-select-buffer-horizontal-window t
+ "*Non-nil means split windows horizontally to open the selection window."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-select-buffer-window-ratio '(18 . 12)
+ "*The percentage of the selection window to the whole frame.
+The car is used when splitting windows horizontally and the cdr is for
+splitting windows vertically."
+ :group 'w3m
+ :type '(cons (integer :format "H: %v[%%] " :size 0)
+ (integer :format "V: %v[%%]\n" :size 0)))
+
+(defvar w3m-select-buffer-window nil)
+(defconst w3m-select-buffer-message
+ "n: next buffer, p: previous buffer, q: quit."
+ "Help message used when the emacs-w3m buffers selection window is open.")
+
+;; Why this function is here abruptly is because of `w-s-b-horizontal-window'.
+(defun w3m-display-width ()
+ "Return the maximum width which should display lines within the value."
+ (if (< 0 w3m-fill-column)
+ w3m-fill-column
+ (+ (if (and w3m-select-buffer-horizontal-window
+ (get-buffer-window w3m-select-buffer-name))
+ ;; Show pages as if there is no buffers selection window.
+ (frame-width)
+ (window-width))
+ (or w3m-fill-column -1))))
+
+(defun w3m-select-buffer (&optional toggle nomsg)
+ "Pop to the emacs-w3m buffers selection window up.
+It provides the feature for switching emacs-w3m buffers using the
+buffer list. The following command keys are available:
+
+\\{w3m-select-buffer-mode-map}"
+ (interactive "P")
+ (when toggle
+ (setq w3m-select-buffer-horizontal-window
+ (not w3m-select-buffer-horizontal-window))
+ (when (get-buffer-window w3m-select-buffer-name)
+ (delete-windows-on w3m-select-buffer-name)))
+ (unless (or (eq major-mode 'w3m-mode)
+ (eq major-mode 'w3m-select-buffer-mode))
+ (let ((buffer (w3m-alive-p t)))
+ (if buffer
+ (w3m-popup-buffer buffer)
+ (w3m-goto-url (or w3m-home-page "about:")))))
+ (let ((selected-window (selected-window))
+ (current-buffer (current-buffer)))
+ (set-buffer (w3m-get-buffer-create w3m-select-buffer-name))
+ (unless (eq nomsg 'update)
+ (setq w3m-select-buffer-window selected-window))
+ (let ((w (or (get-buffer-window w3m-select-buffer-name)
+ (split-window selected-window
+ (w3m-select-buffer-window-size)
+ w3m-select-buffer-horizontal-window))))
+ (set-window-buffer w (current-buffer))
+ (select-window w))
+ (w3m-select-buffer-generate-contents current-buffer))
+ (w3m-select-buffer-mode)
+ (or nomsg (w3m-message w3m-select-buffer-message)))
+
+(defun w3m-select-buffer-update (&rest args)
+ (when (get-buffer-window w3m-select-buffer-name)
+ (save-selected-window
+ (w3m-select-buffer nil 'update)))
+ (when w3m-use-tab
+ (w3m-force-window-update)))
+
+(defun w3m-select-buffer-generate-contents (current-buffer)
+ (let ((i 0)
+ (buffer-read-only))
+ (delete-region (point-min) (point-max))
+ (dolist (buffer (w3m-list-buffers))
+ (put-text-property (point)
+ (progn
+ (insert (format "%d:%s %s\n" (incf i)
+ (if (w3m-unseen-buffer-p buffer)
+ "(u)" " ")
+ (w3m-buffer-title buffer)))
+ (point))
+ 'w3m-select-buffer buffer))
+ (skip-chars-backward " \t\r\f\n")
+ (delete-region (point) (point-max))
+ (set-buffer-modified-p nil)
+ (goto-char (or (text-property-any (point-min) (point-max)
+ 'w3m-select-buffer current-buffer)
+ (point-min)))))
+
+(defvar w3m-select-buffer-mode-map nil)
+(unless w3m-select-buffer-mode-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map)
+ (substitute-key-definition
+ 'next-line 'w3m-select-buffer-next-line map global-map)
+ (substitute-key-definition
+ 'previous-line 'w3m-select-buffer-previous-line map global-map)
+ (substitute-key-definition
+ 'w3m-copy-buffer 'w3m-select-buffer-copy-buffer map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-next-buffer 'w3m-select-buffer-next-line map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-previous-buffer 'w3m-select-buffer-previous-line map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-delete-buffer 'w3m-select-buffer-delete-buffer map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-delete-other-buffers
+ 'w3m-select-buffer-delete-other-buffers map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-scroll-up-or-next-url
+ 'w3m-select-buffer-show-this-line map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-scroll-down-or-previous-url
+ 'w3m-select-buffer-show-this-line-and-down map w3m-mode-map)
+ (substitute-key-definition
+ 'w3m-select-buffer 'w3m-select-buffer-toggle-style map w3m-mode-map)
+ (define-key map " " 'w3m-select-buffer-show-this-line)
+ (define-key map "g" 'w3m-select-buffer-recheck)
+ (define-key map "j" 'w3m-select-buffer-next-line)
+ (define-key map "k" 'w3m-select-buffer-previous-line)
+ (define-key map "n" 'w3m-select-buffer-next-line)
+ (define-key map "p" 'w3m-select-buffer-previous-line)
+ (define-key map "q" 'w3m-select-buffer-quit)
+ (define-key map "h" 'w3m-select-buffer-show-this-line-and-switch)
+ (define-key map "w" 'w3m-select-buffer-show-this-line-and-switch)
+ (define-key map "\C-m" 'w3m-select-buffer-show-this-line-and-quit)
+ (define-key map "\C-c\C-c" 'w3m-select-buffer-show-this-line-and-quit)
+ (define-key map "\C-c\C-k" 'w3m-select-buffer-quit)
+ (define-key map "\C-c\C-q" 'w3m-select-buffer-quit)
+ (define-key map "\C-g" 'w3m-select-buffer-quit)
+ (define-key map "?" 'describe-mode)
+ (setq w3m-select-buffer-mode-map map)))
+
+(defun w3m-select-buffer-mode ()
+ "Major mode for switching emacs-w3m buffers using the buffer list.
+
+\\<w3m-select-buffer-mode-map>\
+\\[w3m-select-buffer-next-line]\
+ Next buffer.
+\\[w3m-select-buffer-previous-line]\
+ Previous buffer.
+
+\\[w3m-select-buffer-show-this-line]\
+ Show the buffer on the current menu line or scroll it up.
+\\[w3m-select-buffer-show-this-line-and-down]\
+ Show the buffer on the current menu line or scroll it down.
+\\[w3m-select-buffer-show-this-line-and-switch]\
+ Show the buffer on the menu and switch to the buffer.
+\\[w3m-select-buffer-show-this-line-and-quit]\
+ Show the buffer on the menu and quit the buffers selection.
+
+\\[w3m-select-buffer-copy-buffer]\
+ Create a copy of the buffer on the menu, and show it.
+\\[w3m-select-buffer-delete-buffer]\
+ Delete the buffer on the current menu line.
+\\[w3m-select-buffer-delete-other-buffers]\
+ Delete emacs-w3m buffers except for the buffer on the menu.
+
+\\[w3m-select-buffer-toggle-style]\
+ Toggle the style of the selection between horizontal and vertical.
+\\[w3m-select-buffer-recheck]\
+ Do the roll call to all emacs-w3m buffers.
+\\[w3m-select-buffer-quit]\
+ Quit the buffers selection.
+"
+ (setq major-mode 'w3m-select-buffer-mode
+ mode-name "w3m buffers"
+ truncate-lines t
+ buffer-read-only t)
+ (use-local-map w3m-select-buffer-mode-map)
+ (w3m-run-mode-hooks 'w3m-select-buffer-mode-hook))
+
+(defun w3m-select-buffer-recheck ()
+ "Do the roll call to all emacs-w3m buffers and regenerate the menu."
+ (interactive)
+ (let ((buffer-read-only nil))
+ (erase-buffer))
+ (w3m-select-buffer-generate-contents
+ (window-buffer w3m-select-buffer-window))
+ (w3m-select-buffer-show-this-line))
+
+(defmacro w3m-select-buffer-current-buffer ()
+ '(get-text-property (point-at-bol) 'w3m-select-buffer))
+
+(defun w3m-select-buffer-show-this-line (&optional interactive-p)
+ "Show the buffer on the current menu line or scroll it up."
+ (interactive (list t))
+ (forward-line 0)
+ (let ((obuffer (and (window-live-p w3m-select-buffer-window)
+ (window-buffer w3m-select-buffer-window)))
+ (buffer (w3m-select-buffer-current-buffer)))
+ (unless buffer
+ (error "No buffer at point"))
+ (cond
+ ((get-buffer-window buffer)
+ (setq w3m-select-buffer-window (get-buffer-window buffer)))
+ ((window-live-p w3m-select-buffer-window)
+ ())
+ ((one-window-p t)
+ (setq w3m-select-buffer-window (selected-window))
+ (select-window
+ (split-window nil
+ (w3m-select-buffer-window-size)
+ w3m-select-buffer-horizontal-window)))
+ (t (setq w3m-select-buffer-window (get-largest-window))))
+ (set-window-buffer w3m-select-buffer-window buffer)
+ (when (and interactive-p (eq obuffer buffer))
+ (save-selected-window
+ (pop-to-buffer buffer)
+ (w3m-scroll-up-or-next-url nil)))
+ (w3m-force-window-update w3m-select-buffer-window)
+ (w3m-message w3m-select-buffer-message)
+ buffer))
+
+(defun w3m-select-buffer-show-this-line-and-down ()
+ "Show the buffer on the current menu line or scroll it down."
+ (interactive)
+ (let ((obuffer (and (window-live-p w3m-select-buffer-window)
+ (window-buffer w3m-select-buffer-window)))
+ (buffer (w3m-select-buffer-show-this-line)))
+ (when (eq obuffer buffer)
+ (save-selected-window
+ (pop-to-buffer buffer)
+ (w3m-scroll-down-or-previous-url nil)))))
+
+(defun w3m-select-buffer-next-line (&optional n)
+ "Move cursor vertically down N lines and show the buffer on the menu."
+ (interactive "p")
+ (forward-line n)
+ (prog1
+ (w3m-select-buffer-show-this-line)
+ (w3m-static-when (featurep 'xemacs)
+ (save-window-excursion
+ ;; Update gutter tabs.
+ (select-window w3m-select-buffer-window)))))
+
+(defun w3m-select-buffer-previous-line (&optional n)
+ "Move cursor vertically up N lines and show the buffer on the menu."
+ (interactive "p")
+ (w3m-select-buffer-next-line (- n)))
+
+(defun w3m-select-buffer-copy-buffer ()
+ "Create a copy of the buffer on the current menu line, and show it."
+ (interactive)
+ (w3m-select-buffer-show-this-line)
+ (let ((window (selected-window)))
+ (select-window (get-buffer-window (w3m-select-buffer-current-buffer)))
+ ;; The selection buffer will be updated automatically because
+ ;; `w3m-copy-buffer' calls `w3m-select-buffer-update' by way of
+ ;; `w3m-goto-url'.
+ (w3m-copy-buffer)
+ (select-window window)))
+
+(defun w3m-select-buffer-delete-buffer (&optional force)
+ "Delete the buffer on the current menu line.
+If there is the sole emacs-w3m buffer, it is assumed to be called for
+terminating the emacs-w3m session; the prefix argument FORCE will be
+passed to the `w3m-quit' function (which see)."
+ (interactive "P")
+ (w3m-select-buffer-show-this-line)
+ (if (= 1 (count-lines (point-min) (point-max)))
+ (w3m-quit force)
+ (let ((buffer (w3m-select-buffer-current-buffer)))
+ (forward-line -1)
+ (w3m-process-stop buffer)
+ (w3m-idle-images-show-unqueue buffer)
+ (kill-buffer buffer)
+ (when w3m-use-form
+ (w3m-form-kill-buffer buffer))
+ (run-hooks 'w3m-delete-buffer-hook)
+ (w3m-select-buffer-generate-contents (w3m-select-buffer-current-buffer))
+ (w3m-select-buffer-show-this-line))))
+
+(defun w3m-select-buffer-delete-other-buffers ()
+ "Delete emacs-w3m buffers except for the buffer on the current menu."
+ (interactive)
+ (w3m-select-buffer-show-this-line)
+ (w3m-delete-other-buffers (w3m-select-buffer-current-buffer)))
+
+(defun w3m-select-buffer-quit ()
+ "Quit the buffers selection."
+ (interactive)
+ (if (one-window-p t)
+ (set-window-buffer (selected-window)
+ (or (w3m-select-buffer-current-buffer)
+ (w3m-alive-p)))
+ (let ((buf (or (w3m-select-buffer-current-buffer)
+ (w3m-alive-p)))
+ pop-up-frames)
+ (pop-to-buffer buf)
+ (and (get-buffer-window w3m-select-buffer-name)
+ (delete-windows-on w3m-select-buffer-name)))))
+
+(defun w3m-select-buffer-show-this-line-and-switch ()
+ "Show the buffer on the menu and switch to the buffer."
+ (interactive)
+ (pop-to-buffer (w3m-select-buffer-show-this-line))
+ (message nil))
+
+(defun w3m-select-buffer-show-this-line-and-quit ()
+ "Show the buffer on the menu and quit the buffers selection."
+ (interactive)
+ (w3m-select-buffer-show-this-line-and-switch)
+ (and (get-buffer-window w3m-select-buffer-name)
+ (delete-windows-on w3m-select-buffer-name)))
+
+(defun w3m-select-buffer-close-window ()
+ "Close the window which displays the buffers selection."
+ (let ((window (get-buffer-window w3m-select-buffer-name)))
+ (when window
+ (if (one-window-p t)
+ (set-window-buffer window (other-buffer))
+ (delete-window window)))))
+
+(defun w3m-select-buffer-toggle-style()
+ "Toggle the style of the selection between horizontal and vertical."
+ (interactive)
+ (w3m-select-buffer t))
+
+(defun w3m-select-buffer-window-size ()
+ (if w3m-select-buffer-horizontal-window
+ (- (window-width)
+ (/ (* (frame-width) (car w3m-select-buffer-window-ratio)) 100))
+ (- (window-height)
+ (/ (* (frame-height) (cdr w3m-select-buffer-window-ratio)) 100))))
+
+
+;;; Header line
+(defcustom w3m-use-header-line t
+ "*Non-nil means display the header line."
+ :group 'w3m
+ :type 'boolean)
+
+(defcustom w3m-use-header-line-title nil
+ "Non-nil means display the current title at the header line.
+This variable is effective only when `w3m-use-tab' is nil."
+ :group 'w3m
+ :type 'boolean)
+
+(defface w3m-header-line-location-title
+ '((((class color) (background light))
+ (:foreground "Blue" :background "Gray90"))
+ (((class color) (background dark))
+ (:foreground "Cyan" :background "Gray20")))
+ "Face used to highlight title when displaying location in the header line."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-header-line-location-title-face
+ 'face-alias 'w3m-header-line-location-title)
+
+(defface w3m-header-line-location-content
+ '((((class color) (background light))
+ (:foreground "DarkGoldenrod" :background "Gray90"))
+ (((class color) (background dark))
+ (:foreground "LightGoldenrod" :background "Gray20")))
+ "Face used to highlight url when displaying location in the header line."
+ :group 'w3m-face)
+;; backward-compatibility alias
+(put 'w3m-header-line-location-content-face
+ 'face-alias 'w3m-header-line-location-content)
+
+(defvar w3m-header-line-map nil)
+(unless w3m-header-line-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map w3m-mode-map)
+ (define-key map [mouse-2] 'w3m-goto-url)
+ ;; Prevent tool-bar from being doubled under GNU Emacs.
+ (define-key map [tool-bar] 'undefined)
+ (setq w3m-header-line-map map)))
+
+(defun w3m-header-line-insert ()
+ "Put the header line into the current buffer."
+ (when (and (or (featurep 'xemacs)
+ (w3m-use-tab-p))
+ w3m-use-header-line
+ w3m-current-url
+ (eq 'w3m-mode major-mode))
+ (goto-char (point-min))
+ (let ((ct (w3m-arrived-content-type w3m-current-url))
+ (charset (w3m-arrived-content-charset w3m-current-url)))
+ (insert (format "Location%s: " (cond ((and ct charset) " [TC]")
+ (ct " [T]")
+ (charset " [C]")
+ (t "")))))
+ (w3m-add-face-property (point-min) (point) 'w3m-header-line-location-title)
+ (let ((start (point)))
+ (insert (w3m-puny-decode-url
+ (if (string-match "[^\000-\177]" w3m-current-url)
+ w3m-current-url
+ (w3m-url-decode-string w3m-current-url w3m-current-coding-system))))
+ (w3m-add-face-property start (point) 'w3m-header-line-location-content)
+ (w3m-add-text-properties start (point)
+ `(mouse-face highlight
+ keymap ,w3m-header-line-map
+ ,@(if (featurep 'xemacs)
+ '(help-echo
+ "button2 prompts to input URL"
+ balloon-help
+ "button2 prompts to input URL")
+ '(help-echo
+ "mouse-2 prompts to input URL"))))
+ (setq start (point))
+ (insert-char ?\ (max
+ 0
+ (- (if (and w3m-select-buffer-horizontal-window
+ (get-buffer-window w3m-select-buffer-name))
+ (frame-width)
+ (window-width))
+ (current-column) 1)))
+ (w3m-add-face-property start (point) 'w3m-header-line-location-content)
+ (unless (eolp)
+ (insert "\n")))))
+
+;;; w3m-minor-mode
+(defcustom w3m-goto-article-function nil
+ "Function used to visit an article pointed to by a given URL
+in `w3m-minor-mode' buffer. Normally, this option is used only
+when you follow a link in an html article. A function set to
+this variable must take one argument URL, and should display the
+specified page. It may return the symbol `w3m-goto-url' when it
+fails displaying the page. In this case, either `w3m-goto-url'
+or `w3m-goto-url-new-session' is employed to display the page."
+ :group 'w3m
+ :type '(radio (const :tag "Use emacs-w3m" nil)
+ (function :value browse-url)))
+
+(defun w3m-safe-view-this-url (&optional force)
+ "View the URL of the link under point.
+This command is quite similar to `w3m-view-this-url' except for the
+four differences: [1]don't handle forms, [2]don't consider URL-like
+string under the cursor, [3]compare URL with `w3m-safe-url-regexp'
+first to check whether it is safe, and [4]the arguments list differs;
+the optional FORCE, if it is non-nil, specifies URL is safe. You
+should use this command rather than `w3m-view-this-url' when viewing
+doubtful pages that might contain vicious forms.
+
+This command makes a new emacs-w3m buffer if `w3m-make-new-session' is
+non-nil and a user invokes this command in a buffer not being running
+the `w3m-mode', otherwise use an existing emacs-w3m buffer."
+ (interactive "P")
+ (let ((w3m-pop-up-windows nil)
+ (url (w3m-url-valid (w3m-anchor)))
+ safe-regexp)
+ (cond
+ (url
+ (setq safe-regexp (get-text-property (point) 'w3m-safe-url-regexp))
+ (if (or (not safe-regexp)
+ (w3m-buffer-local-url-p url)
+ (string-match safe-regexp url)
+ (and force
+ (or (not (interactive-p))
+ (yes-or-no-p "\
+Are you sure you really want to follow this link (maybe insecure)? "))))
+ (unless (and (functionp w3m-goto-article-function)
+ (not (eq 'w3m-goto-url
+ (funcall w3m-goto-article-function url))))
+ (if (and w3m-make-new-session
+ (not (eq major-mode 'w3m-mode)))
+ (w3m-goto-url-new-session url)
+ (w3m-goto-url url)))
+ (when (interactive-p)
+ (w3m-message "\
+This link is considered to be unsafe; use the prefix arg to view anyway"))))
+ ((w3m-url-valid (w3m-image))
+ (if (w3m-display-graphic-p)
+ (if (interactive-p)
+ (call-interactively 'w3m-toggle-inline-image)
+ (w3m-toggle-inline-image force))
+ (w3m-view-image)))
+ (t (w3m-message "No URL at point")))))
+
+(defun w3m-mouse-safe-view-this-url (event)
+ "Perform the command `w3m-safe-view-this-url' by the mouse event."
+ ;; Note: a command invoked by [mouse-N] cannot accept the prefix
+ ;; argument since [down-mouse-N] eats it.
+ (interactive "e")
+ (mouse-set-point event)
+ (let ((url (w3m-url-valid (or (w3m-anchor) (w3m-image)))))
+ (if url
+ (let ((safe-regexp (get-text-property (point) 'w3m-safe-url-regexp))
+ (use-dialog-box t))
+ (when (or (not safe-regexp)
+ (w3m-buffer-local-url-p url)
+ (string-match safe-regexp url)
+ (y-or-n-p "\
+This link is considered to be unsafe; continue? "))
+ (w3m-safe-view-this-url t)))
+ (w3m-message "No URL at point"))))
+
+(defconst w3m-minor-mode-command-alist
+ '((w3m-next-anchor)
+ (w3m-previous-anchor)
+ (w3m-next-image)
+ (w3m-previous-image)
+ (w3m-toggle-inline-image)
+ (w3m-toggle-inline-images)
+ (w3m-view-this-url . w3m-safe-view-this-url)
+ (w3m-mouse-view-this-url . w3m-mouse-safe-view-this-url)
+ (w3m-print-this-url))
+ "Alist of commands and commands to be defined in `w3m-minor-mode-map'.
+Each element looks like (FROM-COMMAND . TO-COMMAND); those keys which
+are defined as FROM-COMMAND in `w3m-mode-map' are redefined as
+TO-COMMAND in `w3m-minor-mode-map'. When TO-COMMAND is nil,
+FROM-COMMAND is defined in `w3m-minor-mode-map' with the same key in
+`w3m-mode-map'.")
+
+(defun w3m-make-minor-mode-keymap ()
+ "Return a keymap used for `w3m-minor-mode'."
+ (let ((keymap (make-sparse-keymap)))
+ (dolist (pair w3m-minor-mode-command-alist)
+ (substitute-key-definition (car pair)
+ (or (cdr pair) (car pair))
+ keymap w3m-mode-map))
+ (unless (featurep 'xemacs)
+ ;; Inhibit the `widget-button-click' command when
+ ;; `w3m-imitate-widget-button' is activated.
+ (define-key keymap [down-mouse-2] 'undefined))
+ keymap))
+
+(defvar w3m-minor-mode-map (w3m-make-minor-mode-keymap)
+ "*Keymap used when `w3m-minor-mode' is active.")
+
+(defcustom w3m-minor-mode-hook nil
+ "*Hook run after `w3m-minor-mode' initialization."
+ :group 'w3m
+ :type 'hook)
+
+(defvar w3m-minor-mode nil "Non-nil if w3m minor mode is enabled.")
+(make-variable-buffer-local 'w3m-minor-mode)
+(unless (assq 'w3m-minor-mode minor-mode-alist)
+ (push (list 'w3m-minor-mode " w3m") minor-mode-alist))
+(unless (assq 'w3m-minor-mode minor-mode-map-alist)
+ (push (cons 'w3m-minor-mode w3m-minor-mode-map) minor-mode-map-alist))
+
+(defun w3m-minor-mode (&optional arg)
+ "Minor mode to view text/html parts in articles."
+ (interactive "P")
+ (when (setq w3m-minor-mode
+ (if arg
+ (> (prefix-numeric-value arg) 0)
+ (not w3m-minor-mode)))
+ (run-hooks 'w3m-minor-mode-hook)))
+
+(defcustom w3m-do-cleanup-temp-files nil
+ "*Whether to clean up temporary files when emacs-w3m shutdown."
+ :group 'w3m
+ :type 'boolean)
+
+(defun w3m-cleanup-temp-files ()
+ (when w3m-do-cleanup-temp-files
+ (dolist (f (directory-files w3m-profile-directory))
+ (when (string-match "^w3m\\(el\\|src\\)" f)
+ (delete-file (expand-file-name f w3m-profile-directory))))))
+
+(provide 'w3m)
+
+(unless noninteractive
+ (if (string-match "\\.el\\'" w3m-init-file)
+ (or (load (concat w3m-init-file "c") t t t)
+ (load w3m-init-file t t t))
+ (load w3m-init-file t t))
+ (run-hooks 'w3m-load-hook))
+
+;;; w3m.el ends here