emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/ement 6b4ce57160 08/10: Merge: (ement-room-imag


From: ELPA Syncer
Subject: [elpa] externals-release/ement 6b4ce57160 08/10: Merge: (ement-room-image-show) Use frame parameters
Date: Tue, 3 Oct 2023 03:58:00 -0400 (EDT)

branch: externals-release/ement
commit 6b4ce571606ac047fff17122e4c3041ec561ac2f
Merge: 9845201d3a 2cfe8c46b3
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Merge: (ement-room-image-show) Use frame parameters
    
    Fixes #223.  Closes #225.
    
    Reported-by: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
---
 README.org    |  4 ++++
 ement-room.el | 17 +++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index c3362ca3cb..fcf57472bf 100644
--- a/README.org
+++ b/README.org
@@ -300,6 +300,10 @@ Ement.el doesn't support encrypted rooms natively, but it 
can be used transparen
 + Group joined direct rooms in directory buffers.
 + Command ~end-of-buffer~ is bound to ~N~ in room buffers.
 
+*Changes*
+
++ Command ~ement-room-image-show~ use frame parameters to maximize the frame, 
making it easier for users to override.  
([[https://github.com/alphapapa/ement.el/issues/223][#223]].  Thanks to 
[[https://github.com/progfolio][Nicholas Vollmer]].)
+
 *Fixes*
 
 + Name for direct rooms in directory buffers.
diff --git a/ement-room.el b/ement-room.el
index a5162b9c16..143c0dcf48 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -4150,8 +4150,7 @@ height."
   (pcase-let* ((image (copy-sequence (get-text-property pos 'display)))
                (ement-event (ewoc-data (ewoc-locate ement-ewoc pos)))
                ((cl-struct ement-event id) ement-event)
-               (buffer-name (format "*Ement image: %s*" id))
-               (new-buffer (get-buffer-create buffer-name)))
+               (buffer-name (format "*Ement image: %s*" id)))
     (when (fboundp 'imagemagick-types)
       ;; Only do this when ImageMagick is supported.
       ;; FIXME: When requiring Emacs 27+, remove this (I guess?).
@@ -4159,12 +4158,14 @@ height."
     (setf (image-property image :scale) 1.0
           (image-property image :max-width) nil
           (image-property image :max-height) nil)
-    (with-current-buffer new-buffer
-      (erase-buffer)
-      (insert-image image)
-      (image-mode))
-    (pop-to-buffer new-buffer '((display-buffer-pop-up-frame)))
-    (set-frame-parameter nil 'fullscreen 'maximized)))
+    (unless (get-buffer buffer-name)
+      (with-current-buffer (get-buffer-create buffer-name)
+        (erase-buffer)
+        (insert-image image)
+        (image-mode)))
+    (pop-to-buffer buffer-name
+                   '((display-buffer-pop-up-frame
+                      (pop-up-frame-parameters . ((fullscreen . t) (maximized 
. t))))))))
 
 (defun ement-room--format-m.image (event)
   "Return \"m.image\" EVENT formatted as a string.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]