diff options
| author | Lars Ingebrigtsen | 2016-02-05 17:35:29 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-05 17:36:12 +1100 |
| commit | 1ef309fc88368f0ff51865be94ef4a8efd01f3fe (patch) | |
| tree | e5fa14f1d75c3e696fa7a8a2e949aa0ca255043b | |
| parent | 2c117fc7e283ad20f404c392be433c74f5cf8a4e (diff) | |
| download | emacs-1ef309fc88368f0ff51865be94ef4a8efd01f3fe.tar.gz emacs-1ef309fc88368f0ff51865be94ef4a8efd01f3fe.zip | |
Restore window conf in nsm
* lisp/net/nsm.el (nsm-query-user): Restore the window configuration.
Backport:
| -rw-r--r-- | 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 ee8b55bf192..d0b55437732 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el | |||
| @@ -309,39 +309,40 @@ unencrypted." | |||
| 309 | 309 | ||
| 310 | (defun nsm-query-user (message args cert) | 310 | (defun nsm-query-user (message args cert) |
| 311 | (let ((buffer (get-buffer-create "*Network Security Manager*"))) | 311 | (let ((buffer (get-buffer-create "*Network Security Manager*"))) |
| 312 | (with-help-window buffer | 312 | (save-window-excursion |
| 313 | (with-current-buffer buffer | 313 | (with-help-window buffer |
| 314 | (erase-buffer) | 314 | (with-current-buffer buffer |
| 315 | (when (> (length cert) 0) | 315 | (erase-buffer) |
| 316 | (insert cert "\n")) | 316 | (when (> (length cert) 0) |
| 317 | (let ((start (point))) | 317 | (insert cert "\n")) |
| 318 | (insert (apply #'format-message message args)) | 318 | (let ((start (point))) |
| 319 | (goto-char start) | 319 | (insert (apply #'format-message message args)) |
| 320 | ;; Fill the first line of the message, which usually | 320 | (goto-char start) |
| 321 | ;; contains lots of explanatory text. | 321 | ;; Fill the first line of the message, which usually |
| 322 | (fill-region (point) (line-end-position))))) | 322 | ;; contains lots of explanatory text. |
| 323 | (let ((responses '((?n . no) | 323 | (fill-region (point) (line-end-position))))) |
| 324 | (?s . session) | 324 | (let ((responses '((?n . no) |
| 325 | (?a . always))) | 325 | (?s . session) |
| 326 | (prefix "") | 326 | (?a . always))) |
| 327 | (cursor-in-echo-area t) | 327 | (prefix "") |
| 328 | response) | 328 | (cursor-in-echo-area t) |
| 329 | (while (not response) | 329 | response) |
| 330 | (setq response | 330 | (while (not response) |
| 331 | (cdr | 331 | (setq response |
| 332 | (assq (downcase | 332 | (cdr |
| 333 | (read-char | 333 | (assq (downcase |
| 334 | (concat prefix | 334 | (read-char |
| 335 | "Continue connecting? (No, Session only, Always) "))) | 335 | (concat prefix |
| 336 | responses))) | 336 | "Continue connecting? (No, Session only, Always) "))) |
| 337 | (unless response | 337 | responses))) |
| 338 | (ding) | 338 | (unless response |
| 339 | (setq prefix "Invalid choice. "))) | 339 | (ding) |
| 340 | (kill-buffer buffer) | 340 | (setq prefix "Invalid choice. "))) |
| 341 | ;; If called from a callback, `read-char' will insert things | 341 | (kill-buffer buffer) |
| 342 | ;; into the pending input. Clear that. | 342 | ;; If called from a callback, `read-char' will insert things |
| 343 | (clear-this-command-keys) | 343 | ;; into the pending input. Clear that. |
| 344 | response))) | 344 | (clear-this-command-keys) |
| 345 | response)))) | ||
| 345 | 346 | ||
| 346 | (defun nsm-save-host (host port status what permanency) | 347 | (defun nsm-save-host (host port status what permanency) |
| 347 | (let* ((id (nsm-id host port)) | 348 | (let* ((id (nsm-id host port)) |