Comments (4)
See also 1115688
from dtrt-indent.
Whops sorry for the noise. There is alread an open issue addressing my problem: #14
from dtrt-indent.
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.
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)
- 1/253 relevant lines HOT 5
- dtrt-indent-try-set-offset doesn't set generic indent variables HOT 1
- check adjacent-files like vim-sleuth HOT 2
- Advice is active regardless of whether the mode is active HOT 5
- Overriding tab setting for hard tabbed file HOT 11
- do nothing when editor-config is activated HOT 4
- Issue with protobuf-mode HOT 3
- Delay for running dtrt-indent HOT 5
- Adapting tab mode to file content not working HOT 7
- Add guess-style to related work section of readme
- Support for different js-mode offset variables HOT 5
- How to install this? HOT 3
- Feature request: Infer additional variable in web-mode
- web-mode support doesn't work well for heterogeneous indent types HOT 4
- Improve analysis of files with consistent indentation where offset is guessed wrongly due to merging HOT 2
- Error while processing typescript files HOT 3
- Guess indentation for new files in a project HOT 3
- Support `typescript-ts-base-mode` and thus `tsx-ts-mode`? HOT 1
- Compilation warnings under Emacs 29.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtrt-indent.