Skip to content

Commit

Permalink
Fix joaotavora#446: don't run sly-editing-mode twice for same .lisp s…
Browse files Browse the repository at this point in the history
…ource

This could happen if `sly.el` were first autoloaded when visiting that
Lisp source.

Under those conditions the sly-editing-mode would be turned on once
when running `lisp-mode-hook` and once again on autoload due to the
final slime-detecting snippet in sly.el.

* sly.el: (cond ... slime): Don't turn on sly-editing-mode if already
on.
  • Loading branch information
joaotavora committed May 17, 2021
1 parent 5966d68 commit 520e641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sly.el
Original file line number Diff line number Diff line change
Expand Up @@ -7464,7 +7464,7 @@ and replace `sly-editing-mode' with `slime-lisp-mode-hook'.")))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (eq major-mode 'lisp-mode)
(sly-editing-mode 1)
(unless sly-editing-mode (sly-editing-mode 1))
(ignore-errors (and (featurep 'slime) (funcall 'slime-mode -1)))))))
(t
(warn
Expand Down

0 comments on commit 520e641

Please sign in to comment.