org-id: Fix checkdoc warnings

* org-id: Fix checkdoc warnings.
This commit is contained in:
Nicholas Vollmer 2021-09-27 20:35:12 -04:00 committed by Bastien
parent 005bba5348
commit b41f2971ab
1 changed files with 17 additions and 14 deletions

View File

@ -419,15 +419,15 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
(substring rnd 18 20) (substring rnd 18 20)
(substring rnd 20 32)))) (substring rnd 20 32))))
(defun org-id-int-to-b36-one-digit (i) (defun org-id-int-to-b36-one-digit (integer)
"Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z." "Convert INTEGER between 0 and 61 into a single character 0..9, A..Z, a..z."
(cond (cond
((< i 10) (+ ?0 i)) ((< integer 10) (+ ?0 integer))
((< i 36) (+ ?a i -10)) ((< integer 36) (+ ?a integer -10))
(t (error "Larger that 35")))) (t (error "Larger that 35"))))
(defun org-id-b36-to-int-one-digit (i) (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." The input I may be a character, or a single-letter string."
(and (stringp i) (setq i (string-to-char i))) (and (stringp i) (setq i (string-to-char i)))
(cond (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)) ((and (>= i ?a) (<= i ?z)) (+ (- i ?a) 10))
(t (error "Invalid b36 letter")))) (t (error "Invalid b36 letter"))))
(defun org-id-int-to-b36 (i &optional length) (defun org-id-int-to-b36 (integer &optional length)
"Convert an integer to a base-36 number represented as a string." "Convert an INTEGER to a base-36 number represented as a string.
(let ((s "")) The returned string is padded with leading zeros to LENGTH if necessary."
(let ((s "")
(i integer))
(while (> i 0) (while (> i 0)
(setq s (concat (char-to-string (setq s (concat (char-to-string
(org-id-int-to-b36-one-digit (mod i 36))) s) (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))) (setq s (concat (make-string (- length (length s)) ?0) s)))
s)) s))
(defun org-id-b36-to-int (s) (defun org-id-b36-to-int (string)
"Convert a base-36 string into the corresponding integer." "Convert a base-36 STRING into the corresponding integer."
(let ((r 0)) (let ((r 0))
(mapc (lambda (i) (setq r (+ (* r 36) (org-id-b36-to-int-one-digit i)))) (mapc (lambda (i) (setq r (+ (* r 36) (org-id-b36-to-int-one-digit i))))
s) string)
r)) r))
(defun org-id-time-to-b36 (&optional time) (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. Store the relation between files and corresponding IDs.
This will scan all agenda files, all associated archives, and all This will scan all agenda files, all associated archives, and all
files currently mentioned in `org-id-locations'. 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) (interactive)
(unless org-id-track-globally (unless org-id-track-globally
(error "Please turn on `org-id-track-globally' if you want to track IDs")) (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)) (add-hook 'kill-emacs-hook 'org-id-locations-save))
(defun org-id-hash-to-alist (hash) (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." This is to be able to write it to a file."
(let (res x) (let (res x)
(maphash (maphash
@ -622,7 +625,7 @@ This is to be able to write it to a file."
res)) res))
(defun org-id-alist-to-hash (list) (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 (let ((res (make-hash-table
:test 'equal :test 'equal
:size (apply '+ (mapcar 'length list)))) :size (apply '+ (mapcar 'length list))))