Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-14 Thread Carsten Dominik
This looks great.

Can you now make a single patch for all the changes?  Then I will apply it.

- Carsten

On 14 mei 2013, at 08:18, Daniil Frumin  wrote:

> OK, here's a patch which adds the ability to highlight the selected text.
> 
> It makes new highlight notes only if `org-mac-Skim-highlight-selection-p' is 
> set to t.
> 
> 
> - Dan
> 
> <0004-Add-the-ability-to-highlight-the-selected-text-in-Sk.patch>
> On May 14, 2013, at 8:33 AM, Carsten Dominik  
> wrote:
> 
>> 
>> On 13.5.2013, at 22:35, Daniil Frumin  wrote:
>> 
>>> So I've been researching this problem and it seems that there is no sane 
>>> way to re-select a text. 
>> 
>> OK, thanks for looking into it.
>> 
>>> 
>>> The problem is that `(do-applescript ..)' only interacts with AppleScript 
>>> well if the return type of the string is either a number or a string. If I 
>>> try to convert the selection object (which is not really an object but a 
>>> list of specifiers) it just returns the selected text. 
>>> 
>>> There is also `selection bounds' but it only covers rectangle selections.
>>> 
>>> It's possible to save the selected text and try to `find' it later, but 
>>> that won't work well (e.g.: there are several repetitions of the same text 
>>> on one page). 
>>> 
>>> I've also tried to implement an auto-scrolling to the selected text, but to 
>>> no avail.
>>> 
>>> The option that seems to me the most reasonable is to add a highlight note 
>>> to the selected text (which is actually possible). What do you think? 
>> 
>> Interesting idea!  I think this should be implemented, but with a user 
>> option to turn it off.
>> 
>>> 
>>> For now, the patch to the problem mentioned by Ivan.
>>> I have actually fixed a small bug in the code for getting links from 
>>> Firefox:
>>> Prior to the fix the firefox link grabber won't work correctly if a cursor 
>>> has been already positioned in the URL field. The fix works by adding an 
>>> additional keystore for selecting all the text in that field.
>>> 
>>> The problem is that I've committed it before committing the stuff that Ivan 
>>> told us about, so I am not sure what to do in this case.
>> 
>> So you mean the patch you would like to send to me is several commits?  That 
>> is no problem, just specify with git which range of commits should be part 
>> of the patch, for example
>> 
>>   git diff HEAD^^
>> 
>> will include the changes from two commits.  You could also amend the 
>> previous commit if it has not yet been push to another repository - there 
>> are many ways to deal with this.
>> 
>> - Carsten
>> 
>>> 
>>> Thanks
>>> 
>>> -- Daniil
>>> 
>>> <0002-Fixing-a-bug-in-as-mac-firefox-get-frontmost-url.patch><0003-Automatic-detection-of-the-presence-of-Skim.app.patch>
>>> 
>>> 
>>> On May 13, 2013, at 10:34 AM, Carsten Dominik  
>>> wrote:
>>> 
 Hi Daniil,
 
 I like this a lot and would like to take the patch after you have taken 
 Ivans feedback, and maybe more feedback if you get any.
 
 I would like it even more if following the link would rehighlight the 
 selected text.  Is there any way to achieve this?
 
 I have another question, this would maybe be for the original author, 
 Anthony Lander?  I see that there are functions with prefixes that are not 
 "org-".  This is dangerous because there might be packages around that use 
 that name space.  I also think it violates coding rules in Emacs.  I think 
 this should be changed - unless you know of a convention that all 
 functions dealing with applescripts are supposed to have an "as-" prefix.
 
 I can fix this - but I wanted your feedback first.
 
 Thanks.
 
 - Carsten
 
 On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
 
> Hi, all!
> 
> I use org-mac-link-grabber.el 
>  almost 
> every day. However, it lacks support for an app that I'd like to use 
> together with org-mode. 
> 
> Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
> ability. I wrote a little patch for org-mac-link-grabber.el to support 
> grabbing links to documents.
> 
> What it does:
> 
> * Grabs not just the link to file, but a page
> 
> * Inserts the selected text as a description, if present. Otherwise
> inserts ", p. "
> 
> * The shortcut is set to [S]
> 
> * Defines a new "skim" link type
> 
> It would be interesting to also add some support for importing notes from 
> Skim to org.
> 
> Since Skim.app is not present in clean OS X installs, by default support 
> for grabbing links from it is disabled. You can enable it by customizing 
> group `org-mac-link-grabber'.
> 
> So, maybe it's possible to get this patch into the tree? It's my first 
> time hacking on org (or even any major elisp extension), so it's probably 
> that I've messed up somewhere with a commit fo

Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-13 Thread Daniil Frumin
OK, here's a patch which adds the ability to highlight the selected text.

It makes new highlight notes only if `org-mac-Skim-highlight-selection-p' is 
set to t.


- Dan



0004-Add-the-ability-to-highlight-the-selected-text-in-Sk.patch
Description: Binary data

On May 14, 2013, at 8:33 AM, Carsten Dominik  wrote:

> 
> On 13.5.2013, at 22:35, Daniil Frumin  wrote:
> 
>> So I've been researching this problem and it seems that there is no sane way 
>> to re-select a text. 
> 
> OK, thanks for looking into it.
> 
>> 
>> The problem is that `(do-applescript ..)' only interacts with AppleScript 
>> well if the return type of the string is either a number or a string. If I 
>> try to convert the selection object (which is not really an object but a 
>> list of specifiers) it just returns the selected text. 
>> 
>> There is also `selection bounds' but it only covers rectangle selections.
>> 
>> It's possible to save the selected text and try to `find' it later, but that 
>> won't work well (e.g.: there are several repetitions of the same text on one 
>> page). 
>> 
>> I've also tried to implement an auto-scrolling to the selected text, but to 
>> no avail.
>> 
>> The option that seems to me the most reasonable is to add a highlight note 
>> to the selected text (which is actually possible). What do you think? 
> 
> Interesting idea!  I think this should be implemented, but with a user option 
> to turn it off.
> 
>> 
>> For now, the patch to the problem mentioned by Ivan.
>> I have actually fixed a small bug in the code for getting links from Firefox:
>> Prior to the fix the firefox link grabber won't work correctly if a cursor 
>> has been already positioned in the URL field. The fix works by adding an 
>> additional keystore for selecting all the text in that field.
>> 
>> The problem is that I've committed it before committing the stuff that Ivan 
>> told us about, so I am not sure what to do in this case.
> 
> So you mean the patch you would like to send to me is several commits?  That 
> is no problem, just specify with git which range of commits should be part of 
> the patch, for example
> 
>git diff HEAD^^
> 
> will include the changes from two commits.  You could also amend the previous 
> commit if it has not yet been push to another repository - there are many 
> ways to deal with this.
> 
> - Carsten
> 
>> 
>> Thanks
>> 
>> -- Daniil
>> 
>> <0002-Fixing-a-bug-in-as-mac-firefox-get-frontmost-url.patch><0003-Automatic-detection-of-the-presence-of-Skim.app.patch>
>> 
>> 
>> On May 13, 2013, at 10:34 AM, Carsten Dominik  
>> wrote:
>> 
>>> Hi Daniil,
>>> 
>>> I like this a lot and would like to take the patch after you have taken 
>>> Ivans feedback, and maybe more feedback if you get any.
>>> 
>>> I would like it even more if following the link would rehighlight the 
>>> selected text.  Is there any way to achieve this?
>>> 
>>> I have another question, this would maybe be for the original author, 
>>> Anthony Lander?  I see that there are functions with prefixes that are not 
>>> "org-".  This is dangerous because there might be packages around that use 
>>> that name space.  I also think it violates coding rules in Emacs.  I think 
>>> this should be changed - unless you know of a convention that all functions 
>>> dealing with applescripts are supposed to have an "as-" prefix.
>>> 
>>> I can fix this - but I wanted your feedback first.
>>> 
>>> Thanks.
>>> 
>>> - Carsten
>>> 
>>> On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
>>> 
 Hi, all!
 
 I use org-mac-link-grabber.el 
  almost 
 every day. However, it lacks support for an app that I'd like to use 
 together with org-mode. 
 
 Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
 ability. I wrote a little patch for org-mac-link-grabber.el to support 
 grabbing links to documents.
 
 What it does:
 
 * Grabs not just the link to file, but a page
 
 * Inserts the selected text as a description, if present. Otherwise
 inserts ", p. "
 
 * The shortcut is set to [S]
 
 * Defines a new "skim" link type
 
 It would be interesting to also add some support for importing notes from 
 Skim to org.
 
 Since Skim.app is not present in clean OS X installs, by default support 
 for grabbing links from it is disabled. You can enable it by customizing 
 group `org-mac-link-grabber'.
 
 So, maybe it's possible to get this patch into the tree? It's my first 
 time hacking on org (or even any major elisp extension), so it's probably 
 that I've messed up somewhere with a commit format or whatnot.
 
 Cheers.
 
 -- Daniil Frumin
 <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>
>>> 
>> 
> 



Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-13 Thread Carsten Dominik

On 13.5.2013, at 22:35, Daniil Frumin  wrote:

> So I've been researching this problem and it seems that there is no sane way 
> to re-select a text. 

OK, thanks for looking into it.

> 
> The problem is that `(do-applescript ..)' only interacts with AppleScript 
> well if the return type of the string is either a number or a string. If I 
> try to convert the selection object (which is not really an object but a list 
> of specifiers) it just returns the selected text. 
> 
> There is also `selection bounds' but it only covers rectangle selections.
> 
> It's possible to save the selected text and try to `find' it later, but that 
> won't work well (e.g.: there are several repetitions of the same text on one 
> page). 
> 
> I've also tried to implement an auto-scrolling to the selected text, but to 
> no avail.
> 
> The option that seems to me the most reasonable is to add a highlight note to 
> the selected text (which is actually possible). What do you think? 

Interesting idea!  I think this should be implemented, but with a user option 
to turn it off.

> 
> For now, the patch to the problem mentioned by Ivan.
> I have actually fixed a small bug in the code for getting links from Firefox:
> Prior to the fix the firefox link grabber won't work correctly if a cursor 
> has been already positioned in the URL field. The fix works by adding an 
> additional keystore for selecting all the text in that field.
> 
> The problem is that I've committed it before committing the stuff that Ivan 
> told us about, so I am not sure what to do in this case.

So you mean the patch you would like to send to me is several commits?  That is 
no problem, just specify with git which range of commits should be part of the 
patch, for example

git diff HEAD^^

will include the changes from two commits.  You could also amend the previous 
commit if it has not yet been push to another repository - there are many ways 
to deal with this.

- Carsten

> 
> Thanks
> 
> -- Daniil
> 
> <0002-Fixing-a-bug-in-as-mac-firefox-get-frontmost-url.patch><0003-Automatic-detection-of-the-presence-of-Skim.app.patch>
> 
> 
> On May 13, 2013, at 10:34 AM, Carsten Dominik  
> wrote:
> 
>> Hi Daniil,
>> 
>> I like this a lot and would like to take the patch after you have taken 
>> Ivans feedback, and maybe more feedback if you get any.
>> 
>> I would like it even more if following the link would rehighlight the 
>> selected text.  Is there any way to achieve this?
>> 
>> I have another question, this would maybe be for the original author, 
>> Anthony Lander?  I see that there are functions with prefixes that are not 
>> "org-".  This is dangerous because there might be packages around that use 
>> that name space.  I also think it violates coding rules in Emacs.  I think 
>> this should be changed - unless you know of a convention that all functions 
>> dealing with applescripts are supposed to have an "as-" prefix.
>> 
>> I can fix this - but I wanted your feedback first.
>> 
>> Thanks.
>> 
>> - Carsten
>> 
>> On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
>> 
>>> Hi, all!
>>> 
>>> I use org-mac-link-grabber.el 
>>>  almost 
>>> every day. However, it lacks support for an app that I'd like to use 
>>> together with org-mode. 
>>> 
>>> Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
>>> ability. I wrote a little patch for org-mac-link-grabber.el to support 
>>> grabbing links to documents.
>>> 
>>> What it does:
>>> 
>>> * Grabs not just the link to file, but a page
>>> 
>>> * Inserts the selected text as a description, if present. Otherwise
>>> inserts ", p. "
>>> 
>>> * The shortcut is set to [S]
>>> 
>>> * Defines a new "skim" link type
>>> 
>>> It would be interesting to also add some support for importing notes from 
>>> Skim to org.
>>> 
>>> Since Skim.app is not present in clean OS X installs, by default support 
>>> for grabbing links from it is disabled. You can enable it by customizing 
>>> group `org-mac-link-grabber'.
>>> 
>>> So, maybe it's possible to get this patch into the tree? It's my first time 
>>> hacking on org (or even any major elisp extension), so it's probably that 
>>> I've messed up somewhere with a commit format or whatnot.
>>> 
>>> Cheers.
>>> 
>>> -- Daniil Frumin
>>> <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>
>> 
> 




Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-13 Thread Daniil Frumin
So I've been researching this problem and it seems that there is no sane way to 
re-select a text. 

The problem is that `(do-applescript ..)' only interacts with AppleScript well 
if the return type of the string is either a number or a string. If I try to 
convert the selection object (which is not really an object but a list of 
specifiers) it just returns the selected text. 

There is also `selection bounds' but it only covers rectangle selections.

It's possible to save the selected text and try to `find' it later, but that 
won't work well (e.g.: there are several repetitions of the same text on one 
page). 

I've also tried to implement an auto-scrolling to the selected text, but to no 
avail.

The option that seems to me the most reasonable is to add a highlight note to 
the selected text (which is actually possible). What do you think? 

For now, the patch to the problem mentioned by Ivan.
I have actually fixed a small bug in the code for getting links from Firefox:
Prior to the fix the firefox link grabber won't work correctly if a cursor has 
been already positioned in the URL field. The fix works by adding an additional 
keystore for selecting all the text in that field.

The problem is that I've committed it before committing the stuff that Ivan 
told us about, so I am not sure what to do in this case.

Thanks

-- Daniil



0002-Fixing-a-bug-in-as-mac-firefox-get-frontmost-url.patch
Description: Binary data


0003-Automatic-detection-of-the-presence-of-Skim.app.patch
Description: Binary data



On May 13, 2013, at 10:34 AM, Carsten Dominik  wrote:

> Hi Daniil,
> 
> I like this a lot and would like to take the patch after you have taken Ivans 
> feedback, and maybe more feedback if you get any.
> 
> I would like it even more if following the link would rehighlight the 
> selected text.  Is there any way to achieve this?
> 
> I have another question, this would maybe be for the original author, Anthony 
> Lander?  I see that there are functions with prefixes that are not "org-".  
> This is dangerous because there might be packages around that use that name 
> space.  I also think it violates coding rules in Emacs.  I think this should 
> be changed - unless you know of a convention that all functions dealing with 
> applescripts are supposed to have an "as-" prefix.
> 
> I can fix this - but I wanted your feedback first.
> 
> Thanks.
> 
> - Carsten
> 
> On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
> 
>> Hi, all!
>> 
>> I use org-mac-link-grabber.el 
>>  almost every 
>> day. However, it lacks support for an app that I'd like to use together with 
>> org-mode. 
>> 
>> Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
>> ability. I wrote a little patch for org-mac-link-grabber.el to support 
>> grabbing links to documents.
>> 
>> What it does:
>> 
>> * Grabs not just the link to file, but a page
>> 
>> * Inserts the selected text as a description, if present. Otherwise
>> inserts ", p. "
>> 
>> * The shortcut is set to [S]
>> 
>> * Defines a new "skim" link type
>> 
>> It would be interesting to also add some support for importing notes from 
>> Skim to org.
>> 
>> Since Skim.app is not present in clean OS X installs, by default support for 
>> grabbing links from it is disabled. You can enable it by customizing group 
>> `org-mac-link-grabber'.
>> 
>> So, maybe it's possible to get this patch into the tree? It's my first time 
>> hacking on org (or even any major elisp extension), so it's probably that 
>> I've messed up somewhere with a commit format or whatnot.
>> 
>> Cheers.
>> 
>> -- Daniil Frumin
>> <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>
> 



Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-13 Thread Carsten Dominik

On 13 mei 2013, at 11:53, Daniel F  wrote:

> Hi Carsten, Ivan.
> 
> Thanks for the feedback. The issue that Ivan mentioned does look important 
> and I'll try to fix it asap and incorporate the check.
> I'll also look into the rehilighting thing, I am not sure if that's possible. 
> I guess it also would be nice to scroll not just to the right page, but also 
> to the right line in the text.
> 
> As for the "as-" prefix I just assumed that this is legit because the package 
> was already present in the org-mode.

Yes, I see that this is also done in org-mac-message.el. H.

- Carsten

> 
> Cheers.
> 
> - Dan
> 
> 
> On Mon, May 13, 2013 at 10:34 AM, Carsten Dominik  
> wrote:
> Hi Daniil,
> 
> I like this a lot and would like to take the patch after you have taken Ivans 
> feedback, and maybe more feedback if you get any.
> 
> I would like it even more if following the link would rehighlight the 
> selected text.  Is there any way to achieve this?
> 
> I have another question, this would maybe be for the original author, Anthony 
> Lander?  I see that there are functions with prefixes that are not "org-".  
> This is dangerous because there might be packages around that use that name 
> space.  I also think it violates coding rules in Emacs.  I think this should 
> be changed - unless you know of a convention that all functions dealing with 
> applescripts are supposed to have an "as-" prefix.
> 
> I can fix this - but I wanted your feedback first.
> 
> Thanks.
> 
> - Carsten
> 
> On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
> 
> > Hi, all!
> >
> > I use org-mac-link-grabber.el 
> >  almost 
> > every day. However, it lacks support for an app that I'd like to use 
> > together with org-mode.
> >
> > Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
> > ability. I wrote a little patch for org-mac-link-grabber.el to support 
> > grabbing links to documents.
> >
> > What it does:
> >
> > * Grabs not just the link to file, but a page
> >
> > * Inserts the selected text as a description, if present. Otherwise
> >  inserts ", p. "
> >
> > * The shortcut is set to [S]
> >
> > * Defines a new "skim" link type
> >
> > It would be interesting to also add some support for importing notes from 
> > Skim to org.
> >
> > Since Skim.app is not present in clean OS X installs, by default support 
> > for grabbing links from it is disabled. You can enable it by customizing 
> > group `org-mac-link-grabber'.
> >
> > So, maybe it's possible to get this patch into the tree? It's my first time 
> > hacking on org (or even any major elisp extension), so it's probably that 
> > I've messed up somewhere with a commit format or whatnot.
> >
> > Cheers.
> >
> > -- Daniil Frumin
> > <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>
> 
> 
> 
> 
> -- 
> Sincerely yours,
> -- Daniil



Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-13 Thread Daniel F
Hi Carsten, Ivan.

Thanks for the feedback. The issue that Ivan mentioned does look important
and I'll try to fix it asap and incorporate the check.
I'll also look into the rehilighting thing, I am not sure if that's
possible. I guess it also would be nice to scroll not just to the right
page, but also to the right line in the text.

As for the "as-" prefix I just assumed that this is legit because the
package was already present in the org-mode.

Cheers.

- Dan


On Mon, May 13, 2013 at 10:34 AM, Carsten Dominik  wrote:

> Hi Daniil,
>
> I like this a lot and would like to take the patch after you have taken
> Ivans feedback, and maybe more feedback if you get any.
>
> I would like it even more if following the link would rehighlight the
> selected text.  Is there any way to achieve this?
>
> I have another question, this would maybe be for the original author,
> Anthony Lander?  I see that there are functions with prefixes that are not
> "org-".  This is dangerous because there might be packages around that use
> that name space.  I also think it violates coding rules in Emacs.  I think
> this should be changed - unless you know of a convention that all functions
> dealing with applescripts are supposed to have an "as-" prefix.
>
> I can fix this - but I wanted your feedback first.
>
> Thanks.
>
> - Carsten
>
> On 12 mei 2013, at 20:29, Daniil Frumin  wrote:
>
> > Hi, all!
> >
> > I use org-mac-link-grabber.el <
> http://orgmode.org/worg/org-contrib/org-mac-link-grabber.html> almost
> every day. However, it lacks support for an app that I'd like to use
> together with org-mode.
> >
> > Skim.app is a light and fast PDF reader for Mac OS X with a note-taking
> ability. I wrote a little patch for org-mac-link-grabber.el to support
> grabbing links to documents.
> >
> > What it does:
> >
> > * Grabs not just the link to file, but a page
> >
> > * Inserts the selected text as a description, if present. Otherwise
> >  inserts ", p. "
> >
> > * The shortcut is set to [S]
> >
> > * Defines a new "skim" link type
> >
> > It would be interesting to also add some support for importing notes
> from Skim to org.
> >
> > Since Skim.app is not present in clean OS X installs, by default support
> for grabbing links from it is disabled. You can enable it by customizing
> group `org-mac-link-grabber'.
> >
> > So, maybe it's possible to get this patch into the tree? It's my first
> time hacking on org (or even any major elisp extension), so it's probably
> that I've messed up somewhere with a commit format or whatnot.
> >
> > Cheers.
> >
> > -- Daniil Frumin
> > <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>
>
>


-- 
Sincerely yours,
-- Daniil


Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-12 Thread Carsten Dominik
Hi Daniil,

I like this a lot and would like to take the patch after you have taken Ivans 
feedback, and maybe more feedback if you get any.

I would like it even more if following the link would rehighlight the selected 
text.  Is there any way to achieve this?

I have another question, this would maybe be for the original author, Anthony 
Lander?  I see that there are functions with prefixes that are not "org-".  
This is dangerous because there might be packages around that use that name 
space.  I also think it violates coding rules in Emacs.  I think this should be 
changed - unless you know of a convention that all functions dealing with 
applescripts are supposed to have an "as-" prefix.

I can fix this - but I wanted your feedback first.

Thanks.

- Carsten

On 12 mei 2013, at 20:29, Daniil Frumin  wrote:

> Hi, all!
> 
> I use org-mac-link-grabber.el 
>  almost every 
> day. However, it lacks support for an app that I'd like to use together with 
> org-mode. 
> 
> Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
> ability. I wrote a little patch for org-mac-link-grabber.el to support 
> grabbing links to documents.
> 
> What it does:
> 
> * Grabs not just the link to file, but a page
> 
> * Inserts the selected text as a description, if present. Otherwise
>  inserts ", p. "
> 
> * The shortcut is set to [S]
> 
> * Defines a new "skim" link type
> 
> It would be interesting to also add some support for importing notes from 
> Skim to org.
> 
> Since Skim.app is not present in clean OS X installs, by default support for 
> grabbing links from it is disabled. You can enable it by customizing group 
> `org-mac-link-grabber'.
> 
> So, maybe it's possible to get this patch into the tree? It's my first time 
> hacking on org (or even any major elisp extension), so it's probably that 
> I've messed up somewhere with a commit format or whatnot.
> 
> Cheers.
> 
> -- Daniil Frumin
> <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>




Re: [O] Skim.app support for org-mac-link-grabber.el

2013-05-12 Thread Ivan Andrus
Just two comments from someone who didn't know org-mac-link-grabber existed 
until today (I'm gonna try it out) and hasn't (yet) contributed to org-mode.

1. It looks like it's actually enabled by default
2. You can detect whether it should be enabled by default with something like

(< 0 (length (shell-command-to-string
  "mdfind kMDItemCFBundleIdentifier == 
'net.sourceforge.skim-app.skim'")))

which will tell whether you have skim installed.  I haven't looked at 
org-mac-link-grabber to see if other similar changes could be made.  So the 
defcustom would be changed to

(defcustom org-mac-grab-Skim-app-p
  (< 0 (length (shell-command-to-string
"mdfind kMDItemCFBundleIdentifier == 
'net.sourceforge.skim-app.skim'")))
  "Enable menu option [S]kim to grab page links from Skim.app"
  :tag "Grab Skim.app page links"
  :group 'org-mac-link-grabber
  :type 'boolean)

-Ivan

On May 12, 2013, at 12:29 PM, Daniil Frumin  wrote:

> Hi, all!
> 
> I use org-mac-link-grabber.el 
>  almost every 
> day. However, it lacks support for an app that I'd like to use together with 
> org-mode. 
> 
> Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
> ability. I wrote a little patch for org-mac-link-grabber.el to support 
> grabbing links to documents.
> 
> What it does:
> 
> * Grabs not just the link to file, but a page
> 
> * Inserts the selected text as a description, if present. Otherwise
>  inserts ", p. "
> 
> * The shortcut is set to [S]
> 
> * Defines a new "skim" link type
> 
> It would be interesting to also add some support for importing notes from 
> Skim to org.
> 
> Since Skim.app is not present in clean OS X installs, by default support for 
> grabbing links from it is disabled. You can enable it by customizing group 
> `org-mac-link-grabber'.
> 
> So, maybe it's possible to get this patch into the tree? It's my first time 
> hacking on org (or even any major elisp extension), so it's probably that 
> I've messed up somewhere with a commit format or whatnot.
> 
> Cheers.
> 
> -- Daniil Frumin
> <0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch>




[O] Skim.app support for org-mac-link-grabber.el

2013-05-12 Thread Daniil Frumin
Hi, all!

I use org-mac-link-grabber.el 
 almost every 
day. However, it lacks support for an app that I'd like to use together with 
org-mode. 

Skim.app is a light and fast PDF reader for Mac OS X with a note-taking 
ability. I wrote a little patch for org-mac-link-grabber.el to support grabbing 
links to documents.

What it does:

* Grabs not just the link to file, but a page

* Inserts the selected text as a description, if present. Otherwise
  inserts ", p. "

* The shortcut is set to [S]

* Defines a new "skim" link type

It would be interesting to also add some support for importing notes from Skim 
to org.

Since Skim.app is not present in clean OS X installs, by default support for 
grabbing links from it is disabled. You can enable it by customizing group 
`org-mac-link-grabber'.

So, maybe it's possible to get this patch into the tree? It's my first time 
hacking on org (or even any major elisp extension), so it's probably that I've 
messed up somewhere with a commit format or whatnot.

Cheers.

-- Daniil Frumin


0001-Adding-Skim.app-support-to-org-mac-link-grabber.el.patch
Description: Binary data