mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
Restore window conf in nsm
* lisp/net/nsm.el (nsm-query-user): Restore the window configuration. Backport:
This commit is contained in:
parent
2c117fc7e2
commit
1ef309fc88
1 changed files with 34 additions and 33 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue