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

implement julia-bol #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,15 @@ strings."
(goto-char orig-pt))))
(goto-char orig-pt))))

(defun julia-bol ()
"Goes to the beginning of line, then skips past the prompt, if any."
(interactive)
(beginning-of-line)
(let ((eol (line-end-position)))
(if (and (looking-at julia-prompt-regexp)
(<= (match-end 0) eol))
(goto-char (match-end 0)))))

(defun julia-latexsub-or-indent (arg)
"Either indent according to mode or perform a LaTeX-like symbol substution"
(interactive "*i")
Expand Down Expand Up @@ -856,6 +865,7 @@ following commands are defined:
(let ((map2 (nconc (make-sparse-keymap) comint-mode-map)))
;; example definition
(define-key map2 (kbd "TAB") 'julia-latexsub-or-indent)
(define-key map2 (kbd "C-a") 'julia-bol)
map2)
"Basic mode map for `inferior-julia-mode'.")

Expand Down