summaryrefslogtreecommitdiff
path: root/lisp/org-id.el
diff options
context:
space:
mode:
authorNicholas Vollmer <iarchivedmywholelife@gmail.com>2021-09-27 20:35:12 -0400
committerBastien <bzg@gnu.org>2021-09-29 08:50:06 +0200
commitb41f2971abd156604aba1e3d0e0dddfc584aef98 (patch)
tree035f15bf63b7af8e3a9c328268a71707626197a9 /lisp/org-id.el
parent005bba5348226bdc97aafb42afd0aec94e26e973 (diff)
org-id: Fix checkdoc warnings
* org-id: Fix checkdoc warnings.
Diffstat (limited to 'lisp/org-id.el')
-rw-r--r--lisp/org-id.el31
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/org-id.el b/lisp/org-id.el
index 3725ff9e5..56783d108 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -419,15 +419,15 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
(substring rnd 18 20)
(substring rnd 20 32))))
-(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."
+(defun org-id-int-to-b36-one-digit (integer)
+ "Convert INTEGER between 0 and 61 into a single character 0..9, A..Z, a..z."
(cond
- ((< i 10) (+ ?0 i))
- ((< i 36) (+ ?a i -10))
+ ((< integer 10) (+ ?0 integer))
+ ((< integer 36) (+ ?a integer -10))
(t (error "Larger that 35"))))
(defun org-id-b36-to-int-one-digit (i)
- "Turn a character 0..9, A..Z, a..z into a number 0..61.
+ "Convert character 0..9, A..Z, a..z into a number 0..61.
The input I may be a character, or a single-letter string."
(and (stringp i) (setq i (string-to-char i)))
(cond
@@ -435,9 +435,11 @@ The input I may be a character, or a single-letter string."
((and (>= i ?a) (<= i ?z)) (+ (- i ?a) 10))
(t (error "Invalid b36 letter"))))
-(defun org-id-int-to-b36 (i &optional length)
- "Convert an integer to a base-36 number represented as a string."
- (let ((s ""))
+(defun org-id-int-to-b36 (integer &optional length)
+ "Convert an INTEGER to a base-36 number represented as a string.
+The returned string is padded with leading zeros to LENGTH if necessary."
+ (let ((s "")
+ (i integer))
(while (> i 0)
(setq s (concat (char-to-string
(org-id-int-to-b36-one-digit (mod i 36))) s)
@@ -447,11 +449,11 @@ The input I may be a character, or a single-letter string."
(setq s (concat (make-string (- length (length s)) ?0) s)))
s))
-(defun org-id-b36-to-int (s)
- "Convert a base-36 string into the corresponding integer."
+(defun org-id-b36-to-int (string)
+ "Convert a base-36 STRING into the corresponding integer."
(let ((r 0))
(mapc (lambda (i) (setq r (+ (* r 36) (org-id-b36-to-int-one-digit i))))
- s)
+ string)
r))
(defun org-id-time-to-b36 (&optional time)
@@ -489,7 +491,8 @@ and TIME is a Lisp time value (HI LO USEC)."
Store the relation between files and corresponding IDs.
This will scan all agenda files, all associated archives, and all
files currently mentioned in `org-id-locations'.
-When FILES is given, scan also these files."
+When FILES is given, scan also these files.
+If SILENT is non-nil, messages are suppressed."
(interactive)
(unless org-id-track-globally
(error "Please turn on `org-id-track-globally' if you want to track IDs"))
@@ -610,7 +613,7 @@ 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.
+ "Turn an org-id HASH into an alist.
This is to be able to write it to a file."
(let (res x)
(maphash
@@ -622,7 +625,7 @@ This is to be able to write it to a file."
res))
(defun org-id-alist-to-hash (list)
- "Turn an org-id location list into a hash table."
+ "Turn an org-id location LIST into a hash table."
(let ((res (make-hash-table
:test 'equal
:size (apply '+ (mapcar 'length list))))