Ignore:
Timestamp:
Sep 22, 2009, 12:51:14 AM (10 years ago)
Author:
gz
Message:

Make sure that all hemlock functions defined outside of hemlock are in the hemlock-ext package, to make it easier to keep track of them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r12856 r12859  
    21512151   frame))
    21522152
    2153 
    2154 (defun hi::lock-buffer (b)
    2155   (grab-lock (hi::buffer-lock b)))
    2156 
    2157 (defun hi::unlock-buffer (b)
    2158   (release-lock (hi::buffer-lock b)))
    2159 
    21602153(defun hemlock-ext:invoke-modifying-buffer-storage (buffer thunk)
    21612154  (assume-cocoa-thread)
     
    21732166        (buffer-document-begin-editing old)))))
    21742167
    2175 
    21762168(defun buffer-document-end-editing (buffer)
    21772169  (when buffer
     
    21942186  (slot-value (slot-value document 'textstorage) 'edit-count))
    21952187
    2196 (defun hi::buffer-edit-level (buffer)
     2188(defun buffer-edit-level (buffer)
    21972189  (if buffer
    21982190    (let* ((document (hi::buffer-document buffer)))
     
    22042196(defun hemlock-ext:invoke-allowing-buffer-display (buffer thunk)
    22052197  ;; Call THUNK with the buffer's edit-level at 0, then restore the buffer's edit level.
    2206   (let* ((level (hi::buffer-edit-level buffer)))
     2198  (let* ((level (buffer-edit-level buffer)))
    22072199    (dotimes (i level) (buffer-document-end-editing buffer))
    22082200    (unwind-protect
     
    22112203
    22122204
    2213 (defun hi::buffer-document-modified (buffer)
     2205(defun buffer-document-modified (buffer)
    22142206  (let* ((doc (hi::buffer-document buffer)))
    22152207    (if doc
     
    22362228
    22372229
    2238 (defun hi::buffer-note-font-change (buffer region font)
     2230(defun hemlock-ext:buffer-note-font-change (buffer region font)
    22392231  (when (hi::bufferp buffer)
    22402232    (let* ((document (hi::buffer-document buffer))
     
    22602252;; Note that inserted a string of length n at mark.  Assumes this is called after
    22612253;; buffer marks were updated.
    2262 (defun hi::buffer-note-insertion (buffer mark n)
     2254(defun hemlock-ext:buffer-note-insertion (buffer mark n)
    22632255  (when (hi::bufferp buffer)
    22642256    (let* ((document (hi::buffer-document buffer))
     
    22752267                                            n))))))
    22762268
    2277 (defun hi::buffer-note-modification (buffer mark n)
     2269(defun hemlock-ext:buffer-note-modification (buffer mark n)
    22782270  (when (hi::bufferp buffer)
    22792271    (let* ((document (hi::buffer-document buffer))
     
    22862278 
    22872279
    2288 (defun hi::buffer-note-deletion (buffer mark n)
     2280(defun hemlock-ext:buffer-note-deletion (buffer mark n)
    22892281  (when (hi::bufferp buffer)
    22902282    (let* ((document (hi::buffer-document buffer))
     
    25062498                (lisp-string-from-nsstring (nsstring-for-nsstring-encoding encoding)))))))
    25072499
    2508 (defun hi::buffer-encoding-name (buffer)
     2500(defun hemlock-ext:buffer-encoding-name (buffer)
    25092501  (let ((doc (hi::buffer-document buffer)))
    25102502    (and doc (document-encoding-name doc))))
     
    26902682    when buf collect buf))
    26912683
    2692 (defmethod hi::document-panes ((document hemlock-editor-document))
     2684(defmethod document-panes ((document hemlock-editor-document))
    26932685  (let* ((ts (slot-value document 'textstorage))
    26942686         (panes ()))
     
    30633055      result)))
    30643056 
    3065 (defun hi::open-document ()
     3057(defun hemlock-ext:open-hemlock-buffer (&key (pathname :prompt))
     3058  (assert (eq pathname :prompt)) ;; TODO: should handle pathname
    30663059  (#/performSelectorOnMainThread:withObject:waitUntilDone:
    30673060   (#/sharedDocumentController hemlock-document-controller)
    30683061   (@selector #/openDocument:) +null-ptr+ t))
    30693062 
    3070 (defmethod hi::save-hemlock-document ((self hemlock-editor-document))
     3063(defun hemlock-ext:save-hemlock-buffer (buffer &key pathname copy)
     3064  (let ((doc (hi::buffer-document buffer)))
     3065    (cond (copy
     3066           (assert (eq pathname :prompt)) ;; TODO: should handle pathname
     3067           (save-hemlock-document-as doc))
     3068          ((null pathname)
     3069           (save-hemlock-document doc))
     3070          (t
     3071           (assert (eq pathname :prompt)) ;; TODO: should handle pathname
     3072           (save-hemlock-document-to doc)))))
     3073
     3074(defmethod save-hemlock-document ((self hemlock-editor-document))
    30713075  (#/performSelectorOnMainThread:withObject:waitUntilDone:
    30723076   self (@selector #/saveDocument:) +null-ptr+ t))
    30733077
    3074 
    3075 (defmethod hi::save-hemlock-document-as ((self hemlock-editor-document))
     3078(defmethod save-hemlock-document-as ((self hemlock-editor-document))
    30763079  (#/performSelectorOnMainThread:withObject:waitUntilDone:
    30773080   self (@selector #/saveDocumentAs:) +null-ptr+ t))
    30783081
    3079 (defmethod hi::save-hemlock-document-to ((self hemlock-editor-document))
     3082(defmethod save-hemlock-document-to ((self hemlock-editor-document))
    30803083  (#/performSelectorOnMainThread:withObject:waitUntilDone:
    30813084   self (@selector #/saveDocumentTo:) +null-ptr+ t))
     
    31043107                  (#/setTitle: item new-title)
    31053108                  (#/release new-title))))))))))
    3106              
     3109
    31073110(defun initialize-user-interface ()
    31083111  ;; The first created instance of an NSDocumentController (or
     
    31623165    (#/setString:forType: pb string #&NSStringPboardType)))
    31633166   
    3164 (defun hi::string-to-clipboard (string)
     3167(defun hemlock-ext:string-to-clipboard (string)
    31653168  (when (> (length string) 0)
    31663169    (#/performSelectorOnMainThread:withObject:waitUntilDone:
     
    32843287    doc))
    32853288
    3286 (defun hi::revert-document (doc)
    3287   (#/performSelectorOnMainThread:withObject:waitUntilDone:
    3288    doc
    3289    (@selector #/revertDocumentToSaved:)
    3290    +null-ptr+
    3291    t))
     3289(defun hemlock-ext:revert-hemlock-buffer (buffer)
     3290  (let* ((doc (hi::buffer-document buffer)))
     3291    (when doc
     3292      (#/performSelectorOnMainThread:withObject:waitUntilDone:
     3293       doc
     3294       (@selector #/revertDocumentToSaved:)
     3295       +null-ptr+
     3296       t))))
    32923297
    32933298(defun hemlock-ext:raise-buffer-view (buffer &optional action)
Note: See TracChangeset for help on using the changeset viewer.