Tuesday, June 30, 2009

Emacs skeleton-pair Funcionality

> I have enabled skeleton-pair funcionality with what I have found in here:
> http://littlechina.org/~cmarcelo/paren-experiment.el
> It works in most modes, but in C++ mode it only works for [ and not for (,{
> or ".

Try:

(define-key c-mode-base-map (kbd "(") #'skeleton-pair-insert-maybe)
;; same for the other keys here...

or

(add-hook 'c-mode-common-hook
#'(lambda ()
(local-set-key (kbd "(") #'skeleton-pair-insert-maybe)
;; same for the other keys here...
))

If you don't like the way skeleton decides whether to insert a pair or
not but to insert a pair always use `insert-pair' instead of
`skeleton-pair-insert-maybe'.

Some thing others.

No comments:

Post a Comment