Mercurial > emacs
comparison lisp/files.el @ 90787:91bf6e05918b
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 662-669)
- Update from CVS
- Fix read-only prompt problem in isearch
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 207-208)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-184
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 18 Mar 2007 14:11:08 +0000 |
parents | ec58e5c426ef 2a5ebeee48fc |
children | c0409ee15cee |
comparison
equal
deleted
inserted
replaced
90786:ca12f314faac | 90787:91bf6e05918b |
---|---|
1472 (file-name-nondirectory filename) | 1472 (file-name-nondirectory filename) |
1473 (/ (nth 7 attributes) 1048576))))) | 1473 (/ (nth 7 attributes) 1048576))))) |
1474 (error "Aborted")) | 1474 (error "Aborted")) |
1475 (if buf | 1475 (if buf |
1476 ;; We are using an existing buffer. | 1476 ;; We are using an existing buffer. |
1477 (progn | 1477 (let (nonexistent) |
1478 (or nowarn | 1478 (or nowarn |
1479 (verify-visited-file-modtime buf) | 1479 (verify-visited-file-modtime buf) |
1480 (cond ((not (file-exists-p filename)) | 1480 (cond ((not (file-exists-p filename)) |
1481 (error "File %s no longer exists!" filename)) | 1481 (setq nonexistent t) |
1482 (message "File %s no longer exists!" filename)) | |
1482 ;; Certain files should be reverted automatically | 1483 ;; Certain files should be reverted automatically |
1483 ;; if they have changed on disk and not in the buffer. | 1484 ;; if they have changed on disk and not in the buffer. |
1484 ((and (not (buffer-modified-p buf)) | 1485 ((and (not (buffer-modified-p buf)) |
1485 (let ((tail revert-without-query) | 1486 (let ((tail revert-without-query) |
1486 (found nil)) | 1487 (found nil)) |
1513 | 1514 |
1514 ;; Check if a formerly read-only file has become | 1515 ;; Check if a formerly read-only file has become |
1515 ;; writable and vice versa, but if the buffer agrees | 1516 ;; writable and vice versa, but if the buffer agrees |
1516 ;; with the new state of the file, that is ok too. | 1517 ;; with the new state of the file, that is ok too. |
1517 (let ((read-only (not (file-writable-p buffer-file-name)))) | 1518 (let ((read-only (not (file-writable-p buffer-file-name)))) |
1518 (unless (or (eq read-only buffer-file-read-only) | 1519 (unless (or nonexistent |
1520 (eq read-only buffer-file-read-only) | |
1519 (eq read-only buffer-read-only)) | 1521 (eq read-only buffer-read-only)) |
1520 (when (or nowarn | 1522 (when (or nowarn |
1521 (let ((question | 1523 (let ((question |
1522 (format "File %s is %s on disk. Change buffer mode? " | 1524 (format "File %s is %s on disk. Change buffer mode? " |
1523 buffer-file-name | 1525 buffer-file-name |
1526 (setq buffer-read-only read-only))) | 1528 (setq buffer-read-only read-only))) |
1527 (setq buffer-file-read-only read-only)) | 1529 (setq buffer-file-read-only read-only)) |
1528 | 1530 |
1529 (when (and (not (eq (not (null rawfile)) | 1531 (when (and (not (eq (not (null rawfile)) |
1530 (not (null find-file-literally)))) | 1532 (not (null find-file-literally)))) |
1533 (not nonexistent) | |
1531 ;; It is confusing to ask whether to visit | 1534 ;; It is confusing to ask whether to visit |
1532 ;; non-literally if they have the file in | 1535 ;; non-literally if they have the file in |
1533 ;; hexl-mode. | 1536 ;; hexl-mode. |
1534 (not (eq major-mode 'hexl-mode))) | 1537 (not (eq major-mode 'hexl-mode))) |
1535 (if (buffer-modified-p) | 1538 (if (buffer-modified-p) |