summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-09-12 08:18:15 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-09-12 08:18:56 -0700
commit6d6d9cd607601f41501b8f64230150ae26b8d500 (patch)
tree224cdc33e4cad3bb5d55fe1889ec4207705a50bb
parent6fdecd4a4988986c82203388d21e6d62908490d7 (diff)
* src/casefiddle.c (casify_word): Simplify.
-rw-r--r--src/casefiddle.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 59b5bbcf43..2d32f498d0 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -378,24 +378,12 @@ character positions to operate on. */)
static Lisp_Object
casify_word (enum case_action flag, Lisp_Object arg)
{
- Lisp_Object beg, end;
- ptrdiff_t newpoint;
- EMACS_INT iarg;
-
CHECK_NUMBER (arg);
- iarg = XINT (arg);
-
- newpoint = scan_words (PT, iarg);
- if (!newpoint)
- newpoint = iarg > 0 ? ZV : BEGV;
-
- XSETFASTINT (beg, PT);
- XSETFASTINT (end, newpoint);
- if (PT > newpoint)
- newpoint = PT;
-
- casify_region (flag, beg, end);
-
+ ptrdiff_t farend = scan_words (PT, XINT (arg));
+ if (!farend)
+ farend = XINT (arg) <= 0 ? BEGV : ZV;
+ ptrdiff_t newpoint = max (PT, farend);
+ casify_region (flag, make_number (PT), make_number (farend));
SET_PT (newpoint);
return Qnil;
}