[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement 680be429cf 4/6: Change: (ement-room-image-keymap)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement 680be429cf 4/6: Change: (ement-room-image-keymap) Inherit from image-map |
Date: |
Fri, 24 Feb 2023 11:57:47 -0500 (EST) |
branch: externals/ement
commit 680be429cf61edcfb55f472b94a89b121570770d
Author: Visuwesh <visuweshm@gmail.com>
Commit: Adam Porter <adam@alphapapa.net>
Change: (ement-room-image-keymap) Inherit from image-map
See also #39.
Comment: (ement-room-image-scale-mouse) Explain changes inline
For a detailed reason, see #39.
Modified-by: Adam Porter <adam@alphapapa.net>
---
ement-room.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/ement-room.el b/ement-room.el
index 65a3393247..9fdf05ddd0 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -3798,6 +3798,7 @@ STRUCT should be an `ement-room-membership-events'
struct."
(defvar ement-room-image-keymap
(let ((map (make-sparse-keymap)))
+ (set-keymap-parent map image-map)
;; TODO: Make RET work for showing images too.
;; (define-key map (kbd "RET") #'ement-room-image-show)
(define-key map [mouse-1] #'ement-room-image-scale-mouse)
@@ -3841,14 +3842,18 @@ height."
(pcase-let* ((image (get-text-property pos 'display))
(window-width (window-body-width nil t))
(window-height (window-body-height nil t))
- (new-height (if (= window-height (image-property image
:max-height))
+ ;; Image scaling commands set :max-height and friends to
nil so use the
+ ;; impossible dummy value -1. See
<https://github.com/alphapapa/ement.el/issues/39>.
+ (new-height (if (= window-height (or (image-property image
:max-height) -1))
(/ window-height 10)
window-height)))
(when (fboundp 'imagemagick-types)
;; Only do this when ImageMagick is supported.
;; FIXME: When requiring Emacs 27+, remove this (I guess?).
(setf (image-property image :type) 'imagemagick))
- (setf (image-property image :max-width) window-width
+ ;; Set :scale to nil since image scaling commands might have changed
it.
+ (setf (image-property image :scale) nil
+ (image-property image :max-width) window-width
(image-property image :max-height) new-height)))))
(defun ement-room-image-show (event)
- [elpa] externals/ement updated (d33ec2a547 -> d6c9e0a909), ELPA Syncer, 2023/02/24
- [elpa] externals/ement 38bf04b4d6 3/6: Merge: (ement-connect) Update password authentication, ELPA Syncer, 2023/02/24
- [elpa] externals/ement 680be429cf 4/6: Change: (ement-room-image-keymap) Inherit from image-map,
ELPA Syncer <=
- [elpa] externals/ement 46b9243c9c 5/6: Docs: Update changelog, ELPA Syncer, 2023/02/24
- [elpa] externals/ement d6c9e0a909 6/6: Merge: (ement-room-image-keymap) Inherit from image-map, ELPA Syncer, 2023/02/24
- [elpa] externals/ement d28314b54b 2/6: Docs: Update changelog, ELPA Syncer, 2023/02/24
- [elpa] externals/ement b7f11a45be 1/6: conduit fix, ELPA Syncer, 2023/02/24