From 13c86a37d67675230d41aa8d47f7ba77472c7623 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 7 Jul 2022 13:25:23 +0200 Subject: [PATCH 1/2] 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. * 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 ae86e55490..3d48281531 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 @@ -1326,29 +1325,24 @@ ffap-copy-string-as-kill ;; 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)) - (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\\) *= *" @@ -1489,12 +1483,7 @@ ffap-file-at-point ((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) @@ -1868,7 +1857,7 @@ ffap-at-mouse ;;; 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 616799f067..5f03995623 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -103,7 +103,7 @@ msb--few-menus ((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 @@ msb--very-many-menus ((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 @@ browse-url (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 @@ browse-url-default-browser ((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 @@ browse-url-w3 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 @@ newsticker--buffer-insert-item (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 @@ newsticker--buffer-do-insert-text "