4.4BSD/usr/src/contrib/emacs-18.57/lisp/userlock.elc


(put (quote file-locked) (quote error-conditions) (quote (file-locked file-error error)))

(defun ask-user-about-lock (fn opponent) "\
Ask user what to do when he wants to edit FILE but it is locked by USER.
This function has a choice of three things to do:
  do (signal 'buffer-file-locked (list FILE USER))
    to refrain from editing the file
  return t (grab the lock on the file)
  return nil (edit the file even though it is locked).
You can rewrite it to use any criterion you like to choose which one to do." (byte-code " ˋ" [answer opponent fn tem inhibit-quit t cursor-in-echo-area quit-flag nil help-char discard-input ((byte-code "?d	
#r!ȉ*	U( _\"?A !!_A=Q ȉ_A=_
	E\")A)" [answer opponent fn tem inhibit-quit t cursor-in-echo-area quit-flag nil help-char message "%s is locking %s: action (s, q, p, ?)? " downcase ask-user-about-lock-help assoc ((115 . t) (113 . yield) (7 . yield) (112) (63 . help)) beep "Please type q, s, or p; or ? for help" sit-for 3 help yield signal file-locked "File is locked"] 14))] 2))

(defun ask-user-about-lock-help nil (byte-code "!" ["*Help*" princ "It has been detected that you want to modify a file that someone else has
already started modifying in EMACS.

You can <s>teal the file; The other user becomes the
  intruder if (s)he ever unmodifies the file and then changes it again.
You can <p>roceed; you edit at your own (and the other user's) risk.
You can <q>uit; don't modify this file."] 3))

(put (quote file-supersession) (quote error-conditions) (quote (file-supersession file-error error)))

(defun ask-user-about-supersession-threat (fn) "\
Ask a user who is about to modify an obsolete buffer what to do.
This function has two choices: it can return, in which case the modification
of the buffer will proceed, or it can (signal 'file-supersession (file)),
in which case the proposed buffer modification will not be made.
You can rewrite this to use any criterion you like to choose which one to do." (byte-code " ɋ" [answer tem cursor-in-echo-area t help-char nil fn buffer-backed-up discard-input ((byte-code "?W!r)!	U˂!	\"A?6 !!R=E ʼnR=RD\")!ʼn)" [answer tem cursor-in-echo-area t help-char nil fn buffer-backed-up message "File has changed on disk; really want to edit the buffer? (y, n or C-h) " downcase help assoc ((110 . yield) (7 . yield) (121 . proceed) (63 . help)) beep "Please type y or n; or ? for help" sit-for 3 ask-user-about-supersession-help yield signal file-supersession "File changed on disk" "File on disk now will become a backup file if you save these changes."] 12))] 2))

(defun ask-user-about-supersession-help nil (byte-code "!" ["*Help*" princ "You want to modify a buffer whose disk file has changed
since you last read it in or saved it with this buffer.

If you say `y' to go ahead and modify this buffer,
you risk ruining the work of whoever rewrote the file.
If you say `n', the change you started to make will be aborted.

You might consider answering `n', running `M-x revert-buffer' to
bring the text in Emacs into accord with what is on disk, and then
making the change again."] 3))