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

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

[elpa] externals/devdocs 61ce83b79d: New user option devdocs-window-sele


From: ELPA Syncer
Subject: [elpa] externals/devdocs 61ce83b79d: New user option devdocs-window-select
Date: Thu, 11 Aug 2022 03:57:32 -0400 (EDT)

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

    New user option devdocs-window-select
    
    Closes #21.
---
 devdocs.el | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/devdocs.el b/devdocs.el
index c10ba90029..d21424bae3 100644
--- a/devdocs.el
+++ b/devdocs.el
@@ -89,6 +89,10 @@ name and a count."
 Fontification is done using the `org-src' library, which see."
   :type 'boolean)
 
+(defcustom devdocs-window-select nil
+  "Whether to select the DevDocs window for viewing."
+  :type 'boolean)
+
 (defface devdocs-code-block '((t nil))
   "Additional face to apply to code blocks in DevDocs buffers.")
 
@@ -574,10 +578,14 @@ If INITIAL-INPUT is not nil, insert it into the 
minibuffer."
   (let* ((entry (devdocs--read-entry "Go to documentation: "
                                      (devdocs--relevant-docs ask-docs)
                                      initial-input))
-         (buffer (devdocs--render entry)))
-    (with-selected-window (display-buffer buffer)
-      (devdocs-goto-target)
-      (recenter 0))))
+         (buffer (devdocs--render entry))
+         (window (display-buffer buffer)))
+    (when window
+      (with-selected-window window
+        (devdocs-goto-target)
+        (recenter 0))
+      (when devdocs-window-select
+        (select-window window)))))
 
 ;;;###autoload
 (defun devdocs-peruse (doc)



reply via email to

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