From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: [PATCH] Consistently use `org-mac-paste-applescript-links' in org-mac-links Date: Wed, 09 Sep 2015 10:33:14 +0200 Message-ID: References: <87pp1shpv2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZaon-0001rJ-II for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 04:33:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZaoj-0006ZD-1q for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 04:33:25 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:39347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZaoi-0006Yi-NA for emacs-orgmode@gnu.org; Wed, 09 Sep 2015 04:33:21 -0400 In-Reply-To: <87pp1shpv2.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 08 Sep 2015 17:50:41 +0200") 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 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2015-09-08 17:50, Nicolas Goaziou writes: > Hello, > > Alan Schmitt writes: > >> I do not know how to write the changelog when the same change happens >> over many different functions. Please tell me if I need to change the >> commit message. > > [...] > >> >> * contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url): >> Replace the handling of AppleScript results code with >> `org-mac-paste-applescript-links'. >> (org-mac-vimperator-get-frontmost-url): Replace the handling of >> AppleScript results code with `org-mac-paste-applescript-links'. >> (org-mac-chrome-get-frontmost-url): Replace the handling of AppleScript >> results code with `org-mac-paste-applescript-links'. >> (org-mac-skim-get-page): Replace the handling of AppleScript results >> code with `org-mac-paste-applescript-links'. >> (org-mac-outlook-message-get-links): Replace the handling of AppleScript >> results code with `org-mac-paste-applescript-links'. >> (org-mac-devonthink-get-links): Replace the handling of AppleScript >> results code with `org-mac-paste-applescript-links'. > > IMO, it should be > > * contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url) > (org-mac-vimperator-get-frontmost-url) > (org-mac-chrome-get-frontmost-url) > ... > (org-mac-devonthink-get-links): Replace the handling of AppleScript > results code with `org-mac-paste-applescript-links'. Here is a patch with fixed message. I can push it myself if you want. Best, Alan --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-mac-link.el-Factorize-code.patch Content-Transfer-Encoding: quoted-printable From=2083201ef720c0cc67acf01cc15c2929beaaa5c7f0 Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Tue, 8 Sep 2015 10:03:56 +0200 Subject: [PATCH] org-mac-link.el: Factorize code * contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url) (org-mac-vimperator-get-frontmost-url) (org-mac-chrome-get-frontmost-url) (org-mac-skim-get-page) (org-mac-outlook-message-get-links) (org-mac-devonthink-get-links): Replace the handling of AppleScript results code with `org-mac-paste-applescript-links'. This fixes some bugs where links would have a dangling quote at the end. =2D-- contrib/lisp/org-mac-link.el | 93 ++++++++--------------------------------= ---- 1 file changed, 16 insertions(+), 77 deletions(-) diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el index c991dfa..5e0f891 100644 =2D-- a/contrib/lisp/org-mac-link.el +++ b/contrib/lisp/org-mac-link.el @@ -1,6 +1,6 @@ ;;; org-mac-link.el --- Insert org-mode links to items selected in various= Mac apps ;; =2D;; Copyright (c) 2010-2014 Free Software Foundation, Inc. +;; Copyright (c) 2010-2015 Free Software Foundation, Inc. ;; ;; Author: Anthony Lander ;; John Wiegley @@ -18,6 +18,10 @@ ;; Author: Mike McLean ;; Add support for Microsoft Outlook for Mac as Org mode links ;; +;; Version: 1.3 +;; Author: Alan Schmitt +;; Consistently use `org-mac-paste-applescript-links' +;;=20 ;; This file is not part of GNU Emacs. ;; ;; This program is free software; you can redistribute it and/or modify @@ -299,15 +303,7 @@ The links are of the form ::split::." (defun org-mac-firefox-get-frontmost-url () (interactive) (message "Applescript: Getting Firefox url...") =2D (let* ((url-and-title (org-as-mac-firefox-get-frontmost-url)) =2D (split-link (split-string url-and-title "::split::")) =2D (URL (car split-link)) =2D (description (cadr split-link)) =2D (org-link)) =2D (when (not (string=3D URL "")) =2D (setq org-link (org-make-link-string URL description))) =2D (kill-new org-link) =2D org-link)) + (org-mac-paste-applescript-links (org-as-mac-firefox-get-frontmost-url))) =20 (defun org-mac-firefox-insert-frontmost-url () (interactive) @@ -345,15 +341,7 @@ The links are of the form ::split::." (defun org-mac-vimperator-get-frontmost-url () (interactive) (message "Applescript: Getting Vimperator url...") =2D (let* ((url-and-title (org-as-mac-vimperator-get-frontmost-url)) =2D (split-link (split-string url-and-title "::split::")) =2D (URL (car split-link)) =2D (description (cadr split-link)) =2D (org-link)) =2D (when (not (string=3D URL "")) =2D (setq org-link (org-make-link-string URL description))) =2D (kill-new org-link) =2D org-link)) + (org-mac-paste-applescript-links (org-as-mac-vimperator-get-frontmost-ur= l))) =20 (defun org-mac-vimperator-insert-frontmost-url () (interactive) @@ -383,15 +371,7 @@ The links are of the form ::split::." (defun org-mac-chrome-get-frontmost-url () (interactive) (message "Applescript: Getting Chrome url...") =2D (let* ((url-and-title (org-as-mac-chrome-get-frontmost-url)) =2D (split-link (split-string url-and-title "::split::")) =2D (URL (car split-link)) =2D (description (cadr split-link)) =2D (org-link)) =2D (when (not (string=3D URL "")) =2D (setq org-link (org-make-link-string URL description))) =2D (kill-new org-link) =2D org-link)) + (org-mac-paste-applescript-links (org-as-mac-chrome-get-frontmost-url))) =20 (defun org-mac-chrome-insert-frontmost-url () (interactive) @@ -557,15 +537,7 @@ The links are of the form ::split::." (defun org-mac-skim-get-page () (interactive) (message "Applescript: Getting Skim page link...") =2D (let* ((link-and-descr (as-get-skim-page-link)) =2D (split-link (split-string link-and-descr "::split::")) =2D (link (car split-link)) =2D (description (cadr split-link)) =2D (org-link)) =2D (when (not (string=3D link "")) =2D (setq org-link (org-make-link-string link description))) =2D (kill-new org-link) =2D org-link)) + (org-mac-paste-applescript-links (as-get-skim-page-link))) =20 (defun org-mac-skim-insert-page () (interactive) @@ -640,27 +612,12 @@ The Org-syntax text will be pushed to the kill ring, = and also returned." (interactive "sLink to (s)elected or (f)lagged messages: ") (setq select-or-flag (or select-or-flag "s")) (message "Org Mac Outlook: searching mailboxes...") =2D (let* ((as-link-list =2D (if (string=3D select-or-flag "s") =2D (org-as-get-selected-outlook-mail) =2D (if (string=3D select-or-flag "f") =2D (org-sh-get-flagged-outlook-mail) =2D (error "Please select \"s\" or \"f\"")))) =2D (link-list =2D (mapcar =2D (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x) (setq x= (match-string 1 x))) x) =2D (split-string as-link-list "[\r\n]+"))) =2D split-link URL description orglink orglink-insert rtn orglink-l= ist) =2D (while link-list =2D (setq split-link (split-string (pop link-list) "::split::")) =2D (setq URL (car split-link)) =2D (setq description (cadr split-link)) =2D (when (not (string=3D URL "")) =2D (setq orglink (org-make-link-string URL description)) =2D (push orglink orglink-list))) =2D (setq rtn (mapconcat 'identity orglink-list "\n")) =2D (kill-new rtn) =2D rtn)) + (org-mac-paste-applescript-links + (if (string=3D select-or-flag "s") + (org-as-get-selected-outlook-mail) + (if (string=3D select-or-flag "f") + (org-sh-get-flagged-outlook-mail) + (error "Please select \"s\" or \"f\""))))) =20 (defun org-mac-outlook-message-insert-selected () "Insert a link to the messages currently selected in Microsoft Outlook.a= pp. @@ -734,25 +691,7 @@ selected items in DEVONthink Pro Office.app and make l= inks out of it/them. This function will push the Org-syntax text to the kill ring, and also return it." (message "Org Mac DEVONthink: looking for selected items...") =2D (let* ((as-link-list (org-as-get-selected-devonthink-item)) =2D (link-list (if as-link-list =2D (mapcar =2D (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\= \'" x) =2D (setq x (match-string 1 x))) =2D x) =2D (split-string as-link-list "[\r\n]+")) =2D nil)) =2D orglink-list) =2D (while link-list =2D (let* ((current-item (pop link-list))) =2D (message "current item: %s" current-item) =2D (when (and current-item (not (string=3D current-item ""))) =2D (let* ((split-link (split-string current-item "::split::")) =2D (orglink (org-make-link-string =2D (url-encode-url (car split-link)) =2D (cadr split-link)))) =2D (push orglink orglink-list))))) =2D (kill-new (mapconcat 'identity orglink-list "\n")))) + (org-mac-paste-applescript-links (org-as-get-selected-devonthink-item))) =20 (defun org-mac-devonthink-item-insert-selected () "Insert a link to the item(s) currently selected in DEVONthink Pro Offic= e. =2D-=20 2.5.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Last week athmospheric CO=E2=82=82 average (Updated September 6, 2015, Maun= a Loa Obs.): 377.86 ppm --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJV7+7KAAoJEAQNCjtO0uXH6msIAMzbKEjwN+2TBUpBsfoKnGko bxdAOdnN5RthWr+z/AWBe6ggu2rNGMEEMZuUqzCuEUefqzkxHWPaJPyX+ycagfMA Uas56DSXo7gfjmWRPQ/oSmgiVlwV8nQnJ3WeR9+SIw4R7puIpDk1xYjqR+0D9rVU 1Bq/EE5NfGUjfO5JzLN85+7rFjI1zNwZhet8aS8SuVesYdv4hN9t351rxWAtYrcP /ZJj1xjXKlJwSLQGbI11NMrN0J9JlUS9P7v5xkpwjTobnuJS4DDJy4srRbjaMGNa TBhGd5PojMEUZS25uxxoko9dmtPY/zuI4MbvWyB78nOwFUTK1Vso1uqhyjlg9aI= =bGGd -----END PGP SIGNATURE----- --==-=-=--