From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.devel Subject: Re: lisp/term/ns-win.el modification Date: Sat, 29 Apr 2017 14:24:04 +0200 Message-ID: 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c122e4c10b057054e4d44fe X-Trace: blaine.gmane.org 1493468653 30402 195.159.176.226 (29 Apr 2017 12:24:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Apr 2017 12:24:13 +0000 (UTC) Cc: aquamacs-devel@googlegroups.com, emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 29 14:24:09 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 1d4RPz-0007mG-Mp for ged-emacs-devel@m.gmane.org; Sat, 29 Apr 2017 14:24:07 +0200 Original-Received: from localhost ([::1]:41040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4RQ5-0001l8-Ex for ged-emacs-devel@m.gmane.org; Sat, 29 Apr 2017 08:24:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4RPz-0001kq-4s for emacs-devel@gnu.org; Sat, 29 Apr 2017 08:24:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4RPy-0006I4-2p for emacs-devel@gnu.org; Sat, 29 Apr 2017 08:24:07 -0400 Original-Received: from mail-ua0-x235.google.com ([2607:f8b0:400c:c08::235]:33898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d4RPx-0006Hu-TQ for emacs-devel@gnu.org; Sat, 29 Apr 2017 08:24:06 -0400 Original-Received: by mail-ua0-x235.google.com with SMTP id q26so13223258uaa.1 for ; Sat, 29 Apr 2017 05:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uYjDqdZ6xSZPOANRJLpdAhX8T5aKfgwZZHBvN7ZgQtA=; b=R1fNEkocazWESRQJeE/wg8zTSvAQ559MmYnEMiDk1ba/6ply0qkGhs7pD8wsBFSt3D mqu62yUKAuCUaGvWD4U3nHN8ad5Hi7yBz/6P9IDgdUm7kFr2IgUXsOsb43eD8HbLBPBj Djj3W7UxcdA5QwTtTWcOxv8CPMam6xc8gdrE5cGhf2izqAFsCBMC4BOTpU8FlPlc46J+ SgwbIwEhp+riGNps1RCJkHazymAvurhjh3V4UN07gZaQTxyoAdWfesmIObBOmyYR+6lr sEqSg5MfUiGo0R/ZnxIhJhZt40EBTaxx8t9T3HUrQEb2IKRxMIwwqCe7nUL9Ngd1Qm/z tA6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uYjDqdZ6xSZPOANRJLpdAhX8T5aKfgwZZHBvN7ZgQtA=; b=l2w84pcKh9Ijg5ty2eMizQgisibNXqA3fq790jDNSY8+uQK7I+JD3kZkGnjhF5YgXH XgKGaOn/gMZ2rwxF6z+j4gu9QGVmgJGi2BqzvEZkVFZpNmerVazTMZubS/DwPFdFEgVC eYzWANe+hVrgMmWJF5h+aMTlv1SvqvxerCYzDi6Tx0PaL78L/y/X0nGmzFyegEpZ1E7v +YvIK+heCuwaBRS+DuhrIcA59ptchF9vTilzKf4qETpRUpnPdmxjK4pDE6200v0FgBuY aCj8r10HIH48649j94++WRGu8wrzIo2q6GE4gK6YxpbnT7JcH5LSOubTIFGvij2Vjp68 8iKg== X-Gm-Message-State: AN3rC/4RwaeLGF0QTaVX3PtZfvh4Chq+l7fywlpB+yL+WHmqQx9bVsFd MAZ4UNoYQ8D+cWAfwMPlRl3x85zP0w== X-Received: by 10.159.37.1 with SMTP id 1mr8849506uaz.131.1493468644943; Sat, 29 Apr 2017 05:24:04 -0700 (PDT) Original-Received: by 10.31.64.140 with HTTP; Sat, 29 Apr 2017 05:24:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::235 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:214405 Archived-At: --94eb2c122e4c10b057054e4d44fe Content-Type: text/plain; charset=UTF-8 Hi! Finally, I start to understand what you are trying to do. Here is a recipe on how to enable it: - In System Preferences > Keyboard > Shortcuts > Services, select Text > Open Selected File - Restart Emacs. (I didn't, which caused Aquamacs to be launched) I did test your patch from within gmail in Chrome. One this that I realized was that when typing a space, it sometimes came out as a plain space, sometimes as a non-breakable space. I'm not sure this is specific to the edit field in gmail, but I think it would ba good idea to trim both kind of spaces. 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'm find with how the code looks now. It's less cluttered than when two functions were used. However, I'm not 100% comfortable to use `subr-x' since it is somewhat experimental (e.g. the functions in the file is not documented in the Emacs lisp manual). Besides, it doesn't trim non-breakable spaces. You could use something like the following: (save-match-data (string-match "\\`[ \u00A0]*\\(.*?\\)[ \u00A0]*\\'" path-string) (match-string 1 path-string)) Some small things: - When sending a patch, it's better to do it against the latest Emacs archive, rather than against the Aquamacs archive. In this case, I had to manually edit the files to apply the patch. Also, for future reference, it's better to attach it than to supply a link. - In a doc string, the first line should be a full sentence with a summary of what the function does. The reason is that when using "apropos", only the first line of the doc string is shown. -- Anders --94eb2c122e4c10b057054e4d44fe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

Finally, I start to understand what= you are trying to do. Here is a recipe on how to enable it:

=
- In System Preferences > Keyboard > Shortcuts > Servic= es, select Text > Open Selected File

- Rest= art Emacs. (I didn't, which caused Aquamacs to be launched)
<= br>
I did test your patch from within gmail in Chrome. One this t= hat I realized was that when typing a space, it sometimes came out as a pla= in space, sometimes as a non-breakable space. I'm not sure this is spec= ific to the edit field in gmail, but I think it would ba good idea to trim = both kind of spaces.


Regarding 3) and Anders' comment "If all you do is to p= lace the call inside a dolist, you should be ok. Introducing additional fun= ctions (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 i= t is. Please advise.

I'm find with = how the code looks now. It's less cluttered than when two functions wer= e used.

However, I'm not 100% comfortable to u= se `subr-x' since it is somewhat experimental (e.g. the functions in th= e file is not documented in the Emacs lisp manual). Besides, it doesn't= trim non-breakable spaces. You could use something like the following:

(save-match=
-data
  (string-match "\\`[ \u00A0]*\\(.*?\\)[ \u00A0]*\\'" =
path-string)
  (match-string 1 path-string))
Some small things:

- When sending a patch, i= t's better to do it against the latest Emacs archive, rather than again= st the Aquamacs archive. In this case, I had to manually edit the files to = apply the patch. Also, for future reference, it's better to attach it t= han to supply a link.

- In a doc string, the first= line should be a full sentence with a summary of what the function does. T= he reason is that when using "apropos", only the first line of th= e doc string is shown.

=C2=A0 =C2=A0 -- Anders
--94eb2c122e4c10b057054e4d44fe--