Esben Stien <b...@esben-stien.name> writes: > I'm trying to figure out how I can get a link to the top most heading > without actually moving point up there and doing C-c C-l. > > Is there some function to do that? > > If I try using the function outline-previous-heading, how can I know > when I've reached the top as it seems to just bang its head in the roof > of the file when it reaches the top. It also finds stuff above the > topmost heading, like lines beginning with "#". > > Any pointers as to what I can try?
I don't know if `org-goto-first-headline' is implemented, but e.g. this function shows how to do it, since it needs to find first headline too: (defun org-first-headline-recenter () "Move cursor to the first headline and recenter the headline." (goto-char (point-min)) (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t) (set-window-start (selected-window) (point-at-bol)))) -- cheers, Thorsten