1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- (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 Ò ˆÅ‰‚R Ó=…R ÔÕÖD\")ˆ‚ ˆÈ×!ˆÅ‰)‡" [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 "It has been detected that you want to modify a buffer
- that is obsolete because changes in the file on disk have happened
- since you read it or wrote 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', whatever change you started to make in the buffer
- will not take place.
- 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))
|