1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

Merge pull request #138341 from adisbladis/emacs-ement-2021-09-16

emacs.pkgs.ement: unstable-2021-09-08 -> unstable-2021-09-16
This commit is contained in:
adisbladis 2021-09-18 12:54:37 -05:00 committed by GitHub
commit 8cc054594a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 7 deletions

View file

@ -9,7 +9,14 @@
trivialBuild {
pname = "ement";
version = "unstable-2021-09-08";
version = "unstable-2021-09-16";
src = fetchFromGitHub {
owner = "alphapapa";
repo = "ement.el";
rev = "c07e914f077199c95b0e7941a421675c95d4687e";
sha256 = "sha256-kYVb2NrHYC87mY/hFUMAjb4TLJ9A2L2RrHoiAXvRaGg=";
};
packageRequires = [
plz
@ -17,12 +24,9 @@ trivialBuild {
ts
];
src = fetchFromGitHub {
owner = "alphapapa";
repo = "ement.el";
rev = "468aa9b0526aaa054f059c63797aa3d9ea13611d";
sha256 = "sha256-0FCAu253iTSf9qcsmoJxKlzfd5eYc8eJXUxG6+0eg/I=";
};
patches = [
./handle-nil-images.patch
];
meta = {
description = "Ement.el is a Matrix client for Emacs";

View file

@ -0,0 +1,28 @@
diff --git a/ement.el b/ement.el
index c9596a7..1b33045 100644
--- a/ement.el
+++ b/ement.el
@@ -682,14 +682,15 @@ can cause undesirable underlining."
"Return a copy of IMAGE set to MAX-WIDTH and MAX-HEIGHT.
IMAGE should be one as created by, e.g. `create-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)
- ;; Only do this when ImageMagick is supported.
- ;; FIXME: When requiring Emacs 27+, remove this (I guess?).
- (setf (image-property new-image :type) 'imagemagick))
- (setf (image-property new-image :max-width) max-width
- (image-property new-image :max-height) max-height)
- new-image))
+ (when image
+ (let ((new-image (cl-copy-list image)))
+ (when (fboundp 'imagemagick-types)
+ ;; Only do this when ImageMagick is supported.
+ ;; FIXME: When requiring Emacs 27+, remove this (I guess?).
+ (setf (image-property new-image :type) 'imagemagick))
+ (setf (image-property new-image :max-width) max-width
+ (image-property new-image :max-height) max-height)
+ new-image)))
;;;;; Reading/writing sessions