Apr 4, 2012, 2:09:40 AM (8 years ago)

cocoa-ide/app-delegate.lisp: move MAYBE-FIXUP-APPLICATION-MENU here,
split it off from INITIALIZE-USER-INTERFACE, call it in delegate's
#/applicationWillFinishLaunching: method

cf-utils.lisp: don't depend on read-time behavior of #_ in macroexpansions.

cocoa-application.lisp: try to nuke command-line args when this file
is loaded (so that Cocoa doesn't try to process things like '-e
\(require \"COCOA-APPLICATION\"\)'.)

cocoa-backtrace.lisp: in COUNT-STACK-DESCRIPTOR-FRAME, only count
frames that satisfy CCL::FUNCTION-FRAME-P. (I believe that this is
correct for some fairly subtle reason that I don't remember ...)

cocoa-editor.lisp,cocoa-listener.lisp: better support multiple views/windows
on the same buffer. (The listener support should more-or-less work, but
there are secondary listener-specific issues.

Add an item to a Hemlock text view's context menu which offers to duplicate
the current window; that creates a new window/view hierarchy that shares
the text view's buffer and document but maintains view-specific selection
state. Windows and views created via this menu item are functionally
equvalent to the original; if the shared document is modified, the Cocoa
document architecture will offer to save it (on those OSX versions that
trust the appliance owner/user to make this sort of decision ...) when the
last window sharing the document is closed. (The last window needn't be
the original.) Listeners have state (streams) that refer to the original
window/view and closing that window/view before closing secondary windows
doesn't work; we need to either change how listener streams work or make
it hard to close the original window when duplicates of it still exist,
but I haven't done this.

The HEMLOCK-VIEW for a text view/echo-area view is maintained in a slot;
the idea's to make it a bit easier to embed multiple text views (which
may refer to multiple buffers) in a window (where the concept of "the
window's HEMLOCK-VIEW" may not apply.)

hemlock/src/command.lisp: a buffer's mark-ring is just a field referenced
by a BUFFER structure, not the value of a buffer-local Hemlock variable.

hemlock/src/killcoms.lisp: mark-ring changes, don't put any reasonable
number of consecutive Ds on the kill ring.

hemlock/src/lispmode.lisp: don't loop forever at end/beginning of buffer
in %LIST-OFFSET macro. Provide a terse description of the error in most
EDITOR-ERROR calls in this file.

hemlock/src/morecoms.lisp: mark-ring changes.

hemlock/src/struct.lisp: move some fields (-point, -%mark, the mark-ring,
the active region indicator) from BUFFER to a new SELECTION-INFO struct
that BUFFER references; redefine traditional accessors to indirect through
the SELECTION-INFO. (Views can maintain their own SELECTION-INFO; view-based
operations temporarily install the view's SELECTION-INFO in the buffer.)

Add a TEXTSTORAGE slot to BUFFER; the idea (NYI) is that buffers can have
Cocoa textstorage associated with them independent of the buffer's DOCUMENT

1 edited


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

    r15063 r15291  
    563563               (return nil))
    564564             (let ((ch (direction-char ,mark ,forwardp)))
     565               (unless ch (return nil))
    565566               (case (character-attribute :lisp-syntax ch)
    566567                 (:close-paren
    16751676            (count (or p 1)))
    16761677        (pre-command-parse-check point)
    1677         (unless (list-offset point count) (editor-error)))))
     1678        (unless (list-offset point count) (editor-error "No next list.")))))
    16791680(defcommand "Select Forward List" (p)
    16841685        (count (or p 1)))
    16851686    (pre-command-parse-check point)
    1686     (unless (list-offset point count) (editor-error))))
     1687    (unless (list-offset point count) (editor-error "No next list."))))
    16881689(defcommand "Backward List" (p)
    16941695        (count (- (or p 1))))
    16951696    (pre-command-parse-check point)
    1696     (unless (list-offset point count) (editor-error)))))
     1697    (unless (list-offset point count) (editor-error "No previous list.")))))
    16981699(defcommand "Select Backward List" (p)
    17031704        (count (- (or p 1))))
    17041705    (pre-command-parse-check point)
    1705     (unless (list-offset point count) (editor-error))))
     1706    (unless (list-offset point count) (editor-error "No previous list."))))
    17071708(defcommand "Forward Form" (p)
    17131714            (count (or p 1)))
    17141715        (pre-command-parse-check point)
    1715         (unless (form-offset point count) (editor-error)))))
     1716        (unless (form-offset point count) (editor-error "No next form.")))))
    17171718(defcommand "Select Forward Form" (p)
    17221723        (count (or p 1)))
    17231724    (pre-command-parse-check point)
    1724     (unless (form-offset point count) (editor-error))))
     1725    (unless (form-offset point count) (editor-error "No next form."))))
    17261727(defcommand "Backward Form" (p)
    17321733            (count (- (or p 1))))
    17331734        (pre-command-parse-check point)
    1734         (unless (form-offset point count) (editor-error)))))
     1735        (unless (form-offset point count) (editor-error "No previous form.")))))
    17361737(defcommand "Select Backward Form" (p)
    17411742        (count (- (or p 1))))
    17421743    (pre-command-parse-check point)
    1743     (unless (form-offset point count) (editor-error))))
     1744    (unless (form-offset point count) (editor-error "No previous form."))))
    17451746(defcommand "Mark Form" (p)
    17551756      (if (form-offset m count)
    17561757          (move-mark mark m)
    1757           (editor-error)))))
     1758          (editor-error "No next form.")))))
    17591760(defcommand "Mark Defun" (p)
    17821783    (pre-command-parse-check m1)
    17831784    (let ((count (or p 1)))
    1784       (unless (form-offset m1 count) (editor-error))
     1785      (unless (form-offset m1 count) (editor-error "No ~a form." (if (minusp count) "previous" "next")))
    17851786      (if (minusp count)
    17861787          (kill-region (region m1 m2) :kill-backward)
    18051806    (with-mark ((form-start point :right-inserting)
    18061807                (form-end point))
    1807       (unless (form-offset form-end 1) (editor-error))
     1808      (unless (form-offset form-end 1) (editor-error "No next form."))
    18081809      (form-offset (move-mark form-start form-end) -1)
    18091810      (with-mark ((containing-start form-start :left-inserting)
    18121813          (unless (and (forward-up-list containing-end)
    18131814                       (backward-up-list containing-start))
    1814             (editor-error)))
     1815            (editor-error "No containing list.")))
    18151816        (let ((r (copy-region (region form-start form-end))))
    18161817          (ring-push (delete-and-save-region
    18331834              :open-paren)
    18341835          (mark-after lend)
    1835           (unless (backward-up-list lstart) (editor-error)))
    1836       (unless (forward-up-list lend) (editor-error))
     1836          (unless (backward-up-list lstart) (editor-error "No containing list.")))
     1837      (unless (forward-up-list lend) (editor-error "No containing list."))
    18371838      (with-mark ((rstart lstart)
    18381839                  (rend lend))
    18641865            (with-mark ((e1 s1 :right-inserting)
    18651866                        (e2 s2 :right-inserting))
    1866               (unless (form-offset e1 1) (editor-error))
    1867               (unless (form-offset e2 1) (editor-error))
     1867              (unless (form-offset e1 1) (editor-error "No next form."))
     1868              (unless (form-offset e2 1) (editor-error "No next form."))
    18681869              (ninsert-region s1 (delete-and-save-region (region s2 e2)))
    18691870              (ninsert-region s2 (delete-and-save-region (region s1 e1))))))
    18731874                      (e2 point :right-inserting))
    18741875            (dotimes (i bcount)
    1875               (unless (form-offset s1 -1) (editor-error)))
     1876              (unless (form-offset s1 -1) (editor-error "No previous form.")))
    18761877            (dotimes (i fcount)
    1877               (unless (form-offset e2 1) (editor-error)))
     1878              (unless (form-offset e2 1) (editor-error "No next form.")))
    18781879            (with-mark ((e1 s1 :right-inserting)
    18791880                        (s2 e2 :left-inserting))
    19591960            (with-mark ((m point))
    19601961              (dotimes (i count (move-mark point m))
    1961                 (unless (forward-up-list m) (editor-error))))))))
     1962                (unless (forward-up-list m) (editor-error "No containing list."))))))))
    19631964(defcommand "Backward Up List" (p)
    19721973            (with-mark ((m point))
    19731974              (dotimes (i count (move-mark point m))
    1974                 (unless (backward-up-list m) (editor-error))))))))
     1975                (unless (backward-up-list m) (editor-error "No containing list."))))))))
    19881989                   do (unless (and (scan-char m :lisp-syntax :open-paren)
    19891990                                   (mark-after m))
    1990                         (editor-error))))
     1991                        (editor-error "No embedded list."))))
    19911992            (t
    19921993             (unless (and (rev-scan-char m :lisp-syntax :close-paren)
    19931994                          (mark-before m))
    1994                (editor-error))))
     1995               (editor-error "No embedded list."))))
    19951996      (move-mark point m))))
Note: See TracChangeset for help on using the changeset viewer.