Skip to content
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

Add markdown-beginning/end-of-line functions and markdown-special-ctrl-a/e variable #820

Merged
merged 3 commits into from
Jan 7, 2024

Conversation

kuranari
Copy link
Contributor

Description

Add functions to move to the beginning and end of lines (markdown-beginning-of-line and markdown-end-of-line), and the variable markdown-special-ctrl-a/e, like Org mode.

I implemented it based on this version of Org mode.

Related Issue

#811

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have updated the documentation in the README.md file if necessary.
  • I have added an entry to CHANGES.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed (using make test).

(define-key newmap [remap move-beginning-of-line] nil)
(define-key newmap [remap move-end-of-line] nil)
(make-local-variable 'minor-mode-overriding-map-alist)
(push `(visual-line-mode . ,newmap) minor-mode-overriding-map-alist)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

markdown-mode.el Outdated
(`(,C-a . ,_) C-a) (_ markdown-special-ctrl-a/e)))
deactivate-mark)
;; First move to a visible line.
(if (bound-and-true-p visual-line-mode)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can see visual-line-mode even if we launch emacs by emacs -Q. So I think bound-and-true-p is not necessary. In addition to that it was introduced at Emacs 24.4 and we don't support such an old version.

org-mode still uses bound-and-true-p for visual-line-mode I suppose org-mode has not updated the code for newer versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@syohex Thank you for the review. I've fixed it.

@syohex syohex merged commit e096bb9 into jrblevin:master Jan 7, 2024
4 checks passed
@syohex
Copy link
Collaborator

syohex commented Jan 7, 2024

Thanks

@kuranari kuranari deleted the markdown-beginning-of-line branch January 9, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants