Simplify sexp wrapping code
This commit is contained in:
parent
150ac9e510
commit
8217618525
3 changed files with 12 additions and 6 deletions
|
@ -564,5 +564,11 @@ This follows freedesktop standards, should work in X servers."
|
||||||
(t (error "Unknown shell")))))
|
(t (error "Unknown shell")))))
|
||||||
(find-file-other-window (expand-file-name shell-init-file (getenv "HOME")))))
|
(find-file-other-window (expand-file-name shell-init-file (getenv "HOME")))))
|
||||||
|
|
||||||
|
(defun prelude-wrap-with (s)
|
||||||
|
"Create a wrapper function for smartparens using S."
|
||||||
|
`(lambda (&optional arg)
|
||||||
|
(interactive "P")
|
||||||
|
(sp-wrap-with-pair ,s)))
|
||||||
|
|
||||||
(provide 'prelude-core)
|
(provide 'prelude-core)
|
||||||
;;; prelude-core.el ends here
|
;;; prelude-core.el ends here
|
||||||
|
|
|
@ -110,10 +110,10 @@ Will only occur if prelude-whitespace is also enabled."
|
||||||
|
|
||||||
(show-smartparens-global-mode +1)
|
(show-smartparens-global-mode +1)
|
||||||
|
|
||||||
(define-key prog-mode-map (kbd "M-(") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "(")))
|
(define-key prog-mode-map (kbd "M-(") (prelude-wrap-with "("))
|
||||||
;; FIXME: pick terminal friendly binding
|
;; FIXME: pick terminal friendly binding
|
||||||
;; (define-key prog-mode-map (kbd "M-[") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "[")))
|
;; (define-key prog-mode-map (kbd "M-[") (prelude-wrap-with "["))
|
||||||
(define-key prog-mode-map (kbd "M-\"") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "\"")))
|
(define-key prog-mode-map (kbd "M-\"") (prelude-wrap-with "\""))
|
||||||
|
|
||||||
;; disable annoying blink-matching-paren
|
;; disable annoying blink-matching-paren
|
||||||
(setq blink-matching-paren nil)
|
(setq blink-matching-paren nil)
|
||||||
|
|
|
@ -39,10 +39,10 @@
|
||||||
(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
|
(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
|
||||||
|
|
||||||
;; wrap keybindings
|
;; wrap keybindings
|
||||||
(define-key lisp-mode-shared-map (kbd "M-(") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "(")))
|
(define-key lisp-mode-shared-map (kbd "M-(") (prelude-wrap-with "("))
|
||||||
;; FIXME: Pick terminal-friendly binding.
|
;; FIXME: Pick terminal-friendly binding.
|
||||||
;;(define-key lisp-mode-shared-map (kbd "M-[") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "[")))
|
;;(define-key lisp-mode-shared-map (kbd "M-[") (prelude-wrap-with "["))
|
||||||
(define-key lisp-mode-shared-map (kbd "M-\"") (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "\"")))
|
(define-key lisp-mode-shared-map (kbd "M-\"") (prelude-wrap-with "\""))
|
||||||
|
|
||||||
;; a great lisp coding hook
|
;; a great lisp coding hook
|
||||||
(defun prelude-lisp-coding-defaults ()
|
(defun prelude-lisp-coding-defaults ()
|
||||||
|
|
Loading…
Reference in a new issue