[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 78e39d5 1/6: lisp/org-id.el: Small enhancements
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 78e39d5 1/6: lisp/org-id.el: Small enhancements |
Date: |
Sat, 15 May 2021 04:57:15 -0400 (EDT) |
branch: externals/org
commit 78e39d58d499299c810de3dca890ebeb0842911a
Author: Bastien <bzg@gnu.org>
Commit: Bastien <bzg@gnu.org>
lisp/org-id.el: Small enhancements
* lisp/org-id.el (org-id-locations-load, org-id-add-location):
Update messages.
(org-id-hash-to-alist, org-id-paste-tracker, org-id-find-id-file):
Docstring minor enhancements.
(org-id-new): Tiny refactoring.
---
lisp/org-id.el | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/lisp/org-id.el b/lisp/org-id.el
index c3d274d..784f41c 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -382,17 +382,15 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
(setq unique (org-id-uuid))))
((eq org-id-method 'org)
(let* ((etime (org-reverse-string (org-id-time-to-b36)))
- (postfix (if org-id-include-domain
- (progn
- (require 'message)
- (concat "@" (message-make-fqdn))))))
+ (postfix (when org-id-include-domain
+ (require 'message)
+ (concat "@" (message-make-fqdn)))))
(setq unique (concat etime postfix))))
((eq org-id-method 'ts)
(let ((ts (format-time-string org-id-ts-format))
- (postfix (if org-id-include-domain
- (progn
- (require 'message)
- (concat "@" (message-make-fqdn))))))
+ (postfix (when org-id-include-domain
+ (require 'message)
+ (concat "@" (message-make-fqdn)))))
(setq unique (concat ts postfix))))
(t (error "Invalid `org-id-method'")))
(concat prefix unique)))
@@ -591,7 +589,7 @@ When FILES is given, scan also these files."
(setf (car item) (expand-file-name (car item) loc))))
org-id-locations)))
(error
- (message "Could not read org-id-values from %s. Setting it to nil."
+ (message "Could not read `org-id-values' from %s, setting it to nil"
org-id-locations-file))))
(setq org-id-files (mapcar 'car org-id-locations))
(setq org-id-locations (org-id-alist-to-hash org-id-locations))))
@@ -600,7 +598,7 @@ When FILES is given, scan also these files."
"Add the ID with location FILE to the database of ID locations."
;; Only if global tracking is on, and when the buffer has a file
(unless file
- (error "bug: org-id-get expects a file-visiting buffer"))
+ (error "`org-id-get' expects a file-visiting buffer"))
(let ((afile (abbreviate-file-name file)))
(when (and org-id-track-globally id)
(unless org-id-locations (org-id-locations-load))
@@ -612,7 +610,8 @@ When FILES is given, scan also these files."
(add-hook 'kill-emacs-hook 'org-id-locations-save))
(defun org-id-hash-to-alist (hash)
- "Turn an org-id hash into an alist, so that it can be written to a file."
+ "Turn an org-id hash into an alist.
+This is to be able to write it to a file."
(let (res x)
(maphash
(lambda (k v)
@@ -636,7 +635,7 @@ When FILES is given, scan also these files."
res))
(defun org-id-paste-tracker (txt &optional buffer-or-file)
- "Update any IDs in TXT and assign BUFFER-OR-FILE to them."
+ "Update any ids in TXT and assign BUFFER-OR-FILE to them."
(when org-id-track-globally
(save-match-data
(setq buffer-or-file (or buffer-or-file (current-buffer)))
@@ -655,7 +654,7 @@ When FILES is given, scan also these files."
;;;###autoload
(defun org-id-find-id-file (id)
- "Query the id database for the file in which this ID is located."
+ "Query the id database for the file in which ID is located."
(unless org-id-locations (org-id-locations-load))
(or (and org-id-locations
(hash-table-p org-id-locations)
- [elpa] externals/org updated (34bbb03 -> e2cf436), ELPA Syncer, 2021/05/15
- [elpa] externals/org 78e39d5 1/6: lisp/org-id.el: Small enhancements,
ELPA Syncer <=
- [elpa] externals/org c6d4c93 2/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org f98e3ef 3/6: lisp/ox-md.el: Mark some arguments as unused, ELPA Syncer, 2021/05/15
- [elpa] externals/org 5a1a1eb 4/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org e2cf436 6/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org b2c5028 5/6: lisp/org.el: Minor aesthetic clean-up, ELPA Syncer, 2021/05/15