Skip to content

Instantly share code, notes, and snippets.

@uk-ar
Created March 1, 2011 21:51
Show Gist options
  • Save uk-ar/849960 to your computer and use it in GitHub Desktop.
Save uk-ar/849960 to your computer and use it in GitHub Desktop.
;; (defun my-insert-pair (&optional arg open close fn)
;; (interactive "P")
;; (if (and (interactive-p) transient-mark-mode (not mark-active))
;; (funcall fn)
;; (insert-pair))
;; )
(defun my-insert-pair-gen (func)
(lexical-let ((fn func))
#'(lambda (&optional arg)
(interactive "P")
;; (if (and (interactive-p) transient-mark-mode (not mark-active))
;; (funcall fn)
(insert-pair)
;; )
)))
(define-key emacs-lisp-mode-map (kbd "\"") 'move-over-dbl-quote)
(define-key emacs-lisp-mode-map (kbd "\'") 'move-over-quote)
(defadvice move-over
(around insert-pair-or-move-over activate)
(if (and transient-mark-mode (not mark-active));;(interactive-p)
ad-do-it
(insert-pair)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment