emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Takaaki Ishikawa <takaxp@ieee.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: orgmode list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Add a custom list in org-mac-link.el
Date: Thu, 15 Jun 2017 22:56:07 +0900	[thread overview]
Message-ID: <CAJsv8THHp1gZ3rVEuXUbtOUO2S2LMqSemUP_A0o+5uCMrPA57A@mail.gmail.com> (raw)
In-Reply-To: <87h8ziikze.fsf@nicolasgoaziou.fr>


[-- Attachment #1.1: Type: text/plain, Size: 1056 bytes --]

Dear Nicolas and all,

I tried to generate a patch for this proposal. Please find an attached file.
If you have any comments or suggestions on the file, feel free to ask me.

Best,
Takaaki


Takaaki ISHIKAWA <takaxp@ieee.org>
  GITI, Waseda University
    :) http://about.me/takaxp

2017-06-15 1:37 GMT+09:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Hello,
>
> Takaaki Ishikawa <takaxp@ieee.org> writes:
>
> > The attached patch includes a change for adding a custom variable to
> easily
> > extend link grabbing capabilities for masOS user. When someone wants to
> add
> > an additional menu to call an external application, it will be possible
> by
> > adding a setting to the proposed variable as follows:
> >
> > #+BEGIN_SRC emacs-lisp
> > (add-to-list 'org-mac-link-descriptors
> >                `("P" "apers" org-mac-papers-insert-frontmost-paper-link
> > ,org-mac-grab-Papers-app-p) t)
> > #+END_SRC
>
> Thank you.
>
> Could you provide a patch, using format-patch, with an appropriate
> commit message?
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #1.2: Type: text/html, Size: 1923 bytes --]

[-- Attachment #2: 0001-org-mac-link-Add-a-custom-list-for-link-descriptors.patch --]
[-- Type: application/octet-stream, Size: 3759 bytes --]

From ec5827a48e4553c7816f93d205502ba778351e4d Mon Sep 17 00:00:00 2001
From: Takaaki ISHIKAWA <takaxp@ieee.org>
Date: Thu, 15 Jun 2017 22:42:27 +0900
Subject: [PATCH] org-mac-link: Add a custom list for link descriptors

* contrib/lisp/org-mac-link.el: Add a custom list for link descriptors

Adding a custom variable named `org-mac-link-descriptors' to easily extend link grabbing capabilities for masOS user. When someone wants to add an additional menu to call an external application, it will be possible by adding a new setting to the list.

Modified from a patch proposal by Takaaki Ishikawa.
---
 contrib/lisp/org-mac-link.el | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index 8ba485d..fa424e0 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -217,6 +217,26 @@
   :group 'org-mac-link
   :type 'string)
 
+(defcustom org-mac-link-descriptors
+  `(("F" "inder" org-mac-finder-insert-selected ,org-mac-grab-Finder-app-p)
+    ("m" "ail" org-mac-message-insert-selected ,org-mac-grab-Mail-app-p)
+    ("d" "EVONthink Pro Office" org-mac-devonthink-item-insert-selected
+     ,org-mac-grab-devonthink-app-p)
+    ("o" "utlook" org-mac-outlook-message-insert-selected ,org-mac-grab-Outlook-app-p)
+    ("a" "ddressbook" org-mac-addressbook-insert-selected ,org-mac-grab-Addressbook-app-p)
+    ("s" "afari" org-mac-safari-insert-frontmost-url ,org-mac-grab-Safari-app-p)
+    ("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p)
+    ("v" "imperator" org-mac-vimperator-insert-frontmost-url ,org-mac-grab-Firefox+Vimperator-p)
+    ("c" "hrome" org-mac-chrome-insert-frontmost-url ,org-mac-grab-Chrome-app-p)
+    ("e" "evernote" org-mac-evernote-note-insert-selected ,org-mac-grab-Evernote-app-p)
+    ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p)
+    ("S" "kim" org-mac-skim-insert-page ,org-mac-grab-Skim-app-p)
+    ("A" "crobat" org-mac-acrobat-insert-page ,org-mac-grab-Acrobat-app-p))
+  "Descriptors to select an application."
+  :tag "A list of descriptors"
+  :group 'org-mac-link'
+  :type 'symbol)
+
 \f
 ;; In mac.c, removed in Emacs 23.
 (declare-function do-applescript "org-mac-message" (script))
@@ -238,21 +258,7 @@
   "Prompt for an application to grab a link from.
 When done, go grab the link, and insert it at point."
   (interactive)
-  (let* ((descriptors
-	  `(("F" "inder" org-mac-finder-insert-selected ,org-mac-grab-Finder-app-p)
-	    ("m" "ail" org-mac-message-insert-selected ,org-mac-grab-Mail-app-p)
-	    ("d" "EVONthink Pro Office" org-mac-devonthink-item-insert-selected
-	     ,org-mac-grab-devonthink-app-p)
-	    ("o" "utlook" org-mac-outlook-message-insert-selected ,org-mac-grab-Outlook-app-p)
-	    ("a" "ddressbook" org-mac-addressbook-insert-selected ,org-mac-grab-Addressbook-app-p)
-	    ("s" "afari" org-mac-safari-insert-frontmost-url ,org-mac-grab-Safari-app-p)
-	    ("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p)
-	    ("v" "imperator" org-mac-vimperator-insert-frontmost-url ,org-mac-grab-Firefox+Vimperator-p)
-	    ("c" "hrome" org-mac-chrome-insert-frontmost-url ,org-mac-grab-Chrome-app-p)
-            ("e" "evernote" org-mac-evernote-note-insert-selected ,org-mac-grab-Evernote-app-p)
-	    ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p)
-	    ("S" "kim" org-mac-skim-insert-page ,org-mac-grab-Skim-app-p)
-	    ("A" "crobat" org-mac-acrobat-insert-page ,org-mac-grab-Acrobat-app-p)))
+  (let* ((descriptors org-mac-link-descriptors)
          (menu-string (make-string 0 ?x))
          input)
 
-- 
2.10.1 (Apple Git-78)


  reply	other threads:[~2017-06-15 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-11  8:25 [PATCH] Add a custom list in org-mac-link.el Takaaki Ishikawa
2017-06-14 16:37 ` Nicolas Goaziou
2017-06-15 13:56   ` Takaaki Ishikawa [this message]
2017-06-15 16:32     ` Nicolas Goaziou
2017-06-15 18:38       ` Takaaki Ishikawa
2017-06-15 19:03         ` Nicolas Goaziou

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CAJsv8THHp1gZ3rVEuXUbtOUO2S2LMqSemUP_A0o+5uCMrPA57A@mail.gmail.com \
    --to=takaxp@ieee.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).