emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: "Robert Pluim" <rpluim@gmail.com>,
	"Sébastien Gendre" <seb@k-7.ch>,
	org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: Cannot yank media when image come from Gnome screenshot
Date: Fri, 24 Jan 2025 10:37:37 +0530	[thread overview]
Message-ID: <87jzakpzom.fsf@gmail.com> (raw)
In-Reply-To: <87o6zwpzwl.fsf@gmail.com> (Visuwesh's message of "Fri, 24 Jan 2025 10:32:50 +0530")

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

[வெள்ளி ஜனவரி 24, 2025] Visuwesh wrote:

> [திங்கள் ஜனவரி 20, 2025] Ihor Radchenko wrote:
>
>> Ihor Radchenko <yantar92@posteo.net> writes:
>>
>>>>     Ihor> Yes, behind version check, pgtk build check, and, ideally, after
>>>>     Ihor> checking that such method is not yet defined.
>>>>
>>>> The cl-defmethod itself checks itʼs being run in a pgtk emacs, so not
>>>> sure we need more than that.
>>>
>>> The idea is to avoid modifying things outside Org mode unless strictly
>>> necessary.
>>
>> Looks like this patch is not happening unless somebody else (who
>> actually uses Emacs GTK build) steps up and creates it against Org mode.
>> Visuwesh?
>
> How about the attached?

Ooops, made a silly mistake.  Still need more coffee.  Sorry for the
noise!


[-- Attachment #2: 0001-Add-workaround-to-make-yank-media-work-under-GNOME-f.patch --]
[-- Type: text/x-diff, Size: 1829 bytes --]

From 0b8cc3d8ff40416c8fbb202e3c94fcf471a21f5d Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Fri, 24 Jan 2025 10:32:15 +0530
Subject: [PATCH] Add workaround to make yank-media work under GNOME for Emacs
 29
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/org-compat.el: Add workaround proposed by Robert Pluim
<rpluim@gmail.com> to make yank-media work under GNOME reliably for
Emacs 29.

Link: https://list.orgmode.org/orgmode/87ed7kttoa.fsf@k-7.ch
Reported-by: Sébastien Gendre <seb@k-7.ch>
---
 lisp/org-compat.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 91192629a..3ad330628 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -1992,6 +1992,21 @@ (make-obsolete-variable 'org-speed-commands-user
                         "configure `org-speed-commands' instead." "9.5")
 (provide 'org-compat)
 
+;;;; yank-media
+;; Emacs 29's pgtk port has a bug where it might fail to return the
+;; right TARGET.  Install a workaround for Emacs <=29 since the fix
+;; went to Emacs 30.  See bug#72254.
+;; Org bug report link: https://list.orgmode.org/orgmode/87ed7kttoa.fsf@k-7.ch
+;; This should be removed once we drop Emacs 29 support.
+(when (<= emacs-major-version 29)
+  (cl-defmethod gui-backend-get-selection ((selection-symbol (eql 'CLIPBOARD))
+                                           (target-type (eql 'TARGETS))
+                                           &context (window-system pgtk))
+    (let ((sel (pgtk-get-selection-internal selection-symbol target-type)))
+      (if (vectorp sel)
+          sel
+        (vector sel)))))
+
 ;; Local variables:
 ;; generated-autoload-file: "org-loaddefs.el"
 ;; End:
-- 
2.45.2


  reply	other threads:[~2025-01-24  5:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23  8:10 Cannot yank media when image come from Gnome screenshot Sébastien Gendre
2024-07-23  9:52 ` Ihor Radchenko
2024-07-23 10:24   ` Sébastien Gendre
2024-07-23 10:29     ` Ihor Radchenko
2024-07-23 10:47       ` Sébastien Gendre
2024-07-23 10:50         ` Ihor Radchenko
2024-07-26 18:35       ` Ihor Radchenko
2024-08-01  6:07         ` Visuwesh
2024-08-04 19:01           ` Ihor Radchenko
2024-08-05 15:32             ` Robert Pluim
2024-08-05 17:44               ` Ihor Radchenko
2024-08-05 19:03                 ` Robert Pluim
2024-08-05 19:07                   ` Ihor Radchenko
2025-01-12 17:58                     ` Ihor Radchenko
2025-01-20 18:58                     ` Ihor Radchenko
2025-01-21  4:07                       ` Visuwesh
2025-01-24  5:02                       ` Visuwesh
2025-01-24  5:07                         ` Visuwesh [this message]
2025-01-24 10:50                           ` Robert Pluim
2025-01-24 12:57                             ` Visuwesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzakpzom.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rpluim@gmail.com \
    --cc=seb@k-7.ch \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).