From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anders Waldenborg Subject: Re: PATCH Make org-open-at-point only ask once Date: Mon, 29 Aug 2011 12:53:45 +0200 Message-ID: <20110829105345.GU5700@0x63.nu> References: <20110828200542.GS5700@0x63.nu> <87liuclmey.fsf@gmail.com> <20110829092146.GT5700@0x63.nu> <87d3folfu4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxzTU-0006Vw-V3 for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 06:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QxzTT-0002zo-Ed for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 06:53:52 -0400 Received: from 0x63.nu ([193.26.17.18]:39286 helo=gagarin.0x63.nu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxzTT-0002zM-9h for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 06:53:51 -0400 Content-Disposition: inline In-Reply-To: <87d3folfu4.fsf@gmail.com> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On Mon, Aug 29, 2011 at 11:36:19AM +0200, Nicolas Goaziou wrote: > Maybe we should define a consistent link search: ignore the narrowing > but first search in current sub-tree, if that fails (any error, I guess) > search in current tree and if that one fails too, search in the whole > buffer. So something with the same semantics as this: (defun find-nearest-heading-named (l) (unless (find-heading-in-current-subtree l) (up-one-level) (find-nearest-heading-named l))) i.e find the target with its parent headings list sharing the longest prefix with current point's. * A ** B * C ** B ** D *** B *** E A link to B inside E would go to C/D/B because (C D B) shares longer prefix with (C D E) than (C B) and (A B) does. anders