[Top][All Lists]

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

Re: [BR] Clipboard support on macOS and Org 9.7

From: Robert Pluim
Subject: Re: [BR] Clipboard support on macOS and Org 9.7
Date: Mon, 17 Jun 2024 14:05:04 +0200

>>>>> On Sun, 16 Jun 2024 23:22:14 +0200, Juergen Fenn <jfenn@gmx.net> said:
    Juergen> You might like to know that upgrading to Sonoma meant that I had to
    Juergen> re-compile my Emacs 29.3 because the one I had built under Ventura 
    Juergen> not run any more on the new platform. I managed to re-compile 
Emacs from
    Juergen> the 29.3 tarball I had used on Ventura, but I realised that I 
    Juergen> compile Emacs under Sonoma with gnutls. Although the latest gnutls 
    Juergen> installed on my machine (I even re-installed gnutls over Homebrew) 
    Juergen> though this posed no problem under Ventura, I had to use 
    Juergen> --with-gnutls=ifavailable=. Perhaps there were some changes to the 
    Juergen> Command Line Tools, too, that I re-installed for Sonoma. I can 
    Juergen> new packages with package.el, but Emacs now keeps telling me that
    Juergen> =Package tls is deprecated=.

That means youʼre using the cli tools, not the GnuTLS library. Perhaps
you need to have pkg-config installed as well in order for configure
to find the includes and the library.

    Juergen> Anyway, I have tested the clipboard bug with Org 9.7.4 on GNU 
Emacs 29.3
    Juergen> (build 1, aarch64-apple-darwin23.5.0, NS appkit-2487.60 Version 
    Juergen> (Build 23F79)) of 2024-06-09. Here is what I can reproduce:

    Juergen> - Open the file manager Finder and select a local jpg file.
    Juergen> - Press Command-c to copy the file to the clipboard.
    Juergen> - Switch to an Org buffer in Emacs.
    Juergen> - M-x yank-media.

    Juergen> It turns out that any file, regardless of its real format, gets 
    Juergen> with a TIFF file ending.

    Juergen> M-x yank-media-type yields:

    Juergen> (1/3) Yank type:
    Juergen> clipboard:image/tiff
    Juergen> clipboard:STRING
    Juergen> clipboard:text/plain


    Juergen> Ihor found out that MIME type support in macOS indeed is 


'ns_get_foreign_selection' queries the clipboard to see what types are
available, and those are the ones it reports. Based on a quick google,
if we were to say "give me the data as JPEG anyway", thereʼs a chance
it might work, but of course the source might actually be TIFF, or PNG.

I canʼt find an official API to query the macOS clipboard for which
types it supports, but then again Appleʼs docs site and I rarely get


reply via email to

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