smarttabs icon indicating copy to clipboard operation
smarttabs copied to clipboard

SmartTabs doesn't support Emacs Lisp??

Open c02y opened this issue 9 years ago • 4 comments

c02y avatar Nov 03 '14 16:11 c02y

Can you post an example of code that would benefit from SmartTabs’s “indent with tabs, align with spaces”?

jcsalomon avatar Nov 03 '14 22:11 jcsalomon

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-hookand nxml-mode-hook) exist in smart-tabs-mode package, what about other modes??

c02y avatar Nov 04 '14 02:11 c02y

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.

jcsalomon avatar Nov 05 '14 17:11 jcsalomon

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.

lmmarsano avatar Feb 09 '18 06:02 lmmarsano