aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2002-05-23 15:22:47 +0000
committerStefan Monnier2002-05-23 15:22:47 +0000
commit28c3eb5ab5aa5c53498f38e8869209ddc53b4dd5 (patch)
treeebf3566bb9f7c625fc0bc9995c1f7442ec44ceeb /src
parentd5857a966b7844ae39f338b9f987a2b78c2b6f3d (diff)
downloademacs-28c3eb5ab5aa5c53498f38e8869209ddc53b4dd5.tar.gz
emacs-28c3eb5ab5aa5c53498f38e8869209ddc53b4dd5.zip
(read_non_regular, Finsert_file_contents): Use BEG_BYTE.
(Finsert_file_contents, build_annotations): Use XCAR, XCDR. (Vwrite_region_annotate_functions): Docstring fix.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 87a6a0da8bd..55d09def69a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3532,7 +3532,7 @@ read_non_regular ()
3532 immediate_quit = 1; 3532 immediate_quit = 1;
3533 QUIT; 3533 QUIT;
3534 nbytes = emacs_read (non_regular_fd, 3534 nbytes = emacs_read (non_regular_fd,
3535 BEG_ADDR + PT_BYTE - 1 + non_regular_inserted, 3535 BEG_ADDR + PT_BYTE - BEG_BYTE + non_regular_inserted,
3536 non_regular_nbytes); 3536 non_regular_nbytes);
3537 immediate_quit = 0; 3537 immediate_quit = 0;
3538 return make_number (nbytes); 3538 return make_number (nbytes);
@@ -4321,7 +4321,7 @@ actually used. */)
4321 here doesn't do any harm. */ 4321 here doesn't do any harm. */
4322 immediate_quit = 1; 4322 immediate_quit = 1;
4323 QUIT; 4323 QUIT;
4324 this = emacs_read (fd, BEG_ADDR + PT_BYTE - 1 + inserted, trytry); 4324 this = emacs_read (fd, BEG_ADDR + PT_BYTE - BEG_BYTE + inserted, trytry);
4325 immediate_quit = 0; 4325 immediate_quit = 0;
4326 } 4326 }
4327 4327
@@ -4550,16 +4550,16 @@ actually used. */)
4550 } 4550 }
4551 4551
4552 p = Vafter_insert_file_functions; 4552 p = Vafter_insert_file_functions;
4553 while (!NILP (p)) 4553 while (CONSP (p))
4554 { 4554 {
4555 insval = call1 (Fcar (p), make_number (inserted)); 4555 insval = call1 (XCAR (p), make_number (inserted));
4556 if (!NILP (insval)) 4556 if (!NILP (insval))
4557 { 4557 {
4558 CHECK_NUMBER (insval); 4558 CHECK_NUMBER (insval);
4559 inserted = XFASTINT (insval); 4559 inserted = XFASTINT (insval);
4560 } 4560 }
4561 QUIT; 4561 QUIT;
4562 p = Fcdr (p); 4562 p = XCDR (p);
4563 } 4563 }
4564 4564
4565 if (!NILP (visit) 4565 if (!NILP (visit)
@@ -5166,11 +5166,11 @@ build_annotations (start, end)
5166 annotations = Qnil; 5166 annotations = Qnil;
5167 p = Vwrite_region_annotate_functions; 5167 p = Vwrite_region_annotate_functions;
5168 GCPRO2 (annotations, p); 5168 GCPRO2 (annotations, p);
5169 while (!NILP (p)) 5169 while (CONSP (p))
5170 { 5170 {
5171 struct buffer *given_buffer = current_buffer; 5171 struct buffer *given_buffer = current_buffer;
5172 Vwrite_region_annotations_so_far = annotations; 5172 Vwrite_region_annotations_so_far = annotations;
5173 res = call2 (Fcar (p), start, end); 5173 res = call2 (XCAR (p), start, end);
5174 /* If the function makes a different buffer current, 5174 /* If the function makes a different buffer current,
5175 assume that means this buffer contains altered text to be output. 5175 assume that means this buffer contains altered text to be output.
5176 Reset START and END from the buffer bounds 5176 Reset START and END from the buffer bounds
@@ -5184,7 +5184,7 @@ build_annotations (start, end)
5184 } 5184 }
5185 Flength (res); /* Check basic validity of return value */ 5185 Flength (res); /* Check basic validity of return value */
5186 annotations = merge (annotations, res, Qcar_less_than_car); 5186 annotations = merge (annotations, res, Qcar_less_than_car);
5187 p = Fcdr (p); 5187 p = XCDR (p);
5188 } 5188 }
5189 5189
5190 /* Now do the same for annotation functions implied by the file-format */ 5190 /* Now do the same for annotation functions implied by the file-format */
@@ -5192,7 +5192,7 @@ build_annotations (start, end)
5192 p = Vauto_save_file_format; 5192 p = Vauto_save_file_format;
5193 else 5193 else
5194 p = current_buffer->file_format; 5194 p = current_buffer->file_format;
5195 for (i = 0; !NILP (p); p = Fcdr (p), ++i) 5195 for (i = 0; CONSP (p); p = XCDR (p), ++i)
5196 { 5196 {
5197 struct buffer *given_buffer = current_buffer; 5197 struct buffer *given_buffer = current_buffer;
5198 5198
@@ -5201,7 +5201,7 @@ build_annotations (start, end)
5201 /* Value is either a list of annotations or nil if the function 5201 /* Value is either a list of annotations or nil if the function
5202 has written annotations to a temporary buffer, which is now 5202 has written annotations to a temporary buffer, which is now
5203 current. */ 5203 current. */
5204 res = call5 (Qformat_annotate_function, Fcar (p), start, end, 5204 res = call5 (Qformat_annotate_function, XCAR (p), start, end,
5205 original_buffer, make_number (i)); 5205 original_buffer, make_number (i));
5206 if (current_buffer != given_buffer) 5206 if (current_buffer != given_buffer)
5207 { 5207 {
@@ -6287,7 +6287,8 @@ of the form (POSITION . STRING), consisting of strings to be effectively
6287inserted at the specified positions of the file being written (1 means to 6287inserted at the specified positions of the file being written (1 means to
6288insert before the first byte written). The POSITIONs must be sorted into 6288insert before the first byte written). The POSITIONs must be sorted into
6289increasing order. If there are several functions in the list, the several 6289increasing order. If there are several functions in the list, the several
6290lists are merged destructively. */); 6290lists are merged destructively. Alternatively, the function can return
6291with a different buffer current and value nil.*/);
6291 Vwrite_region_annotate_functions = Qnil; 6292 Vwrite_region_annotate_functions = Qnil;
6292 6293
6293 DEFVAR_LISP ("write-region-annotations-so-far", 6294 DEFVAR_LISP ("write-region-annotations-so-far",