|
From: | Carsten Dominik |
Subject: | Re: [Orgmode] Line numbers with org-store-link? |
Date: | Tue, 6 May 2008 09:20:57 +0200 |
Hi Bart, You can pretty easily hack this, though: Lets say you want to have line numbers for links to any files in c-mode (because this is the programming language you are talking about). Limiting it to some special files makes sure that in other file types you will still get links based on (somewhat) more reliable text snippets. Then you can write a small function and add it to the hook org-create-file-search-functions: (defun my-link-to-line-number-in-c-mode () "When in c-mode, use line number as search item." (when (eq major-mode 'c-mode) (number-to-string (org-current-line)))) (add-hook 'org-create-file-search-functions 'my-link-to-line-number-in-c-mode) Normally you would also have to write a function to search for the custom link search text and add that function to `org-execute-file-search-functions'. But you are lucky: if the search item is an integer number, Org already interprets it as a line number. Hope this helps. - Carsten On May 5, 2008, at 11:40 PM, Bart Parliman wrote: Is there a way to force org-store-link to store the current line number rather than a string to locate? |
[Prev in Thread] | Current Thread | [Next in Thread] |