Giter Site home page Giter Site logo

Comments (4)

jgeerds avatar jgeerds commented on July 28, 2024

See also 1115688

from dtrt-indent.

jgeerds avatar jgeerds commented on July 28, 2024

Whops sorry for the noise. There is alread an open issue addressing my problem: #14

from dtrt-indent.

rrthomas avatar rrthomas commented on July 28, 2024

So, indent-region should be calling smie-indent-line (as the value of indent-line-function).

If I call indent-line-function, then indeed it reindents to two spaces. However, the smie code in sh-script.el, as far as I can see, only uses sh-indentation, never sh-basic-offset.

The two spaces seem to be specifically after a brace. This uses sh-indent-after-open, which is +, which is sh-basic-offset.

In other words, the SMIE code is sometimes falling back to older values.

So, dtrt-indent should really set both variables (or defer to SMIE, as smie-config-guess changes the rule appropriately, but as you say, that issue already exists). I don't understand why sh-script.el's SMIE code uses sh-indentation and not sh-basic-offset.

Given that the aim is to make dtrt-indent defer to SMIE eventually, the best fix for now is probably to have it set both variables. I'll need to allow multiple variables per mode for that.

from dtrt-indent.

rrthomas avatar rrthomas commented on July 28, 2024

Since it's easier to implement SMIE support, I've done that instead, and reverted the variable to change to sh-basic-offset for Emacs < 24.4 (without SMIE).

from dtrt-indent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.