diff options
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/common-win.el | 10 | ||||
-rw-r--r-- | lisp/term/haiku-win.el | 22 | ||||
-rw-r--r-- | lisp/term/x-win.el | 8 |
3 files changed, 32 insertions, 8 deletions
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el index 7a48fc04c6c..b219014a73c 100644 --- a/lisp/term/common-win.el +++ b/lisp/term/common-win.el @@ -419,6 +419,16 @@ the operating system.") (setq defined-colors (cons this-color defined-colors)))) defined-colors))) +;;;; Session management. + +(defvar emacs-save-session-functions nil + "Special hook run when a save-session event occurs. +The functions do not get any argument. +Functions can return non-nil to inform the session manager that the +window system shutdown should be aborted. + +See also `emacs-session-save'.") + (provide 'term/common-win) ;;; common-win.el ends here 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) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 4c6fcc904c0..ca38a0a8c92 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -109,14 +109,6 @@ (setq x-session-previous-id (car x-invocation-args) x-invocation-args (cdr x-invocation-args))) -(defvar emacs-save-session-functions nil - "Special hook run when a save-session event occurs. -The functions do not get any argument. -Functions can return non-nil to inform the session manager that the -window system shutdown should be aborted. - -See also `emacs-session-save'.") - (defun emacs-session-filename (session-id) "Construct a filename to save the session in based on SESSION-ID. Return a filename in `user-emacs-directory', unless the session file |