From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: lisp/term/ns-win.el modification Date: Tue, 2 May 2017 21:57:47 +0900 Message-ID: <72EA8A0D-F889-4AC9-8E5E-45C2956E5CAD@gmail.com> References: <44D4AA3B-8F87-42B6-A2D2-00487B066183@gmail.com> <74D20593-63B6-46FB-BAC3-D841D0BCD461@gmail.com> <0A49E755-3D18-48E8-81D4-253160F60A16@gmail.com> <40f503a4-49eb-a3ff-fe5f-993c8f346c33@lanl.gov> <15112485-03CC-4FFF-8A9D-BA28D2490A91@gmail.com> <42CDF1D0-015D-4F0D-A8A2-A55776D34FEE@gmail.com> <83inlmkmqq.fsf@gnu.org> <5d3d3f3d-e49e-2b83-0591-14b3e19f8cb0@gmail.com> <834lx5lxz6.fsf@gnu.org> <7A82B268-C40B-4D45-8973-68A2408F7F28@gmail.com> <83r309jdcj.fsf@gnu.org> <00A24BD4-FE6F-4098-A8DD-73240899FA13@gmail.com> <83efw9j6l0.fsf@gnu.org> <0FED46C2-B8D7-40B3-BEF0-1515E7E5DE9F@gmail.com> <83wpa0iold.fsf@gnu.org> <72ADB3FE-F9A6-4030-A4F8-84C60A42040C@gmail.com> <83vapkilx4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_66195E0E-26F8-4CFF-A982-2D4533528B86" X-Trace: blaine.gmane.org 1493729884 21789 195.159.176.226 (2 May 2017 12:58:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 12:58:04 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 02 14:58:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5XNQ-0005Zj-4H for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 14:58:00 +0200 Original-Received: from localhost ([::1]:58735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5XNV-0008MM-Q9 for ged-emacs-devel@m.gmane.org; Tue, 02 May 2017 08:58:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5XNN-0008Kc-3u for emacs-devel@gnu.org; Tue, 02 May 2017 08:57:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5XNJ-0003Wc-6O for emacs-devel@gnu.org; Tue, 02 May 2017 08:57:57 -0400 Original-Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]:34863) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5XNJ-0003WB-16 for emacs-devel@gnu.org; Tue, 02 May 2017 08:57:53 -0400 Original-Received: by mail-pg0-x22b.google.com with SMTP id o3so55611697pgn.2 for ; Tue, 02 May 2017 05:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=ksKlQKA6pRv97j1cgrFr3gtU9i6rmCKBab7MhX1yWUo=; b=VNgR65TAjstJ6GXPNs5tiva8VJjVnnxA3rZL7C02gqO/rP82XJFJyckqD7ksK7ZOQH hcIx/2F66ZzKPwbqY3XgNtWnk5UZXR/TJIClvD0c6mETOjSfoP3JPPQV/cF2oAY60leM +B9D4KEwGtS/UcUOxekyLzJjvMX6lDyMHD/203RbCwTUsMKCWAId80Zrpw9ho758jSst zlODZEw0+TH6GvLrbngraiZDrgNsg5onOk2YQRUjnlW7n0NQbxFrqvX8qJmD96DDKyCr HFlw5BtccHUxyqCVyFo5jcHjQikBgfFZb7ZP/ss6iZmRteNdFV9aAyMJe8Zi1dHUMRlx 4Mww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=ksKlQKA6pRv97j1cgrFr3gtU9i6rmCKBab7MhX1yWUo=; b=cDGBxGZaAL01LQduQgnety8DDnqdWApYGq04+UOqqz38Hoin8+5vc1I6puibk7Iiu5 8KBloFibhPYNm+wgZw/lXWipxuxPyFW8GT/c0pg99NKSOUq25soEcLN6UskEe0bw2+XL sRzfsFxRHSQzICGSRZgaINjXpzYXIyIx95087g41LUzxbOlZBiPGfXLc7CKT1Ep/Gyw7 7C2q6b+ZuzXOUaCLbLf83ZdGViXWeH2CvNSVXm9h0Hsdum5p5jjdAY2eg46rUVG87LxT LgGAZJ65i31ZG02cIsb8AdOriDXhYTj1DSA3lSyM+DlgQ/1955zi26ov2/G3X6e/oWyU QxUw== X-Gm-Message-State: AN3rC/4POC1O+DMBlP52pzJRMD7UsAy06iaktGeccKjepSMtMYz2iFPD KnjvBfnNT62nOBSxEyA= X-Received: by 10.99.127.80 with SMTP id p16mr5280219pgn.180.1493729871785; Tue, 02 May 2017 05:57:51 -0700 (PDT) Original-Received: from [192.168.24.54] (pl25298.ag0304.nttpc.ne.jp. [133.232.153.210]) by smtp.gmail.com with ESMTPSA id 83sm8010096pfu.106.2017.05.02.05.57.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 05:57:50 -0700 (PDT) In-Reply-To: <83vapkilx4.fsf@gnu.org> X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214515 Archived-At: --Apple-Mail=_66195E0E-26F8-4CFF-A982-2D4533528B86 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 2, 2017, at 1:25, Eli Zaretskii wrote: >=20 >> From: Jean-Christophe Helary >> Date: Tue, 2 May 2017 00:58:44 +0900 >>=20 >> Ok, everything fixed here. I'll resend the patch when I am done with = the copyright paperwork and when I understand how to write a proper = commit log message (hopefully it will take me less time that it took to = write this patch... :) >=20 > This contribution is short enough for us to accept it even without the > paperwork. (I do encourage you to go on with paperwork, so that your > future contributions will be accepted as well.) So just send the > fixed patch with the log message, and someone will commit it for you. Ok, I'm not sure how to send the log message so I just copied it here. = And I've further simplified the patch so I'm attaching the newest and = hopefully last version here. Jean-Christophe=20 Log message: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Multiline support in NS "open-file" service * lisp/term/ns-win.el (ns-open-file-service): new function. Wraps the = original call in a (split-string) to create as many calls as there are = lines. (ns-spi-service-call): use it. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D --Apple-Mail=_66195E0E-26F8-4CFF-A982-2D4533528B86 Content-Disposition: attachment; filename=ns-win.el.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="ns-win.el.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 70bd817d93..2d173b2d80 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -229,6 +229,16 @@ The properties returned may include `top', `left', `height', and `width'." (declare-function dnd-open-file "dnd" (uri action)) +;; Handles multiline strings that are passed to the "open-file" service. +(defun ns-open-file-service (filenames) + "Open multiple files when selecting a multiline string FILENAMES." + (let ((filelist (split-string filenames "[\n\r]+" t "[ \u00A0\t]+"))) + ;; The path strings are timmed for spaces, nbsp and tabs. + (dolist (filestring filelist) + (if (not (equal "" filestring)) + (dnd-open-file filestring nil))))) + + (defun ns-spi-service-call () "Respond to a service request." (interactive) @@ -236,7 +246,7 @@ The properties returned may include `top', `left', `height', and `width'." (switch-to-buffer (generate-new-buffer "*untitled*")) (insert ns-input-spi-arg)) ((string-equal ns-input-spi-name "open-file") - (dnd-open-file ns-input-spi-arg nil)) + (ns-open-file-service ns-input-spi-arg)) ((string-equal ns-input-spi-name "mail-selection") (compose-mail) (rfc822-goto-eoh) --Apple-Mail=_66195E0E-26F8-4CFF-A982-2D4533528B86--