emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/devdocs a433fab92f 2/4: Allow calling devdocs-install w


From: ELPA Syncer
Subject: [elpa] externals/devdocs a433fab92f 2/4: Allow calling devdocs-install with a document slug as argument
Date: Mon, 27 Nov 2023 12:57:59 -0500 (EST)

branch: externals/devdocs
commit a433fab92f1b3deaa97aecb6287d23653d3dfcf5
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>

    Allow calling devdocs-install with a document slug as argument
---
 devdocs.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/devdocs.el b/devdocs.el
index 8cb3e2fc96..b4fe3b2e8f 100644
--- a/devdocs.el
+++ b/devdocs.el
@@ -199,10 +199,15 @@ DOC is a document metadata alist."
 ;;;###autoload
 (defun devdocs-install (doc)
   "Download and install DevDocs documentation.
-DOC is a document metadata alist."
+DOC is a document slug or metadata alist.  If the document is
+already installed, reinstall it."
   (interactive (list (devdocs--read-document "Install documentation: " nil t)))
   (make-directory devdocs-data-dir t)
-  (let* ((slug (alist-get 'slug doc))
+  (let* ((doc (or (listp doc)
+                  (seq-find (lambda (it) (string= doc (alist-get 'slug it)))
+                            (devdocs--available-docs))
+                  (user-error "No such document: %s" doc)))
+         (slug (alist-get 'slug doc))
          (mtime (alist-get 'mtime doc))
          (temp (make-temp-file "devdocs-" t))
          pages)



reply via email to

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