-
Notifications
You must be signed in to change notification settings - Fork 174
extend markdown-do to follow links #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@edrex Your patch breaks tests and existed behaviors. How about following patch ? diff --git a/markdown-mode.el b/markdown-mode.el
index 321a284..f999cfe 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8221,9 +8221,6 @@ Jumps between reference links and definitions; between footnote
markers and footnote text."
(interactive)
(cond
- ;; Link
- ((or (markdown-link-p) (markdown-wiki-link-p))
- (markdown-follow-thing-at-point nil))
;; Footnote definition
((markdown-footnote-text-positions)
(markdown-footnote-return))
@@ -8242,6 +8239,9 @@ markers and footnote text."
;; Align table
((markdown-table-at-point-p)
(call-interactively #'markdown-table-align))
+ ;; Link
+ ((or (markdown-link-p) (markdown-wiki-link-p))
+ (markdown-follow-thing-at-point nil))
;; Otherwise
(t
(markdown-insert-gfm-checkbox)))) |
motivation: spacemacs and others bind <RET> to markdown-do in evil normal mode. with this change links can also be followed with enter.
|
thanks for the quick feedback @syohex! I hadn't worked with the emacs testing tools yet, good time to start :) I updated the change so the footnote jump test passes, putting the link branch between the footnote and table branches, since table cells can have inlines so links should take precedence there. I added 3 failing tests that I don't yet know how to make asserts for, LMK if you have any ideas:
Guessing some mock is needed at least for the URL |
ea512df to
fc729ea
Compare
|
I fix your tests at #667. How about this ? |
Improves markdown-do to follow markdown links and [[WikiLinks]] jrblevin/markdown-mode#666
Improves markdown-do to follow markdown links and [[WikiLinks]] jrblevin/markdown-mode#666
Improves markdown-do to follow markdown links and [[WikiLinks]] jrblevin/markdown-mode#666
jrblevin/markdown-mode@862ae8addd29 -> jrblevin/markdown-mode@c3c2f0d473a3 Improves markdown-do to follow markdown links and [[WikiLinks]] jrblevin/markdown-mode#666
motivation: spacemacs and others bind
<RET>tomarkdown-doin evil normal mode.with this change links can also be followed with enter.
Type of Change
Checklist
make test).