diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-03-06 18:54:21 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-03-06 18:54:21 +0000 |
commit | 34628a901f6b7f8ecd7ca08b3b39df153235f14b (patch) | |
tree | 0d1831796c057ae126954bbe7bbe798578839818 /src/casefiddle.c | |
parent | d6eac7d4685d3a8c94024dd403995a868b4f6d8a (diff) | |
download | emacs-34628a901f6b7f8ecd7ca08b3b39df153235f14b.tar.gz |
(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.
Diffstat (limited to 'src/casefiddle.c')
-rw-r--r-- | src/casefiddle.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c index 44ecab569d8..212780acb21 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -187,19 +187,19 @@ upcase_initials_region (b, e) } 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 @@ See also `capitalize-word'.") (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 @@ With negative argument, convert previous words but do not move.") (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 @@ With negative argument, capitalize previous words but do not move.") (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; } |