summaryrefslogtreecommitdiff
path: root/src/casefiddle.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-06 18:54:21 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-06 18:54:21 +0000
commit59cc25bf64917e54e7e4b0095da9049611db431c (patch)
tree066be069273e3d44b665be2bc19c18b3998e8b74 /src/casefiddle.c
parent6380cb665f875d07463721e8d904d2b5fdb510e8 (diff)
downloademacs-59cc25bf64917e54e7e4b0095da9049611db431c.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.c36
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;
}