[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/srht a3088beb18 18/27: srht-git-repo-update: Set initia
From: |
ELPA Syncer |
Subject: |
[elpa] externals/srht a3088beb18 18/27: srht-git-repo-update: Set initial inputs. |
Date: |
Tue, 17 May 2022 22:58:00 -0400 (EDT) |
branch: externals/srht
commit a3088beb189b54d0abdb7bf3cbe74995e233b0d4
Author: Aleksandr Vityazev <avityazev@posteo.org>
Commit: Aleksandr Vityazev <avityazev@posteo.org>
srht-git-repo-update: Set initial inputs.
* lisp/srht-git (srht-git--find-info): New function.
(srht-git-repo-update): Set initial inputs.
---
lisp/srht-git.el | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/lisp/srht-git.el b/lisp/srht-git.el
index 990474c183..1e237d6944 100644
--- a/lisp/srht-git.el
+++ b/lisp/srht-git.el
@@ -222,21 +222,34 @@ Called when the request fails with one argument, a
‘plz-error’ struct PLZ-ER
:description description)
:else #'srht-git--else))
+
+(defun srht-git--find-info (repo-name)
+ "Find repository information by REPO-NAME."
+ (catch 'found
+ (seq-doseq (repo (plist-get srht-git-repos :results))
+ (when (equal (cl-getf repo :name) repo-name)
+ (throw 'found repo)))))
+
+
;;;###autoload
-(defun srht-git-repo-update (repo-name visibility name description)
+(defun srht-git-repo-update (repo-name visibility new-name description)
"Update repository REPO-NAME.
-Set VISIBILITY, NAME and DESCRIPTION."
+Set VISIBILITY, NEW-NAME and DESCRIPTION."
(interactive
- (list (srht-git--repo-name-read)
- (completing-read "Visibility: "
- '("private" "public" "unlisted") nil t)
- (read-string "Repository name: " nil
- 'srht-git-repo-name-history)
- (read-string "Repository description (markdown): ")))
+ (pcase-let* ((name (srht-git--repo-name-read))
+ ((map (:visibility v)
+ (:description d))
+ (srht-git--find-info name)))
+ (list name
+ (completing-read "Visibility: "
+ '("private" "public" "unlisted") nil t v)
+ (read-string "Repository name: " name
+ 'srht-git-repo-name-history )
+ (read-string "Repository description (markdown): " d))))
(when (yes-or-no-p (format "Update %s repository?" repo-name))
(srht-update (srht-git-repo repo-name nil
:visibility visibility
- :name name
+ :name new-name
:description description)
:then (lambda (_resp)
;; NOTE: resp examle
- [elpa] externals/srht 3c4df2cff1 06/27: Add make rules., (continued)
- [elpa] externals/srht 3c4df2cff1 06/27: Add make rules., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 7b3792ac75 12/27: Eldev: use the path from the store for plz., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 81519fed59 15/27: Add git service bindings., ELPA Syncer, 2022/05/17
- [elpa] externals/srht a99a8e4bd1 19/27: srht-git--repo-name-read: Add doc string., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 9dd0d15e4a 20/27: srht-git-repo-update: Fix., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 0e53961bbc 27/27: srht-read-with-annotaion: Add category arg., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 0b37b7225f 24/27: Add support for pagination., ELPA Syncer, 2022/05/17
- [elpa] externals/srht f3cd7c5639 10/27: Set eldev-project-main-file., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 87ab3099b0 13/27: build: Add emacs-plz to packages., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 6f87acb901 16/27: Add commands to create, update and delete git repo., ELPA Syncer, 2022/05/17
- [elpa] externals/srht a3088beb18 18/27: srht-git-repo-update: Set initial inputs.,
ELPA Syncer <=
- [elpa] externals/srht 0e0d56a77b 17/27: srth: srht-read-with-annotaion: Fix., ELPA Syncer, 2022/05/17
- [elpa] externals/srht e464826002 23/27: Clean up the code, enhance README, update headers for ELPA., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 764350e334 26/27: Fix test., ELPA Syncer, 2022/05/17
- [elpa] externals/srht d6393e8c31 11/27: Eldev: add load-path., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 0175b45ac1 14/27: external: Expunge., ELPA Syncer, 2022/05/17
- [elpa] externals/srht 50ad7d35bc 25/27: Update README., ELPA Syncer, 2022/05/17