# HG changeset patch # User Richard M. Stallman # Date 762980061 0 # Node ID c2d29681d218c6b5d6b3622edf6e4282bf35648c # Parent 42589aecdd5947a3fca1b8af1b481c00cc09964d (operate_on_word): Don't move point; store in *NEWPOINT. (Fupcase_word, Fdowncase_word, Fcapitalize_word): Set point after changing case. Rename opoint to beg. diff -r 42589aecdd59 -r c2d29681d218 src/casefiddle.c --- a/src/casefiddle.c Sun Mar 06 03:27:00 1994 +0000 +++ b/src/casefiddle.c Sun Mar 06 18:54:21 1994 +0000 @@ -187,19 +187,19 @@ } Lisp_Object -operate_on_word (arg) +operate_on_word (arg, newpoint) Lisp_Object arg; + int *newpoint; { Lisp_Object val; - int end, farend; + int farend; CHECK_NUMBER (arg, 0); farend = scan_words (point, XINT (arg)); if (!farend) farend = XINT (arg) > 0 ? ZV : BEGV; - end = point > farend ? point : farend; - SET_PT (end); + *newpoint = point > farend ? point : farend; XFASTINT (val) = farend; return val; @@ -212,10 +212,12 @@ (arg) Lisp_Object arg; { - Lisp_Object opoint; - - XFASTINT (opoint) = point; - casify_region (CASE_UP, opoint, operate_on_word (arg)); + Lisp_Object beg, end; + int newpoint; + XFASTINT (beg) = point; + end = operate_on_word (arg, &newpoint); + casify_region (CASE_UP, beg, end); + SET_PT (newpoint); return Qnil; } @@ -225,9 +227,12 @@ (arg) Lisp_Object arg; { - Lisp_Object opoint; - XFASTINT (opoint) = point; - casify_region (CASE_DOWN, opoint, operate_on_word (arg)); + Lisp_Object beg, end; + int newpoint; + XFASTINT (beg) = point; + end = operate_on_word (arg, &newpoint); + casify_region (CASE_DOWN, beg, end); + SET_PT (newpoint); return Qnil; } @@ -239,9 +244,12 @@ (arg) Lisp_Object arg; { - Lisp_Object opoint; - XFASTINT (opoint) = point; - casify_region (CASE_CAPITALIZE, opoint, operate_on_word (arg)); + Lisp_Object beg, end; + int newpoint; + XFASTINT (beg) = point; + end = operate_on_word (arg, &newpoint); + casify_region (CASE_CAPITALIZE, beg, end); + SET_PT (newpoint); return Qnil; }