emacs-devel
[Top][All Lists]
Advanced

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

Re: lisp/term/ns-win.el modification


From: Jean-Christophe Helary
Subject: Re: lisp/term/ns-win.el modification
Date: Fri, 28 Apr 2017 10:49:42 +0900

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 <address@hidden> wrote:
> 
>> 
>> On Apr 28, 2017, at 0:09, Davis Herring <address@hidden> 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




reply via email to

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