Skip to content

Commit f4fe6dd

Browse files
Fix use of paredit-space-for-delimiter-predicates; fixes greghendershott#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.
1 parent 3dc8c17 commit f4fe6dd

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

racket-hash-lang.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,8 @@ A discussion of the information provided by a Racket language:
263263
(setq-local completion-at-point-functions nil) ;rely on racket-xp-mode
264264
(setq racket-submodules-at-point-function nil) ;might change in on-new-lang
265265
(when (boundp 'paredit-space-for-delimiter-predicates)
266-
(add-hook 'paredit-space-for-delimiter-predicates
267-
#'racket--paredit-space-for-delimiter-predicate
268-
nil t))
266+
(setq-local paredit-space-for-delimiter-predicates
267+
(list #'racket--paredit-space-for-delimiter-predicate)))
269268
;; Create back end hash-lang object.
270269
;;
271270
;; On the one hand, `racket--cmd/await' would be simpler to use

racket-mode.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@
202202
nil t)
203203
(setq racket-submodules-at-point-function #'racket-submodules-at-point-text-sexp)
204204
(when (boundp 'paredit-space-for-delimiter-predicates)
205-
(add-hook 'paredit-space-for-delimiter-predicates
206-
#'racket--paredit-space-for-delimiter-predicate
207-
nil t)))
205+
(setq-local paredit-space-for-delimiter-predicates
206+
(list #'racket--paredit-space-for-delimiter-predicate))))
208207

209208
;;;###autoload
210209
(progn

racket-repl.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,8 @@ identifier bindings and modules from the REPL's namespace.
15111511
(add-to-list 'semantic-symref-filepattern-alist
15121512
'(racket-repl-mode "*.rkt" "*.rktd" "*.rktl"))
15131513
(when (boundp 'paredit-space-for-delimiter-predicates)
1514-
(add-hook 'paredit-space-for-delimiter-predicates
1515-
#'racket--paredit-space-for-delimiter-predicate
1516-
nil t)))
1514+
(setq-local paredit-space-for-delimiter-predicates
1515+
(list #'racket--paredit-space-for-delimiter-predicate))))
15171516

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

0 commit comments

Comments
 (0)