emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards a cleaner build


From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build
Date: Sun, 09 Jun 2019 17:40:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Some of these warnings are perhaps not, like, very useful to be able to
suppress, but I thought it'd be nice if the warnings you could suppress
is the same as you can do via byte-compile-warnings, so I've implemented
almost all of them.

So now the following monstrosity compiles without a single warning.  :-)

;;; stest.el ---  -*- lexical-binding: t -*-

(require 'stest-defs)

(defun obsolete ()
  (declare (obsolete foo "22.1")))

(defun wrong-params (foo &optional _unused)
  foo)

(with-suppressed-warnings ((lexical prefixless))
  (defvar prefixless))

(with-suppressed-warnings ((redefine redefine))
  (defun redefine (foo bar)
    (cons foo bar)))

(defun tests ()
  (with-suppressed-warnings ((constants nil))
    (let ((nil t))
      (message-mail)))
  
  (with-suppressed-warnings ((obsolete obsolete))
    (obsolete))
  (with-suppressed-warnings ((callargs wrong-params))
    (wrong-params 1 2 3))
  (with-suppressed-warnings ((obsolete obsolete-variable))
    obsolete-variable)

  (with-suppressed-warnings ((mapcar mapcar))
    (mapcar #'list '(1 2 3)))
  
  (with-suppressed-warnings ((free-vars free-variable))
    free-variable)

  (with-suppressed-warnings ((suspicious set-buffer))
    (save-excursion
      (set-buffer (get-buffer-create "foo"))
      nil))

  )


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




reply via email to

[Prev in Thread] Current Thread [Next in Thread]