   ;; to take explicit action.
   (and (boundp 'zmacs-region-stays)
        (setq zmacs-region-stays t)))
+
+(defsubst py-point (position)
+  ;; Returns the value of point at certain commonly referenced POSITIONs.
+  ;; POSITION can be one of the following symbols:
+  ;; 
+  ;; bol  -- beginning of line
+  ;; eol  -- end of line
+  ;; bod  -- beginning of defun
+  ;; boi  -- back to indentation
+  ;; 
+  ;; This function does not modify point or mark.
+  (let ((here (point)))
+    (cond
+     ((eq position 'bol) (beginning-of-line))
+     ((eq position 'eol) (end-of-line))
+     ((eq position 'bod) (beginning-of-python-def-or-class))
+     ((eq position 'bob) (beginning-of-buffer))
+     ((eq position 'eob) (end-of-buffer))
+     ((eq position 'boi) (back-to-indentation))
+     (t (error "unknown buffer position requested: %s" position))
+     )
+    (prog1
+	(point)
+      (goto-char here))))
+
+(defsubst py-highlight-line (from to file line)
+  (cond
+   ((fboundp 'make-extent)
+    ;; XEmacs
+    (let ((e (make-extent from to)))
+      (set-extent-property e 'mouse-face 'highlight)
+      (set-extent-property e 'py-exc-info (cons file line))
+      (set-extent-property e 'keymap py-mode-output-map)))
+   (t
+    ;; Emacs -- Please port this!
+    )
+   ))
 
  

	    ))
      (set-buffer curbuf))))


;;; Subprocess commands

;;;###autoload
(defun py-shell ()

  (setq comint-prompt-regexp "^>>> \\|^[.][.][.] ")
  (set-process-filter (get-buffer-process (current-buffer)) 'py-process-filter)
  (set-syntax-table py-mode-syntax-table)
  ;; set up keybindings for this subshell
  (local-set-key [tab]   'self-insert-command)
  (local-set-key "\C-c-" 'py-up-exception)
  (local-set-key "\C-c=" 'py-down-exception)
  )

(defun py-clear-queue ()
  "Clear the queue of temporary files waiting to execute."
