]> code.delx.au - gnu-emacs/commitdiff
* lisp/doc-view.el: Add some comments about desktop support
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Feb 2015 15:26:57 +0000 (10:26 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Feb 2015 15:26:57 +0000 (10:26 -0500)
lisp/doc-view.el

index 0e63d37adc58e595edc07df0685b0acc2eb7375a..b718f1d8b2c338847eafa64aceae9b63e511097f 100644 (file)
@@ -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)))))