Skip to content

Commit d466d11

Browse files
committed
Fix formatting, use save-excursion instead of saving point manually
1 parent e9d0fba commit d466d11

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

elixir-mode.el

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,12 @@ is used to limit the scan."
217217
(defun elixir-syntax-stringify ()
218218
"Put `syntax-table' property correctly on single/triple quotes."
219219
(let* ((num-quotes (length (match-string-no-properties 1)))
220-
(ppss (prog2
221-
(backward-char num-quotes)
222-
(syntax-ppss)
223-
(forward-char num-quotes)))
224-
(string-start (and (not (elixir-ppss-comment-depth ppss))
225-
(elixir-ppss-comment-or-string-start ppss)))
226220
(quote-starting-pos (- (point) num-quotes))
227221
(quote-ending-pos (point))
222+
(ppss (save-excursion
223+
(syntax-ppss quote-starting-pos)))
224+
(string-start (and (not (elixir-ppss-comment-depth ppss))
225+
(elixir-ppss-comment-or-string-start ppss)))
228226
(num-closing-quotes
229227
(and string-start
230228
(elixir-syntax-count-quotes
@@ -528,8 +526,9 @@ just return nil."
528526
(when pos
529527
(save-excursion
530528
(goto-char pos)
531-
(and (looking-at "\"\"\"")(looking-back (rx "@" (or "moduledoc" "typedoc" "doc") (+ space))
532-
(line-beginning-position)))))))
529+
(and (looking-at "\"\"\"")
530+
(looking-back (rx "@" (or "moduledoc" "typedoc" "doc") (+ space))
531+
(line-beginning-position)))))))
533532

534533
(defun elixir-font-lock-syntactic-face-function (state)
535534
(if (elixir-ppss-string-terminator state)

0 commit comments

Comments
 (0)