Skip to content

Commit

Permalink
Fix use of paredit-space-for-delimiter-predicates; fixes greghendersh…
Browse files Browse the repository at this point in the history
…ott#736

All along we had been using `add-hook` to update paredit's
paredit-space-for-delimiter-predicates.

Commit 3a9675d started supply `t` for the optional LOCAL argument to
add-hook, which is the correct way set a local value for hook
variables.

The problem is, paredit-space-for-delimiter-predicates was never a
hook variable -- paredit doesn't use it via some run-hook variant, and
so it chokes on the `t` value.

Instead just setq-local it in each of our major modes, which should be
fine because they are major modes.
  • Loading branch information
greghendershott committed Dec 27, 2024
1 parent 3dc8c17 commit f4fe6dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions racket-hash-lang.el
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,8 @@ A discussion of the information provided by a Racket language:
(setq-local completion-at-point-functions nil) ;rely on racket-xp-mode
(setq racket-submodules-at-point-function nil) ;might change in on-new-lang
(when (boundp 'paredit-space-for-delimiter-predicates)
(add-hook 'paredit-space-for-delimiter-predicates
#'racket--paredit-space-for-delimiter-predicate
nil t))
(setq-local paredit-space-for-delimiter-predicates
(list #'racket--paredit-space-for-delimiter-predicate)))
;; Create back end hash-lang object.
;;
;; On the one hand, `racket--cmd/await' would be simpler to use
Expand Down
5 changes: 2 additions & 3 deletions racket-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@
nil t)
(setq racket-submodules-at-point-function #'racket-submodules-at-point-text-sexp)
(when (boundp 'paredit-space-for-delimiter-predicates)
(add-hook 'paredit-space-for-delimiter-predicates
#'racket--paredit-space-for-delimiter-predicate
nil t)))
(setq-local paredit-space-for-delimiter-predicates
(list #'racket--paredit-space-for-delimiter-predicate))))

;;;###autoload
(progn
Expand Down
5 changes: 2 additions & 3 deletions racket-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -1511,9 +1511,8 @@ identifier bindings and modules from the REPL's namespace.
(add-to-list 'semantic-symref-filepattern-alist
'(racket-repl-mode "*.rkt" "*.rktd" "*.rktl"))
(when (boundp 'paredit-space-for-delimiter-predicates)
(add-hook 'paredit-space-for-delimiter-predicates
#'racket--paredit-space-for-delimiter-predicate
nil t)))
(setq-local paredit-space-for-delimiter-predicates
(list #'racket--paredit-space-for-delimiter-predicate))))

(defun racket-repl-write-all-histories ()
"Call `racket-repl-write-history' for all `racket-repl-mode' buffers.
Expand Down

0 comments on commit f4fe6dd

Please sign in to comment.