aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-08-19 21:44:56 +0000
committerChong Yidong2008-08-19 21:44:56 +0000
commitbf2e3fa7a92748c89f16ea1b68e00138b16f4bec (patch)
tree86cc524b3182a068f6685c8de884ea4640fa4741
parentedfbf712e5735a9d9754c628c5fdd757bfa82620 (diff)
downloademacs-bf2e3fa7a92748c89f16ea1b68e00138b16f4bec.tar.gz
emacs-bf2e3fa7a92748c89f16ea1b68e00138b16f4bec.zip
(edmacro-parse-keys): Catch events with spaces in their names.
-rw-r--r--lisp/edmacro.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 1c2f9104a06..be948ad579f 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -686,14 +686,22 @@ This function assumes that the events can be stored in a string."
686 686
687(defun edmacro-parse-keys (string &optional need-vector) 687(defun edmacro-parse-keys (string &optional need-vector)
688 (let ((case-fold-search nil) 688 (let ((case-fold-search nil)
689 (len (length string)) ; We won't alter string in the loop below.
689 (pos 0) 690 (pos 0)
690 (res [])) 691 (res []))
691 (while (and (< pos (length string)) 692 (while (and (< pos len)
692 (string-match "[^ \t\n\f]+" string pos)) 693 (string-match "[^ \t\n\f]+" string pos))
693 (let ((word (substring string (match-beginning 0) (match-end 0))) 694 (let* ((word-beg (match-beginning 0))
694 (key nil) 695 (word-end (match-end 0))
695 (times 1)) 696 (word (substring string word-beg len))
696 (setq pos (match-end 0)) 697 (times 1)
698 key)
699 ;; Try to catch events of the form "<as df>".
700 (if (string-match "^<[^ >\t\n\f][^>\t\n\f]*>" word)
701 (setq word (match-string 0 word)
702 pos (+ word-beg (match-end 0)))
703 (setq word (substring string word-beg word-end)
704 pos word-end))
697 (when (string-match "\\([0-9]+\\)\\*." word) 705 (when (string-match "\\([0-9]+\\)\\*." word)
698 (setq times (string-to-number (substring word 0 (match-end 1)))) 706 (setq times (string-to-number (substring word 0 (match-end 1))))
699 (setq word (substring word (1+ (match-end 1))))) 707 (setq word (substring word (1+ (match-end 1)))))