Changeset 780


Ignore:
Timestamp:
Apr 13, 2004, 12:22:55 PM (21 years ago)
Author:
Gary Byers
Message:

Better EVAL-REGION.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/hemlock/src/listener.lisp

    r736 r780  
    482482  "Evaluates lisp forms between the point and the mark in the editor Lisp."
    483483  (declare (ignore p))
    484   (eval-region (current-region)))
     484  (if (region-active-p)
     485    (eval-region (current-region))
     486    (let* ((point (current-point)))
     487      (pre-command-parse-check point)
     488      (when (valid-spot point nil)      ; not in the middle of a comment
     489        (cond ((eql (next-character point) #\()
     490               (with-mark ((m point))
     491                 (if (list-offset m 1)
     492                   (eval-region (region point m)))))
     493              ((eql (previous-character point) #\))
     494               (with-mark ((m point))
     495                 (if (list-offset m -1)
     496                   (eval-region (region m point))))))))))
    485497           
    486498(defcommand "Editor Re-evaluate Defvar" (p)
Note: See TracChangeset for help on using the changeset viewer.