;;; edmacro.el --- keyboard macro editor
-;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
;; Maintainer: Dave Gillespie <daveg@synaptics.com>
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;; Usage:
;;
-;; The `C-x C-k' (`edit-kbd-macro') command edits a keyboard macro
+;; The `C-x C-k e' (`edit-kbd-macro') command edits a keyboard macro
;; in a special buffer. It prompts you to type a key sequence,
;; which should be one of:
;;
(and b (commandp b) (not (arrayp b))
(not (kmacro-extract-lambda b))
(or (not (fboundp b))
- (not (arrayp (symbol-function b))))
+ (not (or (arrayp (symbol-function b))
+ (get b 'kmacro))))
(not (y-or-n-p
(format "Key %s is already defined; %s"
(edmacro-format-keys key 1)
(let ((str (buffer-substring (match-beginning 1)
(match-end 1))))
(unless (equal str "")
- (setq mac-counter (string-to-int str))))
+ (setq mac-counter (string-to-number str))))
t)
((looking-at "Format:[ \t]*\"\\([^\n]*\\)\"[ \t]*$")
(when edmacro-store-hook
This function assumes that the events can be stored in a string."
(setq seq (copy-sequence seq))
(loop for i below (length seq) do
- (when (< (aref seq i) 0)
+ (when (logand (aref seq i) 128)
(setf (aref seq i) (logand (aref seq i) 127))))
seq)
(cond ((atom ev)
(push ev result))
((eq (car ev) 'help-echo))
+ ((eq (car ev) 'switch-frame))
((equal ev '(menu-bar))
(push 'menu-bar result))
((equal (cadadr ev) '(menu-bar))
(times 1))
(setq pos (match-end 0))
(when (string-match "\\([0-9]+\\)\\*." word)
- (setq times (string-to-int (substring word 0 (match-end 1))))
+ (setq times (string-to-number (substring word 0 (match-end 1))))
(setq word (substring word (1+ (match-end 1)))))
(cond ((string-match "^<<.+>>$" word)
(setq key (vconcat (if (eq (key-binding [?\M-x])