Browse Source

Fixes for the Emacs 27 linter

pull/2/head
Damien Cassou 1 month ago
parent
commit
5689caa885
Signed by: Damien Cassou <damien@cassou.me> GPG Key ID: B68746238E59B548
5 changed files with 16 additions and 9 deletions
  1. +2
    -0
      libbcel-actions.el
  2. +5
    -2
      libbcel-nav.el
  3. +7
    -7
      libbcel-oauth.el
  4. +1
    -0
      libbcel-structs.el
  5. +1
    -0
      libbcel.el

+ 2
- 0
libbcel-actions.el View File

@@ -35,11 +35,13 @@
When finished, execute CALLBACK if non-nil.")

(cl-defmethod libbcel-actions-todo-toggle ((todo libbcel-todo) &optional callback)
"Toggle the completed state of TODO. When done, execute CALLBACK if non-nil."
(if (libbcel-todo-completed todo)
(libbcel-actions-todo-uncomplete todo callback)
(libbcel-actions-todo-complete todo callback)))

(cl-defmethod libbcel-actions-todo-toggle ((todos list) &optional callback)
"Toggle the completed state of all TODOS. When done, execute CALLBACK if non-nil."
(libbcel-util-async-mapc
#'libbcel-actions-todo-toggle
todos

+ 5
- 2
libbcel-nav.el View File

@@ -38,15 +38,16 @@
(cl-defgeneric libbcel-nav-children (entity callback)
"Execute CALLBACK with the children of ENTITY as parameter.")

(cl-defmethod libbcel-nav-children ((entity (eql projects)) callback)
(cl-defmethod libbcel-nav-children ((_entity (eql projects)) callback)
"Execute CALLBACK with the list of all projects as parameter."
(libbcel-client-get-path
"projects.json"
(lambda (projects-data)
(funcall callback
(libbcel-structs-create-instances-from-data projects-data entity)))))
(libbcel-structs-create-instances-from-data projects-data 'projects)))))

(cl-defmethod libbcel-nav-children ((project libbcel-project) callback)
"Execute CALLBACK with the list of all PROJECT's tools as parameter."
(let* ((enabled-tool-alists (seq-filter
(lambda (tool-alist)
(not (eq (map-elt tool-alist 'enabled) :json-false)))
@@ -60,6 +61,7 @@
(lambda (tools-data) (funcall callback (libbcel-structs-create-instances-from-data tools-data project))))))

(cl-defmethod libbcel-nav-children ((tool libbcel-tool) callback)
"Execute CALLBACK with the list of TOOL entities as parameter."
(libbcel-client-get-url
(libbcel-tool-children-url tool)
(lambda (children-data)
@@ -67,6 +69,7 @@
(libbcel-structs-create-instances-from-data children-data tool)))))

(cl-defmethod libbcel-nav-children ((todolist libbcel-todolist) callback)
"Execute CALLBACK with TODOLIST's todos as parameter."
(libbcel-util-async-mapcar
(lambda (params partial-callback)
(libbcel-client-get-url

+ 7
- 7
libbcel-oauth.el View File

@@ -232,15 +232,15 @@ a string such as \"http://localhost:9321\"."
(deadline (when expires-in
(time-add (current-time) expires-in))))
(when access-token
(map-put store :access-token access-token))
(setf (map-elt store :access-token) access-token))
(when refresh-token
(map-put store :refresh-token refresh-token))
(setf (map-elt store :refresh-token) refresh-token))
(when deadline
(map-put store :deadline deadline))
(setf (map-elt store :deadline) deadline))
(when client-id
(map-put store :client-id client-id))
(setf (map-elt store :client-id) client-id))
(when client-secret
(map-put store :client-secret client-secret)))
(setf (map-elt store :client-secret) client-secret)))
(with-current-buffer (find-file-noselect libbcel-oauth-store-filename)
(erase-buffer)
(insert (format "%S" store))
@@ -257,8 +257,8 @@ a string such as \"http://localhost:9321\"."
(setf (point) (point-min))
(read (current-buffer)))
(make-hash-table :size 10))))
(map-put store :client-id libbcel-oauth-client-id)
(map-put store :client-secret libbcel-oauth-client-secret)
(setf (map-elt store :client-id) libbcel-oauth-client-id)
(setf (map-elt store :client-secret) libbcel-oauth-client-secret)
store))

(defun libbcel-oauth-get-access-token (store callback)

+ 1
- 0
libbcel-structs.el View File

@@ -112,6 +112,7 @@
(:conc-name libbcel-person-)))

(cl-defmethod libbcel-equal ((entity1 libbcel-entity) (entity2 libbcel-entity))
"Return t iff ENTITY1 is the same entity as ENTITY2."
(equal (libbcel-entity-id entity1) (libbcel-entity-id entity2)))

(defun libbcel-structs-create-instance-from-data (entity-data &optional parent)

+ 1
- 0
libbcel.el View File

@@ -71,6 +71,7 @@ Pass PROMPT, the elements of ENTITY and TRANSFORMER to
(libbcel-completing-read prompt entities transformer)))))

(cl-defmethod libbcel-nav-children ((entities list) callback)
"Execute CALLBACK with the children of all ENTITIES as parameter."
(libbcel-util-async-mapcar
#'libbcel-nav-children
entities

Loading…
Cancel
Save