From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71909: 30.0.60; Date: Sat, 02 Nov 2024 12:44:32 +0200 Message-ID: <86ldy1zzhr.fsf@gnu.org> References: <865xtnhyn6.fsf@foxmail.com> <58c79a62-cd21-4ff5-8e81-a9ba3e9b2097@imayhem.com> <86plnj56li.fsf@gnu.org> <3b0ad17c-aa6e-421c-a17a-453bf0483023@imayhem.com> <86r07x4n93.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27074"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71909@debbugs.gnu.org To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 02 11:46:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t7Be3-0006mc-KJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Nov 2024 11:46:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7Bds-0000aB-VN; Sat, 02 Nov 2024 06:46:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7Bdr-0000Zz-1K for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 06:46:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7Bdq-00062I-Od for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 06:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=4wPnMyZzse7yFKO+9COMC4+ZMltj+uoRJACKUQ530vU=; b=q74QDSGKlCzlFC6X6Nh5cD1favC2nz3OQGK+E4YU4TUbJvkvtL+8iPuVWJ78R1nU1fAorU5GAI3Lo7EzujfaZAF2uJX27VFpQ8cVpXTrE0tWmh/1jr2QiNimUWSYEsUjqhPvEQ7FSJ0/xwCwkVlnVeiGzwWxO+Nj5NiDqZfFSG2VDwhiwamCmvLCAz8jo2t1J8FeLjpZRFRYegiZvaNjuj9YLDc0iJ1LqEWePGd2JelD43Lpf1P3/OPe3mzdUAJsTnxKyOn8VW1+x4zKiGvU5B30nXuMJYVYmFx/7zpt0YS0OutR7U2Xn7zvIKaGdQiDACLzsF0N9KNVwmXzSTMEyQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t7Bdq-0006Vh-If for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 06:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2024 10:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71909 X-GNU-PR-Package: emacs Original-Received: via spool by 71909-submit@debbugs.gnu.org id=B71909.173054430424711 (code B ref 71909); Sat, 02 Nov 2024 10:46:02 +0000 Original-Received: (at 71909) by debbugs.gnu.org; 2 Nov 2024 10:45:04 +0000 Original-Received: from localhost ([127.0.0.1]:53241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7Bcu-0006Pg-Bt for submit@debbugs.gnu.org; Sat, 02 Nov 2024 06:45:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7Bcr-0006Or-Pb for 71909@debbugs.gnu.org; Sat, 02 Nov 2024 06:45:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7Bcm-0005VB-Cn; Sat, 02 Nov 2024 06:44:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4wPnMyZzse7yFKO+9COMC4+ZMltj+uoRJACKUQ530vU=; b=Dgp6v/8r6aj3 jan1hPjBnwnelRKJqSZuPmKbw1z7m7JaC0SLTMvRKLwZKTAu/GByBI++uQiDLCi5Ei6W/PnypW6Bv 97k/0pr5k0l7qZm4fZpWgtp+Ba79LLA3zecZjWcnYhMFOsMge4vFDFmPehNb/3XG2byUQKr9dOWQl 1K0ZXqblmVY1QAT1+nSY/dfXAXCGPmwPse3ystY56GIUrouj0qmahKBKpCXITgA+Tt2XdtcE2Lz1g 0QR22Zf9hMbtf7imiAp/atbo4t9sAozn3KshNYuxG8hGi1yJwVspBQ5hWUTkPI3culc7pa+ZFJAZE mY6VS69O85wyAYBYKSN7Tg==; In-Reply-To: (message from Cecilio Pardo on Sat, 2 Nov 2024 01:23:11 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294724 Archived-At: > Date: Sat, 2 Nov 2024 01:23:11 +0100 > Cc: 71909@debbugs.gnu.org > From: Cecilio Pardo > > Here is a new version, with the discussed corrections. > > - Now the test for gdiplus is done calling w32_gdiplus_startup. > Will use it if its available, even if native image functions > are disabled. > - Don't use cl-seq. > - Use Fexpand_file_name on file name. > - Send unibyte string only for binary data. > - Use unwind-protect to ensure temp file is deleted. > - Fixed docs, changelog, NEWS and manual. Thanks, there are a few minor nits left. > Adds the capacity to handle types different from strings to the > clipboard management functions on MS-Windows, and some logic > required to convert media types names and content to be what > yank-media and the modes that use it expect. Please mention the bug number somwhere in the log message. > * lisp/term/w32-win.el (w32--selection-target-translations): New > variable that holds the name translations for media tytpes. ^^^^^^ Typo. > (w32--translate-reverse-selection-target): New function, Reverse > translation. ^^^^^^^ "reverse", not capitalized. > * src/w32select.c (stdfmt_name): Made global, was function > static. ^^^^^^^^^^^^ ^^^^^^ "was static function" > (convert_dibv5_to_png): New function to convert DIBV5 clipboard > format to PNG. > (get_clipboard_format_name): New function get the name of a > format given its index. > (Fw32__get_clipboard_data_media): New function, retrieves and > converts media content. > (syms_of_w32select): Export new lisp functions > * src/w32gdiplus.h: New file, for definitions in w32image.c > * doc/lispref/frames.texi: Updated with MS-Windows support. etc/NEWS not mentioned. > ++++ > +** Emacs on MS-Windows now supports 'yank-media'. > +This command inserts clipboard data of different formats into the > +current buffer, if the active mode supports it. ^^^^^^^^^^^ "major mode" > +(defun w32--translate-selection-target(target) ^^ We leave one space between the function's name and the opening parenthesis. Same issue with other functions you added. > + (let ((str (symbol-name mime-type))) > + (or > + (eq mime-type 'application/xml) > + (eq mime-type 'application/json) > + (eq mime-type 'application/yaml) > + (eq mime-type 'application/json-seq) > + (string-match-p "\\`text/" str) > + (string-match-p "+xml\\'" str) > + (string-match-p "+json\\'" str) > + (string-match-p "+yaml\\'" str) > + (string-match-p "+json-seq\\'" str)))) This begs for 2 variables and using memq and seq-contains-p. Or am I missing something? > +Elements in FORMATS are symbols naming a format, such a image/png, or > +image/jpeg. They don't need to be MIME types, any format available can > +be retrieved. For compatibility with X systems, some conventional > +format names are translated to equivalent MIME types. Should this mention 'w32--selection-target-translations'? And I don't understand what you mean by the second sentence above. Surely, "any format" can be retrieved only if there's a handler for it? > +If it returns t, then the file contains the data. I guess we should add "and the caller should read the file to fetch the data"? > +If it returns a string, then that is the data and the file is not used. > + > +When returning a string, it can be unibyte if the format is not known to > +be text. */) > + (Lisp_Object formats, Lisp_Object temp_file_in, Lisp_Object is_textual) This doc string doesn't say anything about the IS-TEXTUAL argument.