]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-id.el
Update copyright year to 2015
[gnu-emacs] / lisp / org / org-id.el
index c156e240dbfaec82bee6281d85720b22010072a6..5c85d7a133e9f5b1151f9ec653353f843ce926f4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-id.el --- Global identifiers for Org-mode entries
 ;;
-;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -186,7 +186,7 @@ the link."
   :type 'boolean)
 
 (defcustom org-id-locations-file (convert-standard-filename
-                                 "~/.emacs.d/.org-id-locations")
+                                 (concat user-emacs-directory ".org-id-locations"))
   "The file for remembering in which file an ID was defined.
 This variable is only relevant when `org-id-track-globally' is set."
   :group 'org-id
@@ -261,11 +261,11 @@ In any case, the ID of the entry is returned."
 
 ;;;###autoload
 (defun org-id-get-with-outline-path-completion (&optional targets)
-  "Use outline-path-completion to retrieve the ID of an entry.
-TARGETS may be a setting for `org-refile-targets' to define the eligible
-headlines.  When omitted, all headlines in all agenda files are
-eligible.
-It returns the ID of the entry.  If necessary, the ID is created."
+  "Use `outline-path-completion' to retrieve the ID of an entry.
+TARGETS may be a setting for `org-refile-targets' to define
+eligible headlines.  When omitted, all headlines in the current
+file are eligible.  This function 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))
@@ -323,6 +323,7 @@ With optional argument MARKERP, return the position as a new marker."
 
 ;; Creating new IDs
 
+;;;###autoload
 (defun org-id-new (&optional prefix)
   "Create a new globally unique ID.
 
@@ -346,7 +347,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
       (unless (org-uuidgen-p unique)
        (setq unique (org-id-uuid))))
      ((eq org-id-method 'org)
-      (let* ((etime (org-id-reverse-string (org-id-time-to-b36)))
+      (let* ((etime (org-reverse-string (org-id-time-to-b36)))
             (postfix (if org-id-include-domain
                          (progn
                            (require 'message)
@@ -379,9 +380,6 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
            (substring rnd 18 20)
            (substring rnd 20 32))))
 
-(defun org-id-reverse-string (s)
-  (mapconcat 'char-to-string (nreverse (string-to-list s)) ""))
-
 (defun org-id-int-to-b36-one-digit (i)
   "Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z."
   (cond
@@ -435,7 +433,7 @@ and time is the usual three-integer representation of time."
     (if (= 2 (length parts))
        (setq prefix (car parts) time (nth 1 parts))
       (setq prefix nil time (nth 0 parts)))
-    (setq time (org-id-reverse-string time))
+    (setq time (org-reverse-string time))
     (setq time (list (org-id-b36-to-int (substring time 0 4))
                     (org-id-b36-to-int (substring time 4 8))
                     (org-id-b36-to-int (substring time 8 12))))
@@ -443,6 +441,7 @@ and time is the usual three-integer representation of time."
 
 ;; Storing ID locations (files)
 
+;;;###autoload
 (defun org-id-update-id-locations (&optional files silent)
   "Scan relevant files for IDs.
 Store the relation between files and corresponding IDs.
@@ -533,7 +532,9 @@ When CHECK is given, prepare detailed information about duplicate IDs."
                   (org-id-hash-to-alist org-id-locations)
                 org-id-locations)))
       (with-temp-file org-id-locations-file
-       (print out (current-buffer))))))
+       (let ((print-level nil)
+             (print-length nil))
+         (print out (current-buffer)))))))
 
 (defun org-id-locations-load ()
   "Read the data from `org-id-locations-file'."
@@ -681,4 +682,8 @@ optional argument MARKERP, return the position as a new marker."
 
 (provide 'org-id)
 
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
 ;;; org-id.el ends here