[Openmcl-cvs-notifications] r12782 - in /trunk/source/contrib/foy/list-definitions-cm: ReadMe.rtf history-lists.lisp list-definitions.lisp

gfoy at clozure.com gfoy at clozure.com
Tue Sep 8 09:27:21 EDT 2009


Author: gfoy
Date: Tue Sep  8 09:27:21 2009
New Revision: 12782

Log:
Miscellaneous.

Modified:
    trunk/source/contrib/foy/list-definitions-cm/ReadMe.rtf
    trunk/source/contrib/foy/list-definitions-cm/history-lists.lisp
    trunk/source/contrib/foy/list-definitions-cm/list-definitions.lisp

Modified: trunk/source/contrib/foy/list-definitions-cm/ReadMe.rtf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/contrib/foy/list-definitions-cm/ReadMe.rtf (original)
+++ trunk/source/contrib/foy/list-definitions-cm/ReadMe.rtf Tue Sep  8 09:2=
7:21 2009
@@ -1,7 +1,7 @@
 {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460
 {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
 {\colortbl;\red255\green255\blue255;\red0\green79\blue175;\red11\green12\b=
lue197;}
-\margl1440\margr1440\vieww12020\viewh17080\viewkind0
+\margl1440\margr1440\vieww12200\viewh17600\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200=
\tx7920\tx8640\ql\qnatural\pardirnatural
 =

 \f0\b\fs28 \cf2 \ul \ulc3 List-Definitions-CM\cf3 \ulnone \
@@ -41,7 +41,6 @@
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200=
\tx7920\tx8640\ql\qnatural\pardirnatural
 \cf3 \
 \
-\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200=
\tx7920\tx8640\ql\qnatural\pardirnatural
 =

 \b \cf0 Setup:
 \b0 \

Modified: trunk/source/contrib/foy/list-definitions-cm/history-lists.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/contrib/foy/list-definitions-cm/history-lists.lisp (origin=
al)
+++ trunk/source/contrib/foy/list-definitions-cm/history-lists.lisp Tue Sep=
  8 09:27:21 2009
@@ -31,27 +31,9 @@
 (defParameter *position-history-list-length* 25)
 (defParameter *file-history-list-length* 25)
 =

-(export '(notify))
-
-;;; This includes a work-around for what appears to be a bug in the hemloc=
k-frame
-;;; #/close method.  After a #/close, the window remains on the (#/ordered=
Windows *NSApp*)
-;;; list, but (hi::buffer-document buffer) in NIL.  Therefore the extra te=
sts:
-(defun window-with-path (path)
-  "If a window with PATH is open, return it."
-  (gui::first-window-satisfying-predicate =

-   #'(lambda (w)
-       (when (and (typep w 'gui::hemlock-frame)
-                  (not (typep w 'gui::hemlock-listener-frame)))
-         (let* ((pane (slot-value w 'gui::pane))
-                (text-view (gui::text-pane-text-view pane))
-                (buffer (gui::hemlock-buffer text-view))
-                (document (when buffer (hi::buffer-document buffer)))
-                (p (hi::buffer-pathname buffer)))
-           (when (and document p) (string-equal path p)))))))
-
 (defun maybe-open-file (path)
   "If a window with PATH is open, return it.  Otherwise open a new window."
-  (let ((w (window-with-path path)))
+  (let ((w (cmenu:window-with-path path)))
     (if w =

       w
       (let ((hemlock-view (gui::cocoa-edit path)))
@@ -64,9 +46,6 @@
                                   filename)
                      (hemlock::user-homedir-pathname)))
 =

-(defun notify (message)
-  "FYI"
-  (gui::alert-window :title "Notification" :message message))
 =

 ;;; ----------------------------------------------------------------------=
------
 ;;;
@@ -85,10 +64,10 @@
   "Display the file and scroll to position."
   (let* ((name (hle-name entry))
          (path (hle-path entry))
-         (window (window-with-path path))
+         (window (cmenu:window-with-path path))
          mark def-list text-view hemlock-view)
     (unless (probe-file path)
-      (notify (format nil "~a does not exist.  It will be deleted from the=
 history lists."
+      (cmenu:notify (format nil "~a does not exist.  It will be deleted fr=
om the history lists."
                       path))
       (purge-file-references *position-history-list* path)
       (remove-path *file-history-list* path)
@@ -116,7 +95,7 @@
              (display-position text-view mark)
              (move-entry-to-front *file-history-list* path) t)
             (t =

-             (notify (format nil "Cannot find ~S.  It will be deleted from=
 the position history list." =

+             (cmenu:notify (format nil "Cannot find ~S.  It will be delete=
d from the position history list." =

                              name))
              (remove-entry *position-history-list* name) nil)))))
 =

@@ -129,11 +108,11 @@
 (defMethod show-entry ((entry file-list-entry))
   (let ((path (hle-path entry)))
     (unless (probe-file path)
-      (notify (format nil "~S does not exist.  It will be deleted from the=
 history lists." path))
+      (cmenu:notify (format nil "~S does not exist.  It will be deleted fr=
om the history lists." path))
       (purge-file-references *position-history-list* path)
       (remove-path *file-history-list* path)
       (return-from show-entry nil))
-    (let ((window (window-with-path path))) =

+    (let ((window (cmenu:window-with-path path))) =

       (unless window =

         (let ((hemlock-view (gui::cocoa-edit path)))
           (when hemlock-view =

@@ -425,7 +404,7 @@
 =

 (defMethod read-history-list ((hl history-list) stream &optional position-=
p)
   (flet ((oops ()
-           (notify (format nil "There is a problem with ~S. Setting the hi=
story to NIL." (hl-path hl)))
+           (cmenu:notify (format nil "There is a problem with ~S. Setting =
the history to NIL." (hl-path hl)))
            (setf (hl-list hl) nil)
            ;;; delete the file?
            (return-from read-history-list)))
@@ -493,7 +472,7 @@
 ;;; File History Interface:
 ;;; =

 (objc:defmethod (#/becomeKeyWindow :void) ((w gui::hemlock-frame))
-  (let* ((path (window-path w))
+  (let* ((path (cmenu:window-path w))
          (name (when (and path (string-equal (pathname-type path) "lisp"))
                  (concatenate 'string (pathname-name path) ".lisp"))))
     (when (and name path)

Modified: trunk/source/contrib/foy/list-definitions-cm/list-definitions.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/contrib/foy/list-definitions-cm/list-definitions.lisp (ori=
ginal)
+++ trunk/source/contrib/foy/list-definitions-cm/list-definitions.lisp Tue =
Sep  8 09:27:21 2009
@@ -2,7 +2,7 @@
 =

 ;;; ----------------------------------------------------------------------=
------
 ;;;
-;;;      list-definitionsisp
+;;;      list-definitions.lisp
 ;;;
 ;;;      copyright (c) 2009 Glen Foy
 ;;;      (Permission is granted to Clozure Associates to distribute this f=
ile.)
@@ -32,7 +32,7 @@
 =

 (require :context-menu-cm)
 =

-(export '(find-and-display-definition))
+(export '(find-and-display-definition window-path active-hemlock-window))
 =

 (defParameter *objc-defmethod-search-pattern* (hi::new-search-pattern :str=
ing-insensitive :forward "(objc:defmethod"))
 (defParameter *def-search-pattern* (hi::new-search-pattern :string-insensi=
tive :forward "(def"))
@@ -44,21 +44,6 @@
 (defVar *file-history-list* nil "The file-history-list instance.")
 =

 (defmacro clone (mark) `(hi::copy-mark ,mark :temporary))
-
-(defun active-hemlock-window ()
-  "Return the active hemlock-frame."
-  (gui::first-window-satisfying-predicate =

-   #'(lambda (w)
-       (and (typep w 'gui::hemlock-frame)
-            (not (typep w 'gui::hemlock-listener-frame))
-            (#/isKeyWindow w)))))
-
-(defun window-path (w)
-  "Return the window's path."
-  (let* ((pane (slot-value w 'gui::pane))
-         (hemlock-view (when pane (gui::text-pane-hemlock-view pane)))
-         (buffer (when hemlock-view (hi::hemlock-view-buffer hemlock-view)=
)))
-    (when buffer (hi::buffer-pathname buffer))))
 =

 ;;; ----------------------------------------------------------------------=
------
 ;;; =

@@ -148,8 +133,8 @@
   (let* ((menu (make-instance 'list-definitions-menu =

                  :sub-title (if alpha-p "alphabetical" "positional")
                  :menu-text-view text-view =

-                 :menu-path (window-path (#/window text-view))))
-         (window (active-hemlock-window))
+                 :menu-path (cmenu:window-path (#/window text-view))))
+         (window (cmenu:active-hemlock-window))
          (alist (when window (list-definitions window alpha-p)))
          (class-icon (#/iconForFileType: (#/sharedWorkspace ns:ns-workspac=
e) (ccl::%make-nsstring "lisp")))
          current-class menu-item)
@@ -366,10 +351,10 @@
 ;;; This is used by the Hemlock-Commands tool.  =

 (defun find-and-display-definition (name path)
   "Display the file and scroll to the definition position."
-  (let ((window (window-with-path path))
+  (let ((window (cmenu:window-with-path path))
          mark def-list text-view hemlock-view)
     (unless (probe-file path)
-      (notify (format nil "~a does not exist."
+      (cmenu:notify (format nil "~a does not exist."
                       path))
       (return-from find-and-display-definition nil))
     (cond (window =




More information about the Openmcl-cvs-notifications mailing list