[Openmcl-devel] Tab character in indented Lisp code, turn it off how?

Gary Byers gb at clozure.com
Tue Nov 27 00:08:36 UTC 2007



On Mon, 26 Nov 2007, Rainer Joswig wrote:

> Hi,
>
> I see that indenting Lisp code inserts tab characters for spaces.
>
> I'll guess that there is a switch to turn that off?

There's a Hemlock variable that contains a function used
to insert whitespace for indentation.  (Somewhat confusingly,
the name of the variable suggests that tabs would be used
for indentation; whether they are or not depends on the
value of that variable):

? (hemlock::variable-value hemlock::indent-with-tabs)
#<Compiled-function HEMLOCK::INDENT-USING-TABS #x3000416FD4EF>
? (setf (hemlock::variable-value hemlock::indent-with-tabs) #'hemlock::indent-using-spaces)
#<Compiled-function HEMLOCK::INDENT-USING-SPACES #x3000416FCF1F>
? (hemlock::variable-value hemlock::spaces-per-tab)
8

Hemlock variables can be buffer-local (the examples above just
accessd the global values.)  Whatever one may think of the way
that they're implemented in Hemlock, the concept of buffer-local
variables (or something very much like them) is certainly useful.

>
> Personally I would prefer to not have tab characters
> in a Lisp file. What do you think?

It's been about 10 years since I cared either way (long enough that
I've forgotten why I ever did.)

I think that most of the reasons for this blissful indifference had
to do with using an editor that provided a rich set of features
("entab", "detab", "set tab width", "use/don't-use tabs", ...)
for dealing with this.  (Even if I rarely had occasion to deal
with any of it.)

I don't have any strong opinion about whether the default behavior
should involve using tabs or not; I do believe that it should be
easy to change the default behavior and to override the default
as needed.

>
> Tab characters are inserted at least by
>
> * Hemlock command: Indent Region
> * Pressing Tab in a Hemlock window
>
> Regards,
>
> Rainer Joswig
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>




More information about the Openmcl-devel mailing list