1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

Use pop-to-buffer-same-window in woman.el

* lisp/woman.el (woman-really-find-file): Work around going to
the wrong buffer by using `pop-to-buffer-same-window' (bug#22332).
(WoMan-find-buffer): Ditto.
This commit is contained in:
Ari Roponen 2016-02-20 18:57:44 +11:00 committed by Lars Ingebrigtsen
parent 2a75f64dd2
commit 24c1c1d5c3

View File

@ -1654,7 +1654,7 @@ Do not call directly!"
(setq woman-frame (make-frame)))))
(set-buffer (get-buffer-create bufname))
(condition-case nil
(display-buffer (current-buffer))
(pop-to-buffer-same-window (current-buffer))
(error (pop-to-buffer (current-buffer))))
(buffer-disable-undo)
(setq buffer-read-only nil)
@ -2064,14 +2064,14 @@ alist in `woman-buffer-alist' and return nil."
(if (zerop woman-buffer-number)
(let ((buffer (get-buffer (cdr (car woman-buffer-alist)))))
(if buffer
(display-buffer buffer)
(pop-to-buffer-same-window buffer)
;; Delete alist element:
(setq woman-buffer-alist (cdr woman-buffer-alist))
nil))
(let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist))
(buffer (get-buffer (cdr (car (cdr prev-ptr))))))
(if buffer
(display-buffer buffer)
(pop-to-buffer-same-window buffer)
;; Delete alist element:
(setcdr prev-ptr (cdr (cdr prev-ptr)))
(if (>= woman-buffer-number (length woman-buffer-alist))