Simplify org mode search hack

This commit is contained in:
coolneng 2023-01-27 14:01:31 +01:00
parent 5de7e2288c
commit a9ad9e54b3
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 2 additions and 23 deletions

25
+org.el
View File

@ -182,26 +182,5 @@
org-goto-max-level 1) org-goto-max-level 1)
(use-package! org-capture-ref) (use-package! org-capture-ref)
;; HACK Fix search folded sections ;; HACK Fix search folded sections
(after! org-fold-core (setq org-fold-core-style 'overlays)
(defun org-show-current-heading-tidily () (evil-select-search-module 'evil-search-module 'evil-search)
(interactive) ;Inteactive
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (show-children))
(setq-local my:current_line (line-number-at-pos))
(outline-back-to-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)
(goto-line my:current_line)))
(defun qw/search-buffer ()
(interactive)
(org-fold-show-all)
(+default/search-buffer)
(org-show-current-heading-tidily)))
(map! :leader :n "s s" #'qw/search-buffer)