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

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

global-set-key, error: Invalid modifier in string


From: John
Subject: global-set-key, error: Invalid modifier in string
Date: Fri, 17 Aug 2007 05:08:46 -0000
User-agent: G2/1.0

I'm trying to remap just a few keys around, but Emacs is telling me
"error: Invalid modifier in string". Here's what I'm dropping into the
middle of my ~/.emacs file:

;; To scroll the window up/down by one line. Stealing M-<
;; and M->. I'll use some other keys for beginning- and
;; end-of-buffer (see below).
(global-set-key "\M-<" '"\C-u1\C-v")
(global-set-key "\M->" '"\C-u1\M-v")

;; Used to be M-< and M->
(global-set-key "\M-," 'beginning-of-buffer)
(global-set-key "\M-." 'end-of-buffer)

;; Used to be M-, and M-.
(global-set-key "\C-<" 'tags-loop-continue)
(global-set-key "\C->" 'find-tag)

;; Used to be M-{ and M-}
(global-set-key "\M-{" nil)
(global-set-key "\M-}" nil)
(global-set-key "\M-p" 'backward-paragraph)
(global-set-key "\M-n" 'forward-paragraph)

;; Used to be M-v and C-v
(global-set-key "\C-v" nil)
(global-set-key "\M-v" nil)
(global-set-key "\C-," 'scroll-down)
(global-set-key "\C-." 'scroll-up)

Seems like some of the Alt keys are working, but the ones with "\C-"
in them are causing the error. I think I'm correctly following the
example in the manual ("57.4.6 Rebinding Keys in Your Init File"). Are
there rules about the order in which you set the bindings?

I'm setting some of those to nil just because I'd guess it would be
easier to acclimate to the new ones without the old ones still
working.

Starting Emacs with --debug-init gives me:


Debugger entered--Lisp error: (error "Invalid modifier in string")
  eval-buffer(#<buffer  *load*> nil "/home/john/.emacs" nil t)  ;
Reading at buffer position 2007
  load-with-code-conversion("/home/john/.emacs" "/home/john/.emacs" t
t)
  load("~/.emacs" t t)
  #[ nil "<snip lots of escaped hexy-looking backslash-ridden
stuff>" [init-file-user system-type user-init-file-1 user-init-file
otherfile source ms-dos "~" "/_emacs" windows-nt directory-files nil "^
\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" "~/
_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load expand-file-name
"init" file-name-as-directory "/.emacs.d" file-name-extension "elc"
file-name-sans-extension ".el" file-exists-p file-newer-than-file-p
message "Warning: %s is newer than %s" sit-for 1 "default" alt inhibit-
default-init inhibit-startup-message] 7]()
  command-line()
  normal-top-level()


Any corrections would be much appreciated.

This is GNU Emacs 22.0.91.1 on Ubuntu (the emacs-snapshot-gtk package).



reply via email to

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