all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: sdn.gnuem@mailnull.com
To: help-gnu-emacs@gnu.org
Subject: Adventures in key mapping
Date: Tue, 10 May 2011 09:31:13 -0400 (EDT)	[thread overview]
Message-ID: <20110510133113.5E0E751023A@outside.256.com> (raw)

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	other threads:[~2011-05-10 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 13:31 sdn.gnuem [this message]
2011-05-10 13:45 ` Adventures in key mapping Antoine Levitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110510133113.5E0E751023A@outside.256.com \
    --to=sdn.gnuem@mailnull.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.