Comments (7)
That's not possible since the source block bracket is displayed in the fringe, we cannot indent that. You may want to disable block styling or try @jdtsmith's org-modern-indent package. Maybe we can also merge back some code from there such that indented source blocks and org-indent-mode work better.
from org-modern.
That's not possible since the source block bracket is displayed in the fringe, we cannot indent that.
I see. Thanks for answering.
You may want to disable block styling or try @jdtsmith's org-modern-indent package.
I tried the org-modern-indent mode. It does not indent the spaces before the source block. It works for org-indent-mode
and put fringe line to source block ahead which looks more elegant and better.
Maybe we can also merge back some code from there such that indented source blocks and org-indent-mode work better.
If you merge this org-modern-indent style. I think keeping spaces before source block is possible. But I don't know whether it's complicated. If so, maybe not worth implemented my needs.
Regards,
stardiviner.
from org-modern.
As a record note.
I change the space in org-modern--block-fringe
function like bellowing:
modified org-modern.el
@@ -468,51 +468,51 @@ You can specify a font `:family'. The font families `Iosevka', `Hack' and
(if (= 0 (mod i 2)) sp1 sp2)))))))))
(defun org-modern--block-fringe ()
"Prettify blocks with fringe bitmaps."
;; Do not add source block fringe markers if org-indent-mode is
;; enabled. org-indent-mode uses line prefixes for indentation.
;; Therefore we cannot have both.
(unless (bound-and-true-p org-indent-mode)
(save-excursion
(goto-char (match-beginning 0))
(add-text-properties
(point) (min (line-end-position) (point-max))
'(wrap-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-begin org-block-begin-line)))
+ #(" " 0 1 (display (left-fringe org-modern--block-begin org-block-begin-line)))
line-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-begin org-block-begin-line)))))
+ #(" " 0 1 (display (left-fringe org-modern--block-begin org-block-begin-line)))))
(forward-line)
(while
(cond
((eobp) nil)
((save-excursion
(let ((case-fold-search t))
(re-search-forward
"^[ \t]*#\\+end_" (line-end-position) 'noerror)))
(add-text-properties
(point) (min (line-end-position) (point-max))
'(wrap-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-end org-block-begin-line)))
+ #(" " 0 1 (display (left-fringe org-modern--block-end org-block-begin-line)))
line-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-end org-block-begin-line)))))
+ #(" " 0 1 (display (left-fringe org-modern--block-end org-block-begin-line)))))
nil)
(t
(add-text-properties
(point) (min (1+ (line-end-position)) (point-max))
'(wrap-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-inner org-block-begin-line)))
+ #(" " 0 1 (display (left-fringe org-modern--block-inner org-block-begin-line)))
line-prefix
- #(" " 0 1 (display (left-fringe org-modern--block-inner org-block-begin-line)))))
+ #(" " 0 1 (display (left-fringe org-modern--block-inner org-block-begin-line)))))
(forward-line)
t))))))
Then the block looks like this:
Need to study org-modern-indent source code.
from org-modern.
Maybe we can also merge back some code from there such that indented source blocks and org-indent-mode work better.
Perfectly happy to go this route and point people here. BTW, I also need to disable org-modern-hide-stars
since it reduces heading indentation with org-indent, so perhaps that could be improved.
Note that org-modern-indent
does rely on org-indent
, since the latter sets a line-prefix which org-modern-indent
tweaks.
The problem with "indenting myself with spaces" is what do you do with:
#+begin_example
Not indented
#+end_example
IMO the correct thing is, e.g.:
from org-modern.
@jdtsmith Uuuh. I don't know how to handle such a weird indentation but the example looks off. I think the border should be indented as deep as the begin/end keywords. I am glad that I don't have these issues with the fringe. π
from org-modern.
@minad Is it possible to use indentation spaces length from original block and pass them as variable into block styling function. And it will display like my upper screenshot. (I know this space gaps looks not fit intuition as fringe. Maybe provide an user custom option to toggle this behavior, and keep it disabled by default. WDYT?)
from org-modern.
@jdtsmith Uuuh. I don't know how to handle such a weird indentation but the example looks off. I think the border should be indented as deep as the begin/end keywords. I am glad that I don't have these issues with the fringe. π
Notice the arrow; where does that go? To treat hand-indented blocks youβd have to calculate the indent by examining the full block! So I donβt think @stardivinerβs request is that easy.
from org-modern.
Related Issues (20)
- New folding indicators do not render well in doom Emacs HOT 2
- Second level folding indicator showing wrong state after folding top level heading
- org-modern-tag-faces does not work as expected HOT 1
- Opt-out for fold indicators? HOT 1
- Can this package work with `visual-fill-column-center-text' set to t?
- fold-stars doesn't work well when org-cycle twice on header HOT 1
- readme screenshot image no longer visible on github
- Org agenda tags go outside the buffer
- Have fringe around dynamics block, like the one around source block.
- org-modern todo stopped working on custom agenda views
- Wrong bullet character HOT 1
- Clock and [%] headlines not aligning properly
- Org-table alignment (divider rows)
- org-modern breaks on blocks that are rendered later
- Timestamps in buffer settings HOT 1
- static-if not available in emacs 29.4 HOT 1
- New invalid-function error with static-if HOT 3
- Triggers (invalid-function static-if) constantly HOT 3
- Change to compat v30 breaks installation on debian systems HOT 1
- Leading stars appear after updating org-modern
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 org-modern.