Remove gpolonkai/enclose-region

I never really used this command.
This commit is contained in:
Gergely Polonkai 2023-10-20 13:35:23 +02:00
parent 87137be645
commit 0b00baff99
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
1 changed files with 0 additions and 39 deletions

View File

@ -416,44 +416,6 @@ Copied from http://whattheemacsd.com/editing-defuns.el-01.html
(indent-for-tab-command))
#+END_SRC
*** Enclose region in a specific character
#+BEGIN_SRC emacs-lisp
(defun gpolonkai/enclose-region (character &optional start end)
"Enclose region between CHARACTER.
If region is empty and neither START nor END is set, simply inserts CHARACTER
two times and moves point between them.
If character is present in `insert-pair-alist', this function will enclose
region in the corresponding pair. In this case, CHARACTER must be the opening
member of the pair."
(interactive "cWhat character? \nr")
(let ((open character)
(close character)
(pair (assq character insert-pair-alist)))
(if pair
(if (nth 2 pair)
(setq open (nth 1 pair) close (nth 2 pair))
(setq open (nth 0 pair) close (nth 1 pair))))
(unless (and open close)
(setq open character
close character))
(unless (use-region-p)
(setq start (point)
end (point)))
(save-excursion
(goto-char end)
(insert-char close)
(goto-char start)
(insert-char open))
(unless (use-region-p)
(forward-char))))
#+END_SRC
*** Convert ~camelCase~ to ~snake_case~
#+BEGIN_SRC emacs-lisp
@ -3917,7 +3879,6 @@ directory. It is available from [[http://plantuml.com/download][here]].
#+BEGIN_SRC emacs-lisp
(bind-keys
:map global-map
("M-(" . gpolonkai/enclose-region)
("<C-return>" . open-line-below)
("<C-S-return>" . open-line-above)
("M-t" . nil) ;; Remove the old keybinding