Changeset 12400


Ignore:
Timestamp:
Jul 11, 2009, 2:51:03 AM (10 years ago)
Author:
mikel
Message:

Trac #501:

Fixed. when balanced-expressions-in-region fails to move forward by one form, it now tries to move forward by a line comment before giving up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/hemlock/src/listener.lisp

    r12399 r12400  
    159159(defvar lispbuf-eof '(nil))
    160160
     161(defun skip-line-comment (mark)
     162  ;; return t if we skipped a comment, nil otherwise
     163  (let ((cstart (to-line-comment mark ";")))
     164    (if cstart
     165        (progn (to-comment-end mark (string #\newline))
     166               t)
     167        nil)))
     168
    161169(defun balanced-expressions-in-region (region)
    162170  "Return true if there's at least one syntactically well-formed S-expression
     
    183191                (progn
    184192                  (pre-command-parse-check m)
    185                   (unless (form-offset m 1)
     193                  (unless (or (form-offset m 1)
     194                              (skip-line-comment m))
    186195                    (return nil))
    187196                  (setq skip-whitespace t))))))))))
     
    217226
    218227(defun send-input-region-to-lisp ()
    219   (let* ((input-region (get-interactive-input))
     228  (let* ((input-mark (value buffer-input-mark))
     229         (end-mark (region-end (buffer-region (current-buffer))))
     230         (input-region (region input-mark end-mark))
    220231         (r (if input-region
    221232                (region (copy-mark (region-start input-region))
    222233                        (copy-mark (region-end input-region) :right-inserting)))))
    223 
    224234    (when input-region
    225235      (insert-character (current-point-for-insertion) #\NewLine)
     
    232242          (append-font-regions (current-buffer))
    233243          (hemlock-ext:send-string-to-listener (current-buffer) string))))))
    234 
    235244
    236245(defun send-region-to-lisp (region)
Note: See TracChangeset for help on using the changeset viewer.