branch: elpa/julia-mode
commit f854352d76672fbbf1a0ede20e0520f27f88dfdb
Author: Adam Beckmeyer <[email protected]>
Commit: Adam Beckmeyer <[email protected]>
Fix byte-compilation warnings for company-integration code
This follows the pattern for conditional integration code from
"net/tramp-integration.el".
---
julia-mode.el | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index 466a547efc..953944aa47 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -876,16 +876,21 @@ buffer where the LaTeX symbol starts."
;; company-mode doesn't work via `indent-for-tab-command'. In order to have a
consistent
;; completion UI, we must dynamically choose between
`company-indent-or-complete-common' and
-;; `indent-for-tab-command' based on whether `company-mode' is active.
+;; `indent-for-tab-command' based on whether `company-mode' is active. First
we need to
+;; pacify the byte-compiler though.
+(declare-function company-indent-or-complete-common "company")
+(defvar company-mode)
+
+(defun julia--company-indent-for-tab-command (arg)
+ "Call `indent-for-tab-command' or `company-indent-or-complete-common'."
+ (interactive "P")
+ (if company-mode
+ (company-indent-or-complete-common arg)
+ (indent-for-tab-command arg)))
+
(with-eval-after-load 'company
- (defun julia-company-indent-for-tab-command (arg)
- "Call `indent-for-tab-command' or `company-indent-or-complete-common' as
appropriate."
- (interactive "P")
- (if company-mode
- (company-indent-or-complete-common arg)
- (indent-for-tab-command arg)))
(define-key julia-mode-map [remap indent-for-tab-command]
- #'julia-company-indent-for-tab-command))
+ #'julia--company-indent-for-tab-command))
;; Math insertion in julia. Use it with
;; (add-hook 'julia-mode-hook 'julia-math-mode)