diff options
Diffstat (limited to 'lisp/term/haiku-win.el')
-rw-r--r-- | lisp/term/haiku-win.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el index c83e0a5c3da..51a6c3c501e 100644 --- a/lisp/term/haiku-win.el +++ b/lisp/term/haiku-win.el @@ -358,6 +358,28 @@ take effect on menu items until the menu bar is updated again." (add-variable-watcher 'use-system-tooltips #'haiku-use-system-tooltips-watcher) + +;;;; Session management. + +(declare-function haiku-save-session-reply "haikufns.c") + +(defun emacs-session-save () + "SKIP: real doc in x-win.el." + (with-temp-buffer ; Saving sessions is not yet supported. + (condition-case nil + ;; A return of t means cancel the shutdown. + (run-hook-with-args-until-success + 'emacs-save-session-functions) + (error t)))) + +(defun handle-save-session (_event) + "SKIP: real doc in xsmfns.c." + (interactive "e") + (let ((cancel-shutdown t)) + (unwind-protect + (setq cancel-shutdown (emacs-session-save)) + (haiku-save-session-reply (not cancel-shutdown))))) + (provide 'haiku-win) (provide 'term/haiku-win) |