Mercurial > emacs
comparison lisp/files.el @ 83542:2d56e13fd23d
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-413
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-414
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-415
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-416
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-417
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-418
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-419
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-420
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-421
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-422
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-423
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-424
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-425
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-426
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-427
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-428
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-429
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-430
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-431
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-432
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-433
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-434
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-435
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-436
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-437
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-438
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-439
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-440
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-441
lisp/url/url-methods.el: Fix format error when http_proxy is empty string
* emacs@sv.gnu.org/emacs--devo--0--patch-442
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-443
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-444
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-445
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-446
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-447
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-448
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-449
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-450
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-451
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-452
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-453
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-454
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-455
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-456
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-457
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-458
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-459
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-460
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-461
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-462
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-463
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-464
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-465
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-466
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-467
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-468
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-469
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-470
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-471
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-472
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-473
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-128
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-129
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-130
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-131
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-132
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-133
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-134
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-135
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-136
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-137
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-138
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-139
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-140
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-141
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-142
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-143
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-144
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-145
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-146
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-147
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-148
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-149
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 14 Oct 2006 17:36:28 +0000 |
parents | 694bbb62a75d c51c8fa9c1f1 |
children | c71725faff1a |
comparison
equal
deleted
inserted
replaced
83541:694bbb62a75d | 83542:2d56e13fd23d |
---|---|
512 you visit a file you cannot alter, and buffers you make read-only | 512 you visit a file you cannot alter, and buffers you make read-only |
513 using \\[toggle-read-only]." | 513 using \\[toggle-read-only]." |
514 :type 'boolean | 514 :type 'boolean |
515 :group 'view) | 515 :group 'view) |
516 | 516 |
517 (defvar file-name-history nil | |
518 "History list of file names entered in the minibuffer.") | |
519 | |
517 (put 'ange-ftp-completion-hook-function 'safe-magic t) | 520 (put 'ange-ftp-completion-hook-function 'safe-magic t) |
518 (defun ange-ftp-completion-hook-function (op &rest args) | 521 (defun ange-ftp-completion-hook-function (op &rest args) |
519 "Provides support for ange-ftp host name completion. | 522 "Provides support for ange-ftp host name completion. |
520 Runs the usual ange-ftp hook, but only for completion operations." | 523 Runs the usual ange-ftp hook, but only for completion operations." |
521 ;; Having this here avoids the need to load ange-ftp when it's not | 524 ;; Having this here avoids the need to load ange-ftp when it's not |
1115 (setq value (nreverse value)) | 1118 (setq value (nreverse value)) |
1116 (cons (switch-to-buffer-other-frame (car value)) | 1119 (cons (switch-to-buffer-other-frame (car value)) |
1117 (mapcar 'switch-to-buffer (cdr value)))) | 1120 (mapcar 'switch-to-buffer (cdr value)))) |
1118 (switch-to-buffer-other-frame value)))) | 1121 (switch-to-buffer-other-frame value)))) |
1119 | 1122 |
1120 (defun find-file-existing (filename &optional wildcards) | 1123 (defun find-file-existing (filename) |
1121 "Edit the existing file FILENAME. | 1124 "Edit the existing file FILENAME. |
1122 Like \\[find-file] but only allow a file that exists." | 1125 Like \\[find-file] but only allow a file that exists, and do not allow |
1123 (interactive (find-file-read-args "Find existing file: " t)) | 1126 file names with wildcards." |
1124 (unless (file-exists-p filename) (error "%s does not exist" filename)) | 1127 (interactive (nbutlast (find-file-read-args "Find existing file: " t))) |
1125 (find-file filename wildcards) | 1128 (if (and (not (interactive-p)) (not (file-exists-p filename))) |
1126 (current-buffer)) | 1129 (error "%s does not exist" filename) |
1130 (find-file filename) | |
1131 (current-buffer))) | |
1127 | 1132 |
1128 (defun find-file-read-only (filename &optional wildcards) | 1133 (defun find-file-read-only (filename &optional wildcards) |
1129 "Edit file FILENAME but don't allow changes. | 1134 "Edit file FILENAME but don't allow changes. |
1130 Like \\[find-file] but marks buffer as read-only. | 1135 Like \\[find-file] but marks buffer as read-only. |
1131 Use \\[toggle-read-only] to permit editing." | 1136 Use \\[toggle-read-only] to permit editing." |
1308 ;; such as `/usr/foobar' when the home dir is `/usr/foo'. | 1313 ;; such as `/usr/foobar' when the home dir is `/usr/foo'. |
1309 (or abbreviated-home-dir | 1314 (or abbreviated-home-dir |
1310 (setq abbreviated-home-dir | 1315 (setq abbreviated-home-dir |
1311 (let ((abbreviated-home-dir "$foo")) | 1316 (let ((abbreviated-home-dir "$foo")) |
1312 (concat "^" (abbreviate-file-name (expand-file-name "~")) | 1317 (concat "^" (abbreviate-file-name (expand-file-name "~")) |
1313 "\\(/\\|$\\)")))) | 1318 "\\(/\\|\\'\\)")))) |
1314 | 1319 |
1315 ;; If FILENAME starts with the abbreviated homedir, | 1320 ;; If FILENAME starts with the abbreviated homedir, |
1316 ;; make it start with `~' instead. | 1321 ;; make it start with `~' instead. |
1317 (if (and (string-match abbreviated-home-dir filename) | 1322 (if (and (string-match abbreviated-home-dir filename) |
1318 ;; If the home dir is just /, don't change it. | 1323 ;; If the home dir is just /, don't change it. |
1363 found) | 1368 found) |
1364 (let* ((attributes (file-attributes truename)) | 1369 (let* ((attributes (file-attributes truename)) |
1365 (number (nthcdr 10 attributes)) | 1370 (number (nthcdr 10 attributes)) |
1366 (list (buffer-list)) found) | 1371 (list (buffer-list)) found) |
1367 (and buffer-file-numbers-unique | 1372 (and buffer-file-numbers-unique |
1368 number | 1373 (car-safe number) ;Make sure the inode is not just nil. |
1369 (while (and (not found) list) | 1374 (while (and (not found) list) |
1370 (with-current-buffer (car list) | 1375 (with-current-buffer (car list) |
1371 (if (and buffer-file-name | 1376 (if (and buffer-file-name |
1372 (equal buffer-file-number number) | 1377 (equal buffer-file-number number) |
1373 ;; Verify this buffer's file number | 1378 ;; Verify this buffer's file number |
1902 ("\\.texinfo\\'" . texinfo-mode) | 1907 ("\\.texinfo\\'" . texinfo-mode) |
1903 ("\\.te?xi\\'" . texinfo-mode) | 1908 ("\\.te?xi\\'" . texinfo-mode) |
1904 ("\\.[sS]\\'" . asm-mode) | 1909 ("\\.[sS]\\'" . asm-mode) |
1905 ("\\.asm\\'" . asm-mode) | 1910 ("\\.asm\\'" . asm-mode) |
1906 ("[cC]hange\\.?[lL]og?\\'" . change-log-mode) | 1911 ("[cC]hange\\.?[lL]og?\\'" . change-log-mode) |
1907 ("[cC]hange[lL]og\\.[0-9]+\\'" . change-log-mode) | 1912 ("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode) |
1908 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) | 1913 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) |
1909 ("\\.scm\\.[0-9]*\\'" . scheme-mode) | 1914 ("\\.scm\\.[0-9]*\\'" . scheme-mode) |
1910 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) | 1915 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) |
1911 ("\\.bash\\'" . sh-mode) | 1916 ("\\.bash\\'" . sh-mode) |
1912 ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode) | 1917 ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode) |
2394 ;; Otherwise, when Emacs visits a file specifying that local variable, the | 2399 ;; Otherwise, when Emacs visits a file specifying that local variable, the |
2395 ;; minor mode file may not be loaded yet. | 2400 ;; minor mode file may not be loaded yet. |
2396 ;; | 2401 ;; |
2397 ;; For variables defined in the C source code the declaration should go here: | 2402 ;; For variables defined in the C source code the declaration should go here: |
2398 | 2403 |
2399 ;; FIXME: Some variables should be moved according to the rules above. | |
2400 (mapc (lambda (pair) | 2404 (mapc (lambda (pair) |
2401 (put (car pair) 'safe-local-variable (cdr pair))) | 2405 (put (car pair) 'safe-local-variable (cdr pair))) |
2402 '((fill-column . integerp) ;; C source code | 2406 '((buffer-read-only . booleanp) ;; C source code |
2407 (fill-column . integerp) ;; C source code | |
2403 (indent-tabs-mode . booleanp) ;; C source code | 2408 (indent-tabs-mode . booleanp) ;; C source code |
2404 (left-margin . integerp) ;; C source code | 2409 (left-margin . integerp) ;; C source code |
2405 (no-update-autoloads . booleanp) | 2410 (no-update-autoloads . booleanp) |
2406 (tab-width . integerp) ;; C source code | 2411 (tab-width . integerp) ;; C source code |
2407 (truncate-lines . booleanp))) ;; C source code | 2412 (truncate-lines . booleanp))) ;; C source code |
2695 | 2700 |
2696 * Its `risky-local-variable' property is non-nil. | 2701 * Its `risky-local-variable' property is non-nil. |
2697 | 2702 |
2698 * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\", | 2703 * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\", |
2699 \"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\", | 2704 \"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\", |
2700 \"mode-alist\", \"font-lock-(syntactic-)keyword*\", or | 2705 \"mode-alist\", \"font-lock-(syntactic-)keyword*\", |
2701 \"map-alist\"." | 2706 \"map-alist\", or \"bindat-spec\"." |
2702 ;; If this is an alias, check the base name. | 2707 ;; If this is an alias, check the base name. |
2703 (condition-case nil | 2708 (condition-case nil |
2704 (setq sym (indirect-variable sym)) | 2709 (setq sym (indirect-variable sym)) |
2705 (error nil)) | 2710 (error nil)) |
2706 (or (get sym 'risky-local-variable) | 2711 (or (get sym 'risky-local-variable) |
2707 (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\ | 2712 (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\ |
2708 -commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\ | 2713 -commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\ |
2709 -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\ | 2714 -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\ |
2710 -map$\\|-map-alist$" (symbol-name sym)))) | 2715 -map$\\|-map-alist$\\|-bindat-spec$" (symbol-name sym)))) |
2711 | 2716 |
2712 (defun hack-one-local-variable-quotep (exp) | 2717 (defun hack-one-local-variable-quotep (exp) |
2713 (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) | 2718 (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) |
2714 | 2719 |
2715 (defun hack-one-local-variable-constantp (exp) | 2720 (defun hack-one-local-variable-constantp (exp) |
3727 (lambda (ignore) | 3732 (lambda (ignore) |
3728 (exit-recursive-edit))) | 3733 (exit-recursive-edit))) |
3729 (recursive-edit) | 3734 (recursive-edit) |
3730 ;; Return nil to ask about BUF again. | 3735 ;; Return nil to ask about BUF again. |
3731 nil) | 3736 nil) |
3732 "view this file") | 3737 "view this buffer") |
3733 (?d diff-buffer-with-file | 3738 (?d (lambda (buf) |
3734 "view changes in file")) | 3739 (save-window-excursion |
3740 (diff-buffer-with-file buf)) | |
3741 (view-buffer (get-buffer-create "*Diff*") | |
3742 (lambda (ignore) (exit-recursive-edit))) | |
3743 (recursive-edit) | |
3744 nil) | |
3745 "view changes in this buffer")) | |
3735 "ACTION-ALIST argument used in call to `map-y-or-n-p'.") | 3746 "ACTION-ALIST argument used in call to `map-y-or-n-p'.") |
3736 | 3747 |
3737 (defvar buffer-save-without-query nil | 3748 (defvar buffer-save-without-query nil |
3738 "Non-nil means `save-some-buffers' should save this buffer without asking.") | 3749 "Non-nil means `save-some-buffers' should save this buffer without asking.") |
3739 (make-variable-buffer-local 'buffer-save-without-query) | 3750 (make-variable-buffer-local 'buffer-save-without-query) |