• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:emacs

0 ;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
29 ;; This code sets a buffer-local variable to t if toggle-emacs-lock is run,
36 ;; run toggle-emacs-lock again.
40 (defvar emacs-lock-from-exiting nil
41 "Whether Emacs is locked to prevent exiting. See `check-emacs-lock'.")
42 (make-variable-buffer-local 'emacs-lock-from-exiting)
44 (defvar emacs-lock-buffer-locked nil
46 (make-variable-buffer-local 'emacs-lock-buffer-locked)
47 (put 'emacs-lock-buffer-locked 'permanent-local t)
49 (defun check-emacs-lock ()
50 "Check if variable `emacs-lock-from-exiting' is t for any buffer.
55 (when emacs-lock-from-exiting
58 (defun toggle-emacs-lock ()
59 "Toggle `emacs-lock-from-exiting' for the current buffer.
60 See `check-emacs-lock'."
62 (setq emacs-lock-from-exiting (not emacs-lock-from-exiting))
63 (if emacs-lock-from-exiting
67 (defun emacs-lock-check-buffer-lock ()
68 "Check if variable `emacs-lock-from-exiting' is t for a buffer.
70 (when emacs-lock-from-exiting
78 (defun emacs-lock-shell-sentinel ()
80 (get-buffer-process (buffer-name)) (function emacs-lock-clear-sentinel)))
82 (defun emacs-lock-clear-sentinel (proc str)
83 (if emacs-lock-from-exiting
85 (setq emacs-lock-from-exiting nil)
86 (setq emacs-lock-buffer-locked t)
88 (setq emacs-lock-buffer-locked nil)))
90 (defun emacs-lock-was-buffer-locked ()
91 (if emacs-lock-buffer-locked
92 (setq emacs-lock-from-exiting t)))
94 (add-hook 'kill-emacs-hook 'check-emacs-lock)
95 (add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
96 (add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
97 (add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
98 (add-hook 'telnet-mode-hook 'emacs-lock-was-buffer-locked)
99 (add-hook 'telnet-mode-hook 'emacs-lock-shell-sentinel)
101 (provide 'emacs-lock)
104 ;;; emacs-lock.el ends here