Skip to content

Commit

Permalink
Simplify helm-org-indent-headings-1 (#29)
Browse files Browse the repository at this point in the history
No need to call org-indent-mode, just modify headings according to
state of org buffer(s).
  • Loading branch information
thierryvolpiatto committed Sep 22, 2024
1 parent d0b7cd5 commit 9b7d5d4
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions helm-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -350,20 +350,10 @@ nothing to CANDIDATES."
(with-helm-current-buffer
(cond
;; org-startup-indented is t, and org-hide-leading-stars is t
;; Or: #+STARTUP: indent hidestars
((and org-startup-indented org-hide-leading-stars)
(with-helm-buffer
(setq-local warning-suppress-log-types '((org-element)))
(require 'org-indent)
(org-indent-mode 1)
(replace-match
(format "%s\\2\\3"
(propertize (replace-match "\\1" t nil candidate)
'face `(:foreground ,foreground)))
t nil candidate)))
;; org-startup-indented is nil, org-hide-leading-stars is t
;; Or: #+STARTUP: noindent hidestars
((and (not org-startup-indented) org-hide-leading-stars)
;; Or: #+STARTUP: indent hidestars. Note that
;; org-indent-mode when enabled set locally
;; org-hide-leading-stars to t.
(org-hide-leading-stars
(with-helm-buffer
(replace-match
(format "%s\\2\\3"
Expand Down

0 comments on commit 9b7d5d4

Please sign in to comment.