doomemacs/modules/lang/org/autoload/org-avy.el
Henrik Lissner 27cabea6b6
Fix gs in org-mode #2218
Also makes +evil/easymotion generic; it can now be moved to any key, and
new keys can be added to the <easymotion> event, rather than having to
wait for evilem-map to become available.

Also fixes +org/goto-visible if used before avy is loaded.

Relevant to #1672
2019-12-20 13:40:06 -05:00

20 lines
630 B
EmacsLisp

;;; lang/org/autoload/org-avy.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +org-headline-avy ()
"TODO"
(require 'avy)
(save-excursion
(when-let* ((org-reverse-note-order t)
(pos (avy-with avy-goto-line (avy-jump (rx bol (1+ "*") (1+ blank))))))
(when (integerp (car pos))
;; If avy is aborted with "C-g", it returns `t', so we know it was NOT
;; aborted when it returns an int. If it doesn't return an int, we
;; return nil.
(copy-marker (car pos))))))
;;;###autoload
(defun +org/goto-visible ()
"TODO"
(interactive)
(goto-char (+org-headline-avy)))