emacs: devel: Fix 'modify-phases' highlighting.
* emacs/guix-devel.el (guix-devel-modify-phases-font-lock-pre): Handle the case when 'modify-phases' is commented.master
parent
1af9815d81
commit
88908d55e0
|
@ -132,8 +132,12 @@ This function is used as a MATCHER for `font-lock-keywords'."
|
||||||
"Skip the next sexp, and return the end point of the current list.
|
"Skip the next sexp, and return the end point of the current list.
|
||||||
This function is used as a PRE-MATCH-FORM for `font-lock-keywords'
|
This function is used as a PRE-MATCH-FORM for `font-lock-keywords'
|
||||||
to find 'modify-phases' keywords."
|
to find 'modify-phases' keywords."
|
||||||
(ignore-errors (forward-sexp))
|
(let ((in-comment? (nth 4 (syntax-ppss))))
|
||||||
(save-excursion (up-list) (point)))
|
;; If 'modify-phases' is commented, do not try to search for its
|
||||||
|
;; keywords.
|
||||||
|
(unless in-comment?
|
||||||
|
(ignore-errors (forward-sexp))
|
||||||
|
(save-excursion (up-list) (point)))))
|
||||||
|
|
||||||
(defvar guix-devel-font-lock-keywords
|
(defvar guix-devel-font-lock-keywords
|
||||||
`((,(rx (or "#~" "#$" "#$@" "#+" "#+@")) .
|
`((,(rx (or "#~" "#$" "#$@" "#+" "#+@")) .
|
||||||
|
|
Reference in New Issue