Index: /branches/ide-1.0/ccl/hemlock/src/killcoms.lisp
===================================================================
--- /branches/ide-1.0/ccl/hemlock/src/killcoms.lisp	(revision 6659)
+++ /branches/ide-1.0/ccl/hemlock/src/killcoms.lisp	(revision 6660)
@@ -27,5 +27,5 @@
   "When set, some commands that affect the current region only work when the
    region is active."
-  :value nil)
+  :value t)
 
 (defhvar "Highlight Active Region"
@@ -78,4 +78,6 @@
 	(mark (current-mark)))
     (if (mark< mark point) (region mark point) (region point mark))))
+
+
 
 
@@ -356,12 +358,13 @@
   next to the text being killed."
   "Kill p words at the point"
-  (let ((point (current-point))
-	(num (or p 1)))
-    (with-mark ((mark point :temporary))
-      (if (word-offset mark num)
-	  (if (minusp num)
+  (let ((point (current-point-for-deletion)))
+    (when point
+      (let* ((num (or p 1)))
+        (with-mark ((mark point :temporary))
+          (if (word-offset mark num)
+            (if (minusp num)
 	      (kill-region (region mark point) :kill-backward)
 	      (kill-region (region point mark) :kill-forward))
-	  (editor-error)))))
+            (editor-error)))))))
 
 (defcommand "Kill Previous Word" (p)
@@ -379,29 +382,30 @@
   deletes that many lines past the point (or before if the prefix is negative)."
   "Kills p lines after the point."
-  (let* ((point (current-point))
-	 (line (mark-line point)))
-    (with-mark ((mark point))
-      (cond 
-       (p
-	(when (and (/= (mark-charpos point) 0) (minusp p))
-	  (incf p))
-	(unless (line-offset mark p 0)
-	  (if (plusp p)
-	      (kill-region (region point (buffer-end mark)) :kill-forward)
-	      (kill-region (region (buffer-start mark) point) :kill-backward))
-	  (editor-error))
-	(if (plusp p)
-	    (kill-region (region point mark) :kill-forward)
-	    (kill-region (region mark point) :kill-backward)))
-       (t
-	(cond ((not (blank-after-p mark))
-	       (line-end mark))
-	      ((line-next line)
-	       (line-start mark (line-next line)))
-	      ((not (end-line-p mark))
-	       (line-end mark))
-	      (t 
-	       (editor-error)))
-	(kill-region (region point mark) :kill-forward))))))
+  (let* ((point (current-point-for-deletion)))
+    (when point
+      (let* ((line (mark-line point)))
+        (with-mark ((mark point))
+          (cond 
+            (p
+             (when (and (/= (mark-charpos point) 0) (minusp p))
+               (incf p))
+             (unless (line-offset mark p 0)
+               (if (plusp p)
+                 (kill-region (region point (buffer-end mark)) :kill-forward)
+                 (kill-region (region (buffer-start mark) point) :kill-backward))
+               (editor-error))
+             (if (plusp p)
+               (kill-region (region point mark) :kill-forward)
+               (kill-region (region mark point) :kill-backward)))
+            (t
+             (cond ((not (blank-after-p mark))
+                    (line-end mark))
+                   ((line-next line)
+                    (line-start mark (line-next line)))
+                   ((not (end-line-p mark))
+                    (line-end mark))
+                   (t 
+                    (editor-error)))
+             (kill-region (region point mark) :kill-forward))))))))
 
 (defcommand "Backward Kill Line" (p)
@@ -413,12 +417,14 @@
   (if p
       (kill-line-command (- p))
-      (with-mark ((m (current-point)))
-	(cond ((zerop (mark-charpos m))
-	       (mark-before m)
-	       (unless (reverse-find-attribute m :space #'zerop)
-		 (buffer-start m)))
-	       (t
-		(line-start m)))
-	(kill-region (region m (current-point)) :kill-backward))))
+    (let* ((point (current-point-for-deletion)))
+      (when point
+        (with-mark ((m point))
+          (cond ((zerop (mark-charpos m))
+                 (mark-before m)
+                 (unless (reverse-find-attribute m :space #'zerop)
+                   (buffer-start m)))
+                (t
+                 (line-start m)))
+          (kill-region (region m (current-point)) :kill-backward))))))
 
 
@@ -429,30 +435,31 @@
   "Kill blank lines around the point"
   (declare (ignore p))
-  (let ((point (current-point)))
-    (with-mark ((beg-mark point :left-inserting)
-		(end-mark point :right-inserting))
-      ;; handle case when the current line is blank
-      (when (blank-line-p (mark-line point))
-	;; back up to last non-whitespace character
-	(reverse-find-attribute beg-mark :whitespace #'zerop)
-	(when (previous-character beg-mark)
-	  ;; that is, we didn't back up to the beginning of the buffer
-	  (unless (same-line-p beg-mark end-mark)
-	    (line-offset beg-mark 1 0)))
-	;; if isolated, zap the line else zap the blank ones above
-	(cond ((same-line-p beg-mark end-mark)
-	       (line-offset end-mark 1 0))
-	      (t
-	       (line-start end-mark)))
-	(delete-region (region beg-mark end-mark)))
-      ;; always delete all blank lines after the current line
-      (move-mark beg-mark point)
-      (when (line-offset beg-mark 1 0)
-	(move-mark end-mark beg-mark)
-	(find-attribute end-mark :whitespace #'zerop)
-	(when (next-character end-mark)
-	  ;; that is, we didn't go all the way to the end of the buffer
-	  (line-start end-mark))
-	(delete-region (region beg-mark end-mark))))))
+  (let ((point (current-point-for-deletion)))
+    (when point
+      (with-mark ((beg-mark point :left-inserting)
+                  (end-mark point :right-inserting))
+        ;; handle case when the current line is blank
+        (when (blank-line-p (mark-line point))
+          ;; back up to last non-whitespace character
+          (reverse-find-attribute beg-mark :whitespace #'zerop)
+          (when (previous-character beg-mark)
+            ;; that is, we didn't back up to the beginning of the buffer
+            (unless (same-line-p beg-mark end-mark)
+              (line-offset beg-mark 1 0)))
+          ;; if isolated, zap the line else zap the blank ones above
+          (cond ((same-line-p beg-mark end-mark)
+                 (line-offset end-mark 1 0))
+                (t
+                 (line-start end-mark)))
+          (delete-region (region beg-mark end-mark)))
+        ;; always delete all blank lines after the current line
+        (move-mark beg-mark point)
+        (when (line-offset beg-mark 1 0)
+          (move-mark end-mark beg-mark)
+          (find-attribute end-mark :whitespace #'zerop)
+          (when (next-character end-mark)
+            ;; that is, we didn't go all the way to the end of the buffer
+            (line-start end-mark))
+          (delete-region (region beg-mark end-mark)))))))
 
 
@@ -466,5 +473,5 @@
     (cond ((> (ring-length *kill-ring*) idx -1)
 	   (let* ((region (ring-ref *kill-ring* idx))
-		  (point (current-point))
+		  (point (current-point-for-insertion))
 		  (mark (copy-mark point)))
 	     (push-buffer-mark mark)
@@ -484,5 +491,5 @@
   called as a lisp function."
   (let ((point (current-point))
-	(mark (current-mark)))
+        (mark (current-mark)))
     (cond ((or (not (eq (last-command-type) :unkill))
 	       (zerop (ring-length *kill-ring*)))
