Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary local version of ‘with-suppressed-warnings’. #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unnecessary local version of ‘with-suppressed-warnings’.
‘with-suppressed-warnings’ was introduced in Emacs 27.1, so we don’t need our
local version any more.
  • Loading branch information
phst committed Nov 30, 2023
commit 129e4e08655fe6a09a46ddb195a915984db37f76
12 changes: 1 addition & 11 deletions bazel.el
Original file line number Diff line number Diff line change
Expand Up @@ -1822,17 +1822,7 @@ the containing workspace. This function is suitable for
"Return the primary root directory of the Bazel workspace PROJECT."
(bazel-workspace-root project))

(eval-when-compile
(defmacro bazel--with-suppressed-warnings (warnings &rest body)
"Suppress WARNINGS in BODY.
This is the same as ‘with-suppressed-warnings’ if available.
Otherwise, just evaluate BODY."
(declare (indent 1) (debug (sexp body)))
(if (macrop 'with-suppressed-warnings)
`(with-suppressed-warnings ,warnings ,@body)
(macroexp-progn body))))

(bazel--with-suppressed-warnings ((obsolete project-roots))
(with-suppressed-warnings ((obsolete project-roots))
(cl-defmethod project-roots ((project bazel-workspace))
"Return the primary root directory of the Bazel workspace PROJECT."
(list (bazel-workspace-root project))))
Expand Down
11 changes: 1 addition & 10 deletions test.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ that buffer once BODY finishes."
(dolist (buffer (buffer-list))
(unless (memq buffer ,buffers) (kill-buffer buffer)))))))

(defmacro bazel-test--with-suppressed-warnings (warnings &rest body)
"Suppress WARNINGS in BODY.
This is the same as ‘with-suppressed-warnigns’ if available.
Otherwise, just evaluate BODY."
(declare (indent 1) (debug (sexp body)))
(if (macrop 'with-suppressed-warnings)
`(with-suppressed-warnings ,warnings ,@body)
(macroexp-progn body)))

(defmacro bazel-test--wait-for (message condition)
"Busy wait for CONDITION to become non-nil.
MESSAGE is a message for ‘ert-info’."
Expand Down Expand Up @@ -434,7 +425,7 @@ gets killed early."
(should (file-directory-p (bazel-workspace-root project)))
(should (file-equal-p (bazel-workspace-root project) dir))
(should (file-equal-p (project-root project) dir))
(bazel-test--with-suppressed-warnings ((obsolete project-roots))
(with-suppressed-warnings ((obsolete project-roots))
(should (consp (project-roots project)))
(should-not (cdr (project-roots project)))
(should (file-equal-p (car (project-roots project)) dir)))
Expand Down