diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-12-11 17:42:53 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-12-11 17:42:53 +0100 |
commit | acedf35ce08b9df4a0dcbcd1413e7d85f1182034 (patch) | |
tree | 240e26f10d2feb66e8c0cd0634082fcb7bd577e5 /lisp/org/org-id.el | |
parent | 39321b94bfa4e50401e30caedfd09a06629f5bd2 (diff) | |
download | emacs-acedf35ce08b9df4a0dcbcd1413e7d85f1182034.tar.gz emacs-acedf35ce08b9df4a0dcbcd1413e7d85f1182034.tar.bz2 emacs-acedf35ce08b9df4a0dcbcd1413e7d85f1182034.zip |
Update to Org mode 7.4
Diffstat (limited to 'lisp/org/org-id.el')
-rw-r--r-- | lisp/org/org-id.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index fcca58831d1..a8004afec8a 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 7.3 +;; Version: 7.4 ;; ;; This file is part of GNU Emacs. ;; @@ -600,15 +600,18 @@ optional argument MARKERP, return the position as a new marker." (defun org-id-store-link () "Store a link to the current entry, using its ID." (interactive) - (let* ((link (org-make-link "id:" (org-id-get-create))) - (case-fold-search nil) - (desc (save-excursion - (org-back-to-heading t) - (or (and (looking-at org-complex-heading-regexp) - (if (match-end 4) (match-string 4) (match-string 0))) - link)))) - (org-store-link-props :link link :description desc :type "id") - link)) + (when (and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) + (let* ((link (org-make-link "id:" (org-id-get-create))) + (case-fold-search nil) + (desc (save-excursion + (org-back-to-heading t) + (or (and (looking-at org-complex-heading-regexp) + (if (match-end 4) + (match-string 4) + (match-string 0))) + link)))) + (org-store-link-props :link link :description desc :type "id") + link))) (defun org-id-open (id) "Go to the entry with id ID." |