[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2a8d083607 1/4: Drop support for the dead third-party w3 package
From: |
Stefan Kangas |
Subject: |
master 2a8d083607 1/4: Drop support for the dead third-party w3 package |
Date: |
Sat, 9 Jul 2022 12:18:18 -0400 (EDT) |
branch: master
commit 2a8d083607e7e0fe9358f1f6526dbd8aa928af61
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
doc/misc/org.org | 2 +-
etc/TODO | 2 --
lisp/ffap.el | 47 +++++++++++++++------------------------
lisp/msb.el | 4 ++--
lisp/net/browse-url.el | 8 +++----
lisp/net/newst-backend.el | 1 -
lisp/net/newst-plainview.el | 17 +++++---------
lisp/net/newst-reader.el | 10 ++++-----
lisp/net/newst-treeview.el | 7 +-----
lisp/org/ol.el | 8 -------
lisp/url/url.el | 2 +-
lisp/widget.el | 1 -
test/lisp/net/browse-url-tests.el | 2 +-
13 files changed, 36 insertions(+), 75 deletions(-)
diff --git a/doc/misc/org.org b/doc/misc/org.org
index b1dc708498..fa8fa408c7 100644
--- a/doc/misc/org.org
+++ b/doc/misc/org.org
@@ -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.
diff --git a/etc/TODO b/etc/TODO
index 7ab913f779..5c55a8b999 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -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
diff --git a/lisp/ffap.el b/lisp/ffap.el
index d7225ee9c9..9de0dd40d1 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -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)
diff --git a/lisp/msb.el b/lisp/msb.el
index 19f0afed73..6843df2edc 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -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
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 7cffe3e32e..355f9c12c0 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -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)
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index 7ae58884f9..5ae2df769a 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -40,7 +40,6 @@
;; Silence warnings
(defvar newsticker-groups)
-(defvar w3-mode-map)
(defvar w3m-minor-mode-map)
(defvar newsticker--retrieval-timer-list nil
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el
index df574dfa2f..4eb6f6c695 100644
--- a/lisp/net/newst-plainview.el
+++ b/lisp/net/newst-plainview.el
@@ -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"
diff --git a/lisp/net/newst-reader.el b/lisp/net/newst-reader.el
index 7e00ac93e7..4a7f0b8e3e 100644
--- a/lisp/net/newst-reader.el
+++ b/lisp/net/newst-reader.el
@@ -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))
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 1e04e7d1ca..637f53e655 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -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)))
diff --git a/lisp/org/ol.el b/lisp/org/ol.el
index a03d85f618..a0dad926bc 100644
--- a/lisp/org/ol.el
+++ b/lisp/org/ol.el
@@ -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))
diff --git a/lisp/url/url.el b/lisp/url/url.el
index 4592f0f2e7..d08ff04eda 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -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
diff --git a/lisp/widget.el b/lisp/widget.el
index 300a95bd22..e6a856b292 100644
--- a/lisp/widget.el
+++ b/lisp/widget.el
@@ -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)
diff --git a/test/lisp/net/browse-url-tests.el
b/test/lisp/net/browse-url-tests.el
index 8fcc831d53..1c993958b8 100644
--- a/test/lisp/net/browse-url-tests.el
+++ b/test/lisp/net/browse-url-tests.el
@@ -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")