smarttabs
smarttabs copied to clipboard
SmartTabs doesn't support Emacs Lisp??
Can you post an example of code that would benefit from SmartTabs’s “indent with tabs, align with spaces”?
I'm just saying that you can not set lisp
or emacs-lisp
in (smart-tabs-insinuate 'c 'c++ 'python)
and there is no other modes such as emacs-lisp-mode
in (defvar smart-tabs-insinuate-alist...
in smart-tabs-mode.el
file. Only 8 modes(c-mode-hook
, c++-mode-hook
, java-mode-hook
, js2-mode-hook
, cperl-mode-hook
, python-mode-hook
, ruby-mode-hook
and nxml-mode-hook
) exist in smart-tabs-mode
package, what about other modes??
My understanding is that Lisp indentation is sufficiently different from the sort found in C or related languages as to make smart-tabs inapplicable. At least, that different engines are at work.
If this is incorrect, I would be glad to incorporate a patch to support lisp.
The let
form might be a good example.
(let ((var expr)
⋮
(var expr))
expr
⋮
expr)
Variable bindings are aligned whereas expressions in the body are indented. In general, pretty-print aligns arguments in function application
(func expr
⋮
expr)
and indents expressions in the bodies of special forms (eg, lambda
, defun
, let
, cond
).
Since everything in lisp is an expression, however, pretty-print may interleave indentation and alignment when, for instance, a lambda
expression is an argument of function application.
(func (lambda (var … var)
expr
⋮
expr)
⋮
expr)
The lambda
expression is aligned as an argument and expressions in the lambda
body are further indented: there's a run of spaces (alignment), then a tab (indentation). Definitely an interesting problem.