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

Re: DrScheme as Emacs-like kitchen sink



Bill Richter <richter@math.nwu.edu> writes:
>   (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.

I don't think that's a different indentation style; it just tells
Emacs that, for example, "fluid-let" should be indented like "let".
(This isn't done by default, as fluid-let isn't a standard Scheme
primitive.)

I've sometimes thought of writing a similar capability to support
MzScheme's specially indented syntactic forms (there aren't very
many), but never got around to doing it...

I think there is a reasonable consensus on how to indent Scheme code,
so multiple indentation styles aren't nearly as necessary as they are
in, say, C code or HTML source.

However, it would sometimes be useful to have user-customisable
indentation. For example, if I define a macro that's a variation of
let, I'd like to be able to tell the editor to indent it as a let.
(This shouldn't be too difficult to do in Emacs: just use the above
`put' statement in, e.g., local variables. But it could be more
convenient.)

>*********** feature request 3: template capability *********** 
..
>In Emacs this is no challenge:

Note that there is also a facility for "tabbing through" the holes in
the template: see expand.el distributed with Emacs for a few examples
(in Lisp and C; see `expand-jump-to-next-slot'). This uses both
Emacs's skeletons (a relatively simple way to define templates) and
some of its own code.

>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}

You probably know this already, but: Templates for most of the
standard environments are present in AUC TeX. If you have that, try
C-c C-s or C-c C-e in TeX mode. For example, the figure environment
asks for things like centering and captions.


Well, enough Emacs specifics. I've been reading this thread for a
while, and I'm not sure if you realise how big a project
reimplementing Emacs is. There are an awful lot of features in
standard Emacs (not to speak of additional elisp packages, some of
which are quite large - e.g., AUC TeX, PSGML, Gnus), and quite a lot
of effort has been spent implementing them. Just a few examples of
features that I use regularly: M-x hippie-expand, C-/, C-M-f (and
friends), C-M-t, M-c (and friends), ispell (and M-x
ispell-complete-word or M-Tab in many modes), the TAGS system,
regexp-replace, keyboard macros, and, of course, the major modes for
about a dozen languages.

Quite a lot of people have tried to write a new Emacs in various
languages (e.g., MIT Scheme has Edwin, and there was a project to
write an Emacs in Haskell), but none of them have really caught on. To
get as featureful as Emacs, you'd probably need dozens of people
writing new features and modes...

Of course, you can start small, and it's possible that you write a
system that's good enough to attract lots of people into improving it.
I guess I just wanted to say that you should probably think of this
project as a large undertaking...

(As for myself, I probably wouldn't use the new editor until it had
support for at least Makefiles, TeX, C, Haskell, shell scripts, HTML
and a few other languages, and lots of convenience features like
expansion and spell-checking. And a text-mode interface: I'm writing
this through a text-mode Emacs on a modem line where X11 forwarding
isn't really practical. I like the idea of a Scheme-based Emacs -
Emacs and especially Emacs Lisp isn't very pretty - but Emacs just has
too many features that I'm used to for me to switch away from it...)

-- 
-=- Rjs -=- Riku.Saikkonen@hut.fi
"An autumn waned, a winter laid / the withered leaves in grove and glade; /
the beeches bare were gaunt and grey, / and red their leaves beneath them lay."
    -- J. R. R. Tolkien