diff options
Diffstat (limited to 'lisp/org/org-id.el')
-rw-r--r-- | lisp/org/org-id.el | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index fd17562ef5a..189865ffe67 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: 6.21b +;; Version: 6.29c ;; ;; This file is part of GNU Emacs. ;; @@ -79,11 +79,16 @@ :tag "Org ID" :group 'org) +(defcustom org-id-uuid-program "uuidgen" + "The uuidgen program." + :group 'org-id + :type 'string) (defcustom org-id-method (condition-case nil (if (string-match "\\`[-0-9a-fA-F]\\{36\\}\\'" - (org-trim (shell-command-to-string "uuidgen"))) + (org-trim (shell-command-to-string + org-id-uuid-program))) 'uuidgen 'org) (error 'org)) @@ -197,7 +202,7 @@ With optional argument FORCE, force the creation of a new ID." "Copy the ID of the entry at point to the kill ring. Create an ID if necessary." (interactive) - (kill-new (org-id-get nil 'create))) + (org-kill-new (org-id-get nil 'create))) ;;;###autoload (defun org-id-get (&optional pom create prefix) @@ -228,6 +233,7 @@ It returns the ID of the entry. If necessary, the ID is created." (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10))))) (org-refile-use-outline-path (if (caar org-refile-targets) 'file t)) + (org-refile-target-verify-function nil) (spos (org-refile-get-location "Entry: ")) (pom (and spos (move-marker (make-marker) (nth 3 spos) (get-file-buffer (nth 1 spos)))))) @@ -300,7 +306,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (if (equal prefix ":") (setq prefix "")) (cond ((eq org-id-method 'uuidgen) - (setq unique (org-trim (shell-command-to-string "uuidgen")))) + (setq unique (org-trim (shell-command-to-string org-id-uuid-program)))) ((eq org-id-method 'org) (let* ((etime (org-id-reverse-string (org-id-time-to-b36))) (postfix (if org-id-include-domain @@ -571,11 +577,22 @@ optional argument MARKERP, return the position as a new marker." (defun org-id-open (id) "Go to the entry with id ID." (org-mark-ring-push) - (let ((m (org-id-find id 'marker))) + (let ((m (org-id-find id 'marker)) + cmd) (unless m (error "Cannot find entry with ID \"%s\"" id)) + ;; Use a buffer-switching command in analogy to finding files + (setq cmd + (or + (cdr + (assq + (cdr (assq 'file org-link-frame-setup)) + '((find-file . switch-to-buffer) + (find-file-other-window . switch-to-buffer-other-window) + (find-file-other-frame . switch-to-buffer-other-frame)))) + 'switch-to-buffer-other-window)) (if (not (equal (current-buffer) (marker-buffer m))) - (switch-to-buffer-other-window (marker-buffer m))) + (funcall cmd (marker-buffer m))) (goto-char m) (move-marker m nil) (org-show-context))) |