help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with global-set-key


From: weber
Subject: Re: help with global-set-key
Date: Fri, 16 May 2008 13:13:24 -0700 (PDT)
User-agent: G2/1.0

On May 16, 12:23 am, "Rich E" <reakina...@gmail.com> wrote:
> Hi,
>
> I found this custom command athttp://www.crsr.net/Notes/Emacs.html:
>
> ;;; Use "%" to jump to the matching parenthesis.
> (defun goto-match-paren (arg)
>   "Go to the matching parenthesis if on parenthesis, otherwise insert
> the character typed."
>   (interactive "p")
>   (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
>     ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
>     (t                    (self-insert-command (or arg 1))) ))
> (global-set-key "%" 'goto-match-paren)
>
> I am trying to change the global-set-key to something like "\C-.", but this
> isn't an acceptable 'string and I don't know why.  Can anyone help?
>
> regards,
> Rich

This works here:
(global-set-key (kbd "C-.") 'goto-match-paren)

HTH
Hugo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]