Changeset 12859


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

Location:
trunk/source/cocoa-ide
Files:
13 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)
  • trunk/source/cocoa-ide/cocoa-listener.lisp

    r12787 r12859  
    667667    (enqueue-listener-input (cocoa-listener-process-input-stream process) string)))
    668668
    669 
    670 (defun hemlock::evaluate-input-selection (selection)
    671   (ccl::application-ui-operation *application* :eval-selection selection))
    672  
    673669(defmethod ui-object-choose-listener-for-selection ((app ns:ns-application)
    674670                                                    selection)
  • trunk/source/cocoa-ide/hemlock/src/charprops.lisp

    r12805 r12859  
    479479      (let ((n (count-characters (region start-mark end-mark)))
    480480            (buffer (line-%buffer start-line)))
    481         (buffer-note-modification buffer mark n)))))
     481        (hemlock-ext:buffer-note-modification buffer mark n)))))
    482482
    483483(defun find-line-charprop-value (line name value &key (start 0) end)
  • trunk/source/cocoa-ide/hemlock/src/cocoa-hemlock.lisp

    r8428 r12859  
    8383;;; Clipboard
    8484(defun region-to-clipboard (region)
    85   (string-to-clipboard (region-to-string region)))
     85  (hemlock-ext:string-to-clipboard (region-to-string region)))
    8686
  • trunk/source/cocoa-ide/hemlock/src/filecoms.lisp

    r12234 r12859  
    354354   version, whichever is more recent."
    355355  (declare (ignore p))
    356   (let* ((doc (hi::buffer-document (current-buffer))))
    357     (when doc
    358       (hi::revert-document doc)))
     356  (hemlock-ext:revert-hemlock-buffer (current-buffer))
    359357  (clear-echo-area))
    360358
     
    370368  (declare (ignore p))
    371369  (hi::allowing-buffer-display ((current-buffer))
    372     (hi::open-document)))
     370    (hemlock-ext:open-hemlock-buffer :pathname :prompt)))
    373371 
    374372
     
    572570 
    573571(defcommand "Write File" (p &optional (buffer (current-buffer)))
    574   "Writes the contents of Buffer, which defaults to the current buffer to
    575   the file named by Pathname.  The prefix argument is ignored."
    576   "Prompts for a file to write the contents of the current Buffer to.
     572  "Prompts for a filename, changes the buffer pathname to it and saves it.
    577573  The prefix argument is ignored."
    578574  (declare (ignore p))
    579   (let* ((document (hi::buffer-document buffer)))
    580     (when document
    581       (hi::save-hemlock-document-as document))))
     575  (hemlock-ext:save-hemlock-buffer buffer :pathname :prompt))
    582576
    583577(defcommand "Save To File" (p &optional (buffer (current-buffer)))
    584   "Writes the contents of Buffer, which defaults to the current buffer to
    585   the file named by Pathname.  The prefix argument is ignored."
    586   "Prompts for a file to write the contents of the current Buffer to.
     578  "Prompts for a filename and writes a copy of the buffer to it.  Buffer's
     579   pathname (and modified state) is unchanged.
    587580  The prefix argument is ignored."
    588581  (declare (ignore p))
    589   (let* ((document (hi::buffer-document buffer)))
    590     (when document
    591       (hi::save-hemlock-document-to document))))
     582  (hemlock-ext:save-hemlock-buffer buffer :pathname :prompt :copy t))
    592583
    593584(defcommand "Save File" (p &optional (buffer (current-buffer)))
     
    597588  (declare (ignore p))
    598589  (when (buffer-modified buffer)
    599     (let* ((document (hi::buffer-document buffer)))
    600       (when document
    601         (hi::save-hemlock-document document)))))
     590    (hemlock-ext:save-hemlock-buffer buffer)))
    602591
    603592(defhvar "Save All Files Confirm"
  • trunk/source/cocoa-ide/hemlock/src/font.lisp

    r8428 r12859  
    3838    (push font-end (line-marks end-line))
    3939    (add-buffer-font-region buffer region)
    40     (buffer-note-font-change buffer region font)
     40    (hemlock-ext:buffer-note-font-change buffer region font)
    4141    region))
    4242
  • trunk/source/cocoa-ide/hemlock/src/htext2.lisp

    r12275 r12859  
    202202             (setf (char (the simple-string (current-open-chars)) (current-right-open-pos))
    203203                   character)
    204              (hi::buffer-note-modification buffer mark 1)))))
     204             (hemlock-ext:buffer-note-modification buffer mark 1)))))
    205205  character)
    206206
  • trunk/source/cocoa-ide/hemlock/src/htext3.lisp

    r12539 r12859  
    118118               (incf (current-left-open-pos))))))
    119119      (adjust-line-origins-forward line)
    120       (buffer-note-insertion buffer mark 1))))
     120      (hemlock-ext:buffer-note-insertion buffer mark 1))))
    121121
    122122
     
    172172              (setf (current-left-open-pos) new))))
    173173          (adjust-line-origins-forward line)
    174           (buffer-note-insertion buffer mark (length string)))))))
     174          (hemlock-ext:buffer-note-insertion buffer mark (length string)))))))
    175175
    176176
     
    255255            (setf (line-next previous) new-line  previous new-line))
    256256          (adjust-line-origins-forward line)
    257           (buffer-note-insertion buffer  mark nins)))))))
     257          (hemlock-ext:buffer-note-insertion buffer  mark nins)))))))
    258258
    259259
     
    338338            (+ last-charpos (- this-charpos charpos)))
    339339          (adjust-line-origins-forward line)
    340           (buffer-note-insertion buffer mark nins)))))))
     340          (hemlock-ext:buffer-note-insertion buffer mark nins)))))))
    341341
    342342(defun paste-characters (position count string)
  • trunk/source/cocoa-ide/hemlock/src/htext4.lisp

    r12696 r12859  
    5555                                 pos)))))
    5656          (adjust-line-origins-forward line)
    57           (buffer-note-deletion buffer mark n)
     57          (hemlock-ext:buffer-note-deletion buffer mark n)
    5858          t)))
    5959     
     
    145145                   (when next (setf (line-previous next) first-line))))))
    146146        (adjust-line-origins-forward first-line)
    147         (buffer-note-deletion buffer start ndel)))))
     147        (hemlock-ext:buffer-note-deletion buffer start ndel)))))
    148148
    149149
     
    265265                       (mark last-line last-charpos :left-inserting))))))
    266266          (adjust-line-origins-forward first-line)
    267           (buffer-note-deletion buffer start ndel)))))))
     267          (hemlock-ext:buffer-note-deletion buffer start ndel)))))))
    268268
    269269
     
    450450                        (setf (mark-line m) start-line)
    451451                        (push m (line-marks start-line)))))))))
    452     (hi::buffer-note-modification buffer origin count)
     452    (hemlock-ext:buffer-note-modification buffer origin count)
    453453    (delete-mark origin)
    454454    region))
  • trunk/source/cocoa-ide/hemlock/src/listener.lisp

    r12663 r12859  
    587587                    (package (variable-value 'current-package :buffer (current-buffer)))
    588588                    (path (buffer-pathname (current-buffer))))
    589   (evaluate-input-selection
    590    (list package path (region-to-string region) (mark-absolute-position (region-start region)))))
     589  (ccl::application-ui-operation ccl:*application*
     590                                 :eval-selection
     591                                 (list package
     592                                       path
     593                                       (region-to-string region)
     594                                       (mark-absolute-position (region-start region)))))
    591595
    592596
  • trunk/source/cocoa-ide/hemlock/src/modeline.lisp

    r12323 r12859  
    8686                         ((:cr) "CR")
    8787                         ((:crlf) "CRLF")))
    88                       (encoding-name (or (buffer-encoding-name buffer)
     88                      (encoding-name (or (hemlock-ext:buffer-encoding-name buffer)
    8989                                         "Default")))
    9090                 (format nil "[~a~@[ ~a~]] "
     
    122122 :function #'(lambda (buffer)
    123123               "Returns \"* \" if buffer is modified, or \"  \"."
    124                (let ((modifiedp (buffer-document-modified buffer)))
     124               (let ((modifiedp (buffer-modified buffer)))
    125125                 (if modifiedp
    126126                     "* "
  • trunk/source/cocoa-ide/hemlock/src/morecoms.lisp

    r11838 r12859  
    113113        (when (alpha-char-p ch)
    114114          (setf (next-character start) (char-upcase ch))
    115           (hi::buffer-note-modification (current-buffer) start 1)
     115          ;; Yikes!  Somebody should do this at a lower level!
     116          (hemlock-ext:buffer-note-modification (current-buffer) start 1)
    116117          (mark-after start)
    117118          (filter-region #'string-downcase region)
  • trunk/source/cocoa-ide/hemlock/src/package.lisp

    r12858 r12859  
    364364   #:invoke-allowing-buffer-display
    365365   #:note-selection-set-by-search
     366   #:buffer-note-font-change
     367   #:buffer-note-insertion
     368   #:buffer-note-modification
     369   #:buffer-note-deletion
     370   #:buffer-encoding-name
    366371   #:scroll-view
    367372   #:ensure-selection-visible
     
    374379   #:read-only-listener-p
    375380   #:all-hemlock-views
     381   #:open-hemlock-buffer
     382   #:save-hemlock-buffer
     383   #:revert-hemlock-buffer
    376384   #:open-sequence-dialog
    377385   #:execute-in-file-view
     
    380388   #:buffer-process-description
    381389   #:raise-buffer-view
     390   #:string-to-clipboard
    382391   ))
    383392
Note: See TracChangeset for help on using the changeset viewer.