diff options
author | Bastien Guerry <bzg@altern.org> | 2012-12-22 23:20:47 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-12-22 23:20:47 +0100 |
commit | 416357c82c3e72bbc5722f71d488618fa5aa6823 (patch) | |
tree | ed7e7611593186d0959bc62adedc3e6fb6f3a5de | |
parent | a0be28eeb6319b2b69babb126ce1655f36c821a3 (diff) | |
download | org-mode-416357c82c3e72bbc5722f71d488618fa5aa6823.tar.gz |
org.el (org-store-link): Use keyword at point as the search string
* org.el (org-store-link): Use keyword at point as the search
string.
Thanks to Thomas Dye for reporting this.
-rw-r--r-- | lisp/org.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 5896866..4b17950 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9021,10 +9021,13 @@ part of Org's core." (buffer-file-name (buffer-base-buffer))))) ;; Add a context search string (when (org-xor org-context-in-file-links arg) - (setq txt (cond + (let ((e (org-element-at-point))) + (setq txt (cond ((org-at-heading-p) nil) + ((eq (org-element-type e) 'keyword) + (plist-get (cadr e) :value)) ((org-region-active-p) - (buffer-substring (region-beginning) (region-end))))) + (buffer-substring (region-beginning) (region-end)))))) (when (or (null txt) (string-match "\\S-" txt)) (setq cpltxt (concat cpltxt "::" |