mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-28 10:56:36 +00:00
Fix desktop support in todo-mode and doc-view (bug#22377)
* lisp/calendar/todo-mode.el (todo-restore-desktop-buffer): * lisp/doc-view.el (doc-view-restore-desktop-buffer): Return current buffer. * lisp/calendar/todo-mode.el (todo-modes-set-2): * lisp/doc-view.el (doc-view-mode): Set desktop-save-buffer unconditionally.
This commit is contained in:
parent
871c8b1b96
commit
7bc7fd6058
@ -5230,7 +5230,8 @@ Also preserve category display, if applicable."
|
||||
(with-current-buffer buffer
|
||||
(widen)
|
||||
(let ((todo-category-number (cdr (assq 'catnum misc))))
|
||||
(todo-category-select))))
|
||||
(todo-category-select)
|
||||
(current-buffer))))
|
||||
|
||||
(add-to-list 'desktop-buffer-mode-handlers
|
||||
'(todo-mode . todo-restore-desktop-buffer))
|
||||
@ -6579,8 +6580,7 @@ Added to `window-configuration-change-hook' in Todo mode."
|
||||
"Make some settings that apply to multiple Todo modes."
|
||||
(add-to-invisibility-spec 'todo)
|
||||
(setq buffer-read-only t)
|
||||
(when (and (boundp 'desktop-save-mode) desktop-save-mode)
|
||||
(setq-local desktop-save-buffer 'todo-desktop-save-buffer))
|
||||
(setq-local desktop-save-buffer 'todo-desktop-save-buffer)
|
||||
(when (boundp 'hl-line-range-function)
|
||||
(setq-local hl-line-range-function
|
||||
(lambda() (save-excursion
|
||||
|
@ -1714,7 +1714,8 @@ If BACKWARD is non-nil, jump to the previous match."
|
||||
;; 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)))))
|
||||
(when slice (apply 'doc-view-set-slice slice))
|
||||
(current-buffer))))
|
||||
|
||||
(add-to-list 'desktop-buffer-mode-handlers
|
||||
'(doc-view-mode . doc-view-restore-desktop-buffer))
|
||||
@ -1788,9 +1789,7 @@ toggle between displaying the document or editing it as text.
|
||||
nil t)
|
||||
(add-hook 'clone-indirect-buffer-hook 'doc-view-clone-buffer-hook nil t)
|
||||
(add-hook 'kill-buffer-hook 'doc-view-kill-proc nil t)
|
||||
(when (and (boundp 'desktop-save-mode)
|
||||
desktop-save-mode)
|
||||
(setq-local desktop-save-buffer 'doc-view-desktop-save-buffer))
|
||||
(setq-local desktop-save-buffer 'doc-view-desktop-save-buffer)
|
||||
|
||||
(remove-overlays (point-min) (point-max) 'doc-view t) ;Just in case.
|
||||
;; Keep track of display info ([vh]scroll, page number, overlay,
|
||||
|
Loading…
Reference in New Issue
Block a user