[Top][All Lists]

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

Re: help with global-set-key

From: Rich E
Subject: Re: help with global-set-key
Date: Mon, 19 May 2008 21:38:22 -0700

Ooh, nice!  That works.  I'll have a look at the manual next time I try something like that, didn't even kow about vectors (don't really know anything about lisp, on that matter).


On Mon, May 19, 2008 at 8:01 PM, Kevin Rodgers <address@hidden> wrote:
Rich E wrote:

I found this custom command at :

;;; 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?

Control-period is not an ASCII character, so it cannot be included in a
string.  But it can be included in a vector: [?\C-.]  See the "String
Basics" node of the Emacs Lisp manual.

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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