• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:after +defs:save +defs:hook

1 ;;; desktop.el --- save partial status of Emacs when killed
39 ;; To use this, use customize to turn on desktop-save-mode or add the
42 ;; (desktop-save-mode 1)
48 ;; added to the `kill-emacs-hook'. This function is responsible for
50 ;; function is added to the `after-init-hook'. This function is
95 ;; When `desktop-save' saves the state of a buffer to the desktop file, it
101 ;; are used to handle non-conventional minor modes. `desktop-save' uses
119 ;; `desktop-globals-to-save' (by default it isn't). This may result in saving
152 (define-minor-mode desktop-save-mode
156 saved from one session to another. See variable `desktop-save'
163 'desktop-save-mode "22.1")
165 (defcustom desktop-save 'ask-if-new
169 t -- always save.
171 ask-if-new -- ask if no desktop file exists, otherwise just save.
172 ask-if-exists -- ask if desktop file exists, otherwise don't save.
173 if-exists -- save if desktop file exists, otherwise don't save.
174 nil -- never save.
175 The desktop is never saved when `desktop-save-mode' is nil.
180 (const :tag "Always save" t)
182 (const :tag "Ask if desktop file is new, else do save" ask-if-new)
183 (const :tag "Ask if desktop file exists, else don't save" ask-if-exists)
185 (const :tag "Never save" nil))
214 (defcustom desktop-no-desktop-file-hook nil
215 "Normal hook run when `desktop-read' can't find a desktop file.
218 :type 'hook
222 (defcustom desktop-after-read-hook nil
223 "Normal hook run after a successful `desktop-read'.
225 :type 'hook
230 (defcustom desktop-save-hook nil
231 "Normal hook run before the desktop is saved in a desktop file.
235 :type 'hook
238 (defcustom desktop-globals-to-save
245 "List of global variables saved by `desktop-save'.
277 (defcustom desktop-locals-to-save
278 '(desktop-locals-to-save ; Itself! Think it over.
294 "List of local variables to save for each buffer.
302 (defcustom desktop-buffers-not-to-save
309 (defcustom desktop-files-not-to-save
315 ;; We skip TAGS files to save time (tags-file-name is saved instead).
316 (defcustom desktop-modes-not-to-save
354 (defvar desktop-save-buffer nil
355 "When non-nil, save buffer status in desktop file.
358 If the value is a function, it is called by `desktop-save' with argument
359 DESKTOP-DIRNAME to obtain auxiliary information to save in the desktop
368 (make-variable-buffer-local 'desktop-save-buffer)
369 (make-obsolete-variable 'desktop-buffer-modes-to-save
370 'desktop-save-buffer "22.1")
372 'desktop-save-buffer "22.1")
495 (defvar desktop-delay-hook nil
496 "Hooks run after all buffers are loaded; intended for internal use.")
537 (add-hook 'kill-emacs-hook 'desktop-kill)
540 "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do.
542 is nil, ask the user where to save the desktop."
543 (when (and desktop-save-mode
545 (or (eq desktop-save t)
546 (and exists (memq desktop-save '(ask-if-new if-exists)))
548 (or (memq desktop-save '(ask ask-if-new))
549 (and exists (eq desktop-save 'ask-if-exists)))
559 (desktop-save desktop-dirname)
649 " (add-hook 'desktop-delay-hook"
652 (t ; save as text
692 (defun desktop-save-buffer-p (filename bufname mode &rest dummy)
698 (and (not (string-match desktop-buffers-not-to-save bufname))
699 (not (memq mode desktop-modes-not-to-save))
701 (not (string-match desktop-files-not-to-save filename)))
704 (not (string-match desktop-files-not-to-save
707 (with-current-buffer bufname desktop-save-buffer))))))
727 (defun desktop-save (dirname)
729 Parameter DIRNAME specifies where to save the desktop file.
731 (interactive "DDirectory to save desktop file in: ")
732 (run-hooks 'desktop-save-hook)
734 (save-excursion
761 (when (functionp desktop-save-buffer)
762 (funcall desktop-save-buffer dirname))
763 (let ((locals desktop-locals-to-save)
784 (dolist (varspec desktop-globals-to-save)
786 (if (memq 'kill-ring desktop-globals-to-save)
794 (when (apply 'desktop-save-buffer-p l)
835 is processed and `desktop-after-read-hook' is run. If no desktop file
836 is found, clear the desktop and run `desktop-no-desktop-file-hook'.
864 (desktop-save nil))
874 (run-hooks 'desktop-delay-hook)
875 (setq desktop-delay-hook nil)
876 (run-hooks 'desktop-after-read-hook)
891 (run-hooks 'desktop-no-desktop-file-hook))
905 'desktop-save-mode "22.1")
911 Kill the desktop as specified by variables `desktop-save-mode' and
912 `desktop-save', then clear the desktop and load the desktop file in
922 (defun desktop-save-in-desktop-dir ()
926 (desktop-save desktop-dirname)
927 (call-interactively 'desktop-save))
1005 ;; allow `default-directory' to change. Therefore we save current buffer.
1006 (save-current-buffer
1054 ;; `desktop-save', they may be modified by handlers wanting to set
1119 (run-hooks 'desktop-delay-hook)
1120 (setq desktop-delay-hook nil)
1130 (save-window-excursion
1145 (save-window-excursion
1161 ;; When `desktop-save-mode' is non-nil and "--no-desktop" is not specified on the
1163 ;; after finishing loading the init file.
1165 ;; functions are processed after `after-init-hook'.
1166 (add-hook
1167 'after-init-hook
1172 (setq desktop-save-mode nil)))
1173 (when desktop-save-mode (desktop-read))))