From d1677d0a926c148ef4fce65251311fc8dc796464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 5 Jul 2025 13:53:56 +0200 Subject: [PATCH] Make elint obsolete (bug#78685) It never was very useful to begin with, produces lots of false positives, and the byte-compiler has long eclipsed it in warning quality. * lisp/emacs-lisp/elint.el: Move this file... * lisp/obsolete/elint.el: ...here, and declare obsolete. (elint-file, elint-directory, elint-current-buffer, elint-defun): Declare obsolete. (elint--file): Split from elint-file to avoid warning. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Remove elint menu entries. * etc/NEWS: Announce --- etc/NEWS | 4 ++++ lisp/{emacs-lisp => obsolete}/elint.el | 12 +++++++++++- lisp/progmodes/elisp-mode.el | 9 --------- 3 files changed, 15 insertions(+), 10 deletions(-) rename lisp/{emacs-lisp => obsolete}/elint.el (99%) diff --git a/etc/NEWS b/etc/NEWS index 7504326374a..679d98d4fe7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2318,6 +2318,10 @@ indicate problems in Org, and if found, will ask whether the bug report is actually about Org (in which case users should use the Org-specific command for reporting bugs). +--- +** The elint package is now obsolete. +Use the byte-compiler instead; it provides more and more useful warnings. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/elint.el b/lisp/obsolete/elint.el similarity index 99% rename from lisp/emacs-lisp/elint.el rename to lisp/obsolete/elint.el index 5ae8880167d..f3d52ba0faf 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/obsolete/elint.el @@ -5,6 +5,7 @@ ;; Author: Peter Liljenberg ;; Maintainer: emacs-devel@gnu.org ;; Created: May 1997 +;; Obsolete-since: 31.1 ;; Keywords: lisp ;; This file is part of GNU Emacs. @@ -24,6 +25,8 @@ ;;; Commentary: +;; *Note: This package is obsolete. Use the byte-compiler instead.* + ;; This is a linter for Emacs Lisp. Currently, it mainly catches ;; misspellings and undefined variables, although it can also catch ;; function calls with the wrong number of arguments. @@ -243,7 +246,11 @@ This environment can be passed to `macroexpand'." ;;;###autoload (defun elint-file (file) "Lint the file FILE." + (declare (obsolete nil "31.1")) (interactive "fElint file: ") + (elint--file file)) + +(defun elint--file (file) (setq file (expand-file-name file)) (or elint-builtin-variables (elint-initialize)) @@ -277,6 +284,7 @@ This environment can be passed to `macroexpand'." (defun elint-directory (directory) "Lint all the .el files in DIRECTORY. A complicated directory may require a lot of memory." + (declare (obsolete nil "31.1")) (interactive "DElint directory: ") (let ((elint-running t)) (dolist (file (directory-files directory t)) @@ -286,13 +294,14 @@ A complicated directory may require a lot of memory." (not (auto-save-file-name-p file))) (if (string-match elint-directory-skip-re file) (message "Skipping file %s" file) - (elint-file file))))) + (elint--file file))))) (elint-set-mode-line)) ;;;###autoload (defun elint-current-buffer () "Lint the current buffer. If necessary, this first calls `elint-initialize'." + (declare (obsolete nil "31.1")) (interactive) (or elint-builtin-variables (elint-initialize)) @@ -312,6 +321,7 @@ If necessary, this first calls `elint-initialize'." (defun elint-defun () "Lint the function at point. If necessary, this first calls `elint-initialize'." + (declare (obsolete nil "31.1")) (interactive) (or elint-builtin-variables (elint-initialize)) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index e3b17f9b4fc..aa2daf6820a 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -106,15 +106,6 @@ All commands in `lisp-mode-shared-map' are inherited by this map." :help "Go to the start of the current function definition"] ["Up List" up-list :help "Go one level up and forward"]) - ("Linting" - ["Lint Defun" elint-defun - :help "Lint the function at point"] - ["Lint Buffer" elint-current-buffer - :help "Lint the current buffer"] - ["Lint File..." elint-file - :help "Lint a file"] - ["Lint Directory..." elint-directory - :help "Lint a directory"]) ("Profiling" ;; Maybe this should be in a separate submenu from the ELP stuff? ["Start Native Profiler..." profiler-start