[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cannot yank media when image come from Gnome screenshot
From: |
Robert Pluim |
Subject: |
Re: Cannot yank media when image come from Gnome screenshot |
Date: |
Fri, 24 Jan 2025 11:50:59 +0100 |
>>>>> On Fri, 24 Jan 2025 10:37:37 +0530, Visuwesh <visuweshm@gmail.com> said:
Visuwesh> * lisp/org-compat.el: Add workaround proposed by Robert Pluim
Visuwesh> <rpluim@gmail.com> to make yank-media work under GNOME reliably
for
Visuwesh> Emacs 29.
Did I propose it? I donʼt remember 😀
Visuwesh> Link: https://list.orgmode.org/orgmode/87ed7kttoa.fsf@k-7.ch
Visuwesh> Reported-by: Sébastien Gendre <seb@k-7.ch>
Visuwesh> ---
Visuwesh> lisp/org-compat.el | 15 +++++++++++++++
Visuwesh> 1 file changed, 15 insertions(+)
Visuwesh> diff --git a/lisp/org-compat.el b/lisp/org-compat.el
Visuwesh> index 91192629a..3ad330628 100644
Visuwesh> --- a/lisp/org-compat.el
Visuwesh> +++ b/lisp/org-compat.el
Visuwesh> @@ -1992,6 +1992,21 @@ (make-obsolete-variable
'org-speed-commands-user
Visuwesh> "configure `org-speed-commands'
instead." "9.5")
Visuwesh> (provide 'org-compat)
Visuwesh> +;;;; yank-media
Visuwesh> +;; Emacs 29's pgtk port has a bug where it might fail to return
the
Visuwesh> +;; right TARGET. Install a workaround for Emacs <=29 since the
fix
Visuwesh> +;; went to Emacs 30. See bug#72254.
Visuwesh> +;; Org bug report link:
https://list.orgmode.org/orgmode/87ed7kttoa.fsf@k-7.ch
Visuwesh> +;; This should be removed once we drop Emacs 29 support.
Visuwesh> +(when (<= emacs-major-version 29)
I thought Ihor wanted this to check for a pgtk build? Personally I
think the check for the window system in the cl-defmethod is enough,
but Iʼm not Ihor.
One way to check for pgtk is checking the result of
(window-system). Or checking whether `pgtk-backend-display-class' is `fboundp'.
Visuwesh> + (cl-defmethod gui-backend-get-selection ((selection-symbol
(eql 'CLIPBOARD))
Visuwesh> + (target-type (eql
'TARGETS))
Visuwesh> + &context
(window-system pgtk))
Visuwesh> + (let ((sel (pgtk-get-selection-internal selection-symbol
target-type)))
Visuwesh> + (if (vectorp sel)
Visuwesh> + sel
Visuwesh> + (vector sel)))))
Visuwesh> +
Visuwesh> ;; Local variables:
Visuwesh> ;; generated-autoload-file: "org-loaddefs.el"
Visuwesh> ;; End:
Visuwesh> --
Visuwesh> 2.45.2
Robert
--