emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 1ef309f: Restore window conf in nsm


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] emacs-25 1ef309f: Restore window conf in nsm
Date: Fri, 05 Feb 2016 06:36:17 +0000

branch: emacs-25
commit 1ef309fc88368f0ff51865be94ef4a8efd01f3fe
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Restore window conf in nsm
    
    * lisp/net/nsm.el (nsm-query-user): Restore the window configuration.
    
    Backport:
---
 lisp/net/nsm.el |   67 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index ee8b55b..d0b5543 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -309,39 +309,40 @@ unencrypted."
 
 (defun nsm-query-user (message args cert)
   (let ((buffer (get-buffer-create "*Network Security Manager*")))
-    (with-help-window buffer
-      (with-current-buffer buffer
-       (erase-buffer)
-       (when (> (length cert) 0)
-         (insert cert "\n"))
-       (let ((start (point)))
-         (insert (apply #'format-message message args))
-         (goto-char start)
-         ;; Fill the first line of the message, which usually
-         ;; contains lots of explanatory text.
-         (fill-region (point) (line-end-position)))))
-    (let ((responses '((?n . no)
-                      (?s . session)
-                      (?a . always)))
-         (prefix "")
-         (cursor-in-echo-area t)
-         response)
-      (while (not response)
-       (setq response
-             (cdr
-              (assq (downcase
-                     (read-char
-                      (concat prefix
-                              "Continue connecting? (No, Session only, Always) 
")))
-                    responses)))
-       (unless response
-         (ding)
-         (setq prefix "Invalid choice.  ")))
-      (kill-buffer buffer)
-      ;; If called from a callback, `read-char' will insert things
-      ;; into the pending input.  Clear that.
-      (clear-this-command-keys)
-      response)))
+    (save-window-excursion
+      (with-help-window buffer
+        (with-current-buffer buffer
+          (erase-buffer)
+          (when (> (length cert) 0)
+            (insert cert "\n"))
+          (let ((start (point)))
+            (insert (apply #'format-message message args))
+            (goto-char start)
+            ;; Fill the first line of the message, which usually
+            ;; contains lots of explanatory text.
+            (fill-region (point) (line-end-position)))))
+      (let ((responses '((?n . no)
+                         (?s . session)
+                         (?a . always)))
+            (prefix "")
+            (cursor-in-echo-area t)
+            response)
+        (while (not response)
+          (setq response
+                (cdr
+                 (assq (downcase
+                        (read-char
+                         (concat prefix
+                                 "Continue connecting? (No, Session only, 
Always) ")))
+                       responses)))
+          (unless response
+            (ding)
+            (setq prefix "Invalid choice.  ")))
+        (kill-buffer buffer)
+        ;; If called from a callback, `read-char' will insert things
+        ;; into the pending input.  Clear that.
+        (clear-this-command-keys)
+        response))))
 
 (defun nsm-save-host (host port status what permanency)
   (let* ((id (nsm-id host port))



reply via email to

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