Drop support for the dead third-party w3 package

The w3 package was removed from GNU ELPA in 2020 as it doesn't run on
a recent Emacs, and development had stopped over a decade before that.
If anyone wants to revive the w3 package, they should look this all
over, but it doesn't make sense for us to maintain this support code.
Ref: https://debbugs.gnu.org/25395

* lisp/net/browse-url.el (browse-url-w3): Make obsolete.
(browse-url--browser-defcustom-type)
(browse-url-default-browser):
* lisp/ffap.el (ffap-url-at-point, ffap-file-at-point):
* lisp/net/newst-plainview.el (newsticker--buffer-do-insert-text):
* lisp/net/newst-reader.el (newsticker-html-renderer)
(newsticker-show-news):
* lisp/net/newst-treeview.el (newsticker--treeview-render-text):
* lisp/org/ol.el (org-store-link):
* lisp/url/url.el (url-retrieve): Remove w3 support code and related
documentation and comments.  (Bug#56435)

* test/lisp/net/browse-url-tests.el
(browse-url-tests-browser-kind): Adjust test for above changes.

* etc/TODO: Remove TODO to install W3.
* doc/misc/org.org (Handling Links): Don't mention W3.
* lisp/msb.el (msb--few-menus, msb--very-many-menus): Check for
eww-mode instead of w3-mode.
This commit is contained in:
Stefan Kangas 2022-07-07 13:25:23 +02:00
parent aa1e837ab4
commit 2a8d083607
13 changed files with 36 additions and 75 deletions

View file

@ -3352,7 +3352,7 @@ current buffer:
~org-link-email-description-format~. By default, it refers to the
addressee and the subject.
- /Web browsers: W3, W3M and EWW/ ::
- /Web browsers: W3M and EWW/ ::
Here the link is the current URL, with the page title as the
description.

View file

@ -722,8 +722,6 @@ bar. In the mean time, it should process other messages.
** Get some major packages installed
*** W3 (development version needs significant work)
*** PSGML, _possibly_ ECB
https://lists.gnu.org/r/emacs-devel/2007-05/msg01493.html Check the
assignments file for other packages which might go in and have been

View file

@ -68,8 +68,8 @@
;; If you do not like these bindings, modify the variable
;; `ffap-bindings', or write your own.
;;
;; If you use ange-ftp, browse-url, complete, efs, or w3, it is best
;; to load or autoload them before ffap. If you use ff-paths, load it
;; If you use ange-ftp, browse-url, complete, efs, it is best to load
;; or autoload them before ffap. If you use ff-paths, load it
;; afterwards. Try apropos {C-h a ffap RET} to get a list of the many
;; option variables. In particular, if ffap is slow, try these:
;;
@ -79,7 +79,7 @@
;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping
;; (setq ffap-gopher-regexp nil) ; disable gopher bookmark matching
;;
;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URLs.
;; ffap uses `browse-url' to fetch URLs.
;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
;; Also, you can add `ffap-menu-rescan' to various hooks to fontify
;; the file and URL references within a buffer.
@ -97,7 +97,6 @@
;; * break long menus into multiple panes (like imenu?)
;; * notice node in "(dired)Virtual Dired" (quotes, parentheses, whitespace)
;; * notice "machine.dom blah blah blah dir/file" (how?)
;; * as w3 becomes standard, rewrite to rely more on its functions
;; * regexp options for ffap-string-at-point, like font-lock (MCOOK)
;; * v19: could replace `ffap-locate-file' with a quieter `locate-library'
;; * handle "$(VAR)" in Makefiles
@ -1339,30 +1338,25 @@ Assumes the buffer has not changed."
;; Older: (apply 'copy-region-as-kill ffap-string-at-point-region)
(message "Copied to kill ring: %s" str))))
;; External.
(declare-function w3-view-this-url "ext:w3" (&optional no-show))
;;;###autoload
(defun ffap-url-at-point ()
"Return URL from around point if it exists, or nil.
Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any."
(when ffap-url-regexp
(or (and (eq major-mode 'w3-mode) ; In a w3 buffer button?
(w3-view-this-url t))
(let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
(thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)
val)
(setq val (thing-at-point-url-at-point ffap-lax-url
(if (use-region-p)
(cons (region-beginning)
(region-end)))))
(if val
(let ((bounds (thing-at-point-bounds-of-url-at-point
ffap-lax-url)))
(setq ffap-string-at-point-region
(list (car bounds) (cdr bounds)))))
val))))
(let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
(thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)
val)
(setq val (thing-at-point-url-at-point ffap-lax-url
(if (use-region-p)
(cons (region-beginning)
(region-end)))))
(if val
(let ((bounds (thing-at-point-bounds-of-url-at-point
ffap-lax-url)))
(setq ffap-string-at-point-region
(list (car bounds) (cdr bounds)))))
val)))
(defvar ffap-gopher-regexp
"\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *"
@ -1503,12 +1497,7 @@ which may actually result in an URL rather than a filename."
((and (eq major-mode 'internal-ange-ftp-mode)
(string-match "^\\*ftp \\(.*\\)@\\(.*\\)\\*$"
(buffer-name)))
(concat "/" (substring (buffer-name) 5 -1) ":"))
;; This is too often a bad idea:
;;((and (eq major-mode 'w3-mode)
;; (stringp url-current-server))
;; (host-to-ange-path url-current-server))
)))
(concat "/" (substring (buffer-name) 5 -1) ":")))))
(and remote-dir
(or
(and (string-match "\\`\\(/?~?ftp\\)/" name)
@ -1882,7 +1871,7 @@ Return value:
;;; ffap-other-*, ffap-read-only-*, ffap-alternate-* commands:
;; There could be a real `ffap-noselect' function, but we would need
;; at least two new user variables, and there is no w3-fetch-noselect.
;; at least two new user variables.
;; So instead, we just fake it with a slow save-window-excursion.
(defun ffap-other-window (filename)

View file

@ -103,7 +103,7 @@
((eq major-mode 'Man-mode)
4090
"Manuals (%d)")
((eq major-mode 'w3-mode)
((eq major-mode 'eww-mode)
4020
"WWW (%d)")
((or (memq major-mode
@ -154,7 +154,7 @@
((eq major-mode 'Man-mode)
5030
"Manuals (%d)")
((eq major-mode 'w3-mode)
((eq major-mode 'eww-mode)
5020
"WWW (%d)")
((or (memq major-mode

View file

@ -40,7 +40,6 @@
;; browse-url-chromium Chromium 3.0
;; browse-url-epiphany GNOME Web (Epiphany) Don't know
;; browse-url-webpositive WebPositive 1.2-alpha (Haiku R1/beta3)
;; browse-url-w3 w3 0
;; browse-url-text-* Any text browser 0
;; browse-url-generic arbitrary
;; browse-url-default-windows-browser MS-Windows browser
@ -108,9 +107,9 @@
;; Gnus provides a standard feature to activate URLs in article
;; buffers for invocation of browse-url.
;; Use the Emacs w3 browser when not running under X11:
;; Use the Emacs Web Wowser (EWW) when not running under X11:
;; (or (eq window-system 'x)
;; (setq browse-url-browser-function 'browse-url-w3))
;; (setq browse-url-browser-function #'eww-browse-url))
;; To always save modified buffers before displaying the file in a browser:
;; (setq browse-url-save-file t)
@ -150,7 +149,6 @@
(defvar browse-url--browser-defcustom-type
'(choice
(function-item :tag "Emacs W3" :value browse-url-w3)
(function-item :tag "eww" :value eww-browse-url)
(function-item :tag "Mozilla" :value browse-url-mozilla)
(function-item :tag "Firefox" :value browse-url-firefox)
@ -1033,7 +1031,6 @@ instead of `browse-url-new-window-flag'."
((executable-find browse-url-chrome-program) 'browse-url-chrome)
((executable-find browse-url-webpositive-program) 'browse-url-webpositive)
((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
((locate-library "w3") 'browse-url-w3)
(t
(lambda (&rest _ignore) (error "No usable browser found"))))
url args))
@ -1367,6 +1364,7 @@ prefix argument reverses the effect of `browse-url-new-window-flag'.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
(declare (obsolete nil "29.1"))
(interactive (browse-url-interactive-arg "W3 URL: "))
(require 'w3) ; w3-fetch-other-window not autoloaded
(if (browse-url-maybe-new-window new-window)

View file

@ -40,7 +40,6 @@
;; Silence warnings
(defvar newsticker-groups)
(defvar w3-mode-map)
(defvar w3m-minor-mode-map)
(defvar newsticker--retrieval-timer-list nil

View file

@ -37,7 +37,6 @@
(require 'xml)
;; Silence warnings
(defvar w3-mode-map)
(defvar w3m-minor-mode-map)
;; ======================================================================
@ -1232,7 +1231,6 @@ item-retrieval time is added as well."
(newsticker--buffer-do-insert-text item 'desc feed-name-symbol))
(defvar w3m-fill-column)
(defvar w3-maximum-line-length)
(defun newsticker--buffer-do-insert-text (item type feed-name-symbol)
"Actually insert contents of news item, format it, render it and all that.
@ -1366,19 +1364,14 @@ FEED-NAME-SYMBOL tells to which feed this item belongs."
"</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t)
;; (message "%s" (newsticker--title item))
(let ((w3m-fill-column (if newsticker-use-full-width
-1 fill-column))
(w3-maximum-line-length
(if newsticker-use-full-width nil fill-column)))
-1 fill-column)))
(save-excursion
(funcall newsticker-html-renderer pos-text-start
pos-text-end)))
(cond ((eq newsticker-html-renderer 'w3m-region)
(add-text-properties pos (point-max)
(list 'keymap
w3m-minor-mode-map)))
((eq newsticker-html-renderer 'w3-region)
(add-text-properties pos (point-max)
(list 'keymap w3-mode-map))))
(when (eq newsticker-html-renderer 'w3m-region)
(add-text-properties pos (point-max)
(list 'keymap
w3m-minor-mode-map)))
(setq is-rendered-HTML t)))
(error
(message "Error: HTML rendering failed: %s, %s"

View file

@ -112,18 +112,18 @@ window is used when filling. See also `newsticker-justification'."
"Function for rendering HTML contents.
If non-nil, newsticker.el will call this function whenever it
finds HTML-like tags in item descriptions.
Possible functions include `shr-render-region', `w3m-region', `w3-region', and
Possible functions include `shr-render-region', `w3m-region', and
`newsticker-htmlr-render'.
Newsticker automatically loads the respective package w3m, w3, or
Newsticker automatically loads the respective package w3m, or
htmlr if this option is set."
:type '(choice :tag "Function"
(const :tag "None" nil)
(const :tag "SHR" shr-render-region)
(const :tag "w3" w3-region)
(const :tag "w3m" w3m-region)
(const :tag "htmlr" newsticker-htmlr-render))
:set #'newsticker--set-customvar-formatting
:group 'newsticker-reader)
:group 'newsticker-reader
:version "29.1")
(defcustom newsticker-date-format
"(%A, %H:%M)"
@ -315,8 +315,6 @@ Return the image."
(if newsticker-html-renderer
(cond ((eq newsticker-html-renderer 'w3m-region)
(require 'w3m))
((eq newsticker-html-renderer 'w3-region)
(require 'w3-auto))
((eq newsticker-html-renderer 'newsticker-htmlr-render)
(require 'htmlr))))
(funcall newsticker-frontend))

View file

@ -252,7 +252,6 @@ their id stays constant."
(declare-function w3m-toggle-inline-images "ext:w3m" (&optional force no-cache))
(defvar w3m-fill-column)
(defvar w3-maximum-line-length)
(defun newsticker--treeview-render-text (start end)
"Render text between markers START and END."
@ -272,17 +271,13 @@ their id stays constant."
"</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" end t)
;; (message "%s" (newsticker--title item))
(let ((w3m-fill-column (if newsticker-use-full-width
-1 fill-column))
(w3-maximum-line-length
(if newsticker-use-full-width nil fill-column)))
-1 fill-column)))
(select-window (newsticker--treeview-item-window))
(save-excursion
(funcall newsticker-html-renderer start end)))
;;(cond ((eq newsticker-html-renderer 'w3m-region)
;; (add-text-properties start end (list 'keymap
;; w3m-minor-mode-map)))
;;((eq newsticker-html-renderer 'w3-region)
;;(add-text-properties start end (list 'keymap w3-mode-map))))
(if (eq newsticker-html-renderer 'w3m-region)
(w3m-toggle-inline-images t))
t)))

View file

@ -1580,14 +1580,6 @@ non-nil."
nil nil nil))))
(org-link-store-props :type "calendar" :date cd)))
((eq major-mode 'w3-mode)
(setq cpltxt (if (and (buffer-name)
(not (string-match "Untitled" (buffer-name))))
(buffer-name)
(url-view-url t))
link (url-view-url t))
(org-link-store-props :type "w3" :url (url-view-url t)))
((eq major-mode 'image-mode)
(setq cpltxt (concat "file:"
(abbreviate-file-name buffer-file-name))

View file

@ -158,7 +158,7 @@ If URL is a multibyte string, it will be encoded as utf-8 and
URL-encoded before it's used."
;; XXX: There is code in Emacs that does dynamic binding
;; of the following variables around url-retrieve:
;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets,
;; url-standalone-mode, url-gateway-unplugged,
;; url-confirmation-func, url-cookie-multiple-line,
;; url-cookie-{{,secure-}storage,confirmation}
;; url-standalone-mode and url-gateway-unplugged should work as

View file

@ -91,7 +91,6 @@ The third argument DOC is a documentation string for the widget."
(put name 'widget-documentation (purecopy doc))
name)
;; This is used by external widget code (in W3, at least).
(define-obsolete-function-alias 'widget-plist-member #'plist-member "26.1")
(provide 'widget)

View file

@ -31,7 +31,7 @@
(require 'ert-x)
(ert-deftest browse-url-tests-browser-kind ()
(should (eq (browse-url--browser-kind #'browse-url-w3 "gnu.org")
(should (eq (browse-url--browser-kind #'browse-url-emacs "gnu.org")
'internal))
(should
(eq (browse-url--browser-kind #'browse-url-firefox "gnu.org")