diff options
| author | Stefan Monnier | 2008-05-28 12:36:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-05-28 12:36:15 +0000 |
| commit | 6b3d752c5df6b19f6ff20174e3cb0471ff3daa27 (patch) | |
| tree | 88a9fb7048a5ed35727537dcc0ee1c1d76d4792a | |
| parent | b75d7f28826a896fad4599b22f25599a4ee582d1 (diff) | |
| download | emacs-6b3d752c5df6b19f6ff20174e3cb0471ff3daa27.tar.gz emacs-6b3d752c5df6b19f6ff20174e3cb0471ff3daa27.zip | |
* src/fileio.c (Fwrite_region): Delay the defaulting to beg&z to after
calling build_annotations.
* lisp/files.el (basic-save-buffer-2): Pass nil rather than (point-min)
to write-region.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 10 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 11 |
4 files changed, 28 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf1a3e309fd..fc88bbc3c60 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-05-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * files.el (basic-save-buffer-2): Pass nil rather than (point-min) | ||
| 4 | to write-region. | ||
| 5 | |||
| 1 | 2008-05-28 Glenn Morris <rgm@gnu.org> | 6 | 2008-05-28 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * Makefile.in (update-elclist): Work around non-portability of "\" | 8 | * Makefile.in (update-elclist): Work around non-portability of "\" |
diff --git a/lisp/files.el b/lisp/files.el index 9802f903eeb..14752752b79 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4085,7 +4085,10 @@ Before and after saving the buffer, this function runs | |||
| 4085 | (setq tempname | 4085 | (setq tempname |
| 4086 | (make-temp-name | 4086 | (make-temp-name |
| 4087 | (expand-file-name "tmp" dir))) | 4087 | (expand-file-name "tmp" dir))) |
| 4088 | (write-region (point-min) (point-max) | 4088 | ;; Pass in nil&nil rather than point-min&max |
| 4089 | ;; cause we're saving the whole buffer. | ||
| 4090 | ;; write-region-annotate-functions may use it. | ||
| 4091 | (write-region nil nil | ||
| 4089 | tempname nil realname | 4092 | tempname nil realname |
| 4090 | buffer-file-truename 'excl) | 4093 | buffer-file-truename 'excl) |
| 4091 | nil) | 4094 | nil) |
| @@ -4119,7 +4122,10 @@ Before and after saving the buffer, this function runs | |||
| 4119 | (let (success) | 4122 | (let (success) |
| 4120 | (unwind-protect | 4123 | (unwind-protect |
| 4121 | (progn | 4124 | (progn |
| 4122 | (write-region (point-min) (point-max) | 4125 | ;; Pass in nil&nil rather than point-min&max to indicate |
| 4126 | ;; we're saving the buffer rather than just a region. | ||
| 4127 | ;; write-region-annotate-functions may make us of it. | ||
| 4128 | (write-region nil nil | ||
| 4123 | buffer-file-name nil t buffer-file-truename) | 4129 | buffer-file-name nil t buffer-file-truename) |
| 4124 | (setq success t)) | 4130 | (setq success t)) |
| 4125 | ;; If we get an error writing the new file, and we made | 4131 | ;; If we get an error writing the new file, and we made |
diff --git a/src/ChangeLog b/src/ChangeLog index ef7acb97eb4..b4a3e74c453 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-05-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * fileio.c (Fwrite_region): Delay the defaulting to beg&z to after | ||
| 4 | calling build_annotations. | ||
| 5 | |||
| 1 | 2008-05-28 Juanma Barranquero <lekktu@gmail.com> | 6 | 2008-05-28 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * coding.c (Fdecode_coding_region, Fencode_coding_region) | 8 | * coding.c (Fdecode_coding_region, Fencode_coding_region) |
diff --git a/src/fileio.c b/src/fileio.c index c4b0113523a..2a700a69f97 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -5079,8 +5079,11 @@ This does code conversion according to the value of | |||
| 5079 | /* Special kludge to simplify auto-saving. */ | 5079 | /* Special kludge to simplify auto-saving. */ |
| 5080 | if (NILP (start)) | 5080 | if (NILP (start)) |
| 5081 | { | 5081 | { |
| 5082 | /* Do it later, so write-region-annotate-function can work differently | ||
| 5083 | if we save "the buffer" vs "a region". | ||
| 5084 | This is useful in tar-mode. --Stef | ||
| 5082 | XSETFASTINT (start, BEG); | 5085 | XSETFASTINT (start, BEG); |
| 5083 | XSETFASTINT (end, Z); | 5086 | XSETFASTINT (end, Z); */ |
| 5084 | Fwiden (); | 5087 | Fwiden (); |
| 5085 | } | 5088 | } |
| 5086 | 5089 | ||
| @@ -5100,6 +5103,12 @@ This does code conversion according to the value of | |||
| 5100 | } | 5103 | } |
| 5101 | } | 5104 | } |
| 5102 | 5105 | ||
| 5106 | if (NILP (start)) | ||
| 5107 | { | ||
| 5108 | XSETFASTINT (start, BEGV); | ||
| 5109 | XSETFASTINT (end, ZV); | ||
| 5110 | } | ||
| 5111 | |||
| 5103 | UNGCPRO; | 5112 | UNGCPRO; |
| 5104 | 5113 | ||
| 5105 | GCPRO5 (start, filename, annotations, visit_file, lockname); | 5114 | GCPRO5 (start, filename, annotations, visit_file, lockname); |