[Gd-chatter] r11753 - trunk/gwydion/tools/elisp

andreas at gwydiondylan.org andreas at gwydiondylan.org
Wed Mar 26 03:41:13 CET 2008


Author: andreas
Date: Wed Mar 26 03:41:12 2008
New Revision: 11753

Added:
   trunk/gwydion/tools/elisp/slime-dylan.el   (contents, props changed)
Modified:
   trunk/gwydion/tools/elisp/dylan-mode.el
Log:
Job: minor
 * fix regular expression for module
 * add hooks for argument completion (on '(', ',', ' '))


Modified: trunk/gwydion/tools/elisp/dylan-mode.el
==============================================================================
--- trunk/gwydion/tools/elisp/dylan-mode.el	(original)
+++ trunk/gwydion/tools/elisp/dylan-mode.el	Wed Mar 26 03:41:12 2008
@@ -1575,11 +1575,11 @@
 
 (defun dylan-find-slime-buffer-package ()
   (let ((case-fold-search t)
-        (regexp "^[mM]odule:[ \t]+\\([^ \n\r\t]+\\)"))
+        (regexp "^module:[ \t]*\\([^ \n\r\t]+\\)"))
     (save-excursion
       (when (or (re-search-backward regexp nil t)
                 (re-search-forward regexp nil t))
-        (match-string 1)))))
+        (match-string-no-properties 1)))))
 
 
 (defun dylan-mode-init-variables ()

Added: trunk/gwydion/tools/elisp/slime-dylan.el
==============================================================================
--- (empty file)
+++ trunk/gwydion/tools/elisp/slime-dylan.el	Wed Mar 26 03:41:12 2008
@@ -0,0 +1,36 @@
+;;;; Arglist Display
+
+(defun slime-dylan-arglist-magic (n)
+  "Insert a space and print some relevant information (function arglist).
+Designed to be bound to the SPC key.  Prefix argument can be used to insert
+more than one space."
+  (interactive "p")
+  (self-insert-command n)
+  (when (and slime-space-information-p
+             (slime-background-activities-enabled-p))
+    (slime-dylan-show-arglist)))
+
+(defun slime-dylan-show-arglist ()
+  (let ((op (slime-dylan-operator-before-point)))
+    (when op 
+      (slime-eval-async `(swank:operator-arglist ,op ,(slime-current-package))
+			(lambda (arglist)
+			  (when arglist
+			    (slime-message "%s" arglist)))))))
+
+(defun slime-dylan-operator-before-point ()
+  (ignore-errors 
+    (save-excursion
+      (backward-up-list 1)
+      (backward-sexp 1)
+      (slime-symbol-name-at-point))))
+
+(defun slime-dylan-init ()
+  (add-hook 'dylan-mode-hook 'slime-dylan-bind-keys))
+
+(defun slime-dylan-bind-keys ()
+  (define-key slime-mode-map (kbd "SPC") 'slime-dylan-arglist-magic)
+  (local-set-key (kbd ",") 'slime-dylan-arglist-magic)
+  (local-set-key (kbd "(") 'slime-dylan-arglist-magic))
+
+(provide 'slime-dylan)
\ No newline at end of file



More information about the chatter mailing list