emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android 1230521f713: Merge remote-tracking branch 'origin/master


From: Po Lu
Subject: feature/android 1230521f713: Merge remote-tracking branch 'origin/master' into feature/android
Date: Mon, 8 May 2023 21:11:19 -0400 (EDT)

branch: feature/android
commit 1230521f7130a3ad8fe4033817f6d936675742c1
Merge: 428c59180d5 b625ccff870
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 lisp/net/secrets.el | 27 ++++++++++++++++++++++++++-
 lisp/treesit.el     |  2 +-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index f4e68d7b817..08ab942fddb 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -687,13 +687,38 @@ ITEM can also be an object path, which is returned if 
contained in COLLECTION."
                    item (secrets-get-item-property item-path "Label"))
                 (throw 'item-found item-path)))))))
 
+(defun secrets-lock-item (collection item)
+  "Lock collection item labeled ITEM in COLLECTION.
+If successful, return the object path of the item.  Does not lock
+the collection."
+  (let ((item-path (secrets-item-path collection item)))
+    (unless (secrets-empty-path item-path)
+      (secrets-prompt
+       (cadr
+        (dbus-call-method
+         :session secrets-service secrets-path secrets-interface-service
+         "Lock" `(:array :object-path ,item-path)))))
+    item-path))
+
+(defun secrets-unlock-item (collection item)
+  "Unlock item labeled ITEM from collection labeled COLLECTION.
+If successful, return the object path of the item."
+  (let ((item-path (secrets-item-path collection item)))
+    (unless (secrets-empty-path item-path)
+      (secrets-prompt
+       (cadr
+        (dbus-call-method
+         :session secrets-service secrets-path secrets-interface-service
+         "Unlock" `(:array :object-path ,item-path)))))
+    item-path))
+
 (defun secrets-get-secret (collection item)
   "Return the secret of item labeled ITEM in COLLECTION.
 If there are several items labeled ITEM, it is undefined which
 one is returned.  If there is no such item, return nil.
 
 ITEM can also be an object path, which is used if contained in COLLECTION."
-  (let ((item-path (secrets-item-path collection item)))
+  (let ((item-path (secrets-unlock-item collection item)))
     (unless (secrets-empty-path item-path)
       (dbus-byte-array-to-string
        (nth 2
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 1b1a7783a32..54f223dc40b 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -252,7 +252,7 @@ and more.  See `treesit-thing-settings' for details.
 
 If INCLUDE-NODE is non-nil, return NODE if it satisfies PRED."
   (let ((pred (or pred (rx-to-string
-                        `(bos ,(treesit-node-type node) eos))))
+                        `(seq bos ,(treesit-node-type node) eos))))
         (result nil))
     (cl-loop for cursor = (if include-node node
                             (treesit-node-parent node))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]