* field-beginning ignores ESCAPE-FROM-EDGE
@ 2006-04-15 19:31 Lars Hansen
0 siblings, 0 replies; only message in thread
From: Lars Hansen @ 2006-04-15 19:31 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 223 bytes --]
field-beginning ignores ESCAPE-FROM-EDGE when POS is at a field
beginning. The attached patch fixes the bug and corrects the description
(comment) of find_field.
If there are no objections, I will install in about a week.
[-- Attachment #2: editfns.diff --]
[-- Type: text/x-patch, Size: 3035 bytes --]
*** editfns.c.~1.412.~ 2006-04-11 23:32:35.000000000 +0200
--- editfns.c 2006-04-14 16:41:37.000000000 +0200
***************
*** 491,514 ****
}
/* Find the field surrounding POS in *BEG and *END. If POS is nil,
! the value of point is used instead. If BEG or END null,
means don't store the beginning or end of the field.
BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
results; they do not effect boundary behavior.
! If MERGE_AT_BOUNDARY is nonzero, then if POS is at the very first
! position of a field, then the beginning of the previous field is
! returned instead of the beginning of POS's field (since the end of a
! field is actually also the beginning of the next input field, this
! behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY
true case, if two fields are separated by a field with the special
value `boundary', and POS lies within it, then the two separated
fields are considered to be adjacent, and POS between them, when
! finding the beginning and ending of the "merged" field.
!
! Either BEG or END may be 0, in which case the corresponding value
! is not stored. */
static void
find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end)
--- 491,511 ----
}
/* Find the field surrounding POS in *BEG and *END. If POS is nil,
! the value of point is used instead. If BEG or END is null,
means don't store the beginning or end of the field.
BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
results; they do not effect boundary behavior.
! If MERGE_AT_BOUNDARY is nonzero, then if POS is at the very last
! position of a field, then the end of the next field is returned
! instead of the end of POS's field (since the end of a field is
! actually also the beginning of the next input field, this behavior
! is sometimes useful). Additionally in the MERGE_AT_BOUNDARY
true case, if two fields are separated by a field with the special
value `boundary', and POS lies within it, then the two separated
fields are considered to be adjacent, and POS between them, when
! finding the beginning and ending of the "merged" field. */
static void
find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end)
***************
*** 674,682 ****
(pos, escape_from_edge, limit)
Lisp_Object pos, escape_from_edge, limit;
{
! int beg;
! find_field (pos, escape_from_edge, limit, &beg, Qnil, 0);
! return make_number (beg);
}
DEFUN ("field-end", Ffield_end, Sfield_end, 0, 3, 0,
--- 671,681 ----
(pos, escape_from_edge, limit)
Lisp_Object pos, escape_from_edge, limit;
{
! int beg, end;
! find_field (pos, escape_from_edge, limit, &beg, Qnil, &end);
! return make_number (NILP (escape_from_edge)
! && XFASTINT (pos) == end
! && end != ZV ? end : beg);
}
DEFUN ("field-end", Ffield_end, Sfield_end, 0, 3, 0,
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-15 19:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-15 19:31 field-beginning ignores ESCAPE-FROM-EDGE Lars Hansen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).