From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luke Amdor Subject: Re: Re: [PATCH] Allow regexps in org-file-apps to capture link parameters using groups Date: Sun, 4 Apr 2010 19:33:51 -0500 Message-ID: References: <4B600794.4010008@jboecker.de> <4BA630AD.1080901@jboecker.de> <9771A876-82D8-4755-9EC4-F951EA9FE6E6@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=000e0cd1ab80db302d0483727cc5 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyaGf-0007Tm-MH for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 20:34:17 -0400 Received: from [140.186.70.92] (port=47889 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyaGe-0007Te-1b for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 20:34:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyaGc-000132-Iq for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 20:34:16 -0400 Received: from mail-pz0-f184.google.com ([209.85.222.184]:52943) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyaGc-00012t-5h for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 20:34:14 -0400 Received: by pzk14 with SMTP id 14so131408pzk.14 for ; Sun, 04 Apr 2010 17:34:12 -0700 (PDT) In-Reply-To: <9771A876-82D8-4755-9EC4-F951EA9FE6E6@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: org-mode Mode --000e0cd1ab80db302d0483727cc5 Content-Type: multipart/alternative; boundary=000e0cd1ab80db30200483727cc3 --000e0cd1ab80db30200483727cc3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi guys, I believe I found one little thing that this patch broke. That is linking to either a text search or heading search in a different org file. I've attached two files which illustrate this. The first file test.orgcontains a link to a heading search of "* Hello" in the other file ( other.org). Let me know if you need any more information. Thanks. Luke On Sun, Mar 21, 2010 at 12:13 PM, Carsten Dominik wrote: > Hi Jan, > > I have now applied this patch. > > Hi everyone, > > I am not sure if I completely understood every part of it, so if > anyone finds strange behavior of links, make sure to report it so > that we (Jan, that is :-) gets a chance to fix it. > > Thanks! > > - Carsten > > On Mar 21, 2010, at 3:43 PM, Jan B=F6cker wrote: > > On 20.03.2010 16:07, Carsten Dominik wrote: >> >>> Hi Jan, >>> >>> I forgot what the last status of this thread was. Could you please >>> remind me? >>> >>> Thanks. >>> >>> - Carsten >>> >>> >> Hi Carsten, >> >> The patch is ready to be applied. I have been using it since January 16 >> without any problems. >> As mentioned in the description, it does introduce a >> backwards-incompatible change, but I know of no existing code which >> depends on the old behavior. >> >> However, I noticed an error in the docstrings and commit message: in >> several places where it says "(string-match n link)", it should say >> "(match-string n link)". >> I have attached a fixed version, which is also available via: >> git pull http://github.com/jboecker/org-mode.git for-carsten >> >> The motivation for this patch went something like this: >> - I wanted to link to PDFs, so I wrote org-docview.el >> - Someone pointed out that docview links did not respect >> org-link-file-path-type, which I fixed >> - Daniel M. German started integrating evince and xournal with >> org-protocol and asked if there was a link syntax to link to a specific >> page of a PDF (there were docview: links, but these are hard-coded to >> open within emacs) >> - I realized that docview: links are/should be a special case of file: >> links, so I wrote this patch >> >> On Jan 27, 2010, at 10:29 AM, Jan B=F6cker wrote: >>> >>>> >>>> Btw, since posting the patch I stumbled upon another disadvantage: >>>> 'extended' link types defined this way will only support autocompletio= n >>>> for the file name, i.e. you will not be prompted for a page number whe= n >>>> entering a link using C-c C-l file , then specifying the path to >>>> some PDF file. >>>> >>> >> I do no longer count this as a reason against this patch, because normal >> file: links do not prompt you for a line number, either, and you should >> not be typing in links by hand anyway most of the time. >> >> A better way to extend file links might be to make it easy to create ne= w >>>> links with "file" behaviour, instead of applying this patch (so a pdf >>>> link would look like file+pdf:/document.pdf::4, and because the link >>>> type starts with "file+", it will e.g. respect org-link-file-path-type >>>> automatically). >>>> What do you think? >>>> >>> >> Because I no longer care about prompting for a page number, I no longer >> care about this crazy idea of mine, too. Please go ahead and apply the >> patch in its current state. >> >> Unfortunately, I won't have much time for programming for about a month >>>> due to exams. >>>> >>> >> This has also changed, I passed all three :) >> Now that I again have time to code and Daniel M German's patches to >> xournal and evince are functional, my next steps will be the two things >> mentioned under "What's next?" in the initial patch description. >> >> If you have any further questions, just ask! >> - Jan >> >> >> PS: >> On 27.01.2010 11:53, Carsten Dominik wrote: >> >>> It is in my list, and I will get to it.... >>> >> When the author of org-mode says it's on his list, you know he will come >> back to it and you don't have to add it to yours :) >> <0001-Allow-regexps-in-org-file-apps-to-capture-link-param.patch> >> > > - Carsten > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --000e0cd1ab80db30200483727cc3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi guys, I believe I found one little thing that this patch broke. That is = linking to either a text search or heading search in a different org file. = I've attached two files which illustrate this. The first file test.org contains a link to a heading search of &q= uot;* Hello" in the other file (other.org= ). Let me know if you need any more information. Thanks.

Luke


On Sun, Mar 21, 2010 at 12:13 PM, Carste= n Dominik <carsten.dominik@gmail.com> wrote:
Hi Jan,

I have now applied this patch.

Hi everyone,

I am not sure if I completely understood every part of it, =A0so if
anyone finds strange behavior of links, make sure to report it so
that we (Jan, that is :-) gets a chance to fix it.

Thanks!

- Carsten

On Mar 21, 2010, at 3:43 PM, Jan B=F6cker wrote:

On 20.03.2010 16:07, Carsten Dominik wrote:
Hi Jan,

I forgot what the last status of this thread was. =A0Could you please
remind me?

Thanks.

- Carsten


Hi Carsten,

The patch is ready to be applied. I have been using it since January 16
without any problems.
As mentioned in the description, it does introduce a
backwards-incompatible change, but I know of no existing code which
depends on the old behavior.

However, I noticed an error in the docstrings and commit message: in
several places where it says "(string-match n link)", it should s= ay
"(match-string n link)".
I have attached a fixed version, which is also available via:
git pull http://github.com/jboecker/org-mode.git for-carsten

The motivation for this patch went something like this:
- I wanted to link to PDFs, so I wrote org-docview.el
- Someone pointed out that docview links did not respect
org-link-file-path-type, which I fixed
- Daniel M. German started integrating evince and xournal with
org-protocol and asked if there was a link syntax to link to a specific
page of a PDF (there were docview: links, but these are hard-coded to
open within emacs)
- I realized that docview: links are/should be a special case of file:
links, so I wrote this patch

On Jan 27, 2010, at 10:29 AM, Jan B=F6cker wrote:

Btw, since posting the patch I stumbled upon another disadvantage:
'extended' link types defined this way will only support autocomple= tion
for the file name, i.e. you will not be prompted for a page number when
entering a link using C-c C-l file <RET>, then specifying the path to=
some PDF file.

I do no longer count this as a reason against this patch, because normal file: links do not prompt you for a line number, either, and you should
not be typing in links by hand anyway most of the time.

A better way to extend file links might be to make it easy to create new links with "file" behaviour, instead of applying this patch (so a= pdf
link would look like file+pdf:/document.pdf::4, and because the link
type starts with "file+", it will e.g. respect org-link-file-path= -type
automatically).
What do you think?

Because I no longer care about prompting for a page number, I no longer
care about this crazy idea of mine, too. Please go ahead and apply the
patch in its current state.

Unfortunately, I won't have much time for programming for about a month=
due to exams.

This has also changed, I passed all three :)
Now that I again have time to code and Daniel M German's patches to
xournal and evince are functional, my next steps will be the two things
mentioned under "What's next?" in the initial patch descripti= on.

If you have any further questions, just ask!
- Jan


PS:
On 27.01.2010 11:53, Carsten Dominik wrote:
It is in my list, and I will get to it....
When the author of org-mode says it's on his list, you know he will com= e
back to it and you don't have to add it to yours :)
<0001-Allow-regexps-in-org-file-apps-to-capture-link-param.patch>

- Carsten





_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

--000e0cd1ab80db30200483727cc3-- --000e0cd1ab80db302d0483727cc5 Content-Type: application/octet-stream; name="test.org" Content-Disposition: attachment; filename="test.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g7mjsgcj0 KiBTb21ldGhpbmcKKiBbW2ZpbGU6b3RoZXIub3JnOjoqT25lXVtqdW1wIHRvIG9uZV1dCg== --000e0cd1ab80db302d0483727cc5 Content-Type: application/octet-stream; name="other.org" Content-Disposition: attachment; filename="other.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g7mjspau1 KiBIZWxsbwoqKiogT25lCioqKiBUd28KKioqIFRocmVlCg== --000e0cd1ab80db302d0483727cc5 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --000e0cd1ab80db302d0483727cc5--