Anonymous avatar Anonymous committed 1565284

Hacked around top-level link creation.

It works a little better, thanks to ugly hacks.

Comments (0)

Files changed (2)

File contents unchanged.


   (abbreviate-file-name (or (buffer-file-name) buffer)))
 (defun get-link (filename)
-  (org-make-link-string (concat "file:" filename)))
+  ; TODO make this handle non-file links
+  ; like docview: or html: links.
+  (org-store-link (point-at-bol)))
 (defun org-annotate-file-add-upper-level (link)
+  (defun ugly-hack ()
+	"Something causes ']' to fall off the end of the link.  This
+ugly hack is required to work around the limitation."
+	(insert "]"))
   (insert "* ")
-  (insert link))
+  (insert link)
+  (ugly-hack))
 (defun org-annotate-file-add-second-level (link)
   "Safely positions cursor for a new entry."
   (goto-char (point-max))
   (unless (= (char-before) 10)
-	(newline)))
+  	(newline)))
 (defun put-cursor-in-annotation ()
   "After a link is inserted, position cursor with newlines to avoid
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.