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

Replace julia-latexsub with appropriate capf functions #1304

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
15 changes: 6 additions & 9 deletions lisp/ess-julia.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
;; Don't require `julia-mode' to compile this file.
(when t (require 'julia-mode))
(declare-function julia-mode "julia-mode" ())
(declare-function julia-latexsub "julia-mode" ())
(declare-function julia-mode-latexsub-completion-at-point-before "julia-mode" ())
(declare-function julia-mode-latexsub-completion-at-point-around "julia-mode" ())
(defvar julia-mode-syntax-table)

(defvar ac-prefix)
Expand Down Expand Up @@ -117,12 +118,6 @@ See `comint-input-sender'."


;;; COMPLETION
(defun ess-julia-latexsub-completion ()
"Complete latex input in format required by `completion-at-point-functions'."
(if (julia-latexsub) ; julia-latexsub returns nil if it performed a completion, the point otherwise
nil
(lambda () t) ;; bypass other completion methods
))

(defun ess-julia-object-completion ()
"Return completions in format required by `completion-at-point-functions'."
Expand Down Expand Up @@ -369,7 +364,8 @@ It makes underscores and dots word constituent chars.")
(remove-hook 'completion-at-point-functions #'ess-filename-completion 'local) ;; should be first
(add-hook 'completion-at-point-functions #'ess-julia-object-completion nil 'local)
(add-hook 'completion-at-point-functions #'ess-filename-completion nil 'local)
(add-hook 'completion-at-point-functions #'ess-julia-latexsub-completion nil 'local)
(add-hook 'completion-at-point-functions #'julia-mode-latexsub-completion-at-point-before nil 'local)
(add-hook 'completion-at-point-functions #'julia-mode-latexsub-completion-at-point-around nil 'local)
(if (fboundp 'ess-add-toolbar) (ess-add-toolbar)))

;; Inferior mode
Expand All @@ -393,7 +389,8 @@ It makes underscores and dots word constituent chars.")
(remove-hook 'completion-at-point-functions #'ess-filename-completion 'local) ;; should be first
(add-hook 'completion-at-point-functions #'ess-julia-object-completion nil 'local)
(add-hook 'completion-at-point-functions #'ess-filename-completion nil 'local)
(add-hook 'completion-at-point-functions #'ess-julia-latexsub-completion nil 'local)
(add-hook 'completion-at-point-functions #'julia-mode-latexsub-completion-at-point-before nil 'local)
(add-hook 'completion-at-point-functions #'julia-mode-latexsub-completion-at-point-around nil 'local)
(setq comint-input-sender #'ess-julia-input-sender))

(defvar ess-julia-mode-hook nil)
Expand Down