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

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

Adventures in key mapping


From: sdn . gnuem
Subject: Adventures in key mapping
Date: Tue, 10 May 2011 09:31:13 -0400 (EDT)

I wanted to assign something to the C-, (control comma) key sequence.  My first 
attempt was:



    (local-set-key  "\C-,"  'some-function)



This gives the error "Invalid modifier in string", although I'm not sure why.  
Then I tried:



    (local-set-key  [C-,]  'some-function)



This gave no error or warning, but it also apparently had no effect.  It did 
not assign anything to C-,.  After much experimentation and frustration, I hit 
upon this:



    (local-set-key  [(control ,)]  'some-function)



which works.



One day, I byte-compiled the elisp file that contains the above line.  I got a 
most curious warning message:



  !! The file uses old-style backquotes !!

  This functionality has been obsolete for more than 10 years already

  and will be removed soon.  See (elisp)Backquote in the manual.



I wonder if this message is a bug.  I have no clue what "old-style backquotes" 
are, and the Backquote section of the elisp manual makes no mention of them.  
The backquote character (ascii 0x60) does not appear anywhere in the source 
file.



After more trial-and-error, I crafted the following:



   (local-set-key  [(control ?,)]  'some-function)



which works and does not result in any byte-compilation warnings.  Also, I have 
found that:



    (local-set-key  [?\C-,]  'some-function)



works as well.





I don't really have a question for the list, since I got it to work.  I'm 
posting this to help anyone in the future who may have similar problems.  But 
does anyone think that the backquote warning is a bug that should be reported?  
Or perhaps the documentation should be updated?

----------
This message was sent from a MailNull anti-spam account.  You can get
your free account and take control over your email by visiting the
following URL.

   http://mailnull.com/



reply via email to

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