diff options
| author | Richard M. Stallman | 1998-05-23 20:02:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-23 20:02:01 +0000 |
| commit | 39a4c932b6632def823eacc2da54972c7bc10e01 (patch) | |
| tree | 7122dc9acb47c478295892e8225a37789094766b /src | |
| parent | 78652ce8bdcab6b19cc068ebf5d12381c56c5777 (diff) | |
| download | emacs-39a4c932b6632def823eacc2da54972c7bc10e01.tar.gz emacs-39a4c932b6632def823eacc2da54972c7bc10e01.zip | |
(Fchar_after): Make nil fully equivalent to (point) as arg.
(Fchar_before): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/editfns.c b/src/editfns.c index 5d45f7c4ede..c6d5a7a52ad 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -578,10 +578,7 @@ DEFUN ("eolp", Feolp, Seolp, 0, 0, 0, | |||
| 578 | DEFUN ("char-after", Fchar_after, Schar_after, 0, 1, 0, | 578 | DEFUN ("char-after", Fchar_after, Schar_after, 0, 1, 0, |
| 579 | "Return character in current buffer at position POS.\n\ | 579 | "Return character in current buffer at position POS.\n\ |
| 580 | POS is an integer or a buffer pointer.\n\ | 580 | POS is an integer or a buffer pointer.\n\ |
| 581 | If POS is out of range, the value is nil.\n\ | 581 | If POS is out of range, the value is nil.") |
| 582 | If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ | ||
| 583 | multi-byte form is ignored, and only one byte at POS\n\ | ||
| 584 | is returned as a character.") | ||
| 585 | (pos) | 582 | (pos) |
| 586 | Lisp_Object pos; | 583 | Lisp_Object pos; |
| 587 | { | 584 | { |
| @@ -589,8 +586,12 @@ If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ | |||
| 589 | register Lisp_Object val; | 586 | register Lisp_Object val; |
| 590 | 587 | ||
| 591 | if (NILP (pos)) | 588 | if (NILP (pos)) |
| 592 | pos_byte = PT_BYTE; | 589 | { |
| 593 | else if (MARKERP (pos)) | 590 | pos_byte = PT_BYTE; |
| 591 | pos = PT; | ||
| 592 | } | ||
| 593 | |||
| 594 | if (MARKERP (pos)) | ||
| 594 | { | 595 | { |
| 595 | pos_byte = marker_byte_position (pos); | 596 | pos_byte = marker_byte_position (pos); |
| 596 | if (pos_byte < BEGV_BYTE || pos_byte >= ZV_BYTE) | 597 | if (pos_byte < BEGV_BYTE || pos_byte >= ZV_BYTE) |
| @@ -611,10 +612,7 @@ If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ | |||
| 611 | DEFUN ("char-before", Fchar_before, Schar_before, 0, 1, 0, | 612 | DEFUN ("char-before", Fchar_before, Schar_before, 0, 1, 0, |
| 612 | "Return character in current buffer preceding position POS.\n\ | 613 | "Return character in current buffer preceding position POS.\n\ |
| 613 | POS is an integer or a buffer pointer.\n\ | 614 | POS is an integer or a buffer pointer.\n\ |
| 614 | If POS is out of range, the value is nil.\n\ | 615 | If POS is out of range, the value is nil.") |
| 615 | If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ | ||
| 616 | multi-byte form is ignored, and only one byte preceding POS\n\ | ||
| 617 | is returned as a character.") | ||
| 618 | (pos) | 616 | (pos) |
| 619 | Lisp_Object pos; | 617 | Lisp_Object pos; |
| 620 | { | 618 | { |
| @@ -622,8 +620,12 @@ is returned as a character.") | |||
| 622 | register int pos_byte; | 620 | register int pos_byte; |
| 623 | 621 | ||
| 624 | if (NILP (pos)) | 622 | if (NILP (pos)) |
| 625 | pos_byte = PT_BYTE; | 623 | { |
| 626 | else if (MARKERP (pos)) | 624 | pos_byte = PT_BYTE; |
| 625 | pos = PT; | ||
| 626 | } | ||
| 627 | |||
| 628 | if (MARKERP (pos)) | ||
| 627 | { | 629 | { |
| 628 | pos_byte = marker_byte_position (pos); | 630 | pos_byte = marker_byte_position (pos); |
| 629 | 631 | ||