emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] PATCH Make org-open-at-point only ask once


From: Anders Waldenborg
Subject: Re: [O] PATCH Make org-open-at-point only ask once
Date: Mon, 29 Aug 2011 12:53:45 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]