all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Automatically closing braces/parenthesis, etc
@ 2005-07-17 18:43 Alberto Simões
  0 siblings, 0 replies; 2+ messages in thread
From: Alberto Simões @ 2005-07-17 18:43 UTC (permalink / raw)


Hi

I found in this list archive that if I add the following code to my 
.emacs, I get automatically closing braces, etc


(setq skeleton-pair t)
(global-set-key "(" 'skeleton-pair-insert-maybe)
(global-set-key "[" 'skeleton-pair-insert-maybe)
(global-set-key "\"" 'skeleton-pair-insert-maybe)
(global-set-key "'" 'skeleton-pair-insert-maybe)
(global-set-key "{" 'skeleton-pair-insert-maybe)


And it is true. Unfortuantely, this does not work under CPerl mode. 
Probably because CPerl redefines something. Is there any easy way to go 
around it?

Thanks
Alberto
-- 
Alberto Simões - Departamento de Informática - Universidade do Minho
                  Campus de Gualtar - 4710-057 Braga - Portugal

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Automatically closing braces/parenthesis, etc
       [not found] <mailman.843.1121626467.20277.help-gnu-emacs@gnu.org>
@ 2005-07-17 21:34 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2005-07-17 21:34 UTC (permalink / raw)


> (setq skeleton-pair t)
> (global-set-key "(" 'skeleton-pair-insert-maybe)
> (global-set-key "[" 'skeleton-pair-insert-maybe)
> (global-set-key "\"" 'skeleton-pair-insert-maybe)
> (global-set-key "'" 'skeleton-pair-insert-maybe)
> (global-set-key "{" 'skeleton-pair-insert-maybe)

> And it is true. Unfortuantely, this does not work under CPerl mode. Probably
> because CPerl redefines something. Is there any easy way to go around it?

Try perl-mode instead ? ;-)
Or do something like:

(add-hook 'cperl-mode-hook
          (lambda ()
            (local-set-key "(" 'skeleton-pair-insert-maybe))
            ...
            ))

-- Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-17 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-17 18:43 Automatically closing braces/parenthesis, etc Alberto Simões
     [not found] <mailman.843.1121626467.20277.help-gnu-emacs@gnu.org>
2005-07-17 21:34 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.