[Openmcl-cvs-notifications] r16244 - in /trunk/source/cocoa-ide/hemlock/src: macros.lisp package.lisp vars.lisp

gz at clozure.com gz at clozure.com
Thu Sep 25 17:24:27 UTC 2014


Author: gz
Date: Thu Sep 25 17:24:27 2014
New Revision: 16244

Log:
Try to add support for meta-. on hemlock variables and commands.  Sort of w=
orks if you know what to do (which is to enter strings) but clearly not ide=
al

Modified:
    trunk/source/cocoa-ide/hemlock/src/macros.lisp
    trunk/source/cocoa-ide/hemlock/src/package.lisp
    trunk/source/cocoa-ide/hemlock/src/vars.lisp

Modified: trunk/source/cocoa-ide/hemlock/src/macros.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/cocoa-ide/hemlock/src/macros.lisp	(original)
+++ trunk/source/cocoa-ide/hemlock/src/macros.lisp	Thu Sep 25 17:24:27 2014
@@ -169,7 +169,23 @@
       `(setf ,place (delete ,hook-fun ,place))))
 =

 =

-=0C
+;; Meta-point etc. support
+(ccl::define-definition-type hemlock-command (ccl::function-definition-typ=
e))
+
+;; This is also used as test of whether the dt applies to name.
+(defmethod ccl::definition-base-name ((dt hemlock-command-definition-type)=
 name)
+  (declare (special *command-names*))
+  (let ((entry (and (stringp name) (getstring name *command-names*))))
+    (and entry (command-function entry))))
+
+(defmethod ccl::definition-bound-p ((dt hemlock-command-definition-type) n=
ame)
+  (declare (special *command-names*))
+  (getstring name *command-names*))
+
+(defmethod ccl::definition-same-p ((dt hemlock-command-definition-type) na=
me1 name2)
+  (equalp name1 name2))
+
+
 ;;;; DEFCOMMAND.
 =

 ;;; Defcommand  --  Public
@@ -218,6 +234,7 @@
     `(eval-when (:load-toplevel :execute)
        (defun ,function-name ,lambda-list ,function-doc
               , at forms)
+       (ccl:record-source-file ,command-name 'hemlock-command)
        (make-command ,command-name ,command-doc ',function-name , at extra-ar=
gs)
        ',function-name)))
 =


Modified: trunk/source/cocoa-ide/hemlock/src/package.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/cocoa-ide/hemlock/src/package.lisp	(original)
+++ trunk/source/cocoa-ide/hemlock/src/package.lisp	Thu Sep 25 17:24:27 2014
@@ -468,7 +468,7 @@
 =

    ;; from macros.lisp
    #:invoke-hook #:value #:setv #:hlet #:string-to-variable #:add-hook #:r=
emove-hook
-   #:defcommand #:with-mark #:use-buffer #:editor-error
+   #:hemlock-command #:defcommand #:with-mark #:use-buffer #:editor-error
    #:editor-error-format-string #:editor-error-format-arguments #:do-strin=
gs
    #:command-case #:reprompt #:with-output-to-mark #:with-input-from-region
    #:handle-lisp-errors #:with-pop-up-display
@@ -613,7 +613,7 @@
 =

    ;; vars.lisp
    #:variable-value #:variable-hooks #:variable-documentation #:variable-n=
ame
-   #:hemlock-bound-p #:defhvar #:delete-variable
+   #:hemlock-variable #:hemlock-bound-p #:defhvar #:delete-variable
 =

    #:input-stream-reading-line
 =

@@ -631,6 +631,8 @@
    #:move-point-for-click
    #:edit-definition
    #:*isearch-is-global*
+   #:hemlock-command
+   #:hemlock-variable
    ))
 =

 =


Modified: trunk/source/cocoa-ide/hemlock/src/vars.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/cocoa-ide/hemlock/src/vars.lisp	(original)
+++ trunk/source/cocoa-ide/hemlock/src/vars.lisp	Thu Sep 25 17:24:27 2014
@@ -153,6 +153,21 @@
 =

 (declaim (special *global-variable-names*))
 =

+(ccl::define-definition-type hemlock-variable ())
+
+(defmethod ccl::definition-base-name ((dt hemlock-variable-definition-type=
) name)
+  (and (stringp name)
+       (or (getstring name *global-variable-names*)
+           ;; Yeah, should check for different syms in different modes, bu=
t in practice there aren't
+           ;; any because we always use string-to-variable
+           (loop for mode-obj in (string-table-values *mode-names*)
+		;; mode-obj is nil at startup, while creating first mode
+	        thereis (and mode-obj (getstring name (mode-object-variables mode=
-obj)))))))
+
+(defmethod ccl::definition-same-p ((dt hemlock-variable-definition-type) n=
ame1 name2)
+  (equalp name1 name2))
+
+
 ;;; DEFHVAR  --  Public
 ;;;
 ;;;    Define a Hemlock variable somewhere.
@@ -160,6 +175,9 @@
 (defun defhvar (name documentation &key mode buffer (hooks nil hook-p)
 		     (value nil value-p))
   (let* ((symbol-name (string-to-variable name)) var)
+    ;; Unfortunately this is used both at toplevel and at runtime.  make a=
 guess.
+    (when (and ccl:*loading-file-source-file* (not buffer))
+      (ccl:record-source-file name 'hemlock-variable))
     (cond
      (mode
       (let* ((mode-obj (get-mode-object mode)))



More information about the Openmcl-cvs-notifications mailing list