Skip to content

Commit 9649022

Browse files
committed
Remove custom syntax-propertize-function.
The original approach created more problems than it solved. Additionally, the desired syntax highlighting behavior is handled gracefully via `rx` and the `rx-constituents` approach I gleaned from puppet-mode.el.
1 parent cdcefa0 commit 9649022

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

elixir-mode.el

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,6 @@ Argument END End of the region."
550550
(set (make-local-variable 'comment-use-syntax) t)
551551
(set (make-local-variable 'tab-width) elixir-basic-offset)
552552
(set (make-local-variable 'imenu-generic-expression) elixir-imenu-generic-expression)
553-
(if (boundp 'syntax-propertize-function)
554-
(set (make-local-variable 'syntax-propertize-function) 'elixir-syntax-propertize))
555553
(smie-setup elixir-smie-grammar 'verbose-elixir-smie-rules ; 'elixir-smie-rules
556554
:forward-token 'elixir-smie-forward-token
557555
:backward-token 'elixir-smie-backward-token))

elixir-smie.el

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,6 @@
3434
table)
3535
"Elixir mode syntax table.")
3636

37-
(defun elixir-syntax-propertize (start end)
38-
(save-excursion
39-
(goto-char start)
40-
;; The ? character on its own is supposed to escape whatever comes
41-
;; after it (including any escaped chars. Examples: ?\# and ?".
42-
(while (search-forward "?" end t)
43-
(let ((start (1- (point))))
44-
(unless (or (= (char-syntax (char-before (- (point) 1))) ?w)
45-
(= (char-syntax (char-before (- (point) 1))) ?_))
46-
(put-text-property (1- (point))
47-
(point)
48-
'syntax-table
49-
'(?|))
50-
(when (= (char-after) ?\\)
51-
(forward-char)
52-
(put-text-property (1- (point))
53-
(point)
54-
'syntax-table
55-
'(?\s)))
56-
(forward-char)
57-
(put-text-property (1- (point))
58-
(point)
59-
'syntax-table
60-
'(?|))
61-
(put-text-property start (point) 'font-lock-face 'font-lock-string-face))))))
62-
6337
(defmacro elixir-smie-debug (message &rest format-args)
6438
`(progn
6539
(when elixir-smie-verbose-p

0 commit comments

Comments
 (0)