]> git.eshelyaron.com Git - emacs.git/commitdiff
scope.el,elisp-mode.el: Recognize warning types
authorEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 07:56:06 +0000 (08:56 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 07:56:06 +0000 (08:56 +0100)
lisp/emacs-lisp/scope.el
lisp/progmodes/elisp-mode.el

index e1e958966e3d59b889fa7c7bdc30aaf669ecce11..f563159254c13e18eff56a958511d5bcb02c7da3 100644 (file)
@@ -982,6 +982,14 @@ a (possibly empty) list of safe macros.")
                           ;; Never expand them!
                           static-if eval-when-compile eval-and-compile))
             (scope-n local forms))
+           ((memq bare '(with-suppressed-warnings))
+            (dolist (warning (car forms))
+              (when-let* ((wsym (car-safe warning))
+                          (beg (scope-sym-pos wsym))
+                          (bare (scope-sym-bare wsym)))
+                (funcall scope-callback 'warning-type beg
+                         (length (symbol-name bare)) nil)))
+            (scope-n local (cdr forms)))
            ((memq bare '(with-slots))
             (scope-with-slots local (car forms) (cadr forms) (cddr forms)))
            ((memq bare '(ert-deftest))
index 39a6ed20ce69d691b9e9c5c83f75e72f830a400d..6161400751095cd5b972a1ca10e6ccc12c1a8514 100644 (file)
@@ -433,6 +433,7 @@ happens in interactive invocations."
      (macro         "Macro call")
      (special-form  "Special form")
      (throw-tag     "`throw'/`catch' tag")
+     (warning-type  "Warning type")
      (feature       "Feature")
      (rx-construct  "`rx' construct")
      (theme         "Theme")
@@ -457,6 +458,7 @@ happens in interactive invocations."
                          (macro         'elisp-macro-call)
                          (special-form  'elisp-special-form)
                          (throw-tag     'elisp-throw-tag)
+                         (warning-type  'font-lock-type-face)
                          (feature       'elisp-feature)
                          (rx-construct  'elisp-rx)
                          (theme         'elisp-theme)
@@ -909,6 +911,8 @@ in `completion-at-point-functions' (which see)."
                             ((major-mode) (lambda (sym) (get sym 'major-mode-name)))
                             ((type) (lambda (sym) (get sym 'cl--class)))
                             ((widget-type) (lambda (sym) (get sym 'widget-type)))
+                            ((warning-type)
+                             (lambda (sym) (memq sym byte-compile-warning-types)))
                             ((group) (lambda (sym) (get sym 'group-documentation)))
                             ((face) #'facep)
                             ((nil) (lambda (sym)