branch: elpa/racket-mode commit a0d0566fb590249d6bfa82080b4845fb0db968bf Author: Greg Hendershott <g...@greghendershott.com> Commit: Greg Hendershott <g...@greghendershott.com>
Improve forward-sexp-function comparison Although we used to check for forward-exp-function being nil, bleeding edge emacs now defaults it to a new forward-sexp-default-function. Anyway what we really meant to check is whether forward-sexp-function is set to our racket-hash-lang-forward-sexp function. --- racket-util.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/racket-util.el b/racket-util.el index 8af8abbd6d..34eff17092 100644 --- a/racket-util.el +++ b/racket-util.el @@ -169,6 +169,9 @@ The \"project\" is determined by trying, in order: (user-error "%S works only in racket-mode or racket-hash-lang-mode edit buffers, or racket-repl-mode buffers" this-command))) +;; Avoid circular require +(declare-function racket-hash-lang-forward-sexp "racket-hash-lang" (&optional arg)) + (defun racket--sexp-edit-mode-p () "Either `racket-mode' or `racket-hash-lang-mode', provided the latter has /not/ set the variable `forward-sexp-function' because @@ -176,7 +179,7 @@ the hash-lang uses racket-grouping-position. In other words, when `forward-sexp-function' is nil we may assume that the lang uses s-expressions." (and (racket--edit-mode-p) - (not forward-sexp-function))) + (not (equal forward-sexp-function #'racket-hash-lang-forward-sexp)))) (defun racket--assert-sexp-edit-mode () (unless (racket--sexp-edit-mode-p)