branch: externals/ement
commit 837991d265ffa9a0004bc8f2fdd866a48cf3ea44
Author: Adam Porter <[email protected]>
Commit: Adam Porter <[email protected]>
Tidy: Lint warnings on CI
The Emacs builds from setup-emacs don't include image or GUI support,
so they cause lint warnings that wouldn't happen otherwise.
---
ement-lib.el | 22 ++++++++++++++--------
ement-notify.el | 6 ++++++
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/ement-lib.el b/ement-lib.el
index 8bfad5e1fd..ad75bf79d3 100644
--- a/ement-lib.el
+++ b/ement-lib.el
@@ -39,6 +39,7 @@
(require 'cl-lib)
+(require 'button)
(require 'color)
(require 'map)
(require 'seq)
@@ -1352,6 +1353,10 @@ can cause undesirable underlining."
(defun ement--resize-image (image max-width max-height)
"Return a copy of IMAGE set to MAX-WIDTH and MAX-HEIGHT.
IMAGE should be one as created by, e.g. `create-image'."
+ (declare
+ ;; This silences a lint warning on our GitHub CI runs, which use a build of
Emacs
+ ;; without image support.
+ (function image-property "image"))
;; It would be nice if the image library had some simple functions to do
this sort of thing.
(let ((new-image (cl-copy-list image)))
(when (fboundp 'imagemagick-types)
@@ -1613,14 +1618,15 @@ problems."
Before Emacs 28, ignores `xml-invalid-character' errors (and any
invalid characters cause STRING to remain unescaped). After
Emacs 28, uses the NOERROR argument to `xml-escape-string'."
- (condition-case _
- (xml-escape-string string 'noerror)
- (wrong-number-of-arguments
- (condition-case _
- (xml-escape-string string)
- (xml-invalid-character
- ;; We still don't want to error on this, so just return the string.
- string)))))
+ (with-suppressed-warnings ((callargs xml-escape-string))
+ (condition-case _
+ (xml-escape-string string 'noerror)
+ (wrong-number-of-arguments
+ (condition-case _
+ (xml-escape-string string)
+ (xml-invalid-character
+ ;; We still don't want to error on this, so just return the string.
+ string))))))
(defun ement--mark-room-direct (room session)
"Mark ROOM on SESSION as a direct room.
diff --git a/ement-notify.el b/ement-notify.el
index ef26f7c06a..1efd147a3a 100644
--- a/ement-notify.el
+++ b/ement-notify.el
@@ -200,6 +200,12 @@ Does not do anything if session hasn't finished initial
sync."
(defun ement-notify--mark-frame-urgent (_event room _session)
"Mark frame showing ROOM's buffer as urgent.
If ROOM has no existing buffer, do nothing."
+ (declare
+ ;; These silence lint warnings on our GitHub CI runs, which use a build of
Emacs
+ ;; without GUI support.
+ (function dbus-get-unique-name "dbusbind.c")
+ (function x-change-window-property "xfns.c")
+ (function x-window-property "xfns.c"))
(cl-labels ((mark-frame-urgent
(frame) (let* ((prop "WM_HINTS")
(hints (cl-coerce