From 14500c83b8e4ea20efdc3ea32499d2fb2e0d9253 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 5 Feb 2015 10:26:57 -0500 Subject: [PATCH] * lisp/doc-view.el: Add some comments about desktop support --- lisp/doc-view.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 0e63d37adc5..b718f1d8b2c 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1685,6 +1685,9 @@ If BACKWARD is non-nil, jump to the previous match." ;; desktop.el integration (defun doc-view-desktop-save-buffer (_desktop-dirname) + ;; FIXME: This is wrong, since this info is per-window but we only do it once + ;; here for the buffer. IOW it should be saved via something like + ;; `window-persistent-parameters'. `((page . ,(doc-view-current-page)) (slice . ,(doc-view-current-slice)))) @@ -1695,8 +1698,13 @@ If BACKWARD is non-nil, jump to the previous match." (let ((page (cdr (assq 'page misc))) (slice (cdr (assq 'slice misc)))) (desktop-restore-file-buffer file name misc) + ;; FIXME: We need to run this code after displaying the buffer. (with-selected-window (or (get-buffer-window (current-buffer) 0) (selected-window)) + ;; FIXME: This should be done for all windows restored that show + ;; this buffer. Basically, the page/slice should be saved as + ;; window-parameters in the window-state(s) and then restoring this + ;; window-state should call us back (to interpret/use those parameters). (doc-view-goto-page page) (when slice (apply 'doc-view-set-slice slice))))) -- 2.11.4.GIT