diff options
| author | Michael Albinus | 2010-11-21 20:39:21 +0100 |
|---|---|---|
| committer | Michael Albinus | 2010-11-21 20:39:21 +0100 |
| commit | e274eb13e0bbe9d200aa813b7ec3ef559f76405c (patch) | |
| tree | a52b1b664b002eef628fcbb077905b44af931151 | |
| parent | 77af54d7c2d9e1ebcbbe1dffec4004b7079ce6bf (diff) | |
| download | emacs-e274eb13e0bbe9d200aa813b7ec3ef559f76405c.tar.gz emacs-e274eb13e0bbe9d200aa813b7ec3ef559f76405c.zip | |
* files.el (backup-by-copying-when-mismatch): The default value is
now t.
* startup.el (normal-top-level):
* net/tramp.el (tramp-handle-insert-file-contents): Do not set
`backup-by-copying-when-mismatch'.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/files.el | 3 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 7 | ||||
| -rw-r--r-- | lisp/startup.el | 3 |
4 files changed, 12 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ac8e56f384..d82eeac7788 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-11-21 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * files.el (backup-by-copying-when-mismatch): The default value is | ||
| 4 | now t. | ||
| 5 | |||
| 6 | * startup.el (normal-top-level): | ||
| 7 | * net/tramp.el (tramp-handle-insert-file-contents): Do not set | ||
| 8 | `backup-by-copying-when-mismatch'. | ||
| 9 | |||
| 1 | 2010-11-21 Jan Djärv <jan.h.d@swipnet.se> | 10 | 2010-11-21 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 11 | ||
| 3 | * tool-bar.el (tool-bar-setup): Remove save as, print and customize. | 12 | * tool-bar.el (tool-bar-setup): Remove save as, print and customize. |
diff --git a/lisp/files.el b/lisp/files.el index 3b130a20d2b..42a3f87cb11 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -115,13 +115,14 @@ This variable is relevant only if `backup-by-copying' is nil." | |||
| 115 | :type 'boolean | 115 | :type 'boolean |
| 116 | :group 'backup) | 116 | :group 'backup) |
| 117 | 117 | ||
| 118 | (defcustom backup-by-copying-when-mismatch nil | 118 | (defcustom backup-by-copying-when-mismatch t |
| 119 | "Non-nil means create backups by copying if this preserves owner or group. | 119 | "Non-nil means create backups by copying if this preserves owner or group. |
| 120 | Renaming may still be used (subject to control of other variables) | 120 | Renaming may still be used (subject to control of other variables) |
| 121 | when it would not result in changing the owner or group of the file; | 121 | when it would not result in changing the owner or group of the file; |
| 122 | that is, for files which are owned by you and whose group matches | 122 | that is, for files which are owned by you and whose group matches |
| 123 | the default for a new file created there by you. | 123 | the default for a new file created there by you. |
| 124 | This variable is relevant only if `backup-by-copying' is nil." | 124 | This variable is relevant only if `backup-by-copying' is nil." |
| 125 | :version "24.1" | ||
| 125 | :type 'boolean | 126 | :type 'boolean |
| 126 | :group 'backup) | 127 | :group 'backup) |
| 127 | (put 'backup-by-copying-when-mismatch 'permanent-local t) | 128 | (put 'backup-by-copying-when-mismatch 'permanent-local t) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d5b55064f3d..10b3c7bd04c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2861,12 +2861,7 @@ User is always nil." | |||
| 2861 | (setq buffer-file-name filename) | 2861 | (setq buffer-file-name filename) |
| 2862 | (setq buffer-read-only (not (file-writable-p filename))) | 2862 | (setq buffer-read-only (not (file-writable-p filename))) |
| 2863 | (set-visited-file-modtime) | 2863 | (set-visited-file-modtime) |
| 2864 | (set-buffer-modified-p nil) | 2864 | (set-buffer-modified-p nil)) |
| 2865 | ;; For root, preserve owner and group when editing files. | ||
| 2866 | (when (string-equal | ||
| 2867 | (tramp-file-name-handler 'file-remote-p filename 'user) | ||
| 2868 | "root") | ||
| 2869 | (set (make-local-variable 'backup-by-copying-when-mismatch) t))) | ||
| 2870 | (when (and (stringp local-copy) | 2865 | (when (and (stringp local-copy) |
| 2871 | (or remote-copy (null tramp-temp-buffer-file-name))) | 2866 | (or remote-copy (null tramp-temp-buffer-file-name))) |
| 2872 | (delete-file local-copy)) | 2867 | (delete-file local-copy)) |
diff --git a/lisp/startup.el b/lisp/startup.el index 8dd76b29741..99189b1df72 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -466,9 +466,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 466 | ;; `user-full-name' is now known; reset its standard-value here. | 466 | ;; `user-full-name' is now known; reset its standard-value here. |
| 467 | (put 'user-full-name 'standard-value | 467 | (put 'user-full-name 'standard-value |
| 468 | (list (default-value 'user-full-name))) | 468 | (list (default-value 'user-full-name))) |
| 469 | ;; For root, preserve owner and group when editing files. | ||
| 470 | (if (equal (user-uid) 0) | ||
| 471 | (setq backup-by-copying-when-mismatch t)) | ||
| 472 | ;; Look in each dir in load-path for a subdirs.el file. | 469 | ;; Look in each dir in load-path for a subdirs.el file. |
| 473 | ;; If we find one, load it, which will add the appropriate subdirs | 470 | ;; If we find one, load it, which will add the appropriate subdirs |
| 474 | ;; of that dir into load-path, | 471 | ;; of that dir into load-path, |