diff options
| author | Stefan Monnier | 2000-11-21 21:12:49 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-11-21 21:12:49 +0000 |
| commit | d5798fa707fcaf0d98c6ccd9f111cf6a9d1480a8 (patch) | |
| tree | 6ea5d0d66b9a6341e7b8889bf2a45738c9898c21 | |
| parent | b6d95ba5c258dc182958dfeba6abe8eaa144f83e (diff) | |
| download | emacs-d5798fa707fcaf0d98c6ccd9f111cf6a9d1480a8.tar.gz emacs-d5798fa707fcaf0d98c6ccd9f111cf6a9d1480a8.zip | |
(find-buffer-visiting): Compare all attributes before
declaring two files identical (rather than just their inode-no).
(auto-mode-alist): Use \' rather than $.
| -rw-r--r-- | lisp/files.el | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lisp/files.el b/lisp/files.el index e8171d7ef21..d721042ce2b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -940,20 +940,20 @@ If there is no such live buffer, return nil." | |||
| 940 | (setq found (car list)))) | 940 | (setq found (car list)))) |
| 941 | (setq list (cdr list))) | 941 | (setq list (cdr list))) |
| 942 | found) | 942 | found) |
| 943 | (let ((number (nthcdr 10 (file-attributes truename))) | 943 | (let* ((attributes (file-attributes truename)) |
| 944 | (list (buffer-list)) found) | 944 | (number (nthcdr 10 attributes)) |
| 945 | (list (buffer-list)) found) | ||
| 945 | (and buffer-file-numbers-unique | 946 | (and buffer-file-numbers-unique |
| 946 | number | 947 | number |
| 947 | (while (and (not found) list) | 948 | (while (and (not found) list) |
| 948 | (save-excursion | 949 | (with-current-buffer (car list) |
| 949 | (set-buffer (car list)) | ||
| 950 | (if (and buffer-file-name | 950 | (if (and buffer-file-name |
| 951 | (equal buffer-file-number number) | 951 | (equal buffer-file-number number) |
| 952 | ;; Verify this buffer's file number | 952 | ;; Verify this buffer's file number |
| 953 | ;; still belongs to its file. | 953 | ;; still belongs to its file. |
| 954 | (file-exists-p buffer-file-name) | 954 | (file-exists-p buffer-file-name) |
| 955 | (equal (nthcdr 10 (file-attributes buffer-file-name)) | 955 | (equal (file-attributes buffer-file-name) |
| 956 | number)) | 956 | attributes)) |
| 957 | (setq found (car list)))) | 957 | (setq found (car list)))) |
| 958 | (setq list (cdr list)))) | 958 | (setq list (cdr list)))) |
| 959 | found)))) | 959 | found)))) |
| @@ -1170,7 +1170,7 @@ that are visiting the various files." | |||
| 1170 | "Like `insert-file-contents', but only reads in the file literally. | 1170 | "Like `insert-file-contents', but only reads in the file literally. |
| 1171 | A buffer may be modified in several ways after reading into the buffer, | 1171 | A buffer may be modified in several ways after reading into the buffer, |
| 1172 | to Emacs features such as format decoding, character code | 1172 | to Emacs features such as format decoding, character code |
| 1173 | conversion, find-file-hooks, automatic uncompression, etc. | 1173 | conversion, `find-file-hooks', automatic uncompression, etc. |
| 1174 | 1174 | ||
| 1175 | This function ensures that none of these modifications will take place." | 1175 | This function ensures that none of these modifications will take place." |
| 1176 | (let ((format-alist nil) | 1176 | (let ((format-alist nil) |
| @@ -1382,7 +1382,7 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1382 | ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode) | 1382 | ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode) |
| 1383 | ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) | 1383 | ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) |
| 1384 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) | 1384 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) |
| 1385 | ("\\.m?spec$" . sh-mode) | 1385 | ("\\.m?spec\\'" . sh-mode) |
| 1386 | ("\\.mm\\'" . nroff-mode) | 1386 | ("\\.mm\\'" . nroff-mode) |
| 1387 | ("\\.me\\'" . nroff-mode) | 1387 | ("\\.me\\'" . nroff-mode) |
| 1388 | ("\\.ms\\'" . nroff-mode) | 1388 | ("\\.ms\\'" . nroff-mode) |
| @@ -1442,15 +1442,11 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1442 | ("[:/]_emacs\\'" . emacs-lisp-mode) | 1442 | ("[:/]_emacs\\'" . emacs-lisp-mode) |
| 1443 | ("/crontab\\.X*[0-9]+\\'" . shell-script-mode) | 1443 | ("/crontab\\.X*[0-9]+\\'" . shell-script-mode) |
| 1444 | ("\\.ml\\'" . lisp-mode) | 1444 | ("\\.ml\\'" . lisp-mode) |
| 1445 | ("\\.asn$" . snmp-mode) | 1445 | ("\\.\\(asn\\|mib\\|smi\\)\\'" . snmp-mode) |
| 1446 | ("\\.mib$" . snmp-mode) | 1446 | ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode) |
| 1447 | ("\\.smi$" . snmp-mode) | ||
| 1448 | ("\\.as2$" . snmpv2-mode) | ||
| 1449 | ("\\.mi2$" . snmpv2-mode) | ||
| 1450 | ("\\.sm2$" . snmpv2-mode) | ||
| 1451 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) | 1447 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) |
| 1452 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG | 1448 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG |
| 1453 | ("\\.[eE]?[pP][sS]$" . ps-mode) | 1449 | ("\\.[eE]?[pP][sS]\\'" . ps-mode) |
| 1454 | ("configure\\.in\\'" . autoconf-mode) | 1450 | ("configure\\.in\\'" . autoconf-mode) |
| 1455 | ("BROWSE\\'" . ebrowse-tree-mode) | 1451 | ("BROWSE\\'" . ebrowse-tree-mode) |
| 1456 | ("\\.ebrowse\\'" . ebrowse-tree-mode) | 1452 | ("\\.ebrowse\\'" . ebrowse-tree-mode) |
| @@ -2248,7 +2244,7 @@ the value is \"\"." | |||
| 2248 | "A function to use instead of the default `make-backup-file-name'. | 2244 | "A function to use instead of the default `make-backup-file-name'. |
| 2249 | A value of nil gives the default `make-backup-file-name' behaviour. | 2245 | A value of nil gives the default `make-backup-file-name' behaviour. |
| 2250 | 2246 | ||
| 2251 | This could be buffer-local to do something special for for specific | 2247 | This could be buffer-local to do something special for specific |
| 2252 | files. If you define it, you may need to change `backup-file-name-p' | 2248 | files. If you define it, you may need to change `backup-file-name-p' |
| 2253 | and `file-name-sans-versions' too. | 2249 | and `file-name-sans-versions' too. |
| 2254 | 2250 | ||