X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=11e36c025d7f8129b2bacca6578d140b483544c4;hp=681043513a175bd3ced6e91133b09a19da05aa3d;hb=8c3ba76279da12973450dde58cbfff6917db69e6;hpb=74d2da38b565cb1358b0a5ed14222729e6e436cd diff --git a/org-ref.org b/org-ref.org index 6810435..11e36c0 100644 --- a/org-ref.org +++ b/org-ref.org @@ -1096,7 +1096,16 @@ keyword we clicked on. We also strip the text properties." (interactive) (let* ((object (org-element-context)) (link-string (org-element-property :path object))) - + ;; you may click on the part before the citations. here we make + ;; sure to move to the beginning so you get the first citation. + (let ((cp (point))) + (goto-char (org-element-property :begin object)) + (search-forward link-string (org-element-property :end object)) + (goto-char (match-beginning 0)) + ;; check if we clicked before the path and move as needed. + (unless (< cp (point)) + (goto-char cp))) + (if (not (org-element-property :contents-begin object)) ;; this means no description in the link (progn @@ -1721,7 +1730,13 @@ construct the heading by hand." (goto-char (point-min)) ;; put new entry in notes if we don't find it. - (unless (re-search-forward (format ":Custom_ID: %s$" key) nil 'end) + (if (re-search-forward (format ":Custom_ID: %s$" key) nil 'end) + (progn + (org-show-entry) + (show-children) + (outline-previous-visible-heading 1) + (recenter-top-bottom 0)) + ;; no entry found, so add one (insert (format "\n** TODO %s - %s" year title)) (insert (format" :PROPERTIES: