Ignore:
Timestamp:
Sep 20, 2013, 5:57:41 PM (8 years ago)
Author:
gz
Message:

Introduced a new convention: symbols exported from the HEMLOCK package are there for the IDE to use. Added a new hemlock file, display.lisp, which defines a set of such functions, mostly code that used to be in the IDE but had no actual Cocoa dependencies - we now have hemlock:update-current-package, hemlock:paren-matching-bounds, hemlock:selection-for-click, hemlock:move-point-for-click, and hemlock:compute-syntax-coloring.

New fn hemlock-ext:lookup-color maps a color description to a Cocoa color object. The current implementation is rudimentary, I'm hoping someone can make
it more real.

Extended hemlock:compute-syntax-coloring to add coloring for symbols. This fixes ticket:125.
To change how symbol colors get decided, you're most likely to want to modify some of:

hemlock::compute-symbol-category
hemlock::defining-symbol-p
hemlock::*lisp-code-colors*

File:
1 edited

Legend:

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

    r15493 r15906  
    478478             (if info
    479479                 (dolist (range (lisp-info-ranges-to-ignore info)
     480                                ;; if mark is at end of line, should check ending-quoted so can quote the newline...
    480481                                (values nil line))
    481482                   (let ((start (car range))
     
    877878                 (when (test-char (next-character mark) :lisp-syntax :symbol-quote)
    878879                   (return t))
    879                  (character-offset mark 2))
     880                 (unless (character-offset mark 2)
     881                   (return nil)))
    880882         (return nil))
    881883       (mark-after mark))
    882884      (:char-quote
    883        (character-offset mark 2))
     885       (unless (character-offset mark 2)
     886         (return nil)))
    884887      (t (return mark)))))
    885888
     
    21982201    (new-search-pattern :string-insensitive :backward "in-package" nil))
    21992202
    2200 (defun package-at-mark (start-mark)
     2203(defun package-at-mark (start-mark &optional return-mark)
    22012204  (let* ((pattern *previous-in-package-search-pattern*)
    22022205         (mark (copy-mark start-mark :temporary)))
     
    22252228                                   'in-package)))
    22262229                   (go again))
    2227                  (unless (form-offset end 1) (format t "~& worse") (return 4))
     2230                 (unless (form-offset end 1) (go again))
    22282231                 (move-mark start end)
    2229                  (form-offset start -1)
     2232                 (unless (form-offset start -1) (go again))
    22302233                 (return
    22312234                  (if (eql (next-character start) #\")
     
    22332236                      (character-offset start 1)
    22342237                      (character-offset end -1)
     2238                      (when return-mark (move-mark return-mark list-end))
    22352239                      (region-to-string (region start end)))
    2236                     (let* ((pkgname (ignore-errors (values (read-from-string (region-to-string (region start end)))))))
    2237                       (if pkgname
    2238                         (values (ignore-errors (string pkgname)))))))))))
     2240                     (let* ((pkgname (ignore-errors (read-from-string (region-to-string (region start end))))))
     2241                       (when (and pkgname (setq pkgname (ignore-errors (string pkgname))))
     2242                         (when return-mark (move-mark return-mark list-end))
     2243                         pkgname))))))))
    22392244         again)))))
    22402245
Note: See TracChangeset for help on using the changeset viewer.