all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean-Christophe Helary <jean.christophe.helary-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: emacs-devel <emacs-devel-mXXj517/zsQ@public.gmane.org>
Cc: aquamacs-devel-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: lisp/term/ns-win.el modification
Date: Fri, 28 Apr 2017 10:49:42 +0900	[thread overview]
Message-ID: <E98DA10D-FE1D-487A-932C-2DEE3172219A@gmail.com> (raw)
In-Reply-To: <15112485-03CC-4FFF-8A9D-BA28D2490A91-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Thank you everybody for the advice. Following yesterday's discussion, I have modified the patch the following way:

1) The code from ergomacs was removed and replaced with the string-trim function from subr-x
2) The splitting on \f, \t, \v was removed (I've kept the splitting on \n and \r since they are "natural" splitters when selecting multiple lines)
3) The ns- prefix was added to the function
4) while was replaced by dolist

Regarding 3) and Anders' comment "If all you do is to place the call inside a dolist, you should be ok. Introducing additional functions (only used in one location) isn't 100% clean either." I'm not sure I want to change the cond block because it is very elegant as it is. Please advise.

I have yet to investigate how to implement Mitsuharu's suggestion but it seems to be involving Objective-C programming which I am not sure I can handle.

The new patch is now waiting to be considered for a merge in Aquamacs and is available here:

https://github.com/davidswelt/aquamacs-emacs/pull/129/files

Jean-Christophe

> On Apr 28, 2017, at 8:32, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
> 
>> 
>> On Apr 28, 2017, at 0:09, Davis Herring <herring-YOWKrPYUwWM@public.gmane.org> wrote:
>> 
>>>> I mean what the string contains. Your code splits it on certain characters: "[\f\t\n\r\v]+". It is always good to be able to go to some documentation, to verify that these really are the characters that delimiter file names. However, if the content is an arbitrary text file, then that should be mentioned.
>>> 
>>> The content is an arbitrary string selected in any application that supports services. I've removed \s from the delimiters *because* spaces can be part of a path on Mac.
>> 
>> All those characters could appear as well: macOS is Unix, after all, and so supports anything except NUL (and reserves / as a directory separator, although in some interfaces / and : are interchanged).  That said, of course spaces are much more common in names, but it's good to remember that this is a human factors decision, not a technical one based on OS rules.
> 
> After a night of sleep, I guess I could split only on \n and \r since they are the one that the user will use as a visual cue to select paths put on multiple lines. Would that be satisfying ?
> 
> Jean-Christophe

-- 
You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aquamacs-devel+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org


  parent reply	other threads:[~2017-04-28  1:49 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  4:50 lisp/term/ns-win.el modification Jean-Christophe Helary
2017-04-27  9:02 ` Anders Lindgren
2017-04-27 10:13   ` Jean-Christophe Helary
2017-04-27 11:30     ` Anders Lindgren
2017-04-27 14:53       ` Jean-Christophe Helary
2017-04-27 15:09         ` Davis Herring
2017-04-27 15:31           ` Jean-Christophe Helary
2017-04-27 23:32           ` Jean-Christophe Helary
     [not found]             ` <15112485-03CC-4FFF-8A9D-BA28D2490A91-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-28  1:49               ` Jean-Christophe Helary [this message]
2017-04-29 12:24                 ` Anders Lindgren
     [not found]                   ` <CABr8ebaB1Fp0BgVy7LWwtOnSs1UOXr3CJumMfOWR4JOooQMT4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-29 12:49                     ` Jean-Christophe Helary
2017-04-30  5:36                       ` Anders Lindgren
2017-04-30 12:14                         ` Noam Postavsky
2017-04-30  6:41                   ` Jean-Christophe Helary
2017-04-30 14:12                     ` Eli Zaretskii
2017-04-30 15:06                       ` Clément Pit-Claudel
2017-04-30 15:24                         ` Eli Zaretskii
2017-04-30 22:28                           ` Jean-Christophe Helary
2017-05-01  6:33                             ` Eli Zaretskii
2017-05-01  8:23                               ` Jean-Christophe Helary
2017-05-01  8:59                                 ` Eli Zaretskii
2017-05-01 10:53                                   ` Jean-Christophe Helary
2017-05-01 11:27                                     ` Eli Zaretskii
2017-05-02  4:00                                       ` Jean-Christophe Helary
2017-05-02  6:44                                         ` Eli Zaretskii
2017-05-02  6:47                                           ` Jean-Christophe Helary
2017-05-01 15:12                                   ` Jean-Christophe Helary
2017-05-01 15:27                                     ` Eli Zaretskii
2017-05-01 15:58                                       ` Jean-Christophe Helary
2017-05-01 16:25                                         ` Eli Zaretskii
2017-05-02 12:57                                           ` Jean-Christophe Helary
2017-05-03 20:40                                             ` Anders Lindgren
2017-05-04  0:10                                               ` Jean-Christophe Helary
2017-05-04  8:50                                               ` Jean-Christophe Helary
2017-05-04 18:37                                                 ` Anders Lindgren
2017-05-05  8:36                                                   ` Jean-Christophe Helary
2017-04-30 22:23                       ` Jean-Christophe Helary
2017-05-01  6:30                         ` Eli Zaretskii
2017-04-27 12:24     ` Noam Postavsky
2017-04-27 14:53       ` Jean-Christophe Helary
2017-04-27 12:51     ` mituharu
2017-04-27 14:55       ` Jean-Christophe Helary
2017-04-27 15:35       ` Jean-Christophe Helary
2017-04-27 18:28         ` mituharu
2017-04-27 23:29           ` Jean-Christophe Helary

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E98DA10D-FE1D-487A-932C-2DEE3172219A@gmail.com \
    --to=jean.christophe.helary-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=aquamacs-devel-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=emacs-devel-mXXj517/zsQ@public.gmane.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.