Skip to content

Commit

Permalink
Fix gs in org-mode #2218
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hlissner committed Dec 20, 2019
1 parent bff04ed commit 27cabea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
3 changes: 2 additions & 1 deletion modules/config/default/+evil-bindings.el
Expand Up @@ -87,7 +87,8 @@
:m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion'
(:after org
:map org-mode-map
:m "gsh" #'+org/goto-visible)
:prefix "<easymotion>"
"h" #'+org/goto-visible)

(:when (featurep! :editor multiple-cursors)
:prefix "gz"
Expand Down
14 changes: 3 additions & 11 deletions modules/editor/evil/autoload/evil.el
Expand Up @@ -88,17 +88,9 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
"Invoke and lazy-load `evil-easymotion' without compromising which-key
integration."
(interactive)
(let ((prefix (this-command-keys)))
(evil-define-key* 'motion 'global prefix nil)
(evilem-default-keybindings (key-description prefix))
(setq prefix-arg current-prefix-arg
unread-command-events
(mapcar (lambda (e) (cons t e))
(vconcat (when evil-this-operator
(where-is-internal evil-this-operator
evil-normal-state-map
t))
prefix)))))
(evilem-default-keybindings "<easymotion>")
(setq prefix-arg current-prefix-arg)
(push '(t . easymotion) unread-command-events))

;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)
(evil-define-operator +evil:apply-macro (beg end)
Expand Down
1 change: 1 addition & 0 deletions modules/lang/org/autoload/org-avy.el
Expand Up @@ -3,6 +3,7 @@
;;;###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))))))
Expand Down

1 comment on commit 27cabea

@ashiklom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this is black magic. I really gotta read a book on Elisp.

Thanks so much for the near-instantaneous bugfix!

Please sign in to comment.