Subject: Re: bug#79390: 31.0.50; oauth2.el; error in byte-compiling

From: Kazuhiro Ito <[email-masked]>
Date: Sat, 06 Sep 2025 15:37:45 +0900

> >> When I byte-compile oauth2.el (0.18), below errors and warnings are
> >> displayed and fail to byte-compiling.
(snip)

> Thanks for the report!  I have now pushed a few fixes which should
> handle those warnings/errors plus a few other fixes.  I have also added
> build checks in Gitlab CI.  Now tagged v0.18.1.  Please help check
> whether those fixes work for you.

I've tested on 0.18.2 and confirmed errors and warnings were fixed,
thank you.
But I have one question.  

In oauth2--update-request-cache, 

> (when host-name
>   (let ((host-name (intern host-name)))
>     (org-plist-delete request-cache host-name)
>     (setq request-cache
>         (plist-put request-cache host-name
>                    `( :access-token ,access-token
>                       :request-timestamp ,request-timestamp)))))
> request-cache)

org-plist-delete returns newly created plist and doesn't modify
arguement PLIST, so it does nothing in the above code.  Moreover,
because next plist-put set new property value, it is no need to delete
old property value explicitly.

Please see attached patch.

-- 
Kazuhiro Ito
>From 4661b972491084d35c23351bd05438cec05e8440 Mon Sep 17 00:00:00 2001
From: Kazuhiro Ito <[email-masked]>
Date: Sat, 6 Sep 2025 15:22:01 +0900
Subject: [PATCH] * oauth2.el (oauth2--update-request-cache): Remove unneeded
 code.

---
 oauth2.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/oauth2.el b/oauth2.el
index c0aca41c66..612881a615 100644
--- a/oauth2.el
+++ b/oauth2.el
@@ -39,7 +39,6 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
-(require 'org-macs)
 (require 'plstore)
 (require 'json)
 (require 'url-http)
@@ -122,7 +121,6 @@ HOST-NAME is nil, do nothing.
 Returns the newly updated request-cache."
   (when host-name
     (let ((host-name (intern host-name)))
-      (org-plist-delete request-cache host-name)
       (setq request-cache
           (plist-put request-cache host-name
                      `( :access-token ,access-token
-- 
2.45.1