Giter Site home page Giter Site logo

emallson / narrow-reindent.el Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 178 KB

Defines a minor mode `narrow-reindent-mode’ that reindents the region narrowed to. The region is then indented again after widening the buffer.

License: GNU General Public License v3.0

Emacs Lisp 100.00%

narrow-reindent.el's Introduction

narrow-reindent.el

Defines a minor mode `narrow-reindent-mode’ that reindents the region narrowed to. The region is then indented again after widening the buffer.

Known Issues

  • The new indentation is saved if the narrowed buffer is saved. (Issue #1)

LICENSE

This code is © 2015 J David Smith and is released to the public under the terms of the GPLv3 license.

narrow-reindent.el's People

Contributors

emallson avatar purcell avatar

Stargazers

Sebastian Wålinder avatar Compro Prasad avatar Mirzhan Irkegulov avatar ESASHIKA Kaoru avatar

Watchers

James Cloos avatar  avatar  avatar

narrow-reindent.el's Issues

Saving while narrowed saves reindentation

Desired Behavior: Saving should store the file with correct indentation.

Actual Behavior: The file is stored with the narrowed region left-aligned.

Planned Fix: Add a before-save/after-save hook of some sort.

Applying the same idea to Org-mode

I am trying to turn my Org-mode into Workflowy-like experience. An interesting thing in Workflowy is that it allows for indefinite depth of headings, where you frequently zoom-in to subtrees. In Org-mode this is inelegant.

Suppose I have a tree:

* a
** aa
*** aaa
**** aaaa
*** aab
** ab
** ac
* b
** ba

If I want to narrow to entry called aaa, I get:

*** aaa
**** aaaa

Instead I want to get is:

* aaa
** aaaa

Imagine what would happen if I have an entry 10 levels deep. Narrowing is supposed to be "concentrating on a local context, ignoring all outside of it", so why do I retain information that it's 10 levels deep? And also it's just noise.

So I'm thinking, narrow-indent could be generalized to include Org-mode too, where it removes stars before narrowing and puts them back before widening.

I need this feature, so I'll possibly try to implement it soon independently, although can't promise anything. But I would like to discuss it here. Also, maybe this could develop into some smart-narrow concept further.

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.