X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=71dff79ece61eaddbd83571e0ddac3e8d4c8cce2;hp=97d047247574cdef8d8697ad4fcbd5c9c28c55f9;hb=7d5790254b19acec7dc688054a65790808bf733f;hpb=97a06ccf1e42682d284f7780366ce381d54733a0;ds=sidebyside diff --git a/org-ref.org b/org-ref.org index 97d0472..71dff79 100644 --- a/org-ref.org +++ b/org-ref.org @@ -1096,7 +1096,18 @@ keyword we clicked on. We also strip the text properties." (interactive) (let* ((object (org-element-context)) (link-string (org-element-property :path object))) - + (message "%s" 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