aboutsummaryrefslogtreecommitdiffstats
path: root/src/textconv.c
diff options
context:
space:
mode:
authorPo Lu2023-06-03 10:16:30 +0800
committerPo Lu2023-06-03 10:16:30 +0800
commita696ed5c30fb9a7ba2d37f0e691de17872fdab16 (patch)
tree392331d300e02b43e5098b9b4a56f008780efdfd /src/textconv.c
parentd84cbcb8ce970d8a54e164a5ef6f0074c0e59f91 (diff)
downloademacs-a696ed5c30fb9a7ba2d37f0e691de17872fdab16.tar.gz
emacs-a696ed5c30fb9a7ba2d37f0e691de17872fdab16.zip
Update Android port
* src/androidterm.c (struct android_get_extracted_text_context): New field `mark_active'. (android_get_extracted_text): Set that field. (struct android_extracted_text_class): New field `flags'. (android_build_extracted_text): New argument `mark_active'. Set flags appropriately. (NATIVE_NAME, android_update_selection): Likewise. * src/textconv.c (get_extracted_text): New argument `mark_active'. Set it if the mark is active. * src/textconv.h: Update prototypes.
Diffstat (limited to 'src/textconv.c')
-rw-r--r--src/textconv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/textconv.c b/src/textconv.c
index 9003816e191..e082eb6ee22 100644
--- a/src/textconv.c
+++ b/src/textconv.c
@@ -1573,8 +1573,9 @@ textconv_barrier (struct frame *f, unsigned long counter)
1573 to the position of the first character returned, *START_OFFSET to 1573 to the position of the first character returned, *START_OFFSET to
1574 the offset of the lesser of mark and point within that text, 1574 the offset of the lesser of mark and point within that text,
1575 *END_OFFSET to the greater of mark and point within that text, and 1575 *END_OFFSET to the greater of mark and point within that text, and
1576 *LENGTH to the actual number of characters returned, and *BYTES to 1576 *LENGTH to the actual number of characters returned, *BYTES to the
1577 the actual number of bytes returned. 1577 actual number of bytes returned, and *MARK_ACTIVE to whether or not
1578 the mark is active.
1578 1579
1579 Value is NULL upon failure, and a malloced string upon success. */ 1580 Value is NULL upon failure, and a malloced string upon success. */
1580 1581
@@ -1583,7 +1584,7 @@ get_extracted_text (struct frame *f, ptrdiff_t n,
1583 ptrdiff_t *start_return, 1584 ptrdiff_t *start_return,
1584 ptrdiff_t *start_offset, 1585 ptrdiff_t *start_offset,
1585 ptrdiff_t *end_offset, ptrdiff_t *length, 1586 ptrdiff_t *end_offset, ptrdiff_t *length,
1586 ptrdiff_t *bytes) 1587 ptrdiff_t *bytes, bool *mark_active)
1587{ 1588{
1588 specpdl_ref count; 1589 specpdl_ref count;
1589 ptrdiff_t start, end, start_byte, end_byte, mark; 1590 ptrdiff_t start, end, start_byte, end_byte, mark;
@@ -1657,9 +1658,13 @@ get_extracted_text (struct frame *f, ptrdiff_t n,
1657 /* Get the mark. If it's not active, use PT. */ 1658 /* Get the mark. If it's not active, use PT. */
1658 1659
1659 mark = get_mark (); 1660 mark = get_mark ();
1661 *mark_active = true;
1660 1662
1661 if (mark == -1) 1663 if (mark == -1)
1662 mark = PT; 1664 {
1665 mark = PT;
1666 *mark_active = false;
1667 }
1663 1668
1664 /* Return the offsets. */ 1669 /* Return the offsets. */
1665 *start_return = start; 1670 *start_return = start;