[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DrScheme as Emacs-like kitchen sink



   The actual editor that DrScheme users see is inflexible. As
   Matthias, Shriram, and Robby have pointed out, the inflexibility
   intentional, in the same way that the restrictions in the default
   language are intentional. But there's no reason that the editor
   couldn't grow with a user, in the same way that language levels do.

Thanks, Matthew.  I like that.  Just make sure I got it: it's
intentional that there's nothing like a .emacs file for users to stick
their customizations in?  However, we can with tools define levels
where such customizations exist?

Here are some Scheme changes that I want that I think you would be
interested in.  I kinda struck out on "general purpose editor", but
there are definite Scheme improvements that I'd like to see in
DrScheme--I'm happy to keep them out of the core editor--but let me
give you some wish-listing, just for Scheme editing:

*********** feature request 1: more key bindings *********** 

I need more function key bindings.  PageUp & PageDown work, but not
Home & End.  I can't imagine why you wouldn't put those bindings in
the core editor.  But I want other bindings, less suitable for the
core editor:

Esc-Shift-Left selects the next expression.   That's a great binding!
But maybe I'd like to put it on a function key, like KP_4.

I definitely want to bind KP_5 to C-l.  

I want to bind right-mouse to what left-mouse does.

Put it another way, the mouse in DrScheme works basically like it does
in XEmacs, and not the way it works in Emacs.  That's great for XEmacs
folks, and tough on Emacs folks.  I don't think it would be untoward
to have a menu item to click in Preferences Emacs vs XEmacs mouse.

But even if you don't want to do that, it's definitely something I
need to figure out how to do.

*********** feature request 2:  multiple indentation styles *********** 

My rap on Latex mode didn't grab anyone, but I can easily restate it
in Scheme terms: DrScheme ought to support multiple indentation
styles.  I don't know how many Scheme styles there are (maybe not as
many as C indentation styles), but I know that Emacs supports:

   ;;;; MIT Scheme specific indentation.

   (if scheme-mit-dialect
       (progn
	 (put 'fluid-let 'scheme-indent-function 1)
	 (put 'in-package 'scheme-indent-function 1)
	 (put 'local-declare 'scheme-indent-function 1)

Now you all know whether MIT Scheme uses a different indentation style
than DrScheme, but I'm taking this as evidence for it.

OK, now in the basic inflexible core editor, maybe you don't want to
offer multiple indentation styles.  I'd think it'd be a lot easier to
teach a Scheme class if everyone's indenting the same way!

However, DrScheme is also for mature Schemers (not me yet :)), and
these mature Schemers may easily want multiple indentation styles.

So I say multiple indentation styles is a great Scheme direction to
head in.  Agree?  And then I can get my Latex mode by defining an
indentation style with no indentation!

*********** feature request 3: template capability *********** 

There must be lazy Schemers out there like me who want templates,
something that inserts this into the Definitions window:

(cond (() )

      (() )

      (() )

      (else () ))

In Emacs this is no challenge:

(defun condify (&optional arg)
  "Types out a `cond' template.  With prefix arg, omit the else branch."
  (interactive "P")
  (insert "(cond (() )\n
      (() )\n
      (() )\n
      (else () ))\n")
  (when arg
        (insert "(cond (() )\n
      (() )\n
      (() ))\n")))

Then `C-u M-x condify' gives a template sans else branch.  

If we can get this capability into the Scheme part of DrScheme, then I
can use it for Latex files, to get things like:

   \begin{Theorem}
   \label{}

   \end{Theorem}

or

   \begin{proof}
   [Proof of ]



   \end{proof}

which I get this by way of embarrassing simple keyboard macros

   (fset 'Thm
   "\\begin{Theorem}
\\label{}

\\end{Theorem}
")

and even somewhat respectable Lisp:

   (defun Proof (&optional arg)
     "Types out a `Proof' environment.  With prefix arg, use the optional
   form `Proof of Theorem XXX'."
     (interactive "P")
     (insert "\\begin{proof}\n")
     (save-excursion
       (insert "\n\n\n\\end{proof}\n\n"))
     (when arg
       (insert "[Proof of ")
       (save-excursion
	 (insert "]\n"))))


   Of course, the reason the PLT never got far (in terms of actual
   editors) is that building a general, user-extensible editing system is
   difficult and time-consuming, and we have other difficult and
   time-consuming goals. We'd all be happy to see someone (or some group)
   take up the challenge.

I might be interested!  Right now I have no competence, but that could
change.