about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement')
-rw-r--r--nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/handle-nil-images.patch28
2 files changed, 64 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/default.nix b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/default.nix
new file mode 100644
index 000000000000..73fd2f4a0a92
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/default.nix
@@ -0,0 +1,36 @@
+{ trivialBuild
+, lib
+, fetchFromGitHub
+, curl
+, plz
+, cl-lib
+, ts
+}:
+
+trivialBuild {
+  pname = "ement";
+  version = "unstable-2021-09-16";
+
+  src = fetchFromGitHub {
+    owner = "alphapapa";
+    repo = "ement.el";
+    rev = "c07e914f077199c95b0e7941a421675c95d4687e";
+    sha256 = "sha256-kYVb2NrHYC87mY/hFUMAjb4TLJ9A2L2RrHoiAXvRaGg=";
+  };
+
+  packageRequires = [
+    plz
+    cl-lib
+    ts
+  ];
+
+  patches = [
+    ./handle-nil-images.patch
+  ];
+
+  meta = {
+    description = "Ement.el is a Matrix client for Emacs";
+    license = lib.licenses.gpl3Only;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/handle-nil-images.patch b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/handle-nil-images.patch
new file mode 100644
index 000000000000..547fee164056
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/emacs/elisp-packages/ement/handle-nil-images.patch
@@ -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
+