From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Purcell Subject: PATCH: Fix malformed "message" links produced by org-mac-link.el Date: Wed, 24 Sep 2014 11:39:53 +0100 Message-ID: <35ACE9A2-E7B9-41DC-A748-13022BC1FABC@sanityinc.com> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_4AB696A4-089A-4397-AC2D-A33A27EA61E6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWjzZ-0007ak-RL for emacs-orgmode@gnu.org; Wed, 24 Sep 2014 06:40:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWjzS-0004uL-DG for emacs-orgmode@gnu.org; Wed, 24 Sep 2014 06:40:13 -0400 Received: from h1189701.stratoserver.net ([85.214.32.38]:43819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWjzS-0004ht-4U for emacs-orgmode@gnu.org; Wed, 24 Sep 2014 06:40:06 -0400 Received: from [192.168.1.104] (host81-156-15-155.range81-156.btcentralplus.com [81.156.15.155]) by h1189701.stratoserver.net (Postfix) with ESMTPSA id 94915820016 for ; Wed, 24 Sep 2014 12:39:55 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --Apple-Mail=_4AB696A4-089A-4397-AC2D-A33A27EA61E6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Links which should look like: [[message://2.11f23692084eb783e40c@NY-WEB01][Private beta invitation for = Emacs Q&A site - Area 51 - Stack Exchange]] are currently mangled into: [[essage://2.11f23692084eb783e40c@NY-WEB01][Private beta invitation for = Emacs Q&A site - Area 51 - Stack Exchang]] This tiny patch fixes this issue. Tested on OS X 10.9. -Steve --Apple-Mail=_4AB696A4-089A-4397-AC2D-A33A27EA61E6 Content-Disposition: attachment; filename=0001-org-mac-link.el-Fix-malformed-message-links.patch Content-Type: application/octet-stream; name="0001-org-mac-link.el-Fix-malformed-message-links.patch" Content-Transfer-Encoding: quoted-printable =46rom=206689b708ddc2e9f9bedfe6c0c2ef5f3084bf1ac6=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Steve=20Purcell=20=0A= Date:=20Wed,=2024=20Sep=202014=2011:27:00=20+0100=0ASubject:=20[PATCH]=20= org-mac-link.el:=20Fix=20malformed=20message=20links=0A=0A*=20= contrib/lisp/org-mac-link.el=20(org-mac-message-get-links):=20Use=20the=20= `org-mac-paste-applescript-links'=20helper.=0A=0AThe=20existing=20code=20= inserted=20links=20which=20should=20have=20been=20"[[message:ABC][the=20= subject]]"=0Aas=20"[[essage:ABC][the=20subjec]]".=0A=0ATINYCHANGE=0A---=0A= =20contrib/lisp/org-mac-link.el=20|=2026=20+++++---------------------=0A=20= 1=20file=20changed,=205=20insertions(+),=2021=20deletions(-)=0A=0Adiff=20= --git=20a/contrib/lisp/org-mac-link.el=20b/contrib/lisp/org-mac-link.el=0A= index=203b58d04..3389334=20100644=0A---=20a/contrib/lisp/org-mac-link.el=0A= +++=20b/contrib/lisp/org-mac-link.el=0A@@=20-856,27=20+856,11=20@@=20The=20= Org-syntax=20text=20will=20be=20pushed=20to=20the=20kill=20ring,=20and=20= also=20returned."=0A=20=20=20(interactive=20"sLink=20to=20(s)elected=20= or=20(f)lagged=20messages:=20")=0A=20=20=20(setq=20select-or-flag=20(or=20= select-or-flag=20"s"))=0A=20=20=20(message=20"AppleScript:=20searching=20= mailboxes...")=0A-=20=20(let*=20((as-link-list=0A-=20=20=20=20=20=20=20=20= =20=20(if=20(string=3D=20select-or-flag=20"s")=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(org-as-get-selected-mail)=0A-=09=20=20=20=20(if=20= (string=3D=20select-or-flag=20"f")=0A-=09=09(org-as-get-flagged-mail)=0A= -=09=20=20=20=20=20=20(error=20"Please=20select=20\"s\"=20or=20= \"f\""))))=0A-=20=20=20=20=20=20=20=20=20(link-list=0A-=20=20=20=20=20=20= =20=20=20=20(mapcar=0A-=20=20=20=20=20=20=20=20=20=20=20(lambda=20(x)=20= (if=20(string-match=20"\\`\"\\(.*\\)\"\\'"=20x)=20(setq=20x=20= (match-string=201=20x)))=20x)=0A-=20=20=20=20=20=20=20=20=20=20=20= (split-string=20(substring=20as-link-list=201=20-1)=20"[\r\n]+")))=0A-=20= =20=20=20=20=20=20=20=20split-link=20URL=20description=20orglink=20= orglink-insert=20rtn=20orglink-list)=0A-=20=20=20=20(while=20link-list=0A= -=20=20=20=20=20=20(setq=20split-link=20(split-string=20(pop=20= link-list)=20"::split::"))=0A-=20=20=20=20=20=20(setq=20URL=20(car=20= split-link))=0A-=20=20=20=20=20=20(setq=20description=20(cadr=20= split-link))=0A-=20=20=20=20=20=20(when=20(not=20(string=3D=20URL=20""))=0A= -=20=20=20=20=20=20=20=20(setq=20orglink=20(org-make-link-string=20URL=20= description))=0A-=20=20=20=20=20=20=20=20(push=20orglink=20= orglink-list)))=0A-=20=20=20=20(setq=20rtn=20(mapconcat=20'identity=20= orglink-list=20"\n"))=0A-=20=20=20=20(kill-new=20rtn)=0A-=20=20=20=20= rtn))=0A+=20=20(org-mac-paste-applescript-links=0A+=20=20=20(cond=0A+=20=20= =20=20((string=3D=20select-or-flag=20"s")=20(org-as-get-selected-mail))=0A= +=20=20=20=20((string=3D=20select-or-flag=20"f")=20= (org-as-get-flagged-mail))=0A+=20=20=20=20(t=20(error=20"Please=20select=20= \"s\"=20or=20\"f\"")))))=0A=20=0A=20(defun=20= org-mac-message-insert-selected=20()=0A=20=20=20"Insert=20a=20link=20to=20= the=20messages=20currently=20selected=20in=20Mail.app.=0A--=20=0A2.1.1=0A= =0A= --Apple-Mail=_4AB696A4-089A-4397-AC2D-A33A27EA61E6--