emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Visuwesh <visuweshm@gmail.com>
Cc: "Ihor Radchenko" <yantar92@posteo.net>,
	"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 11:50:59 +0100	[thread overview]
Message-ID: <87cygc7aek.fsf@gmail.com> (raw)
In-Reply-To: <87jzakpzom.fsf@gmail.com> (Visuwesh's message of "Fri, 24 Jan 2025 10:37:37 +0530")

>>>>> 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
-- 


  reply	other threads:[~2025-01-24 10:51 UTC|newest]

Thread overview: 21+ 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
2025-01-24 10:50                           ` Robert Pluim [this message]
2025-01-24 12:57                             ` Visuwesh
2025-01-24 16:50                               ` Robert Pluim

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=87cygc7aek.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=seb@k-7.ch \
    --cc=visuweshm@gmail.com \
    --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).