From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: OrgmodeWiki Support Date: Thu, 24 Dec 2009 09:01:30 +0100 Message-ID: References: <200912062323.35140.liste@barisch.com> <20091218112849.GH5666@atlantic.linksys.moosehall> <6AB8487A-888D-440D-8A8E-C0BB63050F2C@gmail.com> <20091218141926.GA23267@atlantic.linksys.moosehall> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNidk-0008CP-HA for emacs-orgmode@gnu.org; Thu, 24 Dec 2009 03:01:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNidb-0008A8-J6 for emacs-orgmode@gnu.org; Thu, 24 Dec 2009 03:01:40 -0500 Received: from [199.232.76.173] (port=53569 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNidb-00089p-2P for emacs-orgmode@gnu.org; Thu, 24 Dec 2009 03:01:35 -0500 Received: from mail-fx0-f228.google.com ([209.85.220.228]:60882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNida-0003o2-KR for emacs-orgmode@gnu.org; Thu, 24 Dec 2009 03:01:34 -0500 Received: by fxm28 with SMTP id 28so1000637fxm.26 for ; Thu, 24 Dec 2009 00:01:33 -0800 (PST) In-Reply-To: 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: Paul Sexton Cc: emacs-orgmode@gnu.org Hi Paul, On Dec 18, 2009, at 9:35 PM, Paul Sexton wrote: > Carsten Dominik gmail.com> writes: > [snip] >> >> I think it would be useful to discuss this proposal first in a >> broader >> sense. >> Let me try to make a start. >> >> A few days ago, Paul Sexton submitted his proposal for simple >> file-to-file links based on etags. >> >> He wanted to make [[sometext]] be a link to <> where >> the target definition <> can be in a different file. >> Furthermore, his proposal uses an external program to do the >> indexing of the tags, and following the links uses the etags >> code shipped with Emacs. >> >> Finally, Paul's proposal also contains a way to automatically >> create new topics when a link is called that does not yet have >> a target. >> >> Now we are talking about WikiWords, or CamelCase links. Here the >> idea is that any such mixed-case word automatically is treated as a >> link. >> Traditionally these links to a separate file with name given by the >> link text directly. But I suppose it could also got to a <> >> somewhere in a file? >> >> For a couple of reasons it seems to me that it would be useful >> to look at these proposals together. For one thing, I am not >> a huge fan of the zillions of files that will be created when using >> the one-file-per-word approach. Since Org-mode is outline based, it >> seem to make a lot of sense to have many topics per file. >> >> One way to move into this direction would be to still use etags >> to index the possible targets, and then to turn specific words >> (like CamelCase words) directly into links without the need to >> surround them with [[...]]. >> >> But of course, we could also have an implementation as Adam >> proposes it, with CamelCase words linking to files, and >> then [[target]] linking to targets. >> >> Can we discuss this for a bit? >> >> - Carsten > > > Hi Carsten, > > In the other thread, you say you have implemented a hook whose > function(s) are > run when attempting to open a link. From your description it sounds > like the > hook is run FIRST, and org's default behaviour only happens if the > hook > functions don't override it. That is correct, because the default behavior not only searches for <>, but also for plain text searches, and this may disrupt the workings of your code. Since all targets in the current file should also be in your tags file, I think they will be fond without any problem in the current file as well. So it is early enough to fall back to full text search by the time your ctags search has *not* returned a successful match. Or am I missing something here? > > However, both the link-to-file-of-same-name proposal and my etags > functionality > would be more easily implemented with a hook function that is called > only when > org can't find a specific target for [[plain link]]. At the moment > org defaults > to performing a full-text search for "plain link". Both the > wikiwords and the > etags behaviours need to happen instead of that default behaviour, > but neither > needs to override the rest of org's link-opening behaviour. Well, all the normal link stuff like http: links and file: links is still does before calling the hook! > > Re the WikiWords idea -- this could be done in 2 independent parts: > 1. Option to tell org to interpret all CamelCase words as plain > links (this > might be behaviour that some people want by itself) > 2. Function, called when org can't find target for plain link, that > tries to > open and visit a file with the same name as the link. > > I think a hook to change the default behaviour of org when it can't > find an > explicit target for a plain link is a very good idea and would > probably lead to > other useful stuff. Personally I don't find the default behaviour of > full-text > search to be useful. Exactly. So why does your org-ctags still need a patch? I am confused. > > Paul > > P.S. My wishlist includes using a different colour to fontify links > whose > targets don't exist (a la wikipedia with its undefined links in > red). Can be > done, but not sure how to do it efficiently. Indeed, this would be relatively hard to do efficiently. - but not impossible. - 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 - Carsten