From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: mituharu@math.s.chiba-u.ac.jp Newsgroups: gmane.emacs.devel Subject: Re: lisp/term/ns-win.el modification Date: Thu, 27 Apr 2017 21:51:03 +0900 Message-ID: References: <44D4AA3B-8F87-42B6-A2D2-00487B066183@gmail.com> <74D20593-63B6-46FB-BAC3-D841D0BCD461@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1493297478 26192 195.159.176.226 (27 Apr 2017 12:51:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Apr 2017 12:51:18 +0000 (UTC) User-Agent: SquirrelMail/1.4.22-4.el6 Cc: emacs-devel To: "Jean-Christophe Helary" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 27 14:51:14 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 1d3it8-0006j9-6T for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2017 14:51:14 +0200 Original-Received: from localhost ([::1]:60586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3itC-000376-RD for ged-emacs-devel@m.gmane.org; Thu, 27 Apr 2017 08:51:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3it6-00036w-Fm for emacs-devel@gnu.org; Thu, 27 Apr 2017 08:51:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3it1-0005Hj-M2 for emacs-devel@gnu.org; Thu, 27 Apr 2017 08:51:12 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:54079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3it1-0005E5-5m for emacs-devel@gnu.org; Thu, 27 Apr 2017 08:51:07 -0400 Original-Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 015BFF08FE; Thu, 27 Apr 2017 21:51:03 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Original-Received: from 114.155.49.99 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Thu, 27 Apr 2017 21:51:03 +0900 In-Reply-To: <74D20593-63B6-46FB-BAC3-D841D0BCD461@gmail.com> X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 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:214339 Archived-At: >> * File names in macOS may start or end with spaces. It's probably not = a >> good idea to trim spaces. (Again, it's hard to tell without a >> description of the format.) > > Yes, but we're not talking about file names but file paths in a text fi= le > here. > The problem with not trimming is that when a legit file is > tripple-clicked, the whole line is selected, including trailing spaces. > The way the service is currently implemented considers that spaces a > belonging to the file name and since that file does not exist just open= s a > blank buffer. > > So I guess I could add a test to check wether the trimmed file exist an= d > if not add the selected white space until I get an existing file (but t= hen > we'd hit cases where 2 files ending with different sorts of white space > could be confused for each other). For more consistent behavior with other apps on macOS, you can let the system parse the selected text to get (possibly multiple) filenames. Just inspect the service pasteboard with NSFilenamesPboardType instead of NSStringPboardType. Alternatively, creating NSURL objects for pasteboard items would also work. (I'm not sure if this works on GNUstep.) https://developer.apple.com/library/content/documentation/Cocoa/Conceptua= l/PasteboardGuide106/Articles/pbReading.html#//apple_ref/doc/uid/TP400081= 23-SW5 YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp