Mercurial > hg > xemacs-beta
comparison lisp/code-files.el @ 863:42375619fa45
[xemacs-hg @ 2002-06-04 06:03:59 by andyp]
merge 21.4 windows changes, minimally tested
author | andyp |
---|---|
date | Tue, 04 Jun 2002 06:05:53 +0000 |
parents | 2b676dc88c66 |
children | 1e9272790fe0 |
comparison
equal
deleted
inserted
replaced
862:278c743f1578 | 863:42375619fa45 |
---|---|
452 | 452 |
453 (defvar write-region-pre-hook nil | 453 (defvar write-region-pre-hook nil |
454 "A special hook to decide the coding system used for writing out a file. | 454 "A special hook to decide the coding system used for writing out a file. |
455 | 455 |
456 Before writing a file, `write-region' calls the functions on this hook with | 456 Before writing a file, `write-region' calls the functions on this hook with |
457 arguments START, END, FILENAME, APPEND, VISIT, LOCKNAME, and CODING-SYSTEM, | 457 arguments START, END, FILENAME, APPEND, VISIT, LOCKNAME and CODING-SYSTEM, |
458 the same as the corresponding arguments in the call to `write-region'. | 458 the same as the corresponding arguments in the call to `write-region'. |
459 | 459 |
460 The return value of each function should be one of | 460 The return value of each function should be one of |
461 | 461 |
462 -- nil | 462 -- nil |
463 -- A coding system or a symbol denoting it, indicating the coding system | 463 -- A coding system or a symbol denoting it, indicating the coding system |
464 to be used for reading the file | 464 to be used for writing the file |
465 -- A list of two elements (absolute pathname and length of data written), | 465 -- A list of two elements (absolute pathname and length of data written), |
466 which is used as the return value to `write-region'. In this | 466 which is used as the return value to `write-region'. In this case, |
467 case, `write-region' assumes that the function has written | 467 `write-region' assumes that the function has written the file and |
468 the file, and returns. | 468 returns. |
469 | 469 |
470 If any function returns non-nil, the remaining functions are not called.") | 470 If any function returns non-nil, the remaining functions are not called.") |
471 | 471 |
472 (defvar write-region-post-hook nil | 472 (defvar write-region-post-hook nil |
473 "A hook called by `write-region' after a file has been written out. | 473 "A hook called by `write-region' after a file has been written out. |
474 | 474 |
475 The functions on this hook are called with arguments START, END, | 475 The functions on this hook are called with arguments START, END, |
476 FILENAME, APPEND, VISIT, LOCKNAME, and CODING-SYSTEM, the same as the | 476 FILENAME, APPEND, VISIT, LOCKNAME, and CODING-SYSTEM, the same as the |
477 corresponding arguments in the call to `write-region'.") | 477 corresponding arguments in the call to `write-region'.") |
478 | 478 |
479 (defun write-region (start end filename &optional append visit lockname coding-system) | 479 (defun write-region (start end filename |
480 &optional append visit lockname coding-system) | |
480 "Write current region into specified file. | 481 "Write current region into specified file. |
481 By default the file's existing contents are replaced by the specified region. | 482 By default the file's existing contents are replaced by the specified region. |
482 Call interactively, prompts for the filename. With a prefix arg, also prompts | 483 Called interactively, prompts for a file name. With a prefix arg, prompts |
483 for a coding system. | 484 for a coding system as well. |
484 | 485 |
485 When called from a program, takes three required arguments: | 486 When called from a program, takes three required arguments: |
486 START, END and FILENAME. START and END are buffer positions. | 487 START, END and FILENAME. START and END are buffer positions. |
487 Optional fourth argument APPEND if non-nil means | 488 Optional fourth argument APPEND if non-nil means |
488 append to existing file contents (if any). | 489 append to existing file contents (if any). |