Skip to content

Commit 6bc5d89

Browse files
committed
fix: fix compile and tests
1 parent f9c0863 commit 6bc5d89

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

netlinx-mode.el

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
(declare-function treesit-induce-language "treesit.c")
2828
(declare-function treesit-node-type "treesit.c")
2929

30+
;; Declare yasnippet and company variables/functions to silence byte-compiler warnings
31+
;; These are loaded at runtime by netlinx-mode--ensure-yasnippet and netlinx-mode--ensure-company
32+
(defvar yas-snippet-dirs)
33+
(defvar company-backends)
34+
(declare-function yas-minor-mode "yasnippet")
35+
(declare-function yas-reload-all "yasnippet")
36+
(declare-function company-mode "company")
37+
38+
;; Declare electric-pair-mode functions
39+
(declare-function electric-pair-default-inhibit "elec-pair")
40+
3041
;; Define the customization group for NetLinx mode
3142
;; This creates a section in Emacs' customization interface (M-x customize-group RET netlinx)
3243
;; where users can modify NetLinx-related settings. All defcustom variables use :group 'netlinx
@@ -152,10 +163,10 @@ The file path is configured via `netlinx-mode-help-file'."
152163

153164
;; Configure electric pair mode for auto-pairing
154165
(setq-local electric-pair-pairs
155-
'((?( . ?))
156-
(?[ . ?])
166+
'((?\( . ?\))
167+
(?\[ . ?\])
157168
(?{ . ?})
158-
(?" . ?")
169+
(?\\" . ?\\")
159170
(?\' . ?\')))
160171
;; Inhibit single quote pairing only after word characters (to avoid issues with contractions)
161172
(setq-local electric-pair-inhibit-predicate

test/netlinx-mode-test.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@
291291
(netlinx-mode)
292292
(should (local-variable-p 'electric-pair-pairs))
293293
;; Check that all expected pairs are defined
294-
(should (member '(?( . ?)) electric-pair-pairs))
295-
(should (member '(?[ . ?]) electric-pair-pairs))
294+
(should (member '(?\( . ?\)) electric-pair-pairs))
295+
(should (member '(?\[ . ?\]) electric-pair-pairs))
296296
(should (member '(?{ . ?}) electric-pair-pairs))
297-
(should (member '(?" . ?") electric-pair-pairs))
297+
(should (member '(?\\" . ?\\") electric-pair-pairs))
298298
(should (member '(?\' . ?\') electric-pair-pairs)))))
299299

300300
(ert-deftest netlinx-mode-test-electric-pair-inhibit-predicate ()

0 commit comments

Comments
 (0)