diff options
author | Greg Hendershott <git@greghendershott.com> | 2019-09-01 17:21:04 -0400 |
---|---|---|
committer | Greg Hendershott <git@greghendershott.com> | 2019-09-01 17:21:04 -0400 |
commit | 8f9374d16f98a3ba03c7f0a87ffaf0230275f83e (patch) | |
tree | d9bed66508627414bbba5f8ced81eed8e5bb7e9b | |
parent | 5300aa004f08535c3fac99f1af78462f129aca81 (diff) |
No longer bind `racket-insert-closing' by default; closes #399
If people want to use this, they can bind the keys in their Emacs init
file. But we should not do so by default.
-rw-r--r-- | doc/generate.el | 1 | ||||
-rw-r--r-- | doc/racket-mode.texi | 28 | ||||
-rw-r--r-- | racket-common.el | 19 | ||||
-rw-r--r-- | racket-mode.el | 3 | ||||
-rw-r--r-- | racket-repl.el | 3 |
5 files changed, 35 insertions, 19 deletions
diff --git a/doc/generate.el b/doc/generate.el index fd38246..a4e96ac 100644 --- a/doc/generate.el +++ b/doc/generate.el @@ -71,6 +71,7 @@ racket-base-requires racket-indent-line racket-smart-open-bracket + racket-insert-closing racket-cycle-paren-shapes racket-backward-up-list racket-check-syntax-mode diff --git a/doc/racket-mode.texi b/doc/racket-mode.texi index a2bef65..042c547 100644 --- a/doc/racket-mode.texi +++ b/doc/racket-mode.texi @@ -112,6 +112,7 @@ Edit * racket-base-requires:: * racket-indent-line:: * racket-smart-open-bracket:: +* racket-insert-closing:: * racket-cycle-paren-shapes:: * racket-backward-up-list:: * racket-check-syntax-mode:: @@ -1047,6 +1048,7 @@ instead of looking at point. * racket-base-requires:: * racket-indent-line:: * racket-smart-open-bracket:: +* racket-insert-closing:: * racket-cycle-paren-shapes:: * racket-backward-up-list:: * racket-check-syntax-mode:: @@ -1264,11 +1266,27 @@ To use, bind the @code{[} key to @ref{racket-smart-open-bracket} in To force insert @code{[}, use @code{quoted-insert}. -Combined with @code{racket-insert-closing} this means that -you can press the unshifted @code{[} and @code{]} keys to get whatever -delimiters follow the Racket conventions for these forms. When -@code{electric-pair-mode} or @code{paredit-mode} is active, you need not -even press @code{]}. +Combined with @ref{racket-insert-closing} this means that you can +press the unshifted @code{[} and @code{]} keys to get whatever delimiters +follow the Racket conventions for these forms. When something +like @code{electric-pair-mode} or @code{paredit-mode} is active, you need +not even press @code{]}. + +@node racket-insert-closing +@subsection racket-insert-closing + +@kbd{M-x} @code{racket-insert-closing} @kbd{RET} + +Insert a matching closing delimiter. + +With a prefix, insert the typed character as-is. + +If you want to use this, in your Emacs init file you can bind +")", "]", and ``@}" keys to @ref{racket-insert-closing}. + +This is handy if you're not yet using something like +@code{paredit-mode}, @code{smartparens-mode}, @code{parinfer-mode}, or simply +@code{electric-pair-mode} added in Emacs 24.5. @node racket-cycle-paren-shapes @subsection racket-cycle-paren-shapes diff --git a/racket-common.el b/racket-common.el index c60c7c0..659b9b4 100644 --- a/racket-common.el +++ b/racket-common.el @@ -297,9 +297,12 @@ which case the selection is to be wrapped in parens." With a prefix, insert the typed character as-is. -This is handy if you're not yet using `paredit-mode', -`smartparens-mode', or simply `electric-pair-mode' added in Emacs -24.5." +If you want to use this, in your Emacs init file you can bind +\")\", \"]\", and \"}\" keys to `racket-insert-closing'. + +This is handy if you're not yet using something like +`paredit-mode', `smartparens-mode', `parinfer-mode', or simply +`electric-pair-mode' added in Emacs 24.5." (interactive "P") (let* ((do-it (not (or prefix (and (string= "#\\" @@ -485,11 +488,11 @@ To use, bind the `[` key to `racket-smart-open-bracket' in To force insert `[`, use `quoted-insert'. -Combined with `racket-insert-closing' this means that -you can press the unshifted `[` and `]` keys to get whatever -delimiters follow the Racket conventions for these forms. When -`electric-pair-mode' or `paredit-mode' is active, you need not -even press `]`." +Combined with `racket-insert-closing' this means that you can +press the unshifted `[` and `]` keys to get whatever delimiters +follow the Racket conventions for these forms. When something +like `electric-pair-mode' or `paredit-mode' is active, you need +not even press `]`." (interactive "P") (let ((ch (or (and (not racket-smart-open-bracket-enable) ?\[) diff --git a/racket-mode.el b/racket-mode.el index 1aefa69..32c5614 100644 --- a/racket-mode.el +++ b/racket-mode.el @@ -61,9 +61,6 @@ ("C-c C-x C-f" racket-open-require-path) ("TAB" indent-for-tab-command) ("M-C-u" racket-backward-up-list) - (")" racket-insert-closing) - ("]" racket-insert-closing) - ("}" racket-insert-closing) ("C-c C-p" racket-cycle-paren-shapes) ("M-C-y" racket-insert-lambda) ("C-c C-d" racket-doc) diff --git a/racket-repl.el b/racket-repl.el index 28c5609..ff65db6 100644 --- a/racket-repl.el +++ b/racket-repl.el @@ -737,9 +737,6 @@ With prefix arg, open the N-th last shown image." ("C-a" comint-bol) ("C-w" comint-kill-region) ("<C-S-backspace>" comint-kill-whole-line) - (")" racket-insert-closing) - ("]" racket-insert-closing) - ("}" racket-insert-closing) ("C-c C-e f" racket-expand-file) ("C-c C-e x" racket-expand-definition) ("C-c C-e e" racket-expand-last-sexp) |